3232using Foundation ;
3333using CoreGraphics ;
3434
35- #if ! NET
36- using NativeHandle = System . IntPtr ;
37- #endif
38-
3935#nullable enable
4036
4137namespace CoreVideo {
4238
4339 // CVImageBuffer.h
44- #if NET
4540 [ SupportedOSPlatform ( "ios" ) ]
4641 [ SupportedOSPlatform ( "maccatalyst" ) ]
4742 [ SupportedOSPlatform ( "macos" ) ]
4843 [ SupportedOSPlatform ( "tvos" ) ]
49- #endif
5044 public partial class CVImageBuffer : CVBuffer {
5145#if ! COREBUILD
5246 [ Preserve ( Conditional = true ) ]
@@ -96,16 +90,11 @@ public bool IsFlipped {
9690 [ DllImport ( Constants . CoreVideoLibrary ) ]
9791 extern static /* CGColorSpaceRef */ IntPtr CVImageBufferGetColorSpace ( /* CVImageBufferRef */ IntPtr imageBuffer ) ;
9892
99- #if NET
10093 [ UnsupportedOSPlatform ( "maccatalyst" ) ]
10194 [ UnsupportedOSPlatform ( "tvos" ) ]
10295 [ UnsupportedOSPlatform ( "ios" ) ]
10396 [ SupportedOSPlatform ( "macos" ) ]
10497 [ ObsoletedOSPlatform ( "macos10.4" ) ]
105- #else
106- [ Deprecated ( PlatformName . MacOSX , 10 , 4 ) ]
107- [ Unavailable ( PlatformName . iOS ) ]
108- #endif
10998 public CGColorSpace ? ColorSpace {
11099 get {
111100 var h = CVImageBufferGetColorSpace ( Handle ) ;
@@ -127,123 +116,99 @@ public CGColorSpace? ColorSpace {
127116 }
128117#endif
129118
130- #if NET
131119 [ SupportedOSPlatform ( "ios" ) ]
132120 [ SupportedOSPlatform ( "macos" ) ]
133121 [ SupportedOSPlatform ( "tvos" ) ]
134122 [ SupportedOSPlatform ( "maccatalyst" ) ]
135- #endif
136123 [ DllImport ( Constants . CoreVideoLibrary ) ]
137124 extern static int CVYCbCrMatrixGetIntegerCodePointForString ( IntPtr yCbCrMatrixString ) ;
138125
139- #if NET
140126 [ SupportedOSPlatform ( "ios" ) ]
141127 [ SupportedOSPlatform ( "macos" ) ]
142128 [ SupportedOSPlatform ( "tvos" ) ]
143129 [ SupportedOSPlatform ( "maccatalyst" ) ]
144- #endif
145130 public static int GetCodePoint ( CVImageBufferYCbCrMatrix yCbCrMatrix )
146131 {
147132 return CVYCbCrMatrixGetIntegerCodePointForString ( yCbCrMatrix . GetConstant ( ) ! . Handle ) ;
148133 }
149134
150- #if NET
151135 [ SupportedOSPlatform ( "ios" ) ]
152136 [ SupportedOSPlatform ( "macos" ) ]
153137 [ SupportedOSPlatform ( "tvos" ) ]
154138 [ SupportedOSPlatform ( "maccatalyst" ) ]
155- #endif
156139 [ DllImport ( Constants . CoreVideoLibrary ) ]
157140 extern static int CVColorPrimariesGetIntegerCodePointForString ( IntPtr colorPrimariesString ) ;
158141
159- #if NET
160142 [ SupportedOSPlatform ( "ios" ) ]
161143 [ SupportedOSPlatform ( "macos" ) ]
162144 [ SupportedOSPlatform ( "tvos" ) ]
163145 [ SupportedOSPlatform ( "maccatalyst" ) ]
164- #endif
165146 public static int GetCodePoint ( CVImageBufferColorPrimaries color )
166147 {
167148 return CVColorPrimariesGetIntegerCodePointForString ( color . GetConstant ( ) ! . Handle ) ;
168149 }
169150
170- #if NET
171151 [ SupportedOSPlatform ( "ios" ) ]
172152 [ SupportedOSPlatform ( "macos" ) ]
173153 [ SupportedOSPlatform ( "tvos" ) ]
174154 [ SupportedOSPlatform ( "maccatalyst" ) ]
175- #endif
176155 [ DllImport ( Constants . CoreVideoLibrary ) ]
177156 extern static int CVTransferFunctionGetIntegerCodePointForString ( IntPtr colorPrimariesString ) ;
178157
179- #if NET
180158 [ SupportedOSPlatform ( "ios" ) ]
181159 [ SupportedOSPlatform ( "macos" ) ]
182160 [ SupportedOSPlatform ( "tvos" ) ]
183161 [ SupportedOSPlatform ( "maccatalyst" ) ]
184- #endif
185162 public static int GetCodePoint ( CVImageBufferTransferFunction function )
186163 {
187164 return CVTransferFunctionGetIntegerCodePointForString ( function . GetConstant ( ) ! . Handle ) ;
188165 }
189166
190- #if NET
191167 [ SupportedOSPlatform ( "ios" ) ]
192168 [ SupportedOSPlatform ( "macos" ) ]
193169 [ SupportedOSPlatform ( "tvos" ) ]
194170 [ SupportedOSPlatform ( "maccatalyst" ) ]
195- #endif
196171 [ DllImport ( Constants . CoreVideoLibrary ) ]
197172 extern static IntPtr CVYCbCrMatrixGetStringForIntegerCodePoint ( int yCbCrMatrixCodePoint ) ;
198173
199- #if NET
200174 [ SupportedOSPlatform ( "ios" ) ]
201175 [ SupportedOSPlatform ( "macos" ) ]
202176 [ SupportedOSPlatform ( "tvos" ) ]
203177 [ SupportedOSPlatform ( "maccatalyst" ) ]
204- #endif
205178 public static CVImageBufferYCbCrMatrix GetYCbCrMatrixOption ( int yCbCrMatrixCodePoint )
206179 {
207180 var ret = Runtime . GetNSObject < NSString > ( CVYCbCrMatrixGetStringForIntegerCodePoint ( yCbCrMatrixCodePoint ) ) ;
208181 return CVImageBufferYCbCrMatrixExtensions . GetValue ( ret ) ;
209182 }
210183
211- #if NET
212184 [ SupportedOSPlatform ( "ios" ) ]
213185 [ SupportedOSPlatform ( "macos" ) ]
214186 [ SupportedOSPlatform ( "tvos" ) ]
215187 [ SupportedOSPlatform ( "maccatalyst" ) ]
216- #endif
217188 [ DllImport ( Constants . CoreVideoLibrary ) ]
218189 extern static IntPtr CVColorPrimariesGetStringForIntegerCodePoint ( int colorPrimariesCodePoint ) ;
219190
220- #if NET
221191 [ SupportedOSPlatform ( "ios" ) ]
222192 [ SupportedOSPlatform ( "macos" ) ]
223193 [ SupportedOSPlatform ( "tvos" ) ]
224194 [ SupportedOSPlatform ( "maccatalyst" ) ]
225- #endif
226195 public static CVImageBufferColorPrimaries GetColorPrimariesOption ( int colorPrimariesCodePoint )
227196 {
228197 var ret = Runtime . GetNSObject < NSString > ( CVColorPrimariesGetStringForIntegerCodePoint ( colorPrimariesCodePoint ) ) ;
229198 return CVImageBufferColorPrimariesExtensions . GetValue ( ret ) ;
230199 }
231200
232- #if NET
233201 [ SupportedOSPlatform ( "ios" ) ]
234202 [ SupportedOSPlatform ( "macos" ) ]
235203 [ SupportedOSPlatform ( "tvos" ) ]
236204 [ SupportedOSPlatform ( "maccatalyst" ) ]
237- #endif
238205 [ DllImport ( Constants . CoreVideoLibrary ) ]
239206 extern static IntPtr CVTransferFunctionGetStringForIntegerCodePoint ( int transferFunctionCodePoint ) ;
240207
241- #if NET
242208 [ SupportedOSPlatform ( "ios" ) ]
243209 [ SupportedOSPlatform ( "macos" ) ]
244210 [ SupportedOSPlatform ( "tvos" ) ]
245211 [ SupportedOSPlatform ( "maccatalyst" ) ]
246- #endif
247212 public static CVImageBufferTransferFunction GetTransferFunctionOption ( int transferFunctionCodePoint )
248213 {
249214 var ret = Runtime . GetNSObject < NSString > ( CVTransferFunctionGetStringForIntegerCodePoint ( transferFunctionCodePoint ) ) ;
0 commit comments