use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UIImageReaderConfiguration;
);
extern_conformance!(
unsafe impl NSCopying for UIImageReaderConfiguration {}
);
unsafe impl CopyingHelper for UIImageReaderConfiguration {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for UIImageReaderConfiguration {}
);
impl UIImageReaderConfiguration {
extern_methods!(
#[unsafe(method(prefersHighDynamicRange))]
#[unsafe(method_family = none)]
pub fn prefersHighDynamicRange(&self) -> bool;
#[unsafe(method(setPrefersHighDynamicRange:))]
#[unsafe(method_family = none)]
pub fn setPrefersHighDynamicRange(&self, prefers_high_dynamic_range: bool);
#[unsafe(method(preparesImagesForDisplay))]
#[unsafe(method_family = none)]
pub fn preparesImagesForDisplay(&self) -> bool;
#[unsafe(method(setPreparesImagesForDisplay:))]
#[unsafe(method_family = none)]
pub fn setPreparesImagesForDisplay(&self, prepares_images_for_display: bool);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(preferredThumbnailSize))]
#[unsafe(method_family = none)]
pub fn preferredThumbnailSize(&self) -> CGSize;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setPreferredThumbnailSize:))]
#[unsafe(method_family = none)]
pub fn setPreferredThumbnailSize(&self, preferred_thumbnail_size: CGSize);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(pixelsPerInch))]
#[unsafe(method_family = none)]
pub fn pixelsPerInch(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setPixelsPerInch:))]
#[unsafe(method_family = none)]
pub fn setPixelsPerInch(&self, pixels_per_inch: CGFloat);
);
}
impl UIImageReaderConfiguration {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new() -> Retained<Self>;
);
}
impl DefaultRetained for UIImageReaderConfiguration {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UIImageReader;
);
extern_conformance!(
unsafe impl NSObjectProtocol for UIImageReader {}
);
impl UIImageReader {
extern_methods!(
#[unsafe(method(defaultReader))]
#[unsafe(method_family = none)]
pub fn defaultReader() -> Retained<UIImageReader>;
#[unsafe(method(readerWithConfiguration:))]
#[unsafe(method_family = none)]
pub fn readerWithConfiguration(
configuration: &UIImageReaderConfiguration,
) -> Retained<Self>;
#[unsafe(method(configuration))]
#[unsafe(method_family = none)]
pub fn configuration(&self) -> Retained<UIImageReaderConfiguration>;
#[cfg(feature = "UIImage")]
#[unsafe(method(imageWithContentsOfFileURL:))]
#[unsafe(method_family = none)]
pub fn imageWithContentsOfFileURL(&self, url: &NSURL) -> Retained<UIImage>;
#[cfg(feature = "UIImage")]
#[unsafe(method(imageWithData:))]
#[unsafe(method_family = none)]
pub fn imageWithData(&self, data: &NSData) -> Retained<UIImage>;
#[cfg(all(feature = "UIImage", feature = "block2"))]
#[unsafe(method(imageWithContentsOfFileURL:completion:))]
#[unsafe(method_family = none)]
pub fn imageWithContentsOfFileURL_completion(
&self,
url: &NSURL,
completion: &block2::DynBlock<dyn Fn(*mut UIImage)>,
);
#[cfg(all(feature = "UIImage", feature = "block2"))]
#[unsafe(method(imageWithData:completion:))]
#[unsafe(method_family = none)]
pub fn imageWithData_completion(
&self,
data: &NSData,
completion: &block2::DynBlock<dyn Fn(*mut UIImage)>,
);
);
}
impl UIImageReader {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new() -> Retained<Self>;
);
}
impl DefaultRetained for UIImageReader {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}