openharmony 鸿蒙 capi-native-color-space-manager-h

2026-08-25 浏览 (1)

native_color_space_manager.h

Overview

This file declares the functions for creating and using a color space.

File to include: <native_color_space_manager/native_color_space_manager.h>

Library: libnative_color_space_manager.so

System capability: SystemCapability.Graphic.Graphic2D.ColorManager.Core

Since: 13

Related module: NativeColorSpaceManager

Summary

Structs

Nametypedef KeywordDescription
ColorSpacePrimariesColorSpacePrimariesDescribes the color space primaries.
WhitePointArray-Describes a white point array. Each white point indicates the coordinates of white in the active color space.
OH_NativeColorSpaceManagerOH_NativeColorSpaceManagerProvides the declaration of an OH_NativeColorSpaceManager struct.

Enumerated value

Nametypedef KeywordDescription
ColorSpaceNameColorSpaceNameDefines an enum for the color space names.

Functions

NameDescription
OH_NativeColorSpaceManager* OH_NativeColorSpaceManager_CreateFromName(ColorSpaceName colorSpaceName)Creates an OH_NativeColorSpaceManager instance based on a color space name.
A new OH_NativeColorSpaceManager instance is created each time this function is called.
OH_NativeColorSpaceManager* OH_NativeColorSpaceManager_CreateFromPrimariesAndGamma(ColorSpacePrimaries primaries, float gamma)Creates an OH_NativeColorSpaceManager instance based on the color primaries and gamma value.
A new OH_NativeColorSpaceManager instance is created each time this function is called.
void OH_NativeColorSpaceManager_Destroy(OH_NativeColorSpaceManager* nativeColorSpaceManager)Destroys an OH_NativeColorSpaceManager instance.
int OH_NativeColorSpaceManager_GetColorSpaceName(OH_NativeColorSpaceManager* nativeColorSpaceManager)Obtains the color space name.
WhitePointArray OH_NativeColorSpaceManager_GetWhitePoint(OH_NativeColorSpaceManager* nativeColorSpaceManager)Obtains the white points.
float OH_NativeColorSpaceManager_GetGamma(OH_NativeColorSpaceManager* nativeColorSpaceManager)Obtains the gamma value.

Enum Description

ColorSpaceName

enum ColorSpaceName

Description

Defines an enum for the color space names.

Since: 13

ValueDescription
NONE = 0Unknown color space.
ADOBE_RGB = 1Color space based on Adobe RGB.
DCI_P3 = 2Color space based on SMPTE RP 431-2-2007 and IEC 61966-2.1:1999.
DISPLAY_P3 = 3Color space based on SMPTE RP 431-2-2007 and IEC 61966-2.1:1999.
SRGB = 4Standard Red Green Blue (SRGB) color space based on IEC 61966-2.1:1999.
BT709 = 6Color space based on ITU-R BT.709.
BT601_EBU = 7Color space based on ITU-R BT.601.
BT601_SMPTE_C = 8Color space based on ITU-R BT.601.
BT2020_HLG = 9Color space based on ITU-R BT.2020.
BT2020_PQ = 10Color space based on ITU-R BT.2020.
P3_HLG = 11Color space with the color primaries of P3_D65, the transfer characteristics of HLG, and the color range of Full.
P3_PQ = 12Color space with the color primaries of P3_D65, the transfer characteristics of PQ, and the color range of Full.
ADOBE_RGB_LIMIT = 13Color space with the color primaries of ADOBE_RGB, the transfer characteristics of ADOBE_RGB, and the color range of LIMIT.
DISPLAY_P3_LIMIT = 14Color space with the color primaries of P3_D65, the transfer characteristics of SRGB, and the color range of LIMIT.
SRGB_LIMIT = 15Color space with the color primaries of SRGB, the transfer characteristics of SRGB, and the color range of LIMIT.
BT709_LIMIT = 16Color space with the color primaries of BT.709, the transfer characteristics of BT.709, and the color range of LIMIT.
BT601_EBU_LIMIT = 17Color space with the color primaries of BT.601_P, the transfer characteristics of BT.709, and the color range of LIMIT.
BT601_SMPTE_C_LIMIT = 18Color space with the color primaries of BT.601_N, the transfer characteristics of BT.709, and the color range of LIMIT.
BT2020_HLG_LIMIT = 19Color space with the color primaries of BT.2020, the transfer characteristics of HLG, and the color range of LIMIT.
BT2020_PQ_LIMIT = 20Color space with the color primaries of BT.2020, the transfer characteristics of PQ, and the color range of LIMIT.
P3_HLG_LIMIT = 21Color space with the color primaries of P3_D65, the transfer characteristics of HLG, and the color range of LIMIT.
P3_PQ_LIMIT = 22Color space with the color primaries of P3_D65, the transfer characteristics of PQ, and the color range of LIMIT.
LINEAR_P3 = 23Color space with the color primaries of P3_D65 and the transfer characteristic of LINEAR.
LINEAR_SRGB = 24Color space with the color primaries of SRGB and the transfer characteristic of LINEAR.
LINEAR_BT709 = LINEAR_SRGBColor space with the color primaries of BT.709 and the transfer characteristic of LINEAR.
LINEAR_BT2020 = 25Color space with the color primaries of BT.2020 and the transfer characteristic of LINEAR.
DISPLAY_SRGB = SRGBColor space with the color primaries of SRGB, the transfer characteristics of SRGB, and the color range of Full.
DISPLAY_P3_SRGB = DISPLAY_P3Color space with the color primaries of P3_D65, the transfer characteristics of SRGB, and the color range of Full.
DISPLAY_P3_HLG = P3_HLGColor space with the color primaries of P3_D65, the transfer characteristics of HLG, and the color range of Full.
DISPLAY_P3_PQ = P3_PQColor space with the color primaries of P3_D65, the transfer characteristics of PQ, and the color range of Full.
CUSTOM = 5Custom color space.

Function Description

OH_NativeColorSpaceManager_CreateFromName()

OH_NativeColorSpaceManager* OH_NativeColorSpaceManager_CreateFromName(ColorSpaceName colorSpaceName)

Description

Creates an OH_NativeColorSpaceManager instance based on a color space name.
A new OH_NativeColorSpaceManager instance is created each time this function is called.

System capability: SystemCapability.Graphic.Graphic2D.ColorManager.Core

Since: 13

Parameters

NameDescription
ColorSpaceName colorSpaceNameColor space name of the created OH_NativeColorSpaceManager instance.

Returns

TypeDescription
OH_NativeColorSpaceManager*Returns a pointer to the OH_NativeColorSpaceManager instance. If the memory is insufficient, the OH_NativeColorSpaceManager instance fails to be created.

OH_NativeColorSpaceManager_CreateFromPrimariesAndGamma()

OH_NativeColorSpaceManager* OH_NativeColorSpaceManager_CreateFromPrimariesAndGamma(ColorSpacePrimaries primaries, float gamma)

Description

Creates an OH_NativeColorSpaceManager instance based on the color primaries and gamma value.
A new OH_NativeColorSpaceManager instance is created each time this function is called.

System capability: SystemCapability.Graphic.Graphic2D.ColorManager.Core

Since: 13

Parameters

NameDescription
ColorSpacePrimaries primariesPrimary color of the created OH_NativeColorSpaceManager instance.
float gammaGamma value of the created OH_NativeColorSpaceManager instance. The gamma value is a floating point number used to correct the brightness range.
Generally, the gamma value is positive. A negative value results in increased brightness in low-light areas and decreased brightness in high-light areas. The value 0 indicates a linear color space.

Returns

TypeDescription
OH_NativeColorSpaceManager*Returns a pointer to the OH_NativeColorSpaceManager instance.
If the memory is insufficient, the OH_NativeColorSpaceManager instance fails to be created.

OH_NativeColorSpaceManager_Destroy()

void OH_NativeColorSpaceManager_Destroy(OH_NativeColorSpaceManager* nativeColorSpaceManager)

Description

Destroys an OH_NativeColorSpaceManager instance.

System capability: SystemCapability.Graphic.Graphic2D.ColorManager.Core

Since: 13

Parameters

NameDescription
OH_NativeColorSpaceManager* nativeColorSpaceManagerPointer to an OH_NativeColorSpaceManager instance.

OH_NativeColorSpaceManager_GetColorSpaceName()

int OH_NativeColorSpaceManager_GetColorSpaceName(OH_NativeColorSpaceManager* nativeColorSpaceManager)

Description

Obtains the color space name.

System capability: SystemCapability.Graphic.Graphic2D.ColorManager.Core

Since: 13

Parameters

NameDescription
OH_NativeColorSpaceManager* nativeColorSpaceManagerPointer to an OH_NativeColorSpaceManager instance.

Returns

TypeDescription
intReturns the color space name, which is defined in ColorSpaceName. The return value 0 means that the function call fails.

OH_NativeColorSpaceManager_GetWhitePoint()

WhitePointArray OH_NativeColorSpaceManager_GetWhitePoint(OH_NativeColorSpaceManager* nativeColorSpaceManager)

Description

Obtains the white points.

System capability: SystemCapability.Graphic.Graphic2D.ColorManager.Core

Since: 13

Parameters

NameDescription
OH_NativeColorSpaceManager* nativeColorSpaceManagerPointer to an OH_NativeColorSpaceManager instance.

Returns

TypeDescription
WhitePointArrayReturns a float array of white points. The value <0.0, 0.0> means that the function call fails.

OH_NativeColorSpaceManager_GetGamma()

float OH_NativeColorSpaceManager_GetGamma(OH_NativeColorSpaceManager* nativeColorSpaceManager)

Description

Obtains the gamma value.

System capability: SystemCapability.Graphic.Graphic2D.ColorManager.Core

Since: 13

Parameters

NameDescription
OH_NativeColorSpaceManager* nativeColorSpaceManagerPointer to an OH_NativeColorSpaceManager instance.

Returns

TypeDescription
floatReturns a float value. The value 0.0 means that the function call fails.

你可能感兴趣的鸿蒙文章

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/97ctgnQz