objc2_av_foundation/generated/AVSemanticSegmentationMatte.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5#[cfg(feature = "objc2-core-foundation")]
6use objc2_core_foundation::*;
7#[cfg(feature = "objc2-core-video")]
8use objc2_core_video::*;
9use objc2_foundation::*;
10
11use crate::*;
12
13/// AVSemanticSegmentationMatteType string constants
14///
15///
16/// AVSemanticSegmentationMatteType string constants describe specific types of semantic segmentation matting images that may be captured and stored along with a primary image and may be used to improve the rendering of various effects on that image.
17///
18/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avsemanticsegmentationmattetype?language=objc)
19// NS_TYPED_ENUM
20pub type AVSemanticSegmentationMatteType = NSString;
21
22extern "C" {
23 /// A matting image segmenting all skin from all persons in the visible field-of-view of an image.
24 ///
25 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avsemanticsegmentationmattetypeskin?language=objc)
26 pub static AVSemanticSegmentationMatteTypeSkin: &'static AVSemanticSegmentationMatteType;
27}
28
29extern "C" {
30 /// A matting image segmenting all hair from all persons in the visible field-of-view of an image.
31 ///
32 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avsemanticsegmentationmattetypehair?language=objc)
33 pub static AVSemanticSegmentationMatteTypeHair: &'static AVSemanticSegmentationMatteType;
34}
35
36extern "C" {
37 /// A matting image segmenting all teeth from all persons in the visible field-of-view of an image.
38 ///
39 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avsemanticsegmentationmattetypeteeth?language=objc)
40 pub static AVSemanticSegmentationMatteTypeTeeth: &'static AVSemanticSegmentationMatteType;
41}
42
43extern "C" {
44 /// A matting image segmenting all glasses ( e.g. eyeglasses, sunglasses ) from all persons wearing glasses in the visible field-of-view of an image.
45 ///
46 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avsemanticsegmentationmattetypeglasses?language=objc)
47 pub static AVSemanticSegmentationMatteTypeGlasses: &'static AVSemanticSegmentationMatteType;
48}
49
50extern_class!(
51 /// An object wrapping a matting image for a particular semantic segmentation.
52 ///
53 ///
54 /// The pixel data in the matting image is represented in CVPixelBuffers as kCVPixelFormatType_OneComponent8 ('L008'). It is stored in image files as an auxiliary image, accessible using CGImageSourceCopyAuxiliaryDataInfoAtIndex using data types defined in
55 /// <ImageIO
56 /// /CGImageProperties.h>.
57 ///
58 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avsemanticsegmentationmatte?language=objc)
59 #[unsafe(super(NSObject))]
60 #[derive(Debug, PartialEq, Eq, Hash)]
61 pub struct AVSemanticSegmentationMatte;
62);
63
64extern_conformance!(
65 unsafe impl NSObjectProtocol for AVSemanticSegmentationMatte {}
66);
67
68impl AVSemanticSegmentationMatte {
69 extern_methods!(
70 #[unsafe(method(init))]
71 #[unsafe(method_family = init)]
72 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
73
74 #[unsafe(method(new))]
75 #[unsafe(method_family = new)]
76 pub unsafe fn new() -> Retained<Self>;
77
78 #[cfg(feature = "objc2-core-foundation")]
79 /// Returns an AVSemanticSegmentationMatte instance from auxiliary image information in an image file.
80 ///
81 ///
82 /// Parameter `imageSourceAuxiliaryDataType`: The kCGImageAuxiliaryDataType constant corresponding to the semantic segmentation matte being created (see
83 /// <ImageIO
84 /// /CGImageProperties.h>.
85 ///
86 /// Parameter `imageSourceAuxiliaryDataInfoDictionary`: A dictionary of primitive semantic segmentation matte related information obtained from CGImageSourceCopyAuxiliaryDataInfoAtIndex.
87 ///
88 /// Parameter `outError`: On return, if the semantic segmentation matte cannot be created, points to an NSError describing the problem.
89 ///
90 /// Returns: An AVSemanticSegmentationMatte instance, or nil if the auxiliary data info dictionary was malformed.
91 ///
92 ///
93 /// When using ImageIO framework's CGImageSource API to read from a HEIF or JPEG file containing a semantic segmentation matte, AVSemanticSegmentationMatte can be instantiated using the result of CGImageSourceCopyAuxiliaryDataInfoAtIndex, which returns a CFDictionary of primitive segmentation matte information.
94 #[unsafe(method(semanticSegmentationMatteFromImageSourceAuxiliaryDataType:dictionaryRepresentation:error:_))]
95 #[unsafe(method_family = none)]
96 pub unsafe fn semanticSegmentationMatteFromImageSourceAuxiliaryDataType_dictionaryRepresentation_error(
97 image_source_auxiliary_data_type: &CFString,
98 image_source_auxiliary_data_info_dictionary: &NSDictionary,
99 ) -> Result<Retained<Self>, Retained<NSError>>;
100
101 /// Specifies the receiver's semantic segmentation matting image type.
102 ///
103 ///
104 /// An AVSemanticSegmentationMatte's matteType is immutable for the life of the object.
105 #[unsafe(method(matteType))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn matteType(&self) -> Retained<AVSemanticSegmentationMatteType>;
108
109 #[cfg(feature = "objc2-core-video")]
110 /// Returns an AVSemanticSegmentationMatte instance wrapping the replacement pixel buffer.
111 ///
112 ///
113 /// Parameter `pixelBuffer`: A pixel buffer containing a semantic segmentation matting image, represented as kCVPixelFormatType_OneComponent8 with a kCVImageBufferTransferFunction_Linear transfer function.
114 ///
115 /// Parameter `outError`: On return, if the AVSemanticSegmentationMatte cannot be created, points to an NSError describing the problem.
116 ///
117 /// Returns: An AVSemanticSegmentationMatte instance, or nil if the pixel buffer is malformed.
118 ///
119 ///
120 /// When applying complex edits to media containing a semantic segmentation matte, you may create a derivative matte with arbitrary transforms applied to it, then use this initializer to create a new AVSemanticSegmentationMatte.
121 #[unsafe(method(semanticSegmentationMatteByReplacingSemanticSegmentationMatteWithPixelBuffer:error:_))]
122 #[unsafe(method_family = none)]
123 pub unsafe fn semanticSegmentationMatteByReplacingSemanticSegmentationMatteWithPixelBuffer_error(
124 &self,
125 pixel_buffer: &CVPixelBuffer,
126 ) -> Result<Retained<Self>, Retained<NSError>>;
127
128 /// Returns a dictionary of primitive map information to be used when writing an image file with a semantic segmentation matte.
129 ///
130 ///
131 /// Parameter `outAuxDataType`: On output, the auxiliary data type to be used when calling CGImageDestinationAddAuxiliaryDataInfo. Currently supported auxiliary data types are enumerated in
132 /// <ImageIO
133 /// /CGImageProperties.h>
134 ///
135 /// Returns: A dictionary of CGImageDestination compatible semantic segmentation matte information, or nil if the auxDataType is unsupported.
136 ///
137 ///
138 /// When using ImageIO framework's CGImageDestination API to write semantic segmentation matte information to a HEIF or JPEG file, you may use this method to generate a dictionary of primitive map information consumed by CGImageDestinationAddAuxiliaryDataInfo.
139 #[unsafe(method(dictionaryRepresentationForAuxiliaryDataType:))]
140 #[unsafe(method_family = none)]
141 pub unsafe fn dictionaryRepresentationForAuxiliaryDataType(
142 &self,
143 out_aux_data_type: Option<&mut Option<Retained<NSString>>>,
144 ) -> Option<Retained<NSDictionary>>;
145
146 /// Specifies the pixel format type of this object's internal matting image.
147 ///
148 ///
149 /// Currently the only supported CV pixel format type for the matting image is kCVPixelFormatType_OneComponent8.
150 #[unsafe(method(pixelFormatType))]
151 #[unsafe(method_family = none)]
152 pub unsafe fn pixelFormatType(&self) -> OSType;
153
154 #[cfg(feature = "objc2-core-video")]
155 /// Provides access to the semantic segmentation matte's internal image.
156 ///
157 ///
158 /// The pixel format can be queried using the pixelFormatType property.
159 #[unsafe(method(mattingImage))]
160 #[unsafe(method_family = none)]
161 pub unsafe fn mattingImage(&self) -> Retained<CVPixelBuffer>;
162 );
163}