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