ohos_sys/native_buffer/
native_buffer_ffi.rs

1// automatically generated by rust-bindgen 0.71.1
2
3#![allow(non_upper_case_globals)]
4#![allow(non_camel_case_types)]
5#![allow(non_snake_case)]
6use ohos_sys_opaque_types::{OHNativeWindowBuffer, OH_NativeBuffer};
7
8impl OH_NativeBuffer_ColorSpace {
9    pub const OH_COLORSPACE_NONE: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(0);
10}
11impl OH_NativeBuffer_ColorSpace {
12    pub const OH_COLORSPACE_BT601_EBU_FULL: OH_NativeBuffer_ColorSpace =
13        OH_NativeBuffer_ColorSpace(1);
14}
15impl OH_NativeBuffer_ColorSpace {
16    pub const OH_COLORSPACE_BT601_SMPTE_C_FULL: OH_NativeBuffer_ColorSpace =
17        OH_NativeBuffer_ColorSpace(2);
18}
19impl OH_NativeBuffer_ColorSpace {
20    pub const OH_COLORSPACE_BT709_FULL: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(3);
21}
22impl OH_NativeBuffer_ColorSpace {
23    pub const OH_COLORSPACE_BT2020_HLG_FULL: OH_NativeBuffer_ColorSpace =
24        OH_NativeBuffer_ColorSpace(4);
25}
26impl OH_NativeBuffer_ColorSpace {
27    pub const OH_COLORSPACE_BT2020_PQ_FULL: OH_NativeBuffer_ColorSpace =
28        OH_NativeBuffer_ColorSpace(5);
29}
30impl OH_NativeBuffer_ColorSpace {
31    pub const OH_COLORSPACE_BT601_EBU_LIMIT: OH_NativeBuffer_ColorSpace =
32        OH_NativeBuffer_ColorSpace(6);
33}
34impl OH_NativeBuffer_ColorSpace {
35    pub const OH_COLORSPACE_BT601_SMPTE_C_LIMIT: OH_NativeBuffer_ColorSpace =
36        OH_NativeBuffer_ColorSpace(7);
37}
38impl OH_NativeBuffer_ColorSpace {
39    pub const OH_COLORSPACE_BT709_LIMIT: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(8);
40}
41impl OH_NativeBuffer_ColorSpace {
42    pub const OH_COLORSPACE_BT2020_HLG_LIMIT: OH_NativeBuffer_ColorSpace =
43        OH_NativeBuffer_ColorSpace(9);
44}
45impl OH_NativeBuffer_ColorSpace {
46    pub const OH_COLORSPACE_BT2020_PQ_LIMIT: OH_NativeBuffer_ColorSpace =
47        OH_NativeBuffer_ColorSpace(10);
48}
49impl OH_NativeBuffer_ColorSpace {
50    pub const OH_COLORSPACE_SRGB_FULL: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(11);
51}
52impl OH_NativeBuffer_ColorSpace {
53    pub const OH_COLORSPACE_P3_FULL: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(12);
54}
55impl OH_NativeBuffer_ColorSpace {
56    pub const OH_COLORSPACE_P3_HLG_FULL: OH_NativeBuffer_ColorSpace =
57        OH_NativeBuffer_ColorSpace(13);
58}
59impl OH_NativeBuffer_ColorSpace {
60    pub const OH_COLORSPACE_P3_PQ_FULL: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(14);
61}
62impl OH_NativeBuffer_ColorSpace {
63    pub const OH_COLORSPACE_ADOBERGB_FULL: OH_NativeBuffer_ColorSpace =
64        OH_NativeBuffer_ColorSpace(15);
65}
66impl OH_NativeBuffer_ColorSpace {
67    pub const OH_COLORSPACE_SRGB_LIMIT: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(16);
68}
69impl OH_NativeBuffer_ColorSpace {
70    pub const OH_COLORSPACE_P3_LIMIT: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(17);
71}
72impl OH_NativeBuffer_ColorSpace {
73    pub const OH_COLORSPACE_P3_HLG_LIMIT: OH_NativeBuffer_ColorSpace =
74        OH_NativeBuffer_ColorSpace(18);
75}
76impl OH_NativeBuffer_ColorSpace {
77    pub const OH_COLORSPACE_P3_PQ_LIMIT: OH_NativeBuffer_ColorSpace =
78        OH_NativeBuffer_ColorSpace(19);
79}
80impl OH_NativeBuffer_ColorSpace {
81    pub const OH_COLORSPACE_ADOBERGB_LIMIT: OH_NativeBuffer_ColorSpace =
82        OH_NativeBuffer_ColorSpace(20);
83}
84impl OH_NativeBuffer_ColorSpace {
85    pub const OH_COLORSPACE_LINEAR_SRGB: OH_NativeBuffer_ColorSpace =
86        OH_NativeBuffer_ColorSpace(21);
87}
88impl OH_NativeBuffer_ColorSpace {
89    pub const OH_COLORSPACE_LINEAR_BT709: OH_NativeBuffer_ColorSpace =
90        OH_NativeBuffer_ColorSpace(22);
91}
92impl OH_NativeBuffer_ColorSpace {
93    pub const OH_COLORSPACE_LINEAR_P3: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(23);
94}
95impl OH_NativeBuffer_ColorSpace {
96    pub const OH_COLORSPACE_LINEAR_BT2020: OH_NativeBuffer_ColorSpace =
97        OH_NativeBuffer_ColorSpace(24);
98}
99impl OH_NativeBuffer_ColorSpace {
100    pub const OH_COLORSPACE_DISPLAY_SRGB: OH_NativeBuffer_ColorSpace =
101        OH_NativeBuffer_ColorSpace(25);
102}
103impl OH_NativeBuffer_ColorSpace {
104    pub const OH_COLORSPACE_DISPLAY_P3_SRGB: OH_NativeBuffer_ColorSpace =
105        OH_NativeBuffer_ColorSpace(26);
106}
107impl OH_NativeBuffer_ColorSpace {
108    pub const OH_COLORSPACE_DISPLAY_P3_HLG: OH_NativeBuffer_ColorSpace =
109        OH_NativeBuffer_ColorSpace(27);
110}
111impl OH_NativeBuffer_ColorSpace {
112    pub const OH_COLORSPACE_DISPLAY_P3_PQ: OH_NativeBuffer_ColorSpace =
113        OH_NativeBuffer_ColorSpace(28);
114}
115impl OH_NativeBuffer_ColorSpace {
116    pub const OH_COLORSPACE_DISPLAY_BT2020_SRGB: OH_NativeBuffer_ColorSpace =
117        OH_NativeBuffer_ColorSpace(29);
118}
119impl OH_NativeBuffer_ColorSpace {
120    pub const OH_COLORSPACE_DISPLAY_BT2020_HLG: OH_NativeBuffer_ColorSpace =
121        OH_NativeBuffer_ColorSpace(30);
122}
123impl OH_NativeBuffer_ColorSpace {
124    pub const OH_COLORSPACE_DISPLAY_BT2020_PQ: OH_NativeBuffer_ColorSpace =
125        OH_NativeBuffer_ColorSpace(31);
126}
127#[repr(transparent)]
128#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
129pub struct OH_NativeBuffer_ColorSpace(pub ::core::ffi::c_uint);
130impl OH_NativeBuffer_MetadataType {
131    pub const OH_VIDEO_HDR_HLG: OH_NativeBuffer_MetadataType = OH_NativeBuffer_MetadataType(0);
132}
133impl OH_NativeBuffer_MetadataType {
134    pub const OH_VIDEO_HDR_HDR10: OH_NativeBuffer_MetadataType = OH_NativeBuffer_MetadataType(1);
135}
136impl OH_NativeBuffer_MetadataType {
137    pub const OH_VIDEO_HDR_VIVID: OH_NativeBuffer_MetadataType = OH_NativeBuffer_MetadataType(2);
138}
139impl OH_NativeBuffer_MetadataType {
140    pub const OH_VIDEO_NONE: OH_NativeBuffer_MetadataType = OH_NativeBuffer_MetadataType(-1);
141}
142#[repr(transparent)]
143#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
144pub struct OH_NativeBuffer_MetadataType(pub ::core::ffi::c_int);
145#[repr(C)]
146#[derive(Debug, Copy, Clone)]
147pub struct OH_NativeBuffer_ColorXY {
148    pub x: f32,
149    pub y: f32,
150}
151#[repr(C)]
152#[derive(Debug, Copy, Clone)]
153pub struct OH_NativeBuffer_Smpte2086 {
154    pub displayPrimaryRed: OH_NativeBuffer_ColorXY,
155    pub displayPrimaryGreen: OH_NativeBuffer_ColorXY,
156    pub displayPrimaryBlue: OH_NativeBuffer_ColorXY,
157    pub whitePoint: OH_NativeBuffer_ColorXY,
158    pub maxLuminance: f32,
159    pub minLuminance: f32,
160}
161#[repr(C)]
162#[derive(Debug, Copy, Clone)]
163pub struct OH_NativeBuffer_Cta861 {
164    pub maxContentLightLevel: f32,
165    pub maxFrameAverageLightLevel: f32,
166}
167#[repr(C)]
168#[derive(Debug, Copy, Clone)]
169pub struct OH_NativeBuffer_StaticMetadata {
170    pub smpte2086: OH_NativeBuffer_Smpte2086,
171    pub cta861: OH_NativeBuffer_Cta861,
172}
173impl OH_NativeBuffer_MetadataKey {
174    pub const OH_HDR_METADATA_TYPE: OH_NativeBuffer_MetadataKey = OH_NativeBuffer_MetadataKey(0);
175}
176impl OH_NativeBuffer_MetadataKey {
177    pub const OH_HDR_STATIC_METADATA: OH_NativeBuffer_MetadataKey = OH_NativeBuffer_MetadataKey(1);
178}
179impl OH_NativeBuffer_MetadataKey {
180    pub const OH_HDR_DYNAMIC_METADATA: OH_NativeBuffer_MetadataKey = OH_NativeBuffer_MetadataKey(2);
181}
182#[repr(transparent)]
183#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
184pub struct OH_NativeBuffer_MetadataKey(pub ::core::ffi::c_uint);
185impl OH_NativeBuffer_Usage {
186    pub const NATIVEBUFFER_USAGE_CPU_READ: OH_NativeBuffer_Usage = OH_NativeBuffer_Usage(1);
187}
188impl OH_NativeBuffer_Usage {
189    /// < CPU read buffer */
190    pub const NATIVEBUFFER_USAGE_CPU_WRITE: OH_NativeBuffer_Usage = OH_NativeBuffer_Usage(2);
191}
192impl OH_NativeBuffer_Usage {
193    /// < CPU write memory */
194    pub const NATIVEBUFFER_USAGE_MEM_DMA: OH_NativeBuffer_Usage = OH_NativeBuffer_Usage(8);
195}
196impl OH_NativeBuffer_Usage {
197    /// < Direct memory access (DMA) buffer */
198    pub const NATIVEBUFFER_USAGE_HW_RENDER: OH_NativeBuffer_Usage = OH_NativeBuffer_Usage(256);
199}
200impl OH_NativeBuffer_Usage {
201    /// < For GPU write case */
202    pub const NATIVEBUFFER_USAGE_HW_TEXTURE: OH_NativeBuffer_Usage = OH_NativeBuffer_Usage(512);
203}
204impl OH_NativeBuffer_Usage {
205    /// < For GPU read case */
206    pub const NATIVEBUFFER_USAGE_CPU_READ_OFTEN: OH_NativeBuffer_Usage =
207        OH_NativeBuffer_Usage(65536);
208}
209impl OH_NativeBuffer_Usage {
210    /// < Often be mapped for direct CPU reads */
211    pub const NATIVEBUFFER_USAGE_ALIGNMENT_512: OH_NativeBuffer_Usage =
212        OH_NativeBuffer_Usage(262144);
213}
214impl ::core::ops::BitOr<OH_NativeBuffer_Usage> for OH_NativeBuffer_Usage {
215    type Output = Self;
216    #[inline]
217    fn bitor(self, other: Self) -> Self {
218        OH_NativeBuffer_Usage(self.0 | other.0)
219    }
220}
221impl ::core::ops::BitOrAssign for OH_NativeBuffer_Usage {
222    #[inline]
223    fn bitor_assign(&mut self, rhs: OH_NativeBuffer_Usage) {
224        self.0 |= rhs.0;
225    }
226}
227impl ::core::ops::BitAnd<OH_NativeBuffer_Usage> for OH_NativeBuffer_Usage {
228    type Output = Self;
229    #[inline]
230    fn bitand(self, other: Self) -> Self {
231        OH_NativeBuffer_Usage(self.0 & other.0)
232    }
233}
234impl ::core::ops::BitAndAssign for OH_NativeBuffer_Usage {
235    #[inline]
236    fn bitand_assign(&mut self, rhs: OH_NativeBuffer_Usage) {
237        self.0 &= rhs.0;
238    }
239}
240#[repr(transparent)]
241/// Indicates the usage of a native buffer.
242///
243///
244/// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeBuffer
245///
246/// Available since API-level: 10
247///
248/// Version: 1.0
249#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
250pub struct OH_NativeBuffer_Usage(pub ::core::ffi::c_uint);
251impl OH_NativeBuffer_Format {
252    /// CLUT8 format
253    ///
254    /// Available since API-level: 12
255    #[cfg(feature = "api-12")]
256    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
257    pub const NATIVEBUFFER_PIXEL_FMT_CLUT8: OH_NativeBuffer_Format = OH_NativeBuffer_Format(0);
258}
259impl OH_NativeBuffer_Format {
260    /// CLUT1 format
261    ///
262    /// Available since API-level: 12
263    #[cfg(feature = "api-12")]
264    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
265    pub const NATIVEBUFFER_PIXEL_FMT_CLUT1: OH_NativeBuffer_Format = OH_NativeBuffer_Format(1);
266}
267impl OH_NativeBuffer_Format {
268    /// CLUT4 format
269    ///
270    /// Available since API-level: 12
271    #[cfg(feature = "api-12")]
272    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
273    pub const NATIVEBUFFER_PIXEL_FMT_CLUT4: OH_NativeBuffer_Format = OH_NativeBuffer_Format(2);
274}
275impl OH_NativeBuffer_Format {
276    /// CLUT4 format
277    ///
278    /// Available since API-level: 12
279    #[cfg(feature = "api-12")]
280    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
281    pub const NATIVEBUFFER_PIXEL_FMT_RGB_565: OH_NativeBuffer_Format = OH_NativeBuffer_Format(3);
282}
283impl OH_NativeBuffer_Format {
284    /// < RGB565 format */
285    pub const NATIVEBUFFER_PIXEL_FMT_RGBA_5658: OH_NativeBuffer_Format = OH_NativeBuffer_Format(4);
286}
287impl OH_NativeBuffer_Format {
288    /// < RGBA5658 format */
289    pub const NATIVEBUFFER_PIXEL_FMT_RGBX_4444: OH_NativeBuffer_Format = OH_NativeBuffer_Format(5);
290}
291impl OH_NativeBuffer_Format {
292    /// < RGBX4444 format */
293    pub const NATIVEBUFFER_PIXEL_FMT_RGBA_4444: OH_NativeBuffer_Format = OH_NativeBuffer_Format(6);
294}
295impl OH_NativeBuffer_Format {
296    /// < RGBA4444 format */
297    pub const NATIVEBUFFER_PIXEL_FMT_RGB_444: OH_NativeBuffer_Format = OH_NativeBuffer_Format(7);
298}
299impl OH_NativeBuffer_Format {
300    /// < RGB444 format */
301    pub const NATIVEBUFFER_PIXEL_FMT_RGBX_5551: OH_NativeBuffer_Format = OH_NativeBuffer_Format(8);
302}
303impl OH_NativeBuffer_Format {
304    /// < RGBX5551 format */
305    pub const NATIVEBUFFER_PIXEL_FMT_RGBA_5551: OH_NativeBuffer_Format = OH_NativeBuffer_Format(9);
306}
307impl OH_NativeBuffer_Format {
308    /// < RGBA5551 format */
309    pub const NATIVEBUFFER_PIXEL_FMT_RGB_555: OH_NativeBuffer_Format = OH_NativeBuffer_Format(10);
310}
311impl OH_NativeBuffer_Format {
312    /// < RGB555 format */
313    pub const NATIVEBUFFER_PIXEL_FMT_RGBX_8888: OH_NativeBuffer_Format = OH_NativeBuffer_Format(11);
314}
315impl OH_NativeBuffer_Format {
316    /// < RGBX8888 format */
317    pub const NATIVEBUFFER_PIXEL_FMT_RGBA_8888: OH_NativeBuffer_Format = OH_NativeBuffer_Format(12);
318}
319impl OH_NativeBuffer_Format {
320    /// < RGBA8888 format */
321    pub const NATIVEBUFFER_PIXEL_FMT_RGB_888: OH_NativeBuffer_Format = OH_NativeBuffer_Format(13);
322}
323impl OH_NativeBuffer_Format {
324    /// < RGB888 format */
325    pub const NATIVEBUFFER_PIXEL_FMT_BGR_565: OH_NativeBuffer_Format = OH_NativeBuffer_Format(14);
326}
327impl OH_NativeBuffer_Format {
328    /// < BGR565 format */
329    pub const NATIVEBUFFER_PIXEL_FMT_BGRX_4444: OH_NativeBuffer_Format = OH_NativeBuffer_Format(15);
330}
331impl OH_NativeBuffer_Format {
332    /// < BGRX4444 format */
333    pub const NATIVEBUFFER_PIXEL_FMT_BGRA_4444: OH_NativeBuffer_Format = OH_NativeBuffer_Format(16);
334}
335impl OH_NativeBuffer_Format {
336    /// < BGRA4444 format */
337    pub const NATIVEBUFFER_PIXEL_FMT_BGRX_5551: OH_NativeBuffer_Format = OH_NativeBuffer_Format(17);
338}
339impl OH_NativeBuffer_Format {
340    /// < BGRX5551 format */
341    pub const NATIVEBUFFER_PIXEL_FMT_BGRA_5551: OH_NativeBuffer_Format = OH_NativeBuffer_Format(18);
342}
343impl OH_NativeBuffer_Format {
344    /// < BGRA5551 format */
345    pub const NATIVEBUFFER_PIXEL_FMT_BGRX_8888: OH_NativeBuffer_Format = OH_NativeBuffer_Format(19);
346}
347impl OH_NativeBuffer_Format {
348    /// < BGRX8888 format */
349    pub const NATIVEBUFFER_PIXEL_FMT_BGRA_8888: OH_NativeBuffer_Format = OH_NativeBuffer_Format(20);
350}
351impl OH_NativeBuffer_Format {
352    /// < BGRA8888 format */
353    /// **
354    /// * YUV422 interleaved format
355    /// * @since 12
356    /// */
357    #[cfg(feature = "api-12")]
358    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
359    pub const NATIVEBUFFER_PIXEL_FMT_YUV_422_I: OH_NativeBuffer_Format = OH_NativeBuffer_Format(21);
360}
361impl OH_NativeBuffer_Format {
362    /// YCBCR422 semi-plannar format
363    ///
364    /// Available since API-level: 12
365    #[cfg(feature = "api-12")]
366    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
367    pub const NATIVEBUFFER_PIXEL_FMT_YCBCR_422_SP: OH_NativeBuffer_Format =
368        OH_NativeBuffer_Format(22);
369}
370impl OH_NativeBuffer_Format {
371    /// YCRCB422 semi-plannar format
372    ///
373    /// Available since API-level: 12
374    #[cfg(feature = "api-12")]
375    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
376    pub const NATIVEBUFFER_PIXEL_FMT_YCRCB_422_SP: OH_NativeBuffer_Format =
377        OH_NativeBuffer_Format(23);
378}
379impl OH_NativeBuffer_Format {
380    /// YCBCR420 semi-plannar format
381    ///
382    /// Available since API-level: 12
383    #[cfg(feature = "api-12")]
384    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
385    pub const NATIVEBUFFER_PIXEL_FMT_YCBCR_420_SP: OH_NativeBuffer_Format =
386        OH_NativeBuffer_Format(24);
387}
388impl OH_NativeBuffer_Format {
389    /// YCRCB420 semi-plannar format
390    ///
391    /// Available since API-level: 12
392    #[cfg(feature = "api-12")]
393    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
394    pub const NATIVEBUFFER_PIXEL_FMT_YCRCB_420_SP: OH_NativeBuffer_Format =
395        OH_NativeBuffer_Format(25);
396}
397impl OH_NativeBuffer_Format {
398    /// YCBCR422 plannar format
399    ///
400    /// Available since API-level: 12
401    #[cfg(feature = "api-12")]
402    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
403    pub const NATIVEBUFFER_PIXEL_FMT_YCBCR_422_P: OH_NativeBuffer_Format =
404        OH_NativeBuffer_Format(26);
405}
406impl OH_NativeBuffer_Format {
407    /// YCRCB422 plannar format
408    ///
409    /// Available since API-level: 12
410    #[cfg(feature = "api-12")]
411    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
412    pub const NATIVEBUFFER_PIXEL_FMT_YCRCB_422_P: OH_NativeBuffer_Format =
413        OH_NativeBuffer_Format(27);
414}
415impl OH_NativeBuffer_Format {
416    /// YCBCR420 plannar format
417    ///
418    /// Available since API-level: 12
419    #[cfg(feature = "api-12")]
420    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
421    pub const NATIVEBUFFER_PIXEL_FMT_YCBCR_420_P: OH_NativeBuffer_Format =
422        OH_NativeBuffer_Format(28);
423}
424impl OH_NativeBuffer_Format {
425    /// YCRCB420 plannar format
426    ///
427    /// Available since API-level: 12
428    #[cfg(feature = "api-12")]
429    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
430    pub const NATIVEBUFFER_PIXEL_FMT_YCRCB_420_P: OH_NativeBuffer_Format =
431        OH_NativeBuffer_Format(29);
432}
433impl OH_NativeBuffer_Format {
434    /// YUYV422 packed format
435    ///
436    /// Available since API-level: 12
437    #[cfg(feature = "api-12")]
438    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
439    pub const NATIVEBUFFER_PIXEL_FMT_YUYV_422_PKG: OH_NativeBuffer_Format =
440        OH_NativeBuffer_Format(30);
441}
442impl OH_NativeBuffer_Format {
443    /// UYVY422 packed format
444    ///
445    /// Available since API-level: 12
446    #[cfg(feature = "api-12")]
447    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
448    pub const NATIVEBUFFER_PIXEL_FMT_UYVY_422_PKG: OH_NativeBuffer_Format =
449        OH_NativeBuffer_Format(31);
450}
451impl OH_NativeBuffer_Format {
452    /// YVYU422 packed format
453    ///
454    /// Available since API-level: 12
455    #[cfg(feature = "api-12")]
456    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
457    pub const NATIVEBUFFER_PIXEL_FMT_YVYU_422_PKG: OH_NativeBuffer_Format =
458        OH_NativeBuffer_Format(32);
459}
460impl OH_NativeBuffer_Format {
461    /// VYUY422 packed format
462    ///
463    /// Available since API-level: 12
464    #[cfg(feature = "api-12")]
465    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
466    pub const NATIVEBUFFER_PIXEL_FMT_VYUY_422_PKG: OH_NativeBuffer_Format =
467        OH_NativeBuffer_Format(33);
468}
469impl OH_NativeBuffer_Format {
470    /// RGBA_1010102 packed format
471    ///
472    /// Available since API-level: 12
473    #[cfg(feature = "api-12")]
474    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
475    pub const NATIVEBUFFER_PIXEL_FMT_RGBA_1010102: OH_NativeBuffer_Format =
476        OH_NativeBuffer_Format(34);
477}
478impl OH_NativeBuffer_Format {
479    /// YCBCR420 semi-planar 10bit packed format
480    ///
481    /// Available since API-level: 12
482    #[cfg(feature = "api-12")]
483    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
484    pub const NATIVEBUFFER_PIXEL_FMT_YCBCR_P010: OH_NativeBuffer_Format =
485        OH_NativeBuffer_Format(35);
486}
487impl OH_NativeBuffer_Format {
488    /// YCRCB420 semi-planar 10bit packed format
489    ///
490    /// Available since API-level: 12
491    #[cfg(feature = "api-12")]
492    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
493    pub const NATIVEBUFFER_PIXEL_FMT_YCRCB_P010: OH_NativeBuffer_Format =
494        OH_NativeBuffer_Format(36);
495}
496impl OH_NativeBuffer_Format {
497    /// Raw 10bit packed format
498    ///
499    /// Available since API-level: 12
500    #[cfg(feature = "api-12")]
501    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
502    pub const NATIVEBUFFER_PIXEL_FMT_RAW10: OH_NativeBuffer_Format = OH_NativeBuffer_Format(37);
503}
504impl OH_NativeBuffer_Format {
505    /// vender mask format
506    ///
507    /// Available since API-level: 12
508    #[cfg(feature = "api-12")]
509    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
510    pub const NATIVEBUFFER_PIXEL_FMT_VENDER_MASK: OH_NativeBuffer_Format =
511        OH_NativeBuffer_Format(2147418112);
512}
513impl OH_NativeBuffer_Format {
514    /// vender mask format
515    ///
516    /// Available since API-level: 12
517    #[cfg(feature = "api-12")]
518    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
519    pub const NATIVEBUFFER_PIXEL_FMT_BUTT: OH_NativeBuffer_Format =
520        OH_NativeBuffer_Format(2147483647);
521}
522#[repr(transparent)]
523/// Indicates the format of a native buffer.
524///
525///
526/// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeBuffer
527///
528/// Available since API-level: 10
529///
530/// Version: 1.0
531#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
532pub struct OH_NativeBuffer_Format(pub ::core::ffi::c_uint);
533#[cfg(feature = "api-12")]
534#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
535impl OH_NativeBuffer_TransformType {
536    /// < No rotation
537    pub const NATIVEBUFFER_ROTATE_NONE: OH_NativeBuffer_TransformType =
538        OH_NativeBuffer_TransformType(0);
539}
540#[cfg(feature = "api-12")]
541#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
542impl OH_NativeBuffer_TransformType {
543    /// < Rotation by 90 degrees
544    pub const NATIVEBUFFER_ROTATE_90: OH_NativeBuffer_TransformType =
545        OH_NativeBuffer_TransformType(1);
546}
547#[cfg(feature = "api-12")]
548#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
549impl OH_NativeBuffer_TransformType {
550    /// < Rotation by 180 degrees
551    pub const NATIVEBUFFER_ROTATE_180: OH_NativeBuffer_TransformType =
552        OH_NativeBuffer_TransformType(2);
553}
554#[cfg(feature = "api-12")]
555#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
556impl OH_NativeBuffer_TransformType {
557    /// < Rotation by 270 degrees
558    pub const NATIVEBUFFER_ROTATE_270: OH_NativeBuffer_TransformType =
559        OH_NativeBuffer_TransformType(3);
560}
561#[cfg(feature = "api-12")]
562#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
563impl OH_NativeBuffer_TransformType {
564    /// < Flip horizontally
565    pub const NATIVEBUFFER_FLIP_H: OH_NativeBuffer_TransformType = OH_NativeBuffer_TransformType(4);
566}
567#[cfg(feature = "api-12")]
568#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
569impl OH_NativeBuffer_TransformType {
570    /// < Flip vertically
571    pub const NATIVEBUFFER_FLIP_V: OH_NativeBuffer_TransformType = OH_NativeBuffer_TransformType(5);
572}
573#[cfg(feature = "api-12")]
574#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
575impl OH_NativeBuffer_TransformType {
576    /// < Flip horizontally and rotate 90 degrees
577    pub const NATIVEBUFFER_FLIP_H_ROT90: OH_NativeBuffer_TransformType =
578        OH_NativeBuffer_TransformType(6);
579}
580#[cfg(feature = "api-12")]
581#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
582impl OH_NativeBuffer_TransformType {
583    /// < Flip vertically and rotate 90 degrees
584    pub const NATIVEBUFFER_FLIP_V_ROT90: OH_NativeBuffer_TransformType =
585        OH_NativeBuffer_TransformType(7);
586}
587#[cfg(feature = "api-12")]
588#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
589impl OH_NativeBuffer_TransformType {
590    /// < Flip horizontally and rotate 180 degrees
591    pub const NATIVEBUFFER_FLIP_H_ROT180: OH_NativeBuffer_TransformType =
592        OH_NativeBuffer_TransformType(8);
593}
594#[cfg(feature = "api-12")]
595#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
596impl OH_NativeBuffer_TransformType {
597    /// < Flip vertically and rotate 180 degrees
598    pub const NATIVEBUFFER_FLIP_V_ROT180: OH_NativeBuffer_TransformType =
599        OH_NativeBuffer_TransformType(9);
600}
601#[cfg(feature = "api-12")]
602#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
603impl OH_NativeBuffer_TransformType {
604    /// < Flip horizontally and rotate 270 degrees
605    pub const NATIVEBUFFER_FLIP_H_ROT270: OH_NativeBuffer_TransformType =
606        OH_NativeBuffer_TransformType(10);
607}
608#[cfg(feature = "api-12")]
609#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
610impl OH_NativeBuffer_TransformType {
611    /// < Flip vertically and rotate 270 degrees
612    pub const NATIVEBUFFER_FLIP_V_ROT270: OH_NativeBuffer_TransformType =
613        OH_NativeBuffer_TransformType(11);
614}
615#[repr(transparent)]
616/// Indicates the transform type of a native buffer.
617///
618///
619/// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeBuffer
620///
621/// Available since API-level: 12
622///
623/// Version: 1.0
624#[cfg(feature = "api-12")]
625#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
626#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
627pub struct OH_NativeBuffer_TransformType(pub ::core::ffi::c_uint);
628#[cfg(feature = "api-12")]
629#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
630impl OH_NativeBuffer_ColorGamut {
631    /// < Native or default
632    pub const NATIVEBUFFER_COLOR_GAMUT_NATIVE: OH_NativeBuffer_ColorGamut =
633        OH_NativeBuffer_ColorGamut(0);
634}
635#[cfg(feature = "api-12")]
636#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
637impl OH_NativeBuffer_ColorGamut {
638    /// < Standard BT601
639    pub const NATIVEBUFFER_COLOR_GAMUT_STANDARD_BT601: OH_NativeBuffer_ColorGamut =
640        OH_NativeBuffer_ColorGamut(1);
641}
642#[cfg(feature = "api-12")]
643#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
644impl OH_NativeBuffer_ColorGamut {
645    /// < Standard BT709
646    pub const NATIVEBUFFER_COLOR_GAMUT_STANDARD_BT709: OH_NativeBuffer_ColorGamut =
647        OH_NativeBuffer_ColorGamut(2);
648}
649#[cfg(feature = "api-12")]
650#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
651impl OH_NativeBuffer_ColorGamut {
652    /// < DCI P3
653    pub const NATIVEBUFFER_COLOR_GAMUT_DCI_P3: OH_NativeBuffer_ColorGamut =
654        OH_NativeBuffer_ColorGamut(3);
655}
656#[cfg(feature = "api-12")]
657#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
658impl OH_NativeBuffer_ColorGamut {
659    /// < SRGB
660    pub const NATIVEBUFFER_COLOR_GAMUT_SRGB: OH_NativeBuffer_ColorGamut =
661        OH_NativeBuffer_ColorGamut(4);
662}
663#[cfg(feature = "api-12")]
664#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
665impl OH_NativeBuffer_ColorGamut {
666    /// < Adobe RGB
667    pub const NATIVEBUFFER_COLOR_GAMUT_ADOBE_RGB: OH_NativeBuffer_ColorGamut =
668        OH_NativeBuffer_ColorGamut(5);
669}
670#[cfg(feature = "api-12")]
671#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
672impl OH_NativeBuffer_ColorGamut {
673    /// < Display P3
674    pub const NATIVEBUFFER_COLOR_GAMUT_DISPLAY_P3: OH_NativeBuffer_ColorGamut =
675        OH_NativeBuffer_ColorGamut(6);
676}
677#[cfg(feature = "api-12")]
678#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
679impl OH_NativeBuffer_ColorGamut {
680    /// < BT2020
681    pub const NATIVEBUFFER_COLOR_GAMUT_BT2020: OH_NativeBuffer_ColorGamut =
682        OH_NativeBuffer_ColorGamut(7);
683}
684#[cfg(feature = "api-12")]
685#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
686impl OH_NativeBuffer_ColorGamut {
687    /// < BT2100 PQ
688    pub const NATIVEBUFFER_COLOR_GAMUT_BT2100_PQ: OH_NativeBuffer_ColorGamut =
689        OH_NativeBuffer_ColorGamut(8);
690}
691#[cfg(feature = "api-12")]
692#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
693impl OH_NativeBuffer_ColorGamut {
694    /// < BT2100 HLG
695    pub const NATIVEBUFFER_COLOR_GAMUT_BT2100_HLG: OH_NativeBuffer_ColorGamut =
696        OH_NativeBuffer_ColorGamut(9);
697}
698#[cfg(feature = "api-12")]
699#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
700impl OH_NativeBuffer_ColorGamut {
701    /// < Display BT2020
702    pub const NATIVEBUFFER_COLOR_GAMUT_DISPLAY_BT2020: OH_NativeBuffer_ColorGamut =
703        OH_NativeBuffer_ColorGamut(10);
704}
705#[repr(transparent)]
706/// Indicates the color gamut of a native buffer.
707///
708///
709/// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeBuffer
710///
711/// Available since API-level: 12
712///
713/// Version: 1.0
714#[cfg(feature = "api-12")]
715#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
716#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
717pub struct OH_NativeBuffer_ColorGamut(pub ::core::ffi::c_uint);
718/// <b>OH_NativeBuffer</b> config.
719///
720/// Used to allocating new <b>OH_NativeBuffer</b> andquery parameters if existing ones.
721///
722///
723/// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeBuffer
724///
725/// Available since API-level: 9
726///
727/// Version: 1.0
728#[repr(C)]
729#[derive(Debug, Copy, Clone)]
730pub struct OH_NativeBuffer_Config {
731    /// < Width in pixels
732    pub width: i32,
733    /// < Height in pixels
734    pub height: i32,
735    /// < One of PixelFormat
736    pub format: i32,
737    /// < Combination of buffer usage
738    pub usage: i32,
739    /// < the stride of memory
740    pub stride: i32,
741}
742/// Holds info for a single image plane.
743///
744///
745///
746/// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeBuffer
747///
748/// Available since API-level: 12
749///
750/// Version: 1.0
751#[cfg(feature = "api-12")]
752#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
753#[repr(C)]
754#[derive(Debug, Copy, Clone)]
755pub struct OH_NativeBuffer_Plane {
756    /// < Offset in bytes of plane.
757    pub offset: u64,
758    /// < Distance in bytes from the first value of one row of the image to the first value of the next row.
759    pub rowStride: u32,
760    /// < Distance in bytes from the first value of one column of the image to the first value of the next column.
761    pub columnStride: u32,
762}
763/// Holds all image planes.
764///
765///
766///
767/// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeBuffer
768///
769/// Available since API-level: 12
770///
771/// Version: 1.0
772#[cfg(feature = "api-12")]
773#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
774#[repr(C)]
775#[derive(Debug, Copy, Clone)]
776pub struct OH_NativeBuffer_Planes {
777    /// < Number of distinct planes.
778    pub planeCount: u32,
779    /// < Array of image planes.
780    pub planes: [OH_NativeBuffer_Plane; 4usize],
781}
782extern "C" {
783    /// Alloc a <b>OH_NativeBuffer</b> that matches the passed BufferRequestConfig.
784    ///
785    /// A new <b>OH_NativeBuffer</b> instance is created each time this function is called.
786    ///
787    /// This interface needs to be used in conjunction with <b>OH_NativeBuffer_Unreference<otherwise memory leaks will occur.
788    ///
789    /// This interface is a non-thread-safe type interface.
790    ///
791    ///
792    ///
793    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeBuffer
794    /// # Arguments
795    ///
796    /// * `config` - Indicates the pointer to a <b>BufferRequestConfig</b> instance.
797    ///
798    /// # Returns
799    ///
800    /// * Returns the pointer to the <b>OH_NativeBuffer</b> instance created if the operation is successful,
801    ///
802    /// returns <b>NULL</b> otherwise.
803    ///
804    /// Available since API-level: 9
805    ///
806    /// Version: 1.0
807    pub fn OH_NativeBuffer_Alloc(config: *const OH_NativeBuffer_Config) -> *mut OH_NativeBuffer;
808    /// Adds the reference count of a OH_NativeBuffer.
809    ///
810    /// This interface needs to be used in conjunction with <b>OH_NativeBuffer_Unreference<otherwise memory leaks will occur.
811    ///
812    /// This interface is a non-thread-safe type interface.
813    ///
814    ///
815    ///
816    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeBuffer
817    /// # Arguments
818    ///
819    /// * `buffer` - Indicates the pointer to a <b>OH_NativeBuffer</b> instance.
820    ///
821    /// # Returns
822    ///
823    /// * Returns an error code, 0 is success, otherwise, failed.
824    ///
825    /// Available since API-level: 9
826    ///
827    /// Version: 1.0
828    pub fn OH_NativeBuffer_Reference(buffer: *mut OH_NativeBuffer) -> i32;
829    /// Decreases the reference count of a OH_NativeBuffer and, when the reference count reaches 0,
830    /// destroys this OH_NativeBuffer.
831    ///
832    /// This interface is a non-thread-safe type interface.
833    ///
834    ///
835    ///
836    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeBuffer
837    /// # Arguments
838    ///
839    /// * `buffer` - Indicates the pointer to a <b>OH_NativeBuffer</b> instance.
840    ///
841    /// # Returns
842    ///
843    /// * Returns an error code, 0 is success, otherwise, failed.
844    ///
845    /// Available since API-level: 9
846    ///
847    /// Version: 1.0
848    pub fn OH_NativeBuffer_Unreference(buffer: *mut OH_NativeBuffer) -> i32;
849    /// Return a config of the OH_NativeBuffer in the passed OHNativeBufferConfig struct.
850    ///
851    /// This interface is a non-thread-safe type interface.
852    ///
853    ///
854    ///
855    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeBuffer
856    /// # Arguments
857    ///
858    /// * `buffer` - Indicates the pointer to a <b>OH_NativeBuffer</b> instance.
859    ///
860    /// * `config` - Indicates the pointer to the <b>NativeBufferConfig</b> of the buffer.
861    ///
862    /// # Returns
863    ///
864    /// * <b>void</b>
865    ///
866    /// Available since API-level: 9
867    ///
868    /// Version: 1.0
869    pub fn OH_NativeBuffer_GetConfig(
870        buffer: *mut OH_NativeBuffer,
871        config: *mut OH_NativeBuffer_Config,
872    );
873    /// Provide direct cpu access to the OH_NativeBuffer in the process's address space.
874    ///
875    /// This interface needs to be used in conjunction with <b>OH_NativeBuffer_Unmap<This interface is a non-thread-safe type interface.
876    ///
877    ///
878    ///
879    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeBuffer
880    /// # Arguments
881    ///
882    /// * `buffer` - Indicates the pointer to a <b>OH_NativeBuffer</b> instance.
883    ///
884    /// * `virAddr` - Indicates the address of the <b>OH_NativeBuffer</b> in virtual memory.
885    ///
886    /// # Returns
887    ///
888    /// * Returns an error code, 0 is success, otherwise, failed.
889    ///
890    /// Available since API-level: 9
891    ///
892    /// Version: 1.0
893    pub fn OH_NativeBuffer_Map(
894        buffer: *mut OH_NativeBuffer,
895        virAddr: *mut *mut ::core::ffi::c_void,
896    ) -> i32;
897    /// Remove direct cpu access ability of the OH_NativeBuffer in the process's address space.
898    ///
899    /// This interface is a non-thread-safe type interface.
900    ///
901    ///
902    ///
903    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeBuffer
904    /// # Arguments
905    ///
906    /// * `buffer` - Indicates the pointer to a <b>OH_NativeBuffer</b> instance.
907    ///
908    /// # Returns
909    ///
910    /// * Returns an error code, 0 is success, otherwise, failed.
911    ///
912    /// Available since API-level: 9
913    ///
914    /// Version: 1.0
915    pub fn OH_NativeBuffer_Unmap(buffer: *mut OH_NativeBuffer) -> i32;
916    /// Get the systen wide unique sequence number of the OH_NativeBuffer.
917    ///
918    /// This interface is a non-thread-safe type interface.
919    ///
920    ///
921    ///
922    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeBuffer
923    /// # Arguments
924    ///
925    /// * `buffer` - Indicates the pointer to a <b>OH_NativeBuffer</b> instance.
926    ///
927    /// # Returns
928    ///
929    /// * Returns the sequence number, which is unique for each OH_NativeBuffer.
930    ///
931    /// Available since API-level: 9
932    ///
933    /// Version: 1.0
934    pub fn OH_NativeBuffer_GetSeqNum(buffer: *mut OH_NativeBuffer) -> u32;
935    /// Provide direct cpu access to the potentially multi-plannar OH_NativeBuffer in the process's address space.
936    ///
937    /// This interface is a non-thread-safe type interface.
938    ///
939    ///
940    ///
941    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeBuffer
942    /// # Arguments
943    ///
944    /// * `buffer` - Indicates the pointer to a <b>OH_NativeBuffer</b> instance.
945    ///
946    /// * `virAddr` - Indicates the address of the <b>OH_NativeBuffer</b> in virtual memory.
947    ///
948    /// * `outPlanes` - Indicates all image planes that contain the pixel data.
949    ///
950    /// # Returns
951    ///
952    /// * Returns an error code, 0 is sucess, otherwise, failed.
953    ///
954    /// Available since API-level: 12
955    ///
956    /// Version: 1.0
957    #[cfg(feature = "api-12")]
958    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
959    pub fn OH_NativeBuffer_MapPlanes(
960        buffer: *mut OH_NativeBuffer,
961        virAddr: *mut *mut ::core::ffi::c_void,
962        outPlanes: *mut OH_NativeBuffer_Planes,
963    ) -> i32;
964    /// Converts an <b>OHNativeWindowBuffer</b> instance to an <b>OH_NativeBuffer</b>.
965    ///
966    /// This interface is a non-thread-safe type interface.
967    ///
968    ///
969    ///
970    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeBuffer
971    /// # Arguments
972    ///
973    /// * `nativeWindowBuffer` - Indicates the pointer to a <b>OHNativeWindowBuffer</b> instance.
974    ///
975    /// * `buffer` - Indicates the pointer to a <b>OH_NativeBuffer</b> pointer.
976    ///
977    /// # Returns
978    ///
979    /// * Returns an error code, 0 is sucess, otherwise, failed.
980    ///
981    /// Available since API-level: 12
982    ///
983    /// Version: 1.0
984    #[cfg(feature = "api-12")]
985    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
986    pub fn OH_NativeBuffer_FromNativeWindowBuffer(
987        nativeWindowBuffer: *mut OHNativeWindowBuffer,
988        buffer: *mut *mut OH_NativeBuffer,
989    ) -> i32;
990    /// Set the color space of the OH_NativeBuffer.
991    ///
992    /// This interface is a non-thread-safe type interface.
993    ///
994    ///
995    ///
996    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeBuffer
997    /// # Arguments
998    ///
999    /// * `buffer` - Indicates the pointer to a <b>OH_NativeBuffer</b> instance.
1000    ///
1001    /// * `colorSpace` - Indicates the color space of native buffer, see <b>OH_NativeBuffer_ColorSpace</b>.
1002    ///
1003    /// # Returns
1004    ///
1005    /// * Returns an error code, 0 is success, otherwise, failed.
1006    ///
1007    /// Available since API-level: 11
1008    ///
1009    /// Version: 1.0
1010    #[cfg(feature = "api-11")]
1011    #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1012    pub fn OH_NativeBuffer_SetColorSpace(
1013        buffer: *mut OH_NativeBuffer,
1014        colorSpace: OH_NativeBuffer_ColorSpace,
1015    ) -> i32;
1016    /// Get the color space of the OH_NativeBuffer.
1017    ///
1018    /// This interface is a non-thread-safe type interface.
1019    ///
1020    ///
1021    ///
1022    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeBuffer
1023    /// # Arguments
1024    ///
1025    /// * `buffer` - Indicates the pointer to a <b>OH_NativeBuffer</b> instance.
1026    ///
1027    /// * `colorSpace` - Indicates the color space of native buffer, see <b>OH_NativeBuffer_ColorSpace</b>.
1028    ///
1029    /// # Returns
1030    ///
1031    /// * [`NATIVE_ERROR_OK`] 0 - Success.
1032    /// [`NATIVE_ERROR_INVALID_ARGUMENTS`] 40001000 - buffer is NULL.
1033    /// [`NATIVE_ERROR_BUFFER_STATE_INVALID`] 41207000 - Incorrect colorSpace state.
1034    ///
1035    /// Available since API-level: 12
1036    ///
1037    /// Version: 1.0
1038    #[cfg(feature = "api-12")]
1039    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1040    pub fn OH_NativeBuffer_GetColorSpace(
1041        buffer: *mut OH_NativeBuffer,
1042        colorSpace: *mut OH_NativeBuffer_ColorSpace,
1043    ) -> i32;
1044    /// Set the metadata type of the OH_NativeBuffer.
1045    ///
1046    /// This interface is a non-thread-safe type interface.
1047    ///
1048    ///
1049    ///
1050    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeBuffer
1051    /// # Arguments
1052    ///
1053    /// * `buffer` - Indicates the pointer to a <b>OH_NativeBuffer</b> instance.
1054    ///
1055    /// * `metadataKey` - Indicates the metadata type of native buffer, see <b>OH_NativeBuffer_MetadataKey</b>.
1056    ///
1057    /// * `size` - Indicates the size of a uint8_t vector.
1058    ///
1059    /// * `metadata` - Indicates the pointer to a uint8_t vector.
1060    ///
1061    /// # Returns
1062    ///
1063    /// * [`NATIVE_ERROR_OK`] 0 - Success.
1064    /// [`NATIVE_ERROR_INVALID_ARGUMENTS`] 40001000 - buffer or metadata is NULL.
1065    /// [`NATIVE_ERROR_BUFFER_STATE_INVALID`] 41207000 - Incorrect metadata state.
1066    /// [`NATIVE_ERROR_UNSUPPORTED`] 50102000 - Unsupported metadata key.
1067    ///
1068    /// Available since API-level: 12
1069    ///
1070    /// Version: 1.0
1071    #[cfg(feature = "api-12")]
1072    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1073    pub fn OH_NativeBuffer_SetMetadataValue(
1074        buffer: *mut OH_NativeBuffer,
1075        metadataKey: OH_NativeBuffer_MetadataKey,
1076        size: i32,
1077        metadata: *mut u8,
1078    ) -> i32;
1079    /// Set the metadata type of the OH_NativeBuffer.
1080    ///
1081    /// This interface is a non-thread-safe type interface.
1082    ///
1083    ///
1084    ///
1085    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeBuffer
1086    /// # Arguments
1087    ///
1088    /// * `buffer` - Indicates the pointer to a <b>OH_NativeBuffer</b> instance.
1089    ///
1090    /// * `metadataKey` - Indicates the metadata type of native buffer, see <b>OH_NativeBuffer_MetadataKey</b>.
1091    ///
1092    /// * `size` - Indicates the size of a uint8_t vector.
1093    ///
1094    /// * `metadata` - Indicates the pointer to a uint8_t vector.
1095    ///
1096    /// # Returns
1097    ///
1098    /// * [`NATIVE_ERROR_OK`] 0 - Success.
1099    /// [`NATIVE_ERROR_INVALID_ARGUMENTS`] 40001000 - buffer, metadata, or size is NULL.
1100    /// [`NATIVE_ERROR_BUFFER_STATE_INVALID`] 41207000 - Incorrect metadata state.
1101    /// [`NATIVE_ERROR_UNSUPPORTED`] 50102000 - Unsupported metadata key.
1102    ///
1103    /// Available since API-level: 12
1104    ///
1105    /// Version: 1.0
1106    #[cfg(feature = "api-12")]
1107    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1108    pub fn OH_NativeBuffer_GetMetadataValue(
1109        buffer: *mut OH_NativeBuffer,
1110        metadataKey: OH_NativeBuffer_MetadataKey,
1111        size: *mut i32,
1112        metadata: *mut *mut u8,
1113    ) -> i32;
1114}