openharmony 鸿蒙 capi-buffer-common-h

2026-08-25 浏览 (1)

buffer_common.h

Overview

This file declares the common types used in the NativeBuffer module.

File to include: <native_buffer/buffer_common.h>

Library: libnative_buffer.so

System capability: SystemCapability.Graphic.Graphic2D.NativeBuffer

Since: 12

Related module: OH_NativeBuffer

Summary

Structs

Nametypedef KeywordDescription
OH_NativeBuffer_ColorXYOH_NativeBuffer_ColorXYDescribes the X and Y coordinates of the primary color.
OH_NativeBuffer_Smpte2086OH_NativeBuffer_Smpte2086Describes the SMPTE ST 2086 static metadata.
OH_NativeBuffer_Cta861OH_NativeBuffer_Cta861Describes the CTA-861.3 static metadata.
OH_NativeBuffer_StaticMetadataOH_NativeBuffer_StaticMetadataDescribes the HDR static metadata.

Enumerated value

Nametypedef KeywordDescription
OH_NativeBuffer_ColorSpaceOH_NativeBuffer_ColorSpaceDefines an enum for the color spaces of an OH_NativeBuffer instance.
OH_NativeBuffer_MetadataTypeOH_NativeBuffer_MetadataTypeDefines an enum for the OH_NativeBuffer image standards.
OH_NativeBuffer_MetadataKeyOH_NativeBuffer_MetadataKeyDefines an enum for the key values of OH_NativeBuffer description information, such as HDR metadata and ROI metadata.
OH_NativeBuffer_FormatOH_NativeBuffer_FormatDefines an enum for the OH_NativeBuffer formats.
OH_NativeBuffer_TransformTypeOH_NativeBuffer_TransformTypeDefines an enum for the conversion types of OH_NativeBuffer.

Enum Description

OH_NativeBuffer_ColorSpace

enum OH_NativeBuffer_ColorSpace

Description

Defines an enum for the color spaces of an OH_NativeBuffer instance.

This enum is moved from native_buffer.h to this header file since API version 12.

Before API version 12, use this enum only if native_buffer.h is referenced. From API version 12 onwards, this enum can be used properly whether native_buffer.h or buffer_common.h is referenced.

System capability: SystemCapability.Graphic.Graphic2D.NativeBuffer

Since: 11

