1use 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
22pub type CIFormat = c_int;
25
26extern "C" {
27 pub static kCIFormatARGB8: CIFormat;
29}
30
31extern "C" {
32 pub static kCIFormatBGRA8: CIFormat;
34}
35
36extern "C" {
37 pub static kCIFormatRGBA8: CIFormat;
39}
40
41extern "C" {
42 pub static kCIFormatRGBX8: CIFormat;
44}
45
46extern "C" {
47 pub static kCIFormatABGR8: CIFormat;
49}
50
51extern "C" {
52 pub static kCIFormatRGBAh: CIFormat;
54}
55
56extern "C" {
57 pub static kCIFormatRGBA16: CIFormat;
59}
60
61extern "C" {
62 pub static kCIFormatRGBAf: CIFormat;
64}
65
66extern "C" {
67 pub static kCIFormatRGBX16: CIFormat;
69}
70
71extern "C" {
72 pub static kCIFormatRGBXh: CIFormat;
74}
75
76extern "C" {
77 pub static kCIFormatRGBXf: CIFormat;
79}
80
81extern "C" {
82 pub static kCIFormatRGB10: CIFormat;
84}
85
86extern "C" {
87 pub static kCIFormatA8: CIFormat;
89}
90
91extern "C" {
92 pub static kCIFormatA16: CIFormat;
94}
95
96extern "C" {
97 pub static kCIFormatAh: CIFormat;
99}
100
101extern "C" {
102 pub static kCIFormatAf: CIFormat;
104}
105
106extern "C" {
107 pub static kCIFormatR8: CIFormat;
109}
110
111extern "C" {
112 pub static kCIFormatR16: CIFormat;
114}
115
116extern "C" {
117 pub static kCIFormatRh: CIFormat;
119}
120
121extern "C" {
122 pub static kCIFormatRf: CIFormat;
124}
125
126extern "C" {
127 pub static kCIFormatRG8: CIFormat;
129}
130
131extern "C" {
132 pub static kCIFormatRG16: CIFormat;
134}
135
136extern "C" {
137 pub static kCIFormatRGh: CIFormat;
139}
140
141extern "C" {
142 pub static kCIFormatRGf: CIFormat;
144}
145
146extern "C" {
147 pub static kCIFormatL8: CIFormat;
149}
150
151extern "C" {
152 pub static kCIFormatL16: CIFormat;
154}
155
156extern "C" {
157 pub static kCIFormatLh: CIFormat;
159}
160
161extern "C" {
162 pub static kCIFormatLf: CIFormat;
164}
165
166extern "C" {
167 pub static kCIFormatLA8: CIFormat;
169}
170
171extern "C" {
172 pub static kCIFormatLA16: CIFormat;
174}
175
176extern "C" {
177 pub static kCIFormatLAh: CIFormat;
179}
180
181extern "C" {
182 pub static kCIFormatLAf: CIFormat;
184}
185
186pub type CIImageOption = NSString;
189
190extern "C" {
191 pub static kCIImageColorSpace: &'static CIImageOption;
193}
194
195extern "C" {
196 pub static kCIImageApplyCleanAperture: &'static CIImageOption;
210}
211
212extern "C" {
213 pub static kCIImageToneMapHDRtoSDR: &'static CIImageOption;
215}
216
217extern "C" {
218 pub static kCIImageExpandToHDR: &'static CIImageOption;
220}
221
222extern "C" {
223 pub static kCIImageContentHeadroom: &'static CIImageOption;
230}
231
232extern "C" {
233 pub static kCIImageContentAverageLightLevel: &'static CIImageOption;
240}
241
242extern "C" {
243 pub static kCIImageNearestSampling: &'static CIImageOption;
245}
246
247extern "C" {
248 pub static kCIImageCacheImmediately: &'static CIImageOption;
250}
251
252extern "C" {
253 pub static kCIImageProperties: &'static CIImageOption;
255}
256
257extern "C" {
258 pub static kCIImageApplyOrientationProperty: &'static CIImageOption;
260}
261
262extern "C" {
263 #[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 #[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 pub static kCIImageAuxiliaryDepth: &'static CIImageOption;
277}
278
279extern "C" {
280 pub static kCIImageAuxiliaryDisparity: &'static CIImageOption;
282}
283
284extern "C" {
285 pub static kCIImageAuxiliaryPortraitEffectsMatte: &'static CIImageOption;
287}
288
289extern "C" {
290 pub static kCIImageAuxiliarySemanticSegmentationSkinMatte: &'static CIImageOption;
292}
293
294extern "C" {
295 pub static kCIImageAuxiliarySemanticSegmentationHairMatte: &'static CIImageOption;
297}
298
299extern "C" {
300 pub static kCIImageAuxiliarySemanticSegmentationTeethMatte: &'static CIImageOption;
302}
303
304extern "C" {
305 pub static kCIImageAuxiliarySemanticSegmentationGlassesMatte: &'static CIImageOption;
307}
308
309extern "C" {
310 pub static kCIImageAuxiliarySemanticSegmentationSkyMatte: &'static CIImageOption;
312}
313
314extern "C" {
315 pub static kCIImageAuxiliaryHDRGainMap: &'static CIImageOption;
317}
318
319extern_class!(
320 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[unsafe(method(imageByApplyingGaussianBlurWithSigma:))]
898 #[unsafe(method_family = none)]
899 pub unsafe fn imageByApplyingGaussianBlurWithSigma(
900 &self,
901 sigma: c_double,
902 ) -> Retained<CIImage>;
903
904 #[unsafe(method(imageBySettingProperties:))]
919 #[unsafe(method_family = none)]
920 pub unsafe fn imageBySettingProperties(
921 &self,
922 properties: &NSDictionary,
923 ) -> Retained<CIImage>;
924
925 #[unsafe(method(imageBySamplingLinear))]
929 #[unsafe(method_family = none)]
930 pub unsafe fn imageBySamplingLinear(&self) -> Retained<CIImage>;
931
932 #[unsafe(method(imageBySamplingNearest))]
936 #[unsafe(method_family = none)]
937 pub unsafe fn imageBySamplingNearest(&self) -> Retained<CIImage>;
938
939 #[unsafe(method(imageByInsertingIntermediate))]
945 #[unsafe(method_family = none)]
946 pub unsafe fn imageByInsertingIntermediate(&self) -> Retained<CIImage>;
947
948 #[unsafe(method(imageByInsertingIntermediate:))]
959 #[unsafe(method_family = none)]
960 pub unsafe fn imageByInsertingIntermediate_(&self, cache: bool) -> Retained<CIImage>;
961
962 #[unsafe(method(imageByInsertingTiledIntermediate))]
968 #[unsafe(method_family = none)]
969 pub unsafe fn imageByInsertingTiledIntermediate(&self) -> Retained<CIImage>;
970
971 #[unsafe(method(imageByApplyingGainMap:))]
983 #[unsafe(method_family = none)]
984 pub unsafe fn imageByApplyingGainMap(&self, gainmap: &CIImage) -> Retained<CIImage>;
985
986 #[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 #[unsafe(method(imageBySettingContentHeadroom:))]
1014 #[unsafe(method_family = none)]
1015 pub unsafe fn imageBySettingContentHeadroom(&self, headroom: c_float) -> Retained<CIImage>;
1016
1017 #[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 #[unsafe(method(extent))]
1035 #[unsafe(method_family = none)]
1036 pub unsafe fn extent(&self) -> CGRect;
1037
1038 #[unsafe(method(isOpaque))]
1046 #[unsafe(method_family = none)]
1047 pub unsafe fn isOpaque(&self) -> bool;
1048
1049 #[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 #[unsafe(method(contentHeadroom))]
1107 #[unsafe(method_family = none)]
1108 pub unsafe fn contentHeadroom(&self) -> c_float;
1109
1110 #[unsafe(method(contentAverageLightLevel))]
1133 #[unsafe(method_family = none)]
1134 pub unsafe fn contentAverageLightLevel(&self) -> c_float;
1135
1136 #[cfg(feature = "objc2-core-video")]
1137 #[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 #[unsafe(method(CGImage))]
1153 #[unsafe(method_family = none)]
1154 pub unsafe fn CGImage(&self) -> Option<Retained<CGImage>>;
1155
1156 #[cfg(feature = "objc2-metal")]
1157 #[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
1184impl 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
1197pub type CIImageAutoAdjustmentOption = NSString;
1200
1201extern "C" {
1202 pub static kCIImageAutoAdjustEnhance: &'static CIImageAutoAdjustmentOption;
1204}
1205
1206extern "C" {
1207 pub static kCIImageAutoAdjustRedEye: &'static CIImageAutoAdjustmentOption;
1209}
1210
1211extern "C" {
1212 pub static kCIImageAutoAdjustFeatures: &'static CIImageAutoAdjustmentOption;
1214}
1215
1216extern "C" {
1217 pub static kCIImageAutoAdjustCrop: &'static CIImageAutoAdjustmentOption;
1219}
1220
1221extern "C" {
1222 pub static kCIImageAutoAdjustLevel: &'static CIImageAutoAdjustmentOption;
1224}
1225
1226impl 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 #[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
1247impl 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}