openharmony 鸿蒙 arkts-apis-image-i

2026-08-25 浏览 (1)

Interfaces (Others)

NOTE

The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.

PositionArea7+

Describes area information in an image.

Widget capability: This API can be used in ArkTS widgets since API version 12.

Atomic service API: This API can be used in atomic services since API version 11.

System capability: SystemCapability.Multimedia.Image.Core

NameTypeRead OnlyOptionalDescription
pixelsArrayBufferNoNoPixels of the image. Only pixel data in BGRA_8888 format is supported.
offsetnumberNoNoOffset for data reading, in bytes.
stridenumberNoNoNumber of bytes from one row of pixels in memory to the next row of pixels in memory. in bytes. The value of stride must be greater than or equal to the value of region.size.width multiplied by 4.
regionRegionNoNoRegion to read or write. The width of the region to write plus the X coordinate cannot be greater than the width of the original image. The height of the region to write plus the Y coordinate cannot be greater than the height of the original image.

ImageInfo

Describes image information.

System capability: SystemCapability.Multimedia.Image.Core

NameTypeRead OnlyOptionalDescription
size6+SizeNoNoImage size.
Atomic service API: This API can be used in atomic services since API version 11.
Widget capability: This API can be used in ArkTS widgets since API version 12.
density9+numberNoNoPixel density, in ppi.
Atomic service API: This API can be used in atomic services since API version 11.
Widget capability: This API can be used in ArkTS widgets since API version 12.
stride11+numberNoNoNumber of bytes from one row of pixels in memory to the next row of pixels in memory. in bytes.stride >= region.size.width*4
Atomic service API: This API can be used in atomic services since API version 11.
Widget capability: This API can be used in ArkTS widgets since API version 12.
pixelFormat12+PixelMapFormatNoNoPixel format.
Atomic service API: This API can be used in atomic services since API version 12.
Widget capability: This API can be used in ArkTS widgets since API version 12.
alphaType12+AlphaTypeNoNoAlpha type.
Atomic service API: This API can be used in atomic services since API version 12.
Widget capability: This API can be used in ArkTS widgets since API version 12.
mimeType12+stringNoNoActual image format (MIME type).
The supported formats for image decoding and image encoding are different. Do not directly use the actual image format obtained after decoding as the value of format in PackingOption during image encoding.
You can use the supportedFormats property of ImageSource and of ImagePacker to view the supported formats for decoding and encoding.
isHdr12+booleanNoNoWhether the image is an HDR image. The value true means an HDR image, and false means an SDR image. For ImageSource, this parameter specifies whether the source image is in HDR format. For PixelMap, this parameter specifies whether the decoded PixelMap is in HDR format.

Size

Describes the size of an image.

Widget capability: This API can be used in ArkTS widgets since API version 12.

Atomic service API: This API can be used in atomic services since API version 11.

System capability: SystemCapability.Multimedia.Image.Core

NameTypeRead OnlyOptionalDescription
heightnumberNoNoImage height, in px.
widthnumberNoNoImage width, in px.

HdrComposeOptions23+

Options for HDR image composition.

Model restriction: This API can be used only in the stage model.

System capability: SystemCapability.Multimedia.Image.Core

NameTypeRead OnlyOptionalDescription
desiredPixelFormatPixelMapFormatNoYesPixel format for image composition. The RGBA_1010102, YCBCR_P010, and YCRCB_P010 formats are supported.

AuxiliaryPictureInfo13+

Describes the auxiliary picture information.

System capability: SystemCapability.Multimedia.Image.Core

NameTypeRead OnlyOptionalDescription
auxiliaryPictureTypeAuxiliaryPictureTypeNoNoAuxiliary picture type.
sizeSizeNoNoImage size.
rowStridenumberNoNoRow stride. The unit is bytes.
pixelFormatPixelMapFormatNoNoPixel format.
colorSpacecolorSpaceManager.ColorSpaceManagerNoNoColor space.

SourceOptions9+

Defines image source initialization options.

Widget capability: This API can be used in ArkTS widgets since API version 12.

Atomic service API: This API can be used in atomic services since API version 11.

System capability: SystemCapability.Multimedia.Image.Core