ValueDescription
OH_COLORSPACE_NONENo color space is available.
OH_COLORSPACE_BT601_EBU_FULLThe color gamut is BT601_P, the transfer function is BT709, the conversion matrix is BT601_P, and the data range is RANGE_FULL.
OH_COLORSPACE_BT601_SMPTE_C_FULLThe color gamut is BT601_N, the transfer function is BT709, the conversion matrix is BT601_N, and the data range is RANGE_FULL.
OH_COLORSPACE_BT709_FULLThe color gamut is BT709, the transfer function is BT709, the conversion matrix is BT709, and the data range is RANGE_FULL.
OH_COLORSPACE_BT2020_HLG_FULLThe color gamut is BT2020, the transfer function is HLG, the conversion matrix is BT2020, and the data range is RANGE_FULL.
OH_COLORSPACE_BT2020_PQ_FULLThe color gamut is BT2020, the transfer function is PQ, the conversion matrix is BT2020, and the data range is RANGE_FULL.
OH_COLORSPACE_BT601_EBU_LIMITThe color gamut is BT601_P, the transfer function is BT709, the conversion matrix is BT601_P, and the data range is RANGE_LIMITED.
OH_COLORSPACE_BT601_SMPTE_C_LIMITThe color gamut is BT601_N, the transfer function is BT709, the conversion matrix is BT601_N, and the data range is RANGE_LIMITED.
OH_COLORSPACE_BT709_LIMITThe color gamut is BT709, the transfer function is BT709, the conversion matrix is BT709, and the data range is RANGE_LIMITED.
OH_COLORSPACE_BT2020_HLG_LIMITThe color gamut is BT2020, the transfer function is HLG, the conversion matrix is BT2020, and the data range is RANGE_LIMITED.
OH_COLORSPACE_BT2020_PQ_LIMITThe color gamut is BT2020, the transfer function is PQ, the conversion matrix is BT2020, and the data range is RANGE_LIMITED.
OH_COLORSPACE_SRGB_FULLThe color gamut is SRGB, the transfer function is SRGB, the conversion matrix is BT601_N, and the data range is RANGE_FULL.
OH_COLORSPACE_P3_FULLThe color gamut is P3_D65, the transfer function is SRGB, the conversion matrix is P3, and the data range is RANGE_FULL.
OH_COLORSPACE_P3_HLG_FULLThe color gamut is P3_D65, the transfer function is HLG, the conversion matrix is P3, and the data range is RANGE_FULL.
OH_COLORSPACE_P3_PQ_FULLThe color gamut is P3_D65, the transfer function is PQ, the conversion matrix is P3, and the data range is RANGE_FULL.
OH_COLORSPACE_ADOBERGB_FULLThe color gamut is ADOBERGB, the transfer function is ADOBERGB, the conversion matrix is ADOBERGB, and the data range is RANGE_FULL.
OH_COLORSPACE_SRGB_LIMITThe color gamut is SRGB, the transfer function is SRGB, the conversion matrix is BT601_N, and the data range is RANGE_LIMITED.
OH_COLORSPACE_P3_LIMITThe color gamut is P3_D65, the transfer function is SRGB, the conversion matrix is P3, and the data range is RANGE_LIMITED.
OH_COLORSPACE_P3_HLG_LIMITThe color gamut is P3_D65, the transfer function is HLG, the conversion matrix is P3, and the data range is RANGE_LIMITED.
OH_COLORSPACE_P3_PQ_LIMITThe color gamut is P3_D65, the transfer function is PQ, the conversion matrix is P3, and the data range is RANGE_LIMITED.
OH_COLORSPACE_ADOBERGB_LIMITThe color gamut is ADOBERGB, the transfer function is ADOBERGB, the conversion matrix is ADOBERGB, and the data range is RANGE_LIMITED.
OH_COLORSPACE_LINEAR_SRGBThe color gamut is SRGB, and the transfer function is LINEAR.
OH_COLORSPACE_LINEAR_BT709It is equivalent to OH_COLORSPACE_LINEAR_SRGB.
OH_COLORSPACE_LINEAR_P3The color gamut is P3_D65, and the transfer function is LINEAR.
OH_COLORSPACE_LINEAR_BT2020The color gamut is BT2020, and the transfer function is LINEAR.
OH_COLORSPACE_DISPLAY_SRGBIt is equivalent to OH_COLORSPACE_SRGB_FULL.
OH_COLORSPACE_DISPLAY_P3_SRGBIt is equivalent to OH_COLORSPACE_P3_FULL.
OH_COLORSPACE_DISPLAY_P3_HLGIt is equivalent to OH_COLORSPACE_P3_HLG_FULL.
OH_COLORSPACE_DISPLAY_P3_PQIt is equivalent to OH_COLORSPACE_P3_PQ_FULL.
OH_COLORSPACE_DISPLAY_BT2020_SRGBThe color gamut is BT2020, the transfer function is SRGB, the conversion matrix is BT2020, and the data range is RANGE_FULL.
OH_COLORSPACE_DISPLAY_BT2020_HLGIt is equivalent to OH_COLORSPACE_BT2020_HLG_FULL.
OH_COLORSPACE_DISPLAY_BT2020_PQIt is equivalent to OH_COLORSPACE_BT2020_PQ_FULL.

OH_NativeBuffer_MetadataType

enum OH_NativeBuffer_MetadataType

Description

Defines an enum for the OH_NativeBuffer image standards.

System capability: SystemCapability.Graphic.Graphic2D.NativeBuffer

Since: 12

ValueDescription
OH_VIDEO_HDR_HLGVideo HLG.
OH_VIDEO_HDR_HDR10Video HDR10.
OH_VIDEO_HDR_VIVIDVideo HDR Vivid.
OH_IMAGE_HDR_VIVID_DUALImage HDR Vivid Dual.
Since: 22
OH_IMAGE_HDR_VIVID_SINGLEImage HDR Vivid Single.
Since: 22
OH_IMAGE_HDR_ISO_DUALImage HDR ISO Dual.
Since: 23
OH_IMAGE_HDR_ISO_SINGLEImage HDR ISO Single.
Since: 23
OH_VIDEO_NONE = -1No metadata.
Since: 13

OH_NativeBuffer_MetadataKey

enum OH_NativeBuffer_MetadataKey

Description

Defines an enum for the key values of OH_NativeBuffer description information, such as HDR metadata and ROI metadata.

System capability: SystemCapability.Graphic.Graphic2D.NativeBuffer

