objc2_core_image/generated/
CIImage.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8#[cfg(feature = "objc2-core-graphics")]
9use objc2_core_graphics::*;
10#[cfg(feature = "objc2-core-video")]
11use objc2_core_video::*;
12use objc2_foundation::*;
13#[cfg(feature = "objc2-image-io")]
14use objc2_image_io::*;
15#[cfg(feature = "objc2-io-surface")]
16use objc2_io_surface::*;
17#[cfg(feature = "objc2-metal")]
18use objc2_metal::*;
19
20use crate::*;
21
22/// [Apple's documentation](https://developer.apple.com/documentation/coreimage/ciformat?language=objc)
23// NS_TYPED_ENUM
24pub type CIFormat = c_int;
25
26extern "C" {
27    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciformatargb8?language=objc)
28    pub static kCIFormatARGB8: CIFormat;
29}
30
31extern "C" {
32    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciformatbgra8?language=objc)
33    pub static kCIFormatBGRA8: CIFormat;
34}
35
36extern "C" {
37    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciformatrgba8?language=objc)
38    pub static kCIFormatRGBA8: CIFormat;
39}
40
41extern "C" {
42    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciformatrgbx8?language=objc)
43    pub static kCIFormatRGBX8: CIFormat;
44}
45
46extern "C" {
47    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciformatabgr8?language=objc)
48    pub static kCIFormatABGR8: CIFormat;
49}
50
51extern "C" {
52    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciformatrgbah?language=objc)
53    pub static kCIFormatRGBAh: CIFormat;
54}
55
56extern "C" {
57    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciformatrgba16?language=objc)
58    pub static kCIFormatRGBA16: CIFormat;
59}
60
61extern "C" {
62    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciformatrgbaf?language=objc)
63    pub static kCIFormatRGBAf: CIFormat;
64}
65
66extern "C" {
67    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciformatrgbx16?language=objc)
68    pub static kCIFormatRGBX16: CIFormat;
69}
70
71extern "C" {
72    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciformatrgbxh?language=objc)
73    pub static kCIFormatRGBXh: CIFormat;
74}
75
76extern "C" {
77    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciformatrgbxf?language=objc)
78    pub static kCIFormatRGBXf: CIFormat;
79}
80
81extern "C" {
82    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciformatrgb10?language=objc)
83    pub static kCIFormatRGB10: CIFormat;
84}
85
86extern "C" {
87    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciformata8?language=objc)
88    pub static kCIFormatA8: CIFormat;
89}
90
91extern "C" {
92    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciformata16?language=objc)
93    pub static kCIFormatA16: CIFormat;
94}
95
96extern "C" {
97    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciformatah?language=objc)
98    pub static kCIFormatAh: CIFormat;
99}
100
101extern "C" {
102    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciformataf?language=objc)
103    pub static kCIFormatAf: CIFormat;
104}
105
106extern "C" {
107    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciformatr8?language=objc)
108    pub static kCIFormatR8: CIFormat;
109}
110
111extern "C" {
112    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciformatr16?language=objc)
113    pub static kCIFormatR16: CIFormat;
114}
115
116extern "C" {
117    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciformatrh?language=objc)
118    pub static kCIFormatRh: CIFormat;
119}
120
121extern "C" {
122    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciformatrf?language=objc)
123    pub static kCIFormatRf: CIFormat;
124}
125
126extern "C" {
127    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciformatrg8?language=objc)
128    pub static kCIFormatRG8: CIFormat;
129}
130
131extern "C" {
132    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciformatrg16?language=objc)
133    pub static kCIFormatRG16: CIFormat;
134}
135
136extern "C" {
137    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciformatrgh?language=objc)
138    pub static kCIFormatRGh: CIFormat;
139}
140
141extern "C" {
142    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciformatrgf?language=objc)
143    pub static kCIFormatRGf: CIFormat;
144}
145
146extern "C" {
147    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciformatl8?language=objc)
148    pub static kCIFormatL8: CIFormat;
149}
150
151extern "C" {
152    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciformatl16?language=objc)
153    pub static kCIFormatL16: CIFormat;
154}
155
156extern "C" {
157    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciformatlh?language=objc)
158    pub static kCIFormatLh: CIFormat;
159}
160
161extern "C" {
162    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciformatlf?language=objc)
163    pub static kCIFormatLf: CIFormat;
164}
165
166extern "C" {
167    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciformatla8?language=objc)
168    pub static kCIFormatLA8: CIFormat;
169}
170
171extern "C" {
172    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciformatla16?language=objc)
173    pub static kCIFormatLA16: CIFormat;
174}
175
176extern "C" {
177    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciformatlah?language=objc)
178    pub static kCIFormatLAh: CIFormat;
179}
180
181extern "C" {
182    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciformatlaf?language=objc)
183    pub static kCIFormatLAf: CIFormat;
184}
185
186/// [Apple's documentation](https://developer.apple.com/documentation/coreimage/ciimageoption?language=objc)
187// NS_TYPED_ENUM
188pub type CIImageOption = NSString;
189
190extern "C" {
191    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciimagecolorspace?language=objc)
192    pub static kCIImageColorSpace: &'static CIImageOption;
193}
194
195extern "C" {
196    /// A Boolean value to control whether an image created with a CVPixelBuffer or an IOSurface
197    /// should be cropped and offset according clean aperture attachments.
198    ///
199    /// For a `CVPixelBuffer` this will use `kCVImageBufferPreferredCleanApertureKey`
200    /// or `kCVImageBufferCleanApertureKey`.
201    ///
202    /// If the value for this option is:
203    /// * True: then image will be cropped and offset to the clean aperture.
204    /// * False: then the full image is returned.
205    /// * ``CIVector`` : then use it as a `CGRect` to crop and offset.
206    /// * Not specified : then it will behave as if False was specified.
207    ///
208    /// See also [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciimageapplycleanaperture?language=objc)
209    pub static kCIImageApplyCleanAperture: &'static CIImageOption;
210}
211
212extern "C" {
213    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciimagetonemaphdrtosdr?language=objc)
214    pub static kCIImageToneMapHDRtoSDR: &'static CIImageOption;
215}
216
217extern "C" {
218    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciimageexpandtohdr?language=objc)
219    pub static kCIImageExpandToHDR: &'static CIImageOption;
220}
221
222extern "C" {
223    /// A value for overriding the automatic behavior of the Content Headroom property
224    /// when creating an image.
225    ///
226    /// The value for this key should be an `NSNumber` instance.
227    ///
228    /// See also [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciimagecontentheadroom?language=objc)
229    pub static kCIImageContentHeadroom: &'static CIImageOption;
230}
231
232extern "C" {
233    /// A value for overriding the automatic behavior of the Content Average Light Level property
234    /// when creating an image.
235    ///
236    /// The value for this key should be an `NSNumber` instance.
237    ///
238    /// See also [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciimagecontentaveragelightlevel?language=objc)
239    pub static kCIImageContentAverageLightLevel: &'static CIImageOption;
240}
241
242extern "C" {
243    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciimagenearestsampling?language=objc)
244    pub static kCIImageNearestSampling: &'static CIImageOption;
245}
246
247extern "C" {
248    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciimagecacheimmediately?language=objc)
249    pub static kCIImageCacheImmediately: &'static CIImageOption;
250}
251
252extern "C" {
253    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciimageproperties?language=objc)
254    pub static kCIImageProperties: &'static CIImageOption;
255}
256
257extern "C" {
258    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciimageapplyorientationproperty?language=objc)
259    pub static kCIImageApplyOrientationProperty: &'static CIImageOption;
260}
261
262extern "C" {
263    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciimagetexturetarget?language=objc)
264    #[deprecated = "Core Image OpenGL API deprecated. (Define CI_SILENCE_GL_DEPRECATION to silence these warnings)"]
265    pub static kCIImageTextureTarget: &'static CIImageOption;
266}
267
268extern "C" {
269    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciimagetextureformat?language=objc)
270    #[deprecated = "Core Image OpenGL API deprecated. (Define CI_SILENCE_GL_DEPRECATION to silence these warnings)"]
271    pub static kCIImageTextureFormat: &'static CIImageOption;
272}
273
274extern "C" {
275    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciimageauxiliarydepth?language=objc)
276    pub static kCIImageAuxiliaryDepth: &'static CIImageOption;
277}
278
279extern "C" {
280    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciimageauxiliarydisparity?language=objc)
281    pub static kCIImageAuxiliaryDisparity: &'static CIImageOption;
282}
283
284extern "C" {
285    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciimageauxiliaryportraiteffectsmatte?language=objc)
286    pub static kCIImageAuxiliaryPortraitEffectsMatte: &'static CIImageOption;
287}
288
289extern "C" {
290    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciimageauxiliarysemanticsegmentationskinmatte?language=objc)
291    pub static kCIImageAuxiliarySemanticSegmentationSkinMatte: &'static CIImageOption;
292}
293
294extern "C" {
295    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciimageauxiliarysemanticsegmentationhairmatte?language=objc)
296    pub static kCIImageAuxiliarySemanticSegmentationHairMatte: &'static CIImageOption;
297}
298
299extern "C" {
300    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciimageauxiliarysemanticsegmentationteethmatte?language=objc)
301    pub static kCIImageAuxiliarySemanticSegmentationTeethMatte: &'static CIImageOption;
302}
303
304extern "C" {
305    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciimageauxiliarysemanticsegmentationglassesmatte?language=objc)
306    pub static kCIImageAuxiliarySemanticSegmentationGlassesMatte: &'static CIImageOption;
307}
308
309extern "C" {
310    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciimageauxiliarysemanticsegmentationskymatte?language=objc)
311    pub static kCIImageAuxiliarySemanticSegmentationSkyMatte: &'static CIImageOption;
312}
313
314extern "C" {
315    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciimageauxiliaryhdrgainmap?language=objc)
316    pub static kCIImageAuxiliaryHDRGainMap: &'static CIImageOption;
317}
318
319extern_class!(
320    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/ciimage?language=objc)
321    #[unsafe(super(NSObject))]
322    #[derive(Debug, PartialEq, Eq, Hash)]
323    pub struct CIImage;
324);
325
326unsafe impl Send for CIImage {}
327
328unsafe impl Sync for CIImage {}
329
330extern_conformance!(
331    unsafe impl NSCoding for CIImage {}
332);
333
334extern_conformance!(
335    unsafe impl NSCopying for CIImage {}
336);
337
338unsafe impl CopyingHelper for CIImage {
339    type Result = Self;
340}
341
342extern_conformance!(
343    unsafe impl NSObjectProtocol for CIImage {}
344);
345
346extern_conformance!(
347    unsafe impl NSSecureCoding for CIImage {}
348);
349
350impl CIImage {
351    extern_methods!(
352        #[cfg(feature = "objc2-core-graphics")]
353        #[unsafe(method(imageWithCGImage:))]
354        #[unsafe(method_family = none)]
355        pub unsafe fn imageWithCGImage(image: &CGImage) -> Retained<CIImage>;
356
357        #[cfg(feature = "objc2-core-graphics")]
358        /// # Safety
359        ///
360        /// `options` generic should be of the correct type.
361        #[unsafe(method(imageWithCGImage:options:))]
362        #[unsafe(method_family = none)]
363        pub unsafe fn imageWithCGImage_options(
364            image: &CGImage,
365            options: Option<&NSDictionary<CIImageOption, AnyObject>>,
366        ) -> Retained<CIImage>;
367
368        #[cfg(feature = "objc2-image-io")]
369        /// # Safety
370        ///
371        /// `dict` generic should be of the correct type.
372        #[unsafe(method(imageWithCGImageSource:index:options:))]
373        #[unsafe(method_family = none)]
374        pub unsafe fn imageWithCGImageSource_index_options(
375            source: &CGImageSource,
376            index: usize,
377            dict: Option<&NSDictionary<CIImageOption, AnyObject>>,
378        ) -> Retained<CIImage>;
379
380        #[cfg(feature = "objc2-core-graphics")]
381        #[deprecated]
382        #[unsafe(method(imageWithCGLayer:))]
383        #[unsafe(method_family = none)]
384        pub unsafe fn imageWithCGLayer(layer: &CGLayer) -> Retained<CIImage>;
385
386        #[cfg(feature = "objc2-core-graphics")]
387        /// # Safety
388        ///
389        /// `options` generic should be of the correct type.
390        #[deprecated]
391        #[unsafe(method(imageWithCGLayer:options:))]
392        #[unsafe(method_family = none)]
393        pub unsafe fn imageWithCGLayer_options(
394            layer: &CGLayer,
395            options: Option<&NSDictionary<CIImageOption, AnyObject>>,
396        ) -> Retained<CIImage>;
397
398        #[cfg(all(feature = "objc2-core-foundation", feature = "objc2-core-graphics"))]
399        #[unsafe(method(imageWithBitmapData:bytesPerRow:size:format:colorSpace:))]
400        #[unsafe(method_family = none)]
401        pub unsafe fn imageWithBitmapData_bytesPerRow_size_format_colorSpace(
402            data: &NSData,
403            bytes_per_row: usize,
404            size: CGSize,
405            format: CIFormat,
406            color_space: Option<&CGColorSpace>,
407        ) -> Retained<CIImage>;
408
409        #[cfg(all(feature = "objc2-core-foundation", feature = "objc2-core-graphics"))]
410        #[deprecated = "Core Image OpenGL API deprecated. (Define CI_SILENCE_GL_DEPRECATION to silence these warnings)"]
411        #[unsafe(method(imageWithTexture:size:flipped:colorSpace:))]
412        #[unsafe(method_family = none)]
413        pub unsafe fn imageWithTexture_size_flipped_colorSpace(
414            name: c_uint,
415            size: CGSize,
416            flipped: bool,
417            color_space: Option<&CGColorSpace>,
418        ) -> Retained<CIImage>;
419
420        #[cfg(feature = "objc2-core-foundation")]
421        /// # Safety
422        ///
423        /// `options` generic should be of the correct type.
424        #[deprecated = "Core Image OpenGL API deprecated. (Define CI_SILENCE_GL_DEPRECATION to silence these warnings)"]
425        #[unsafe(method(imageWithTexture:size:flipped:options:))]
426        #[unsafe(method_family = none)]
427        pub unsafe fn imageWithTexture_size_flipped_options(
428            name: c_uint,
429            size: CGSize,
430            flipped: bool,
431            options: Option<&NSDictionary<CIImageOption, AnyObject>>,
432        ) -> Retained<CIImage>;
433
434        #[cfg(feature = "objc2-metal")]
435        /// # Safety
436        ///
437        /// - `texture` may need to be synchronized.
438        /// - `texture` may be unretained, you must ensure it is kept alive while in use.
439        /// - `options` generic should be of the correct type.
440        #[unsafe(method(imageWithMTLTexture:options:))]
441        #[unsafe(method_family = none)]
442        pub unsafe fn imageWithMTLTexture_options(
443            texture: &ProtocolObject<dyn MTLTexture>,
444            options: Option<&NSDictionary<CIImageOption, AnyObject>>,
445        ) -> Option<Retained<CIImage>>;
446
447        #[unsafe(method(imageWithContentsOfURL:))]
448        #[unsafe(method_family = none)]
449        pub unsafe fn imageWithContentsOfURL(url: &NSURL) -> Option<Retained<CIImage>>;
450
451        /// # Safety
452        ///
453        /// `options` generic should be of the correct type.
454        #[unsafe(method(imageWithContentsOfURL:options:))]
455        #[unsafe(method_family = none)]
456        pub unsafe fn imageWithContentsOfURL_options(
457            url: &NSURL,
458            options: Option<&NSDictionary<CIImageOption, AnyObject>>,
459        ) -> Option<Retained<CIImage>>;
460
461        #[unsafe(method(imageWithData:))]
462        #[unsafe(method_family = none)]
463        pub unsafe fn imageWithData(data: &NSData) -> Option<Retained<CIImage>>;
464
465        /// # Safety
466        ///
467        /// `options` generic should be of the correct type.
468        #[unsafe(method(imageWithData:options:))]
469        #[unsafe(method_family = none)]
470        pub unsafe fn imageWithData_options(
471            data: &NSData,
472            options: Option<&NSDictionary<CIImageOption, AnyObject>>,
473        ) -> Option<Retained<CIImage>>;
474
475        #[cfg(feature = "objc2-core-video")]
476        #[unsafe(method(imageWithCVImageBuffer:))]
477        #[unsafe(method_family = none)]
478        pub unsafe fn imageWithCVImageBuffer(image_buffer: &CVImageBuffer) -> Retained<CIImage>;
479
480        #[cfg(feature = "objc2-core-video")]
481        /// # Safety
482        ///
483        /// `options` generic should be of the correct type.
484        #[unsafe(method(imageWithCVImageBuffer:options:))]
485        #[unsafe(method_family = none)]
486        pub unsafe fn imageWithCVImageBuffer_options(
487            image_buffer: &CVImageBuffer,
488            options: Option<&NSDictionary<CIImageOption, AnyObject>>,
489        ) -> Retained<CIImage>;
490
491        #[cfg(feature = "objc2-core-video")]
492        #[unsafe(method(imageWithCVPixelBuffer:))]
493        #[unsafe(method_family = none)]
494        pub unsafe fn imageWithCVPixelBuffer(pixel_buffer: &CVPixelBuffer) -> Retained<CIImage>;
495
496        #[cfg(feature = "objc2-core-video")]
497        /// # Safety
498        ///
499        /// `options` generic should be of the correct type.
500        #[unsafe(method(imageWithCVPixelBuffer:options:))]
501        #[unsafe(method_family = none)]
502        pub unsafe fn imageWithCVPixelBuffer_options(
503            pixel_buffer: &CVPixelBuffer,
504            options: Option<&NSDictionary<CIImageOption, AnyObject>>,
505        ) -> Retained<CIImage>;
506
507        #[cfg(feature = "objc2-io-surface")]
508        #[unsafe(method(imageWithIOSurface:))]
509        #[unsafe(method_family = none)]
510        pub unsafe fn imageWithIOSurface(surface: &IOSurfaceRef) -> Retained<CIImage>;
511
512        #[cfg(feature = "objc2-io-surface")]
513        /// # Safety
514        ///
515        /// `options` generic should be of the correct type.
516        #[unsafe(method(imageWithIOSurface:options:))]
517        #[unsafe(method_family = none)]
518        pub unsafe fn imageWithIOSurface_options(
519            surface: &IOSurfaceRef,
520            options: Option<&NSDictionary<CIImageOption, AnyObject>>,
521        ) -> Retained<CIImage>;
522
523        #[cfg(feature = "CIColor")]
524        #[unsafe(method(imageWithColor:))]
525        #[unsafe(method_family = none)]
526        pub unsafe fn imageWithColor(color: &CIColor) -> Retained<CIImage>;
527
528        #[unsafe(method(emptyImage))]
529        #[unsafe(method_family = none)]
530        pub unsafe fn emptyImage() -> Retained<CIImage>;
531
532        #[unsafe(method(blackImage))]
533        #[unsafe(method_family = none)]
534        pub unsafe fn blackImage() -> Retained<CIImage>;
535
536        #[unsafe(method(whiteImage))]
537        #[unsafe(method_family = none)]
538        pub unsafe fn whiteImage() -> Retained<CIImage>;
539
540        #[unsafe(method(grayImage))]
541        #[unsafe(method_family = none)]
542        pub unsafe fn grayImage() -> Retained<CIImage>;
543
544        #[unsafe(method(redImage))]
545        #[unsafe(method_family = none)]
546        pub unsafe fn redImage() -> Retained<CIImage>;
547
548        #[unsafe(method(greenImage))]
549        #[unsafe(method_family = none)]
550        pub unsafe fn greenImage() -> Retained<CIImage>;
551
552        #[unsafe(method(blueImage))]
553        #[unsafe(method_family = none)]
554        pub unsafe fn blueImage() -> Retained<CIImage>;
555
556        #[unsafe(method(cyanImage))]
557        #[unsafe(method_family = none)]
558        pub unsafe fn cyanImage() -> Retained<CIImage>;
559
560        #[unsafe(method(magentaImage))]
561        #[unsafe(method_family = none)]
562        pub unsafe fn magentaImage() -> Retained<CIImage>;
563
564        #[unsafe(method(yellowImage))]
565        #[unsafe(method_family = none)]
566        pub unsafe fn yellowImage() -> Retained<CIImage>;
567
568        #[unsafe(method(clearImage))]
569        #[unsafe(method_family = none)]
570        pub unsafe fn clearImage() -> Retained<CIImage>;
571
572        #[cfg(feature = "objc2-core-graphics")]
573        #[unsafe(method(initWithCGImage:))]
574        #[unsafe(method_family = init)]
575        pub unsafe fn initWithCGImage(this: Allocated<Self>, image: &CGImage) -> Retained<Self>;
576
577        #[cfg(feature = "objc2-core-graphics")]
578        /// # Safety
579        ///
580        /// `options` generic should be of the correct type.
581        #[unsafe(method(initWithCGImage:options:))]
582        #[unsafe(method_family = init)]
583        pub unsafe fn initWithCGImage_options(
584            this: Allocated<Self>,
585            image: &CGImage,
586            options: Option<&NSDictionary<CIImageOption, AnyObject>>,
587        ) -> Retained<Self>;
588
589        #[cfg(feature = "objc2-image-io")]
590        /// # Safety
591        ///
592        /// `dict` generic should be of the correct type.
593        #[unsafe(method(initWithCGImageSource:index:options:))]
594        #[unsafe(method_family = init)]
595        pub unsafe fn initWithCGImageSource_index_options(
596            this: Allocated<Self>,
597            source: &CGImageSource,
598            index: usize,
599            dict: Option<&NSDictionary<CIImageOption, AnyObject>>,
600        ) -> Retained<Self>;
601
602        #[cfg(feature = "objc2-core-graphics")]
603        #[deprecated = "Use initWithCGImage: instead."]
604        #[unsafe(method(initWithCGLayer:))]
605        #[unsafe(method_family = init)]
606        pub unsafe fn initWithCGLayer(this: Allocated<Self>, layer: &CGLayer) -> Retained<Self>;
607
608        #[cfg(feature = "objc2-core-graphics")]
609        /// # Safety
610        ///
611        /// `options` generic should be of the correct type.
612        #[deprecated = "Use initWithCGImage:options instead."]
613        #[unsafe(method(initWithCGLayer:options:))]
614        #[unsafe(method_family = init)]
615        pub unsafe fn initWithCGLayer_options(
616            this: Allocated<Self>,
617            layer: &CGLayer,
618            options: Option<&NSDictionary<CIImageOption, AnyObject>>,
619        ) -> Retained<Self>;
620
621        #[unsafe(method(initWithData:))]
622        #[unsafe(method_family = init)]
623        pub unsafe fn initWithData(this: Allocated<Self>, data: &NSData) -> Option<Retained<Self>>;
624
625        /// # Safety
626        ///
627        /// `options` generic should be of the correct type.
628        #[unsafe(method(initWithData:options:))]
629        #[unsafe(method_family = init)]
630        pub unsafe fn initWithData_options(
631            this: Allocated<Self>,
632            data: &NSData,
633            options: Option<&NSDictionary<CIImageOption, AnyObject>>,
634        ) -> Option<Retained<Self>>;
635
636        #[cfg(all(feature = "objc2-core-foundation", feature = "objc2-core-graphics"))]
637        #[unsafe(method(initWithBitmapData:bytesPerRow:size:format:colorSpace:))]
638        #[unsafe(method_family = init)]
639        pub unsafe fn initWithBitmapData_bytesPerRow_size_format_colorSpace(
640            this: Allocated<Self>,
641            data: &NSData,
642            bytes_per_row: usize,
643            size: CGSize,
644            format: CIFormat,
645            color_space: Option<&CGColorSpace>,
646        ) -> Retained<Self>;
647
648        #[cfg(all(feature = "objc2-core-foundation", feature = "objc2-core-graphics"))]
649        #[deprecated = "Core Image OpenGL API deprecated. (Define CI_SILENCE_GL_DEPRECATION to silence these warnings)"]
650        #[unsafe(method(initWithTexture:size:flipped:colorSpace:))]
651        #[unsafe(method_family = init)]
652        pub unsafe fn initWithTexture_size_flipped_colorSpace(
653            this: Allocated<Self>,
654            name: c_uint,
655            size: CGSize,
656            flipped: bool,
657            color_space: Option<&CGColorSpace>,
658        ) -> Retained<Self>;
659
660        #[cfg(feature = "objc2-core-foundation")]
661        /// # Safety
662        ///
663        /// `options` generic should be of the correct type.
664        #[deprecated = "Core Image OpenGL API deprecated. (Define CI_SILENCE_GL_DEPRECATION to silence these warnings)"]
665        #[unsafe(method(initWithTexture:size:flipped:options:))]
666        #[unsafe(method_family = init)]
667        pub unsafe fn initWithTexture_size_flipped_options(
668            this: Allocated<Self>,
669            name: c_uint,
670            size: CGSize,
671            flipped: bool,
672            options: Option<&NSDictionary<CIImageOption, AnyObject>>,
673        ) -> Retained<Self>;
674
675        #[cfg(feature = "objc2-metal")]
676        /// # Safety
677        ///
678        /// - `texture` may need to be synchronized.
679        /// - `texture` may be unretained, you must ensure it is kept alive while in use.
680        /// - `options` generic should be of the correct type.
681        #[unsafe(method(initWithMTLTexture:options:))]
682        #[unsafe(method_family = init)]
683        pub unsafe fn initWithMTLTexture_options(
684            this: Allocated<Self>,
685            texture: &ProtocolObject<dyn MTLTexture>,
686            options: Option<&NSDictionary<CIImageOption, AnyObject>>,
687        ) -> Option<Retained<Self>>;
688
689        #[unsafe(method(initWithContentsOfURL:))]
690        #[unsafe(method_family = init)]
691        pub unsafe fn initWithContentsOfURL(
692            this: Allocated<Self>,
693            url: &NSURL,
694        ) -> Option<Retained<Self>>;
695
696        /// # Safety
697        ///
698        /// `options` generic should be of the correct type.
699        #[unsafe(method(initWithContentsOfURL:options:))]
700        #[unsafe(method_family = init)]
701        pub unsafe fn initWithContentsOfURL_options(
702            this: Allocated<Self>,
703            url: &NSURL,
704            options: Option<&NSDictionary<CIImageOption, AnyObject>>,
705        ) -> Option<Retained<Self>>;
706
707        #[cfg(feature = "objc2-io-surface")]
708        #[unsafe(method(initWithIOSurface:))]
709        #[unsafe(method_family = init)]
710        pub unsafe fn initWithIOSurface(
711            this: Allocated<Self>,
712            surface: &IOSurfaceRef,
713        ) -> Retained<Self>;
714
715        #[cfg(feature = "objc2-io-surface")]
716        /// # Safety
717        ///
718        /// `options` generic should be of the correct type.
719        #[unsafe(method(initWithIOSurface:options:))]
720        #[unsafe(method_family = init)]
721        pub unsafe fn initWithIOSurface_options(
722            this: Allocated<Self>,
723            surface: &IOSurfaceRef,
724            options: Option<&NSDictionary<CIImageOption, AnyObject>>,
725        ) -> Retained<Self>;
726
727        #[cfg(feature = "objc2-io-surface")]
728        /// # Safety
729        ///
730        /// `options` generic should be of the correct type.
731        #[deprecated]
732        #[unsafe(method(initWithIOSurface:plane:format:options:))]
733        #[unsafe(method_family = init)]
734        pub unsafe fn initWithIOSurface_plane_format_options(
735            this: Allocated<Self>,
736            surface: &IOSurfaceRef,
737            plane: usize,
738            format: CIFormat,
739            options: Option<&NSDictionary<CIImageOption, AnyObject>>,
740        ) -> Retained<Self>;
741
742        #[cfg(feature = "objc2-core-video")]
743        #[unsafe(method(initWithCVImageBuffer:))]
744        #[unsafe(method_family = init)]
745        pub unsafe fn initWithCVImageBuffer(
746            this: Allocated<Self>,
747            image_buffer: &CVImageBuffer,
748        ) -> Retained<Self>;
749
750        #[cfg(feature = "objc2-core-video")]
751        /// # Safety
752        ///
753        /// `options` generic should be of the correct type.
754        #[unsafe(method(initWithCVImageBuffer:options:))]
755        #[unsafe(method_family = init)]
756        pub unsafe fn initWithCVImageBuffer_options(
757            this: Allocated<Self>,
758            image_buffer: &CVImageBuffer,
759            options: Option<&NSDictionary<CIImageOption, AnyObject>>,
760        ) -> Retained<Self>;
761
762        #[cfg(feature = "objc2-core-video")]
763        #[unsafe(method(initWithCVPixelBuffer:))]
764        #[unsafe(method_family = init)]
765        pub unsafe fn initWithCVPixelBuffer(
766            this: Allocated<Self>,
767            pixel_buffer: &CVPixelBuffer,
768        ) -> Retained<Self>;
769
770        #[cfg(feature = "objc2-core-video")]
771        /// # Safety
772        ///
773        /// `options` generic should be of the correct type.
774        #[unsafe(method(initWithCVPixelBuffer:options:))]
775        #[unsafe(method_family = init)]
776        pub unsafe fn initWithCVPixelBuffer_options(
777            this: Allocated<Self>,
778            pixel_buffer: &CVPixelBuffer,
779            options: Option<&NSDictionary<CIImageOption, AnyObject>>,
780        ) -> Retained<Self>;
781
782        #[cfg(feature = "CIColor")]
783        #[unsafe(method(initWithColor:))]
784        #[unsafe(method_family = init)]
785        pub unsafe fn initWithColor(this: Allocated<Self>, color: &CIColor) -> Retained<Self>;
786
787        #[cfg(feature = "objc2-core-foundation")]
788        #[unsafe(method(imageByApplyingTransform:))]
789        #[unsafe(method_family = none)]
790        pub unsafe fn imageByApplyingTransform(
791            &self,
792            matrix: CGAffineTransform,
793        ) -> Retained<CIImage>;
794
795        #[cfg(feature = "objc2-core-foundation")]
796        #[unsafe(method(imageByApplyingTransform:highQualityDownsample:))]
797        #[unsafe(method_family = none)]
798        pub unsafe fn imageByApplyingTransform_highQualityDownsample(
799            &self,
800            matrix: CGAffineTransform,
801            high_quality_downsample: bool,
802        ) -> Retained<CIImage>;
803
804        #[unsafe(method(imageByApplyingOrientation:))]
805        #[unsafe(method_family = none)]
806        pub unsafe fn imageByApplyingOrientation(&self, orientation: c_int) -> Retained<CIImage>;
807
808        #[cfg(feature = "objc2-core-foundation")]
809        #[unsafe(method(imageTransformForOrientation:))]
810        #[unsafe(method_family = none)]
811        pub unsafe fn imageTransformForOrientation(&self, orientation: c_int) -> CGAffineTransform;
812
813        #[cfg(feature = "objc2-image-io")]
814        #[unsafe(method(imageByApplyingCGOrientation:))]
815        #[unsafe(method_family = none)]
816        pub unsafe fn imageByApplyingCGOrientation(
817            &self,
818            orientation: CGImagePropertyOrientation,
819        ) -> Retained<CIImage>;
820
821        #[cfg(all(feature = "objc2-core-foundation", feature = "objc2-image-io"))]
822        #[unsafe(method(imageTransformForCGOrientation:))]
823        #[unsafe(method_family = none)]
824        pub unsafe fn imageTransformForCGOrientation(
825            &self,
826            orientation: CGImagePropertyOrientation,
827        ) -> CGAffineTransform;
828
829        #[unsafe(method(imageByCompositingOverImage:))]
830        #[unsafe(method_family = none)]
831        pub unsafe fn imageByCompositingOverImage(&self, dest: &CIImage) -> Retained<CIImage>;
832
833        #[cfg(feature = "objc2-core-foundation")]
834        #[unsafe(method(imageByCroppingToRect:))]
835        #[unsafe(method_family = none)]
836        pub unsafe fn imageByCroppingToRect(&self, rect: CGRect) -> Retained<CIImage>;
837
838        #[unsafe(method(imageByClampingToExtent))]
839        #[unsafe(method_family = none)]
840        pub unsafe fn imageByClampingToExtent(&self) -> Retained<CIImage>;
841
842        #[cfg(feature = "objc2-core-foundation")]
843        #[unsafe(method(imageByClampingToRect:))]
844        #[unsafe(method_family = none)]
845        pub unsafe fn imageByClampingToRect(&self, rect: CGRect) -> Retained<CIImage>;
846
847        /// # Safety
848        ///
849        /// `params` generic should be of the correct type.
850        #[unsafe(method(imageByApplyingFilter:withInputParameters:))]
851        #[unsafe(method_family = none)]
852        pub unsafe fn imageByApplyingFilter_withInputParameters(
853            &self,
854            filter_name: &NSString,
855            params: &NSDictionary<NSString, AnyObject>,
856        ) -> Retained<CIImage>;
857
858        #[unsafe(method(imageByApplyingFilter:))]
859        #[unsafe(method_family = none)]
860        pub unsafe fn imageByApplyingFilter(&self, filter_name: &NSString) -> Retained<CIImage>;
861
862        #[cfg(feature = "objc2-core-graphics")]
863        #[unsafe(method(imageByColorMatchingColorSpaceToWorkingSpace:))]
864        #[unsafe(method_family = none)]
865        pub unsafe fn imageByColorMatchingColorSpaceToWorkingSpace(
866            &self,
867            color_space: &CGColorSpace,
868        ) -> Option<Retained<CIImage>>;
869
870        #[cfg(feature = "objc2-core-graphics")]
871        #[unsafe(method(imageByColorMatchingWorkingSpaceToColorSpace:))]
872        #[unsafe(method_family = none)]
873        pub unsafe fn imageByColorMatchingWorkingSpaceToColorSpace(
874            &self,
875            color_space: &CGColorSpace,
876        ) -> Option<Retained<CIImage>>;
877
878        #[unsafe(method(imageByPremultiplyingAlpha))]
879        #[unsafe(method_family = none)]
880        pub unsafe fn imageByPremultiplyingAlpha(&self) -> Retained<CIImage>;
881
882        #[unsafe(method(imageByUnpremultiplyingAlpha))]
883        #[unsafe(method_family = none)]
884        pub unsafe fn imageByUnpremultiplyingAlpha(&self) -> Retained<CIImage>;
885
886        #[cfg(feature = "objc2-core-foundation")]
887        #[unsafe(method(imageBySettingAlphaOneInExtent:))]
888        #[unsafe(method_family = none)]
889        pub unsafe fn imageBySettingAlphaOneInExtent(&self, extent: CGRect) -> Retained<CIImage>;
890
891        /// Create an image by applying a gaussian blur to the receiver.
892        /// - Parameters:
893        /// - sigma: The sigma of the gaussian blur to apply to the receiver.
894        /// If the sigma is very small (less than `0.16`) then the receiver is returned.
895        /// - Returns:
896        /// An autoreleased ``CIImage`` instance or the received image.
897        #[unsafe(method(imageByApplyingGaussianBlurWithSigma:))]
898        #[unsafe(method_family = none)]
899        pub unsafe fn imageByApplyingGaussianBlurWithSigma(
900            &self,
901            sigma: c_double,
902        ) -> Retained<CIImage>;
903
904        /// Return a new image by changing the receiver's metadata properties.
905        ///
906        /// When you create an image, Core Image sets an image’s properties to a metadata
907        /// dictionary as described here: ``properties``.
908        /// Use this method to override an image’s metadata properties with new values.
909        ///
910        /// - Parameters:
911        /// - properties: A dictionary of metadata properties akin to the `CGImageSourceCopyPropertiesAtIndex()` function.
912        /// - Returns:
913        /// An autoreleased ``CIImage`` instance with a copy of the new properties.
914        ///
915        /// # Safety
916        ///
917        /// `properties` generic should be of the correct type.
918        #[unsafe(method(imageBySettingProperties:))]
919        #[unsafe(method_family = none)]
920        pub unsafe fn imageBySettingProperties(
921            &self,
922            properties: &NSDictionary,
923        ) -> Retained<CIImage>;
924
925        /// Create an image by changing the receiver's sample mode to bilinear interpolation.
926        /// - Returns:
927        /// An autoreleased ``CIImage`` instance with a bilinear sampling.
928        #[unsafe(method(imageBySamplingLinear))]
929        #[unsafe(method_family = none)]
930        pub unsafe fn imageBySamplingLinear(&self) -> Retained<CIImage>;
931
932        /// Create an image by changing the receiver's sample mode to nearest neighbor.
933        /// - Returns:
934        /// An autoreleased ``CIImage`` instance with a nearest sampling.
935        #[unsafe(method(imageBySamplingNearest))]
936        #[unsafe(method_family = none)]
937        pub unsafe fn imageBySamplingNearest(&self) -> Retained<CIImage>;
938
939        /// Create an image that inserts a intermediate that is cacheable
940        ///
941        /// This intermediate will be not be cached if ``kCIContextCacheIntermediates`` is false.
942        /// - Returns:
943        /// An autoreleased ``CIImage``.
944        #[unsafe(method(imageByInsertingIntermediate))]
945        #[unsafe(method_family = none)]
946        pub unsafe fn imageByInsertingIntermediate(&self) -> Retained<CIImage>;
947
948        /// Create an image that inserts a intermediate that is cacheable.
949        ///
950        /// - Parameters:
951        /// - cache: Controls if Core Image caches the returned image.
952        /// * `YES` : This intermediate will be cacheable even if
953        /// ``kCIContextCacheIntermediates`` is false.
954        /// * `NO`  : the intermediate will be not be cached if
955        /// ``kCIContextCacheIntermediates`` is false.
956        /// - Returns:
957        /// An autoreleased ``CIImage``.
958        #[unsafe(method(imageByInsertingIntermediate:))]
959        #[unsafe(method_family = none)]
960        pub unsafe fn imageByInsertingIntermediate_(&self, cache: bool) -> Retained<CIImage>;
961
962        /// Create an image that inserts a intermediate that is cached in tiles
963        ///
964        /// This intermediate will be cacheable even if ``kCIContextCacheIntermediates`` is false.
965        /// - Returns:
966        /// An autoreleased ``CIImage``.
967        #[unsafe(method(imageByInsertingTiledIntermediate))]
968        #[unsafe(method_family = none)]
969        pub unsafe fn imageByInsertingTiledIntermediate(&self) -> Retained<CIImage>;
970
971        /// Create an image that applies a gain map Core Image image to the received Core Image image.
972        ///
973        /// The gain map image can be obtained by creating a ``CIImage`` instance from `NSURL`/`NSData`
974        /// and setting the ``kCIImageAuxiliaryHDRGainMap`` option set to `
975        /// `true``.
976        ///
977        /// If the gain map ``CIImage`` instance doesn't have the needed ``properties`` metadata,
978        /// the received image will be returned as-is.
979        ///
980        /// - Returns:
981        /// An autoreleased ``CIImage`` instance or the received image.
982        #[unsafe(method(imageByApplyingGainMap:))]
983        #[unsafe(method_family = none)]
984        pub unsafe fn imageByApplyingGainMap(&self, gainmap: &CIImage) -> Retained<CIImage>;
985
986        /// Create an image that applies a gain map Core Image image with a specified headroom to the received Core Image image.
987        ///
988        /// - Parameters:
989        /// - gainmap: The gain map ``CIImage`` instance to apply to the receiver.
990        /// - headroom: a float value that specify how much headroom the resulting image should have.
991        /// The headroom value will be limited to between 1.0 (i.e. SDR) and
992        /// the full headroom allowed by the gain map.
993        /// - Returns:
994        /// An autoreleased ``CIImage`` instance or the received image.
995        #[unsafe(method(imageByApplyingGainMap:headroom:))]
996        #[unsafe(method_family = none)]
997        pub unsafe fn imageByApplyingGainMap_headroom(
998            &self,
999            gainmap: &CIImage,
1000            headroom: c_float,
1001        ) -> Retained<CIImage>;
1002
1003        /// Create an image by changing the receiver's contentHeadroom property.
1004        ///
1005        /// Changing this value will alter the behavior of the `CIToneMapHeadroom` and `CISystemToneMap` filters.
1006        /// * If the value is set to 0.0 then the returned image's headroom is unknown.
1007        /// * If the value is set to 1.0 then the returned image is SDR.
1008        /// * If the value is set to greater 1.0 then the returned image is HDR.
1009        /// * Otherwise the returned image's headroom is unknown.
1010        ///
1011        /// - Returns:
1012        /// An autoreleased ``CIImage``.
1013        #[unsafe(method(imageBySettingContentHeadroom:))]
1014        #[unsafe(method_family = none)]
1015        pub unsafe fn imageBySettingContentHeadroom(&self, headroom: c_float) -> Retained<CIImage>;
1016
1017        /// Create an image by changing the receiver's contentAverageLightLevel property.
1018        ///
1019        /// Changing this value will alter the behavior of the `CIToneMapHeadroom` and `CISystemToneMap` filters.
1020        /// * If the value is set to 0.0 or less then the returned image's ``contentAverageLightLevel`` is unknown.
1021        ///
1022        /// - Returns:
1023        /// An autoreleased ``CIImage``.
1024        #[unsafe(method(imageBySettingContentAverageLightLevel:))]
1025        #[unsafe(method_family = none)]
1026        pub unsafe fn imageBySettingContentAverageLightLevel(
1027            &self,
1028            average: c_float,
1029        ) -> Retained<CIImage>;
1030
1031        #[cfg(feature = "objc2-core-foundation")]
1032        /// Returns a rectangle the defines the bounds of non-(0,0,0,0) pixels in the image.
1033        /// > Note: the ``extent`` of `CIImage`` may be infinite or have a non-zero origin.
1034        #[unsafe(method(extent))]
1035        #[unsafe(method_family = none)]
1036        pub unsafe fn extent(&self) -> CGRect;
1037
1038        /// Returns YES if the image is known to have and alpha value of `1.0` over the entire image extent.
1039        ///
1040        /// This property is not atomic.
1041        ///
1042        /// # Safety
1043        ///
1044        /// This might not be thread-safe.
1045        #[unsafe(method(isOpaque))]
1046        #[unsafe(method_family = none)]
1047        pub unsafe fn isOpaque(&self) -> bool;
1048
1049        /// Returns the metadata properties dictionary of the image.
1050        ///
1051        /// If the ``CIImage`` was created from `NSURL` or `NSData` then this dictionary is determined by calling `CGImageSourceCopyPropertiesAtIndex()`.
1052        ///
1053        /// If the ``CIImage`` was created with the ``kCIImageProperties`` option, then that dictionary is returned.
1054        ///
1055        /// If the ``CIImage`` was created by applying ``CIFilter-class`` or ``CIKernel`` then the
1056        /// properties of the root inputImage will be returned.
1057        #[unsafe(method(properties))]
1058        #[unsafe(method_family = none)]
1059        pub unsafe fn properties(&self) -> Retained<NSDictionary<NSString, AnyObject>>;
1060
1061        #[cfg(feature = "CIFilterShape")]
1062        #[unsafe(method(definition))]
1063        #[unsafe(method_family = none)]
1064        pub unsafe fn definition(&self) -> Retained<CIFilterShape>;
1065
1066        #[unsafe(method(url))]
1067        #[unsafe(method_family = none)]
1068        pub unsafe fn url(&self) -> Option<Retained<NSURL>>;
1069
1070        #[cfg(feature = "objc2-core-graphics")]
1071        #[unsafe(method(colorSpace))]
1072        #[unsafe(method_family = none)]
1073        pub unsafe fn colorSpace(&self) -> Option<Retained<CGColorSpace>>;
1074
1075        /// Returns the content headroom of the image.
1076        ///
1077        /// If the image headroom is unknown, then the value 0.0 will be returned.
1078        ///
1079        /// If the image headroom is known, then a value greater than or equal to 1.0 will be returned.
1080        /// A value of 1.0 will be returned if the image is SDR.
1081        /// A value greater than 1.0 will be returned if the image is HDR.
1082        ///
1083        /// The image headroom may known when a CIImage is first initialized.
1084        /// If the a CIImage is initialized using:
1085        /// * `NSURL` or `NSData` : the headroom may be determined by associated metadata
1086        /// or deduced from pixel format or colorSpace information.
1087        /// * `CGImage` : headroom may be determined by `CGImageGetHeadroomInfo()`
1088        /// or deduced from pixel format or colorSpace information.
1089        /// * `IOSurface` : then the headroom will be determined by `kIOSurfaceContentHeadroom`.
1090        /// or deduced from pixel format or colorSpace information.
1091        /// * `CVPixelBuffer` : then the headroom will be determined by `kCVImageBufferContentLightLevelInfoKey`.
1092        /// or deduced from pixel format or colorSpace information.
1093        /// * `BitmapData` : headroom may be deduced from pixel format or colorSpace information.
1094        ///
1095        /// If the image is the result of applying a ``CIFilter-class`` or ``CIKernel``, this method will return `0.0`.
1096        ///
1097        /// There are exceptions to this.  Applying a `CIWarpKernel`` or certain ``CIFilter-class``
1098        /// (e.g. `CIGaussianBlur`, `CILanczosScaleTransform`, `CIAreaAverage` and some others)
1099        /// to an image will result in a ``CIImage`` instance with the same `contentHeadroom` property value.
1100        ///
1101        /// This property is not atomic.
1102        ///
1103        /// # Safety
1104        ///
1105        /// This might not be thread-safe.
1106        #[unsafe(method(contentHeadroom))]
1107        #[unsafe(method_family = none)]
1108        pub unsafe fn contentHeadroom(&self) -> c_float;
1109
1110        /// Returns the content average light level of the image.
1111        ///
1112        /// If the image average light level is unknown, then the value 0.0 will be returned.
1113        ///
1114        /// If the image headroom is known, then a value greater than or equal to 0.0 will be returned.
1115        ///
1116        /// The image average light level may known when a CIImage is first initialized.
1117        /// If the a CIImage is initialized with a:
1118        /// * `CGImage` : then the headroom will be determined by `CGImageGetContentAverageLightLevel()`.
1119        /// * `CVPixelBuffer` : then the headroom will be determined by `kCVImageBufferContentLightLevelInfoKey`.
1120        ///
1121        /// If the image is the result of applying a ``CIFilter-class`` or ``CIKernel``, this property will return `0.0`.
1122        ///
1123        /// There are exceptions to this.  Applying a ``CIWarpKernel`` or certain ``CIFilter-class``
1124        /// (e.g. `CIGaussianBlur`, `CILanczosScaleTransform`, `CIAreaAverage` and some others)
1125        /// to an image will result in a ``CIImage`` instance with the same `contentAverageLightLevel` property value.
1126        ///
1127        /// This property is not atomic.
1128        ///
1129        /// # Safety
1130        ///
1131        /// This might not be thread-safe.
1132        #[unsafe(method(contentAverageLightLevel))]
1133        #[unsafe(method_family = none)]
1134        pub unsafe fn contentAverageLightLevel(&self) -> c_float;
1135
1136        #[cfg(feature = "objc2-core-video")]
1137        /// This property is not atomic.
1138        ///
1139        /// # Safety
1140        ///
1141        /// This might not be thread-safe.
1142        #[unsafe(method(pixelBuffer))]
1143        #[unsafe(method_family = none)]
1144        pub unsafe fn pixelBuffer(&self) -> Option<Retained<CVPixelBuffer>>;
1145
1146        #[cfg(feature = "objc2-core-graphics")]
1147        /// This property is not atomic.
1148        ///
1149        /// # Safety
1150        ///
1151        /// This might not be thread-safe.
1152        #[unsafe(method(CGImage))]
1153        #[unsafe(method_family = none)]
1154        pub unsafe fn CGImage(&self) -> Option<Retained<CGImage>>;
1155
1156        #[cfg(feature = "objc2-metal")]
1157        /// Returns a Metal Texture if the Core Image image was created with a texture.
1158        ///
1159        /// This will return non-nil if the image was created with ``/CIImage/imageWithMTLTexture:options:`` and no options.
1160        /// Otherwise this property will be `nil` you should instead call
1161        /// ``/CIContext/render:toMTLTexture:commandBuffer:bounds:colorSpace:``.
1162        /// > Warning: Modifying the contents of this texture will cause the ``CIImage`` instance to render with incorrect results.
1163        ///
1164        /// This property is not atomic.
1165        ///
1166        /// # Safety
1167        ///
1168        /// This might not be thread-safe.
1169        #[unsafe(method(metalTexture))]
1170        #[unsafe(method_family = none)]
1171        pub unsafe fn metalTexture(&self) -> Option<Retained<ProtocolObject<dyn MTLTexture>>>;
1172
1173        #[cfg(feature = "objc2-core-foundation")]
1174        #[unsafe(method(regionOfInterestForImage:inRect:))]
1175        #[unsafe(method_family = none)]
1176        pub unsafe fn regionOfInterestForImage_inRect(
1177            &self,
1178            image: &CIImage,
1179            rect: CGRect,
1180        ) -> CGRect;
1181    );
1182}
1183
1184/// Methods declared on superclass `NSObject`.
1185impl CIImage {
1186    extern_methods!(
1187        #[unsafe(method(init))]
1188        #[unsafe(method_family = init)]
1189        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1190
1191        #[unsafe(method(new))]
1192        #[unsafe(method_family = new)]
1193        pub unsafe fn new() -> Retained<Self>;
1194    );
1195}
1196
1197/// [Apple's documentation](https://developer.apple.com/documentation/coreimage/ciimageautoadjustmentoption?language=objc)
1198// NS_TYPED_ENUM
1199pub type CIImageAutoAdjustmentOption = NSString;
1200
1201extern "C" {
1202    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciimageautoadjustenhance?language=objc)
1203    pub static kCIImageAutoAdjustEnhance: &'static CIImageAutoAdjustmentOption;
1204}
1205
1206extern "C" {
1207    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciimageautoadjustredeye?language=objc)
1208    pub static kCIImageAutoAdjustRedEye: &'static CIImageAutoAdjustmentOption;
1209}
1210
1211extern "C" {
1212    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciimageautoadjustfeatures?language=objc)
1213    pub static kCIImageAutoAdjustFeatures: &'static CIImageAutoAdjustmentOption;
1214}
1215
1216extern "C" {
1217    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciimageautoadjustcrop?language=objc)
1218    pub static kCIImageAutoAdjustCrop: &'static CIImageAutoAdjustmentOption;
1219}
1220
1221extern "C" {
1222    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/kciimageautoadjustlevel?language=objc)
1223    pub static kCIImageAutoAdjustLevel: &'static CIImageAutoAdjustmentOption;
1224}
1225
1226/// AutoAdjustment.
1227impl CIImage {
1228    extern_methods!(
1229        #[cfg(feature = "CIFilter")]
1230        #[unsafe(method(autoAdjustmentFilters))]
1231        #[unsafe(method_family = none)]
1232        pub unsafe fn autoAdjustmentFilters(&self) -> Retained<NSArray<CIFilter>>;
1233
1234        #[cfg(feature = "CIFilter")]
1235        /// # Safety
1236        ///
1237        /// `options` generic should be of the correct type.
1238        #[unsafe(method(autoAdjustmentFiltersWithOptions:))]
1239        #[unsafe(method_family = none)]
1240        pub unsafe fn autoAdjustmentFiltersWithOptions(
1241            &self,
1242            options: Option<&NSDictionary<CIImageAutoAdjustmentOption, AnyObject>>,
1243        ) -> Retained<NSArray<CIFilter>>;
1244    );
1245}
1246
1247/// LabConversion.
1248impl CIImage {
1249    extern_methods!(
1250        #[unsafe(method(imageByConvertingWorkingSpaceToLab))]
1251        #[unsafe(method_family = none)]
1252        pub unsafe fn imageByConvertingWorkingSpaceToLab(&self) -> Retained<CIImage>;
1253
1254        #[unsafe(method(imageByConvertingLabToWorkingSpace))]
1255        #[unsafe(method_family = none)]
1256        pub unsafe fn imageByConvertingLabToWorkingSpace(&self) -> Retained<CIImage>;
1257    );
1258}