objc2_ui_kit/generated/
UIImageReader.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13 #[unsafe(super(NSObject))]
15 #[derive(Debug, PartialEq, Eq, Hash)]
16 pub struct UIImageReaderConfiguration;
17);
18
19extern_conformance!(
20 unsafe impl NSCopying for UIImageReaderConfiguration {}
21);
22
23unsafe impl CopyingHelper for UIImageReaderConfiguration {
24 type Result = Self;
25}
26
27extern_conformance!(
28 unsafe impl NSObjectProtocol for UIImageReaderConfiguration {}
29);
30
31impl UIImageReaderConfiguration {
32 extern_methods!(
33 #[unsafe(method(prefersHighDynamicRange))]
35 #[unsafe(method_family = none)]
36 pub fn prefersHighDynamicRange(&self) -> bool;
37
38 #[unsafe(method(setPrefersHighDynamicRange:))]
40 #[unsafe(method_family = none)]
41 pub fn setPrefersHighDynamicRange(&self, prefers_high_dynamic_range: bool);
42
43 #[unsafe(method(preparesImagesForDisplay))]
45 #[unsafe(method_family = none)]
46 pub fn preparesImagesForDisplay(&self) -> bool;
47
48 #[unsafe(method(setPreparesImagesForDisplay:))]
50 #[unsafe(method_family = none)]
51 pub fn setPreparesImagesForDisplay(&self, prepares_images_for_display: bool);
52
53 #[cfg(feature = "objc2-core-foundation")]
54 #[unsafe(method(preferredThumbnailSize))]
56 #[unsafe(method_family = none)]
57 pub fn preferredThumbnailSize(&self) -> CGSize;
58
59 #[cfg(feature = "objc2-core-foundation")]
60 #[unsafe(method(setPreferredThumbnailSize:))]
62 #[unsafe(method_family = none)]
63 pub fn setPreferredThumbnailSize(&self, preferred_thumbnail_size: CGSize);
64
65 #[cfg(feature = "objc2-core-foundation")]
66 #[unsafe(method(pixelsPerInch))]
68 #[unsafe(method_family = none)]
69 pub fn pixelsPerInch(&self) -> CGFloat;
70
71 #[cfg(feature = "objc2-core-foundation")]
72 #[unsafe(method(setPixelsPerInch:))]
74 #[unsafe(method_family = none)]
75 pub fn setPixelsPerInch(&self, pixels_per_inch: CGFloat);
76 );
77}
78
79impl UIImageReaderConfiguration {
81 extern_methods!(
82 #[unsafe(method(init))]
83 #[unsafe(method_family = init)]
84 pub fn init(this: Allocated<Self>) -> Retained<Self>;
85
86 #[unsafe(method(new))]
87 #[unsafe(method_family = new)]
88 pub fn new() -> Retained<Self>;
89 );
90}
91
92impl DefaultRetained for UIImageReaderConfiguration {
93 #[inline]
94 fn default_retained() -> Retained<Self> {
95 Self::new()
96 }
97}
98
99extern_class!(
100 #[unsafe(super(NSObject))]
102 #[derive(Debug, PartialEq, Eq, Hash)]
103 pub struct UIImageReader;
104);
105
106extern_conformance!(
107 unsafe impl NSObjectProtocol for UIImageReader {}
108);
109
110impl UIImageReader {
111 extern_methods!(
112 #[unsafe(method(defaultReader))]
114 #[unsafe(method_family = none)]
115 pub fn defaultReader() -> Retained<UIImageReader>;
116
117 #[unsafe(method(readerWithConfiguration:))]
119 #[unsafe(method_family = none)]
120 pub fn readerWithConfiguration(
121 configuration: &UIImageReaderConfiguration,
122 ) -> Retained<Self>;
123
124 #[unsafe(method(configuration))]
125 #[unsafe(method_family = none)]
126 pub fn configuration(&self) -> Retained<UIImageReaderConfiguration>;
127
128 #[cfg(feature = "UIImage")]
129 #[unsafe(method(imageWithContentsOfFileURL:))]
131 #[unsafe(method_family = none)]
132 pub fn imageWithContentsOfFileURL(&self, url: &NSURL) -> Retained<UIImage>;
133
134 #[cfg(feature = "UIImage")]
135 #[unsafe(method(imageWithData:))]
137 #[unsafe(method_family = none)]
138 pub fn imageWithData(&self, data: &NSData) -> Retained<UIImage>;
139
140 #[cfg(all(feature = "UIImage", feature = "block2"))]
141 #[unsafe(method(imageWithContentsOfFileURL:completion:))]
143 #[unsafe(method_family = none)]
144 pub fn imageWithContentsOfFileURL_completion(
145 &self,
146 url: &NSURL,
147 completion: &block2::DynBlock<dyn Fn(*mut UIImage)>,
148 );
149
150 #[cfg(all(feature = "UIImage", feature = "block2"))]
151 #[unsafe(method(imageWithData:completion:))]
153 #[unsafe(method_family = none)]
154 pub fn imageWithData_completion(
155 &self,
156 data: &NSData,
157 completion: &block2::DynBlock<dyn Fn(*mut UIImage)>,
158 );
159 );
160}
161
162impl UIImageReader {
164 extern_methods!(
165 #[unsafe(method(init))]
166 #[unsafe(method_family = init)]
167 pub fn init(this: Allocated<Self>) -> Retained<Self>;
168
169 #[unsafe(method(new))]
170 #[unsafe(method_family = new)]
171 pub fn new() -> Retained<Self>;
172 );
173}
174
175impl DefaultRetained for UIImageReader {
176 #[inline]
177 fn default_retained() -> Retained<Self> {
178 Self::new()
179 }
180}