Since: 12

ValueDescription
OH_HDR_METADATA_TYPEMetadata type. For details about the available options, see OH_NativeBuffer_MetadataType. size indicates the size of OH_NativeBuffer_MetadataType.
OH_HDR_STATIC_METADATAStatic metadata. For details about the available options, see OH_NativeBuffer_StaticMetadata. size indicates the size of OH_NativeBuffer_StaticMetadata.
OH_HDR_DYNAMIC_METADATADynamic metadata. For details about the available options, see the SEI byte stream in the video stream. The value range of size is 1-3000.
OH_REGION_OF_INTEREST_METADATAROI metadata of video encoding and decoding. The configuration format is as follows: Top1,Left1-Bottom1,Right1=QpOffset1;Top2,Left2-Bottom2,Right2=QpOffset2;
Each ROI box consists of the position information (Top,Left-Bottom,Right) and encoding quality offset information (QpOffset), and ends with a semicolon (;).
The encoding quality offset information of the ROI box can be defaulted. The default value is -3. The configuration example when the default value is used is as follows: Top1,Left1-Bottom1,Right1;Top2,Left2-Bottom2,Right2;
A maximum of six ROIs can be configured for each group of ROI metadata, and the total area of the ROIs cannot exceed 1/5 of the image.
This enumerated value can be called only through the OH_NativeBuffer_SetMetadataValue() API.
Since: 22

OH_NativeBuffer_Format

enum OH_NativeBuffer_Format

Description

Defines an enum for the OH_NativeBuffer formats.

This enum is moved from native_buffer.h to this header file since API version 22.

Before API version 22, use this enum only if native_buffer.h is referenced. From API version 22 onwards, this enum can be used properly whether native_buffer.h or buffer_common.h is referenced.

System capability: SystemCapability.Graphic.Graphic2D.NativeBuffer

Since: 10

ValueDescription
NATIVEBUFFER_PIXEL_FMT_CLUT8 = 0CLUT8.
Since: 12
NATIVEBUFFER_PIXEL_FMT_CLUT1CLUT1.
Since: 12
NATIVEBUFFER_PIXEL_FMT_CLUT4CLUT4.
Since: 12
NATIVEBUFFER_PIXEL_FMT_RGB_565 = 3RGB565.
NATIVEBUFFER_PIXEL_FMT_RGBA_5658RGBA5658.
NATIVEBUFFER_PIXEL_FMT_RGBX_4444RGBX4444.
NATIVEBUFFER_PIXEL_FMT_RGBA_4444RGBA4444.
NATIVEBUFFER_PIXEL_FMT_RGB_444RGB444.
NATIVEBUFFER_PIXEL_FMT_RGBX_5551RGBX5551.
NATIVEBUFFER_PIXEL_FMT_RGBA_5551RGBA5551.
NATIVEBUFFER_PIXEL_FMT_RGB_555RGB555.
NATIVEBUFFER_PIXEL_FMT_RGBX_8888RGBX8888.
NATIVEBUFFER_PIXEL_FMT_RGBA_8888RGBA8888.
NATIVEBUFFER_PIXEL_FMT_RGB_888RGB888.
NATIVEBUFFER_PIXEL_FMT_BGR_565BGR565.
NATIVEBUFFER_PIXEL_FMT_BGRX_4444BGRX4444.
NATIVEBUFFER_PIXEL_FMT_BGRA_4444BGRA4444.
NATIVEBUFFER_PIXEL_FMT_BGRX_5551BGRX5551.
NATIVEBUFFER_PIXEL_FMT_BGRA_5551BGRA5551.
NATIVEBUFFER_PIXEL_FMT_BGRX_8888BGRX8888.
NATIVEBUFFER_PIXEL_FMT_BGRA_8888BGRA8888.
NATIVEBUFFER_PIXEL_FMT_YUV_422_IYUV422 interleaved.
Since: 12
NATIVEBUFFER_PIXEL_FMT_YCBCR_422_SPYCbCr422 semi-planar format.
Since: 12
NATIVEBUFFER_PIXEL_FMT_YCRCB_422_SPYCrCb422 semi-planar.
Since: 12
NATIVEBUFFER_PIXEL_FMT_YCBCR_420_SPYCbCr420 semi-planar.
Since: 12
NATIVEBUFFER_PIXEL_FMT_YCRCB_420_SPYCrCb420 semi-planar.
Since: 12
NATIVEBUFFER_PIXEL_FMT_YCBCR_422_PYCbCr422 planar.
Since: 12
NATIVEBUFFER_PIXEL_FMT_YCRCB_422_PYCrCb422 planar.
Since: 12
NATIVEBUFFER_PIXEL_FMT_YCBCR_420_PYCbCr420 planar.
Since: 12
NATIVEBUFFER_PIXEL_FMT_YCRCB_420_PYCrCb420 planar.
Since: 12
NATIVEBUFFER_PIXEL_FMT_YUYV_422_PKGYUYV422 packed.
Since: 12
NATIVEBUFFER_PIXEL_FMT_UYVY_422_PKGUYVY422 packed.
Since: 12
NATIVEBUFFER_PIXEL_FMT_YVYU_422_PKGYVYU422 packed.
Since: 12
NATIVEBUFFER_PIXEL_FMT_VYUY_422_PKGVYUY422 packed.
Since: 12
NATIVEBUFFER_PIXEL_FMT_RGBA_1010102RGBA_1010102 packed.
Since: 12
NATIVEBUFFER_PIXEL_FMT_YCBCR_P010YCBCR420 semi-planar 10-bit packed.
Since: 12
NATIVEBUFFER_PIXEL_FMT_YCRCB_P010YCRCB420 semi-planar 10-bit packed.
Since: 12
NATIVEBUFFER_PIXEL_FMT_RAW10Raw 10-bit packed.
Since: 12
NATIVEBUFFER_PIXEL_FMT_BLOBBLOB.
Since: 15
NATIVEBUFFER_PIXEL_FMT_RGBA16_FLOATRGBA16 float.
Since: 15
NATIVEBUFFER_PIXEL_FMT_Y8 = 40Y8.
Since: 20
NATIVEBUFFER_PIXEL_FMT_Y16 = 41Y16.
Since: 20
NATIVEBUFFER_PIXEL_FMT_VENDER_MASK = 0X7FFF0000Vender mask.
Since: 12
NATIVEBUFFER_PIXEL_FMT_BUTT = 0X7FFFFFFFInvalid format.

