1#![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 pub const NATIVEBUFFER_USAGE_CPU_WRITE: OH_NativeBuffer_Usage = OH_NativeBuffer_Usage(2);
191}
192impl OH_NativeBuffer_Usage {
193 pub const NATIVEBUFFER_USAGE_MEM_DMA: OH_NativeBuffer_Usage = OH_NativeBuffer_Usage(8);
195}
196impl OH_NativeBuffer_Usage {
197 pub const NATIVEBUFFER_USAGE_HW_RENDER: OH_NativeBuffer_Usage = OH_NativeBuffer_Usage(256);
199}
200impl OH_NativeBuffer_Usage {
201 pub const NATIVEBUFFER_USAGE_HW_TEXTURE: OH_NativeBuffer_Usage = OH_NativeBuffer_Usage(512);
203}
204impl OH_NativeBuffer_Usage {
205 pub const NATIVEBUFFER_USAGE_CPU_READ_OFTEN: OH_NativeBuffer_Usage =
207 OH_NativeBuffer_Usage(65536);
208}
209impl OH_NativeBuffer_Usage {
210 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#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
250pub struct OH_NativeBuffer_Usage(pub ::core::ffi::c_uint);
251impl OH_NativeBuffer_Format {
252 #[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 #[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 #[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 #[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 pub const NATIVEBUFFER_PIXEL_FMT_RGBA_5658: OH_NativeBuffer_Format = OH_NativeBuffer_Format(4);
286}
287impl OH_NativeBuffer_Format {
288 pub const NATIVEBUFFER_PIXEL_FMT_RGBX_4444: OH_NativeBuffer_Format = OH_NativeBuffer_Format(5);
290}
291impl OH_NativeBuffer_Format {
292 pub const NATIVEBUFFER_PIXEL_FMT_RGBA_4444: OH_NativeBuffer_Format = OH_NativeBuffer_Format(6);
294}
295impl OH_NativeBuffer_Format {
296 pub const NATIVEBUFFER_PIXEL_FMT_RGB_444: OH_NativeBuffer_Format = OH_NativeBuffer_Format(7);
298}
299impl OH_NativeBuffer_Format {
300 pub const NATIVEBUFFER_PIXEL_FMT_RGBX_5551: OH_NativeBuffer_Format = OH_NativeBuffer_Format(8);
302}
303impl OH_NativeBuffer_Format {
304 pub const NATIVEBUFFER_PIXEL_FMT_RGBA_5551: OH_NativeBuffer_Format = OH_NativeBuffer_Format(9);
306}
307impl OH_NativeBuffer_Format {
308 pub const NATIVEBUFFER_PIXEL_FMT_RGB_555: OH_NativeBuffer_Format = OH_NativeBuffer_Format(10);
310}
311impl OH_NativeBuffer_Format {
312 pub const NATIVEBUFFER_PIXEL_FMT_RGBX_8888: OH_NativeBuffer_Format = OH_NativeBuffer_Format(11);
314}
315impl OH_NativeBuffer_Format {
316 pub const NATIVEBUFFER_PIXEL_FMT_RGBA_8888: OH_NativeBuffer_Format = OH_NativeBuffer_Format(12);
318}
319impl OH_NativeBuffer_Format {
320 pub const NATIVEBUFFER_PIXEL_FMT_RGB_888: OH_NativeBuffer_Format = OH_NativeBuffer_Format(13);
322}
323impl OH_NativeBuffer_Format {
324 pub const NATIVEBUFFER_PIXEL_FMT_BGR_565: OH_NativeBuffer_Format = OH_NativeBuffer_Format(14);
326}
327impl OH_NativeBuffer_Format {
328 pub const NATIVEBUFFER_PIXEL_FMT_BGRX_4444: OH_NativeBuffer_Format = OH_NativeBuffer_Format(15);
330}
331impl OH_NativeBuffer_Format {
332 pub const NATIVEBUFFER_PIXEL_FMT_BGRA_4444: OH_NativeBuffer_Format = OH_NativeBuffer_Format(16);
334}
335impl OH_NativeBuffer_Format {
336 pub const NATIVEBUFFER_PIXEL_FMT_BGRX_5551: OH_NativeBuffer_Format = OH_NativeBuffer_Format(17);
338}
339impl OH_NativeBuffer_Format {
340 pub const NATIVEBUFFER_PIXEL_FMT_BGRA_5551: OH_NativeBuffer_Format = OH_NativeBuffer_Format(18);
342}
343impl OH_NativeBuffer_Format {
344 pub const NATIVEBUFFER_PIXEL_FMT_BGRX_8888: OH_NativeBuffer_Format = OH_NativeBuffer_Format(19);
346}
347impl OH_NativeBuffer_Format {
348 pub const NATIVEBUFFER_PIXEL_FMT_BGRA_8888: OH_NativeBuffer_Format = OH_NativeBuffer_Format(20);
350}
351impl OH_NativeBuffer_Format {
352 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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#[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 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 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 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 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 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 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 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 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 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 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 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 pub const NATIVEBUFFER_FLIP_V_ROT270: OH_NativeBuffer_TransformType =
613 OH_NativeBuffer_TransformType(11);
614}
615#[repr(transparent)]
616#[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 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 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 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 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 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 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 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 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 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 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 pub const NATIVEBUFFER_COLOR_GAMUT_DISPLAY_BT2020: OH_NativeBuffer_ColorGamut =
703 OH_NativeBuffer_ColorGamut(10);
704}
705#[repr(transparent)]
706#[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#[repr(C)]
729#[derive(Debug, Copy, Clone)]
730pub struct OH_NativeBuffer_Config {
731 pub width: i32,
733 pub height: i32,
735 pub format: i32,
737 pub usage: i32,
739 pub stride: i32,
741}
742#[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 pub offset: u64,
758 pub rowStride: u32,
760 pub columnStride: u32,
762}
763#[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 pub planeCount: u32,
779 pub planes: [OH_NativeBuffer_Plane; 4usize],
781}
782extern "C" {
783 pub fn OH_NativeBuffer_Alloc(config: *const OH_NativeBuffer_Config) -> *mut OH_NativeBuffer;
808 pub fn OH_NativeBuffer_Reference(buffer: *mut OH_NativeBuffer) -> i32;
829 pub fn OH_NativeBuffer_Unreference(buffer: *mut OH_NativeBuffer) -> i32;
849 pub fn OH_NativeBuffer_GetConfig(
870 buffer: *mut OH_NativeBuffer,
871 config: *mut OH_NativeBuffer_Config,
872 );
873 pub fn OH_NativeBuffer_Map(
894 buffer: *mut OH_NativeBuffer,
895 virAddr: *mut *mut ::core::ffi::c_void,
896 ) -> i32;
897 pub fn OH_NativeBuffer_Unmap(buffer: *mut OH_NativeBuffer) -> i32;
916 pub fn OH_NativeBuffer_GetSeqNum(buffer: *mut OH_NativeBuffer) -> u32;
935 #[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 #[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 #[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 #[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 #[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 #[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}