NameTypeRead OnlyOptionalDescription
sourceDensitynumberNoNoPixel density of the image resource, in ppi.
If desiredSize is not set in DecodingOptions and SourceOptions.sourceDensity and DecodingOptions.fitDensity are not 0, the PixelMap output after decoding will be scaled.
The formula for calculating the width after scaling is as follows (the same applies to the height): (width * fitDensity + (sourceDensity >> 1)) / sourceDensity.
sourcePixelFormatPixelMapFormatNoYesImage pixel format. The default value is UNKNOWN.
sourceSizeSizeNoYesImage pixel size. The default value is null.

InitializationOptions8+

Defines PixelMap initialization options.

System capability: SystemCapability.Multimedia.Image.Core

NameTypeRead OnlyOptionalDescription
alphaType9+AlphaTypeNoYesAlpha type. The default value is IMAGE_ALPHA_TYPE_PREMUL.
Atomic service API: This API can be used in atomic services since API version 11.
Widget capability: This API can be used in ArkTS widgets since API version 12.
editablebooleanNoYesWhether the image pixels are editable. true if editable, false otherwise. The value false provides better image rendering and transmission performance. The default value is false.
Atomic service API: This API can be used in atomic services since API version 11.
Widget capability: This API can be used in ArkTS widgets since API version 12.
srcPixelFormat12+PixelMapFormatNoYesPixel format of the passed-in buffer data. The default value is BGRA_8888.
pixelFormatPixelMapFormatNoYesPixel format of the generated PixelMap. The default value is RGBA_8888.
Atomic service API: This API can be used in atomic services since API version 11.
Widget capability: This API can be used in ArkTS widgets since API version 12.
scaleMode9+ScaleModeNoYesScale mode. The default value is 0.
Atomic service API: This API can be used in atomic services since API version 11.
Widget capability: This API can be used in ArkTS widgets since API version 12.
sizeSizeNoNoImage size.
Atomic service API: This API can be used in atomic services since API version 11.
Widget capability: This API can be used in ArkTS widgets since API version 12.

DecodingOptions7+

Describes the image decoding options.

System capability: SystemCapability.Multimedia.Image.ImageSource

NameTypeRead OnlyOptionalDescription
sampleSizenumberNoYesSampling size of the thumbnail. The default value is 1. Currently, the value can only be 1.
Atomic service API: This API can be used in atomic services since API version 11.
Widget capability: This API can be used in ArkTS widgets since API version 12.
rotatenumberNoYesRotation angle. The unit is degrees. The default value is 0.
Atomic service API: This API can be used in atomic services since API version 11.
Widget capability: This API can be used in ArkTS widgets since API version 12.
editablebooleanNoYesWhether pixels are editable. true if editable, false otherwise. The default value is false.
If this parameter is set to false, the image rendering and transmission performance is improved, but the image cannot be edited. For example, the writePixels operation will fail.
Atomic service API: This API can be used in atomic services since API version 11.
Widget capability: This API can be used in ArkTS widgets since API version 12.
desiredSizeSizeNoYesExpected output size. The value must be a positive integer and defaults to the original image size. If the output size is different from the original size, the output is stretched or scaled to the specified size.
Note: If both desiredSize and desiredRegion are passed to the decoding API, you must also include cropAndScaleStrategy to determine whether to crop or scale first. CROP_FIRST is recommended.
Atomic service API: This API can be used in atomic services since API version 11.
Widget capability: This API can be used in ArkTS widgets since API version 12.
desiredRegionRegionNoYesRectangle specified by Region in the decoded image. When the original image is large and only a specific part of the image is required, you can set this parameter to improve performance. The default value is the original image size.
Note: If both desiredSize and desiredRegion are passed to the decoding API, you must also include cropAndScaleStrategy to determine whether to crop or scale first. CROP_FIRST is recommended.
Atomic service API: This API can be used in atomic services since API version 11.
Widget capability: This API can be used in ArkTS widgets since API version 12.
desiredPixelFormatPixelMapFormatNoYesPixel format for decoding. The default value is RGBA_8888. Only RGBA_8888, BGRA_8888, and RGB_565 are supported. RGB_565 is not supported for images with alpha channels, such as PNG, GIF, ICO, and WEBP.
Atomic service API: This API can be used in atomic services since API version 11.
Widget capability: This API can be used in ArkTS widgets since API version 12.
indexnumberNoYesIndex of the image to decode. The default value is 0, indicating the first image. If this parameter is set to N, the (N+1)th image is used. For single-frame images, the value is always 0. For multi-frame images such as animations, the value ranges from 0 to (Number of frames – 1).
Atomic service API: This API can be used in atomic services since API version 11.
Widget capability: This API can be used in ArkTS widgets since API version 12.
fitDensity9+numberNoYesPixel density, in ppi. The default value is 0.
Atomic service API: This API can be used in atomic services since API version 11.
Widget capability: This API can be used in ArkTS widgets since API version 12.
desiredColorSpace11+colorSpaceManager.ColorSpaceManagerNoYesTarget color space. The default value is UNKNOWN.
desiredDynamicRange12+DecodingDynamicRangeNoYesDesired dynamic range. The default value is SDR.
This property cannot be set for an image source created using CreateIncrementalSource. By default, the image source is decoded as SDR content.
If the platform does not support HDR, the setting is invalid and the content is decoded as SDR content by default.
cropAndScaleStrategy18+CropAndScaleStrategyNoYesIf desiredRegion and desiredSize are both specified, the order of cropping and scaling is determined.
Only SCALE_FIRST and CROP_FIRST are supported.

DecodingOptionsForPicture13+

Describes the image decoding options.

System capability: SystemCapability.Multimedia.Image.ImageSource

NameTypeRead OnlyOptionalDescription
desiredAuxiliaryPicturesArray<AuxiliaryPictureType>NoNoAuxiliary picture type. If no auxiliary picture type is specified or an empty array is passed, the system decodes all available auxiliary picture types.
To exclude all auxiliary picture, you can decode the auxiliary picture to a PixelMap and use the PixelMap to create a Picture that contains only the main picture.
desiredSizeForMainPixelMap24+SizeNoYesExpected size of the main picture. The value must be a positive integer. The default value is the original size of the main picture, in pixels.
If the original size of the main picture is different from the specified size, the main picture is stretched or scaled to the specified size.
The width and height of the auxiliary picture are scaled in the same proportion as those of the main picture.
Model restriction: This API can be used only in the stage model.
desiredPixelFormat24+PixelMapFormatNoYesPixel format for decoding. The default value is RGBA_8888.
Only RGBA_8888, BGRA_8888, RGB_565, NV12, and NV21 are supported.
If an unsupported pixel format is set, a decoding failure is returned.
Model restriction: This API can be used only in the stage model.

DecodingOptionsForThumbnail

Thumbnail decoding options.

Since: 26.0.0

Model restriction: This API can be used only in the stage model.

System capability: SystemCapability.Multimedia.Image.ImageSource

NameTypeRead OnlyOptionalDescription
generateThumbnailIfAbsentbooleanNoYesWhether to generate a thumbnail when the image does not have one. The value true indicates yes, and the value false indicates no. The default value is true.
If the image file does not contain a thumbnail and generateThumbnailIfAbsent is set to false, undefined is returned (error code 7700303 is reported).
maxGeneratedPixelDimensionnumberNoYesMaximum side length (the larger of the width and height) for generating thumbnails. The shorter side is scaled proportionally to the longer side. This parameter is valid only when generateThumbnailIfAbsent is set to true.
The value must be an integer. The default value is 512. Both the width and height of the generated thumbnail are limited to maxGeneratedPixelDimension.
If the calculated thumbnail width or height is less than 1 pixel (rounded down to 0), no thumbnail will be generated.
The unit is px.

Region8+

Describes the region information.

Widget capability: This API can be used in ArkTS widgets since API version 12.

Atomic service API: This API can be used in atomic services since API version 11.

System capability: SystemCapability.Multimedia.Image.Core

NameTypeRead OnlyOptionalDescription
size7+SizeNoNoRegion size.
x7+numberNoNoX coordinate of the top-left corner of the region, in px.
y7+numberNoNoY coordinate of the top-left corner of the region, in px.

PackingOption

Describes the options for image encoding.

System capability: SystemCapability.Multimedia.Image.ImagePacker

NameTypeRead OnlyOptionalDescription
formatstringNoNoFormat of the packed image.
- When the input is ImageSource or PixelMap, the following formats are supported: image/jpeg, image/webp, image/png, image/heic (or image/heif)12+, image/sdr_astc_4x418+, image/sdr_sut_superfast_4x418+ (depending on the hardware), and image/hdr_astc_4x420+.
- When the input is Picture, only image/jpeg and image/heic (or image/heif)12+ are supported.
- GIF image encoding requires input of multiple PixelMap objects, with the format specified as image/gif. The encoding can be performed using packToDataFromPixelmapSequence or packToFileFromPixelmapSequence.
NOTE: The JPEG format does not support the alpha channel. If the JPEG format with the alpha channel is used for data encoding, the transparent color turns black.
Atomic service API: This API can be used in atomic services since API version 11.
qualitynumberNoNo1. Quality of the output image set. This parameter takes effect only for JPEG and HEIF images. The value range is [0, 100]. The value 0 means the lowest quality, and 100 means the highest quality. The higher the quality, the larger the space occupied by the generated image. WebP and PNG images are lossless.
2. In the case of sdr_astc_4x4 encoding, the parameter can be set to 92 and 85.
3. In the case of sut encoding, the parameter can be set to 92.
4. (Available since API version 20) In the case of hdr_astc_4x4 encoding, the parameter can be set to 85.
Atomic service API: This API can be used in atomic services since API version 11.
bufferSize9+numberNoYesSize of the buffer for receiving the encoded data, in bytes. If this parameter is not set, the default value 25 MB is used. If the size of an image exceeds 25 MB, you must specify the size. The value of bufferSize must be greater than the size of the encoded image. The use of packToFile is not restricted by this parameter.
Atomic service API: This API can be used in atomic services since API version 11.
desiredDynamicRange12+PackingDynamicRangeNoYesDesired dynamic range. The default value is SDR.
needsPackProperties12+booleanNoYesWhether encoding image property information, for example, Exif, is required. true if required, false otherwise. The default value is false.
maxEmbedThumbnailDimensionnumberNoYesMaximum side length (the larger of the width and height) for generating thumbnails during encoding. The shorter side is scaled proportionally to the longer side. This parameter is valid only when needsPackProperties is set to true.
The value must be an integer. The default value is 0.
If this parameter is not specified or the thumbnail width or height calculated based on the value of this parameter is 0, no thumbnail will be generated during encoding.
The unit is px.
Since: 26.0.0
Model restriction: This API can be used only in the stage model.

PackingOptionsForSequence18+

Defines the options for encoding animated images.

System capability: SystemCapability.Multimedia.Image.ImagePacker

NameTypeRead OnlyOptionalDescription
frameCountnumberNoNoNumber of frames specified in GIF encoding.
delayTimeListArray<number>NoNoDelay time of each frame in GIF encoding. The value must be greater than 0.
The unit is 10 milliseconds. For example, if this parameter is set to 10, the actual delay per frame is 100 ms.
If the array length is less than frameCount, the last value in the array will be used for the remaining frames.
disposalTypesArray<number>NoYesArray that defines how each image frame transitions. If the array length is less than frameCount, the last value in the array will be used for the remaining frames. The values can be:
- 0: No operation is required.
- 1: Keeps the image unchanged.
- 2: Restores the background color.
- 3: Restores to the previous state.
loopCountnumberNoYesNumber of times that the output image in GIF encoding loops. The value range is [0, 65535].
The value 0 means an infinite loop. If this field is not carried, loop playback is not performed.

ImagePropertyOptions11+

Describes the image properties.

System capability: SystemCapability.Multimedia.Image.ImageSource

NameTypeRead OnlyOptionalDescription
indexnumberNoYesIndex of the image. The default value is 0.
defaultValuestringNoYesDefault property value. The default value is null.

Component9+

Describes the color components of an image.

System capability: SystemCapability.Multimedia.Image.Core

NameTypeRead OnlyOptionalDescription
componentTypeComponentTypeYesNoColor component type.
rowStridenumberYesNoRow stride. The unit is bytes. The camera preview stream data needs to be read by stride. For details, see Solution to Screen Artifacts During Camera Preview.
pixelStridenumberYesNoPixel stride. The unit is bytes.
byteBufferArrayBufferYesNoComponent buffer.

HdrStaticMetadata12+

Describes the static metadata keys, that is, the values available for HDR_STATIC_METADATA in HdrMetadataKey.

System capability: SystemCapability.Multimedia.Image.Core

NameTypeRead OnlyOptionalDescription
displayPrimariesXArray<number>NoNoX coordinate of the three primary colors of the display device after normalization. The array length is 3. The unit is 0.00002. The value range is [0.0, 1.0].
displayPrimariesYArray<number>NoNoY coordinate of the three primary colors of the display device after normalization. The array length is 3. The unit is 0.00002. The value range is [0.0, 1.0].
whitePointXnumberNoNoX coordinate of the white point after normalization. The unit is 0.00002. The value range is [0.0, 1.0].
whitePointYnumberNoNoY coordinate of the white point after normalization. The unit is 0.00002. The value range is [0.0, 1.0].
maxLuminancenumberNoNoMaximum luminance of the main monitor. The unit is nits. The maximum value is 65535.
minLuminancenumberNoNoMinimum luminance of the main monitor. The unit is nits. Actual value = Stored value × 0.0001. The maximum value is 6.5535.
maxContentLightLevelnumberNoNoMaximum luminance of the displayed content. The unit is nits. The maximum value is 65535.
maxFrameAverageLightLevelnumberNoNoMaximum average luminance of the displayed content. The unit is nits. The maximum value is 65535.

GainmapChannel12+

Describes the data content of a single channel of the gain map. For details, see ISO 21496-1.

System capability: SystemCapability.Multimedia.Image.Core

NameTypeRead OnlyOptionalDescription
gainmapMaxnumberNoNoMaximum value of the gain map. For details, see ISO 21496-1.
gainmapMinnumberNoNoMinimum value of the gain map. For details, see ISO 21496-1.
gammanumberNoNoGamma. For details, see ISO 21496-1.
baseOffsetnumberNoNoOffset of the base graphic. For details, see ISO 21496-1.
alternateOffsetnumberNoNoOffset of the alternative graphic that can be extracted. For details, see ISO 21496-1.

ImageMetadata23+

Describes the image metadata set.

Model restriction: This API can be used only in the stage model.

System capability: SystemCapability.Multimedia.Image.Core

NameTypeRead OnlyOptionalDescription
exifMetadataExifMetadataNoYesExif metadata.
makerNoteHuaweiMetadataMakerNoteHuaweiMetadataNoYesPhoto metadata from Huawei cameras.
heifsMetadataHeifsMetadataNoYesHEIF image sequence metadata.
webPMetadata24+WebPMetadataNoYesWebP image metadata class, which is used to store image metadata.
dngMetadata24+DngMetadataNoYesDNG image metadata.

DngMetadata24+

DNG image metadata class, which is used to store image metadata.

Model restriction: This API can be used only in the stage model.

System capability: SystemCapability.Multimedia.Image.Core

NameTypeRead OnlyOptionalDescription
dngVersionnumber[]YesYesVersion number of the DNG image.
dngBackwardVersionnumber[]YesYesMinimum backward-compatible version number of the DNG file.
uniqueCameraModelstringYesYesUnique model ID of the camera, which is used to distinguish different devices.
localizedCameraModelstringYesYesLocalized camera model name.
cfaPlaneColornumber[]YesYesColor channel definition for each Color Filter Array (CFA) plane.
cfaLayoutnumberYesYesCFA layout type.
linearizationTablenumber[]YesYesLinearization lookup table, which is used to map raw sensor values to the linear light intensity.
blackLevelRepeatDimnumber[]YesYesBlack level repetition dimension.
blackLevelnumber[]YesYesEncoding level in zero illumination.
blackLevelDeltaHnumber[]YesYesHorizontal black level correction increment.
blackLevelDeltaVnumber[]YesYesVertical black level correction increment.
whiteLevelnumber[]YesYesWhite level, indicating the maximum valid output of the sensor.
defaultScalenumber[]YesYesDefault scaling ratio. The format is [Horizontal scaling ratio, Vertical scaling ratio].
defaultCropOriginnumber[]YesYesCoordinates (x, y) of the upper left corner of the default crop area.
defaultCropSizenumber[]YesYesWidth and height of the default crop area.
colorMatrix1number[]YesYesColor transformation matrix under the first calibration illuminant.
colorMatrix2number[]YesYesColor transformation matrix under the second calibration illuminant.
cameraCalibration1number[]YesYesCamera transformation matrix under the first calibration illuminant.
cameraCalibration2number[]YesYesCamera transformation matrix under the second calibration illuminant.
reductionMatrix1number[]YesYesDimension reduction matrix under the first calibration illuminant.
reductionMatrix2number[]YesYesDimension reduction matrix under the second calibration illuminant.
analogBalancenumber[]YesYesAnalog gain balance coefficient.
asShotNeutralnumber[]YesYesNeutral white point at capture.
asShotWhiteXYnumber[]YesYesCIE (1931 color space) x-y chromaticity coordinates of the white point at capture.
baselineExposurenumberYesYesBaseline exposure compensation value, in EV.
baselineNoisenumberYesYesBaseline noise level.
baselineSharpnessnumberYesYesBaseline sharpness gain.
bayerGreenSplitnumberYesYesSeparation degree of the two green channels in a Bayer image.
linearResponseLimitnumberYesYesLinear response upper limit.
cameraSerialNumberstringYesYesCamera serial number.
lensInfonumber[]YesYesLens information.
chromaBlurRadiusnumberYesYesChrominance blur radius, in pixels.
antiAliasStrengthnumberYesYesAnti-aliasing filter strength.
shadowScalenumberYesYesShadow region scaling factor.
dngPrivateDataArrayBufferYesYesVendor-specific data block.
makerNoteSafetynumberYesYesWhether the EXIF MakerNote is secure and can be retained. The value 1 indicates yes, and the value 0 indicates no.
calibrationIlluminant1numberYesYesType of the first calibration illuminant.
calibrationIlluminant2numberYesYesType of the second calibration illuminant.
bestQualityScalenumberYesYesScaling ratio for the optimal image quality.
rawDataUniqueIDstringYesYesUnique ID of the raw image data.
originalRawFileNamestringYesYesOriginal raw file name.
originalRawFileDataArrayBufferYesYesComplete data of the original raw file.
activeAreanumber[]YesYesValid image area.
maskedAreasnumber[]YesYesList of masked areas.
asShotICCProfileArrayBufferYesYesICC color profile used at capture.
asShotPreProfileMatrixnumber[]YesYesPre-transformation matrix before the ICC color profile is applied.
currentICCProfileArrayBufferYesYesICC color profile in use.
currentPreProfileMatrixnumber[]YesYesPre-transformation matrix used before the current ICC color profile.
colorimetricReferencenumberYesYesChromaticity reference standard.
cameraCalibrationSignaturestringYesYesCamera calibration signature.
profileCalibrationSignaturestringYesYesProfile calibration signature.
extraCameraProfilesnumber[]YesYesList of additional camera profile indexes.
asShotProfileNamestringYesYesName of the profile used at capture.
noiseReductionAppliednumberYesYesApplied noise reduction intensity level.
profileNamestringYesYesColor profile name.
profileHueSatMapDimsnumber[]YesYesDimensions of the hue/saturation mapping table.
profileHueSatMapData1number[]YesYesFirst set of hue/saturation mapping table data.
profileHueSatMapData2number[]YesYesSecond set of hue/saturation mapping table data.
profileToneCurvenumber[]YesYesTone curve of the profile.
profileEmbedPolicynumberYesYesProfile embedding policy.
profileCopyrightstringYesYesProfile copyright information.
forwardMatrix1number[]YesYesFirst forward transformation matrix.
forwardMatrix2number[]YesYesSecond forward transformation matrix.
previewApplicationNamestringYesYesName of the application that generates the preview image.
previewApplicationVersionstringYesYesVersion of the application that generates the preview image.
previewSettingsNamestringYesYesName of the preview image processing configuration.
previewSettingsDigeststringYesYesMD5 digest of the preview image configuration.
previewColorSpacenumberYesYesColor space of the preview image.
previewDateTimestringYesYesPreview image generation time.
rawImageDigeststringYesYesMD5 digest of the raw image data.
originalRawFileDigeststringYesYesMD5 digest of the original raw file data.
subTileBlockSizenumber[]YesYesBlock length and width for image titled storage.
rowInterleaveFactornumberYesYesRow interleaving factor.
profileLookTableDimsnumber[]YesYesProfileLookTableData dimensions.
profileLookTableDatanumber[]YesYesColor table data.
opcodeList1ArrayBufferYesYesFirst operation code list.
opcodeList2ArrayBufferYesYesSecond operation code list.
opcodeList3ArrayBufferYesYesThird operation code list.
noiseProfilenumber[]YesYesNoise profile parameters.
originalDefaultFinalSizenumber[]YesYesOriginal default final output dimensions.
originalBestQualityFinalSizenumber[]YesYesOriginal output dimensions for optimal image quality.
originalDefaultCropSizenumber[]YesYesOriginal default crop dimensions.
profileHueSatMapEncodingnumberYesYesEncoding mode of the hue/saturation mapping table.
profileLookTableEncodingnumberYesYesColor table encoding mode.
baselineExposureOffsetnumberYesYesBaseline exposure offset, in EV.
defaultBlackRendernumberYesYesDefault black field rendering mode.
newRawImageDigeststringYesYesNew MD5 digest of the update raw image data.
rawToPreviewGainnumberYesYesGain ratio of the main raw image to the preview image.
defaultUserCropnumber[]YesYesDefault user crop area.

HdrGainmapMetadata12+

Describes the metadata keys used by a gain map, that is, the values available for HDR_GAINMAP_METADATA in HdrMetadataKey. For details, see ISO 21496-1.

System capability: SystemCapability.Multimedia.Image.Core

NameTypeRead OnlyOptionalDescription
writerVersionnumberNoNoVersion used by the metadata editor.
miniVersionnumberNoNoMinimum version that needs to be understood for metadata parsing.
gainmapChannelCountnumberNoNoNumber of color channels of the gain map. When the value is 3, the metadata values of the RGB channels are different. When the value is 1, the metadata values of the RGB channels are the same. For details, see ISO 21496-1.
useBaseColorFlagbooleanNoNoWhether the color space of the base graphic is used. For details, see ISO 21496-1. true if used, false otherwise.
baseHeadroomnumberNoNoHeadroom of the base graphic, which means the additional brightness that can be added to the base graphic. For details, see ISO 21496-1.
alternateHeadroomnumberNoNoHeadroom of the alternate graphic. For details, see ISO 21496-1.
channelsArray<GainmapChannel>NoNoNumber of channels. The length is 3. For details, see ISO 21496-1.

ImageReceiverOptions23+

Defines the initialization options for ImageReceiver.

Model restriction: This API can be used only in the stage model.

System capability: SystemCapability.Multimedia.Image.ImageReceiver

NameTypeRead OnlyOptionalDescription
sizeSizeNoYesImage size (including width and height), in pixels. Both the width and height values must be greater than 0.
This parameter does not affect the size of the received image. The actual returned size is determined by the producer, for example, the camera.
capacitynumberNoYesMaximum number of images that can be accessed concurrently. The value must be a positive integer less than or equal to 64.
This parameter is used only as an expected value. The actual capacity depends on the device hardware.

ImageBufferData23+

Saves the pointer to the image buffer data as well as the row stride and pixel stride information of different color components.

Model restriction: This API can be used only in the stage model.

System capability: SystemCapability.Multimedia.Image.Core

NameTypeRead OnlyOptionalDescription
rowStridenumber[]YesNoRow strides of color components, in bytes.
This property is meaningless for encoded images such as JPEG images.
The camera preview stream data needs to be read by stride. For details, see Solution to Screen Artifacts During Camera Preview.
pixelStridenumber[]YesNoPixel strides of color components, in bytes.
This property is meaningless for encoded images such as JPEG images.
byteBufferArrayBufferYesNoImage buffer.

ImageRawData24+

Describes the image raw data.

Model restriction: This API can be used only in the stage model.

System capability: SystemCapability.Multimedia.Image.Core

NameTypeRead OnlyOptionalDescription
bufferArrayBufferNoNoImage buffer.
bitsPerPixelnumberNoNoNumber of bits occupied by each pixel in the buffer data, in bits.

GetImagePropertyOptions(deprecated)

Describes the image properties.

NOTE

This API is supported since API version 7 and is deprecated since API version 11. You are advised to use ImagePropertyOptions instead.

System capability: SystemCapability.Multimedia.Image.ImageSource

NameTypeRead OnlyOptionalDescription
indexnumberNoYesIndex of the image. The default value is 0.
defaultValuestringNoYesDefault property value. The default value is null.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 capi-image-nativemodule-oh-pixelmap-hdrmetadatavalue

openharmony 鸿蒙 capi-image-imagepacker-opts-

openharmony 鸿蒙 capi-image-nativemodule-image-region

openharmony 鸿蒙 capi-image-imagepacker-native-

openharmony 鸿蒙 capi-image-imagenative-

openharmony 鸿蒙 capi-image-processing-h

openharmony 鸿蒙 capi-image-ohosimagesourcesupportedformat

openharmony 鸿蒙 capi-image-nativemodule-image-size

openharmony 鸿蒙 capi-image-mdk-h

openharmony 鸿蒙 capi-image-ohosimagesourcedelaytimelist

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