OH_NativeBuffer_TransformType

enum OH_NativeBuffer_TransformType

Description

Defines an enum for the conversion types of OH_NativeBuffer.

This enum is moved from native_buffer.h to this header file since API version 22.

Before API version 22, use this enum only if native_buffer.h is referenced. From API version 22 onwards, this enum can be used properly whether native_buffer.h or buffer_common.h is referenced.

System capability: SystemCapability.Graphic.Graphic2D.NativeBuffer

Since: 12

ValueDescription
NATIVEBUFFER_ROTATE_NONE = 0No rotation.
NATIVEBUFFER_ROTATE_90Rotates by 90 degrees.
NATIVEBUFFER_ROTATE_180Rotates by 180 degrees.
NATIVEBUFFER_ROTATE_270Rotates by 270 degrees.
NATIVEBUFFER_FLIP_HFlips horizontally.
NATIVEBUFFER_FLIP_VFlips vertically.
NATIVEBUFFER_FLIP_H_ROT90Flips horizontally and rotates by 90 degrees.
NATIVEBUFFER_FLIP_V_ROT90Flips vertically and rotates by 90 degrees.
NATIVEBUFFER_FLIP_H_ROT180Flips horizontally and rotates by 180 degrees.
NATIVEBUFFER_FLIP_V_ROT180Flips vertically and rotates by 180 degrees.
NATIVEBUFFER_FLIP_H_ROT270Flips horizontally and rotates by 270 degrees.
NATIVEBUFFER_FLIP_V_ROT270Flips vertically and rotates by 270 degrees.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 capi-drawing-gpu-context-h

openharmony 鸿蒙 capi-drawing-nativepixelmap-

openharmony 鸿蒙 capi-nativevsync-oh-nativevsync-expectedraterange

openharmony 鸿蒙 capi-drawing-oh-drawing-brush

openharmony 鸿蒙 capi-drawing-oh-drawing-image-info

openharmony 鸿蒙 capi-drawing-text-linetypography-h

openharmony 鸿蒙 capi-oh-nativeimage-oh-nativeimage

openharmony 鸿蒙 capi-drawing-typeface-h

openharmony 鸿蒙 capi-drawing-brush-h

openharmony 鸿蒙 capi-nativewindow

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/SPJ3PGV4