harmony 鸿蒙image_pixel_map_mdk.h

  • 2023-10-30
  • 浏览 (471)

image_pixel_map_mdk.h

Overview

The image_pixel_map_mdk.h file declares the APIs that can lock, access, and unlock a pixel map. Need link libpixelmapndk.z.so

Since

10

Related Modules

Image

Summary

Structs

Name Description
OhosPixelMapInfos Defines the pixel map information.
OhosPixelMapCreateOps Defines the options for creating a pixel map.

Types

Name Description
NativePixelMap Defines the data type name of the pixel map at the native layer.
OhosPixelMapInfos Defines the pixel map information.

Enums

Name Description
{ OHOS_PIXEL_MAP_ALPHA_TYPE_UNKNOWN = 0,
OHOS_PIXEL_MAP_ALPHA_TYPE_OPAQUE = 1,
OHOS_PIXEL_MAP_ALPHA_TYPE_PREMUL = 2,
OHOS_PIXEL_MAP_ALPHA_TYPE_UNPREMUL = 3 }
Enumerates the pixel map alpha types.
{ OHOS_PIXEL_MAP_READ_ONLY = 0,
OHOS_PIXEL_MAP_EDITABLE = 1 }
Enumerates the pixel map editing types.

Functions

Name Description
OH_PixelMap_CreatePixelMap (napi_env env, OhosPixelMapCreateOps info, void *buf, size_t len, napi_value *res) Creates a PixelMap object.
OH_PixelMap_CreateAlphaPixelMap (napi_env env, napi_value source, napi_value *alpha) Creates a PixelMap object that contains only alpha channel information.
OH_PixelMap_InitNativePixelMap (napi_env env, napi_value source) Initializes a PixelMap object.
OH_PixelMap_GetBytesNumberPerRow (const NativePixelMap *native, int32_t *num) Obtains the number of bytes per row of a NativePixelMap object.
OH_PixelMap_GetIsEditable (const NativePixelMap *native, int32_t *editable) Checks whether a NativePixelMap object is editable.
OH_PixelMap_IsSupportAlpha (const NativePixelMap *native, int32_t *alpha) Checks whether a NativePixelMap object supports alpha channels.
OH_PixelMap_SetAlphaAble (const NativePixelMap *native, int32_t alpha) Sets an alpha channel for a NativePixelMap object.
OH_PixelMap_GetDensity (const NativePixelMap *native, int32_t *density) Obtains the pixel density of a NativePixelMap object.
OH_PixelMap_SetDensity (const NativePixelMap *native, int32_t density) Sets the pixel density for a NativePixelMap object.
OH_PixelMap_SetOpacity (const NativePixelMap *native, float opacity) Sets the opacity for a NativePixelMap object.
OH_PixelMap_Scale (const NativePixelMap *native, float x, float y) Scales a NativePixelMap object.
OH_PixelMap_Translate (const NativePixelMap *native, float x, float y) Translates a NativePixelMap object.
OH_PixelMap_Rotate (const NativePixelMap *native, float angle) Rotates a NativePixelMap object.
OH_PixelMap_Flip (const NativePixelMap *native, int32_t x, int32_t y) Flips a NativePixelMap object.
OH_PixelMap_Crop (const NativePixelMap *native, int32_t x, int32_t y, int32_t width, int32_t height) Crops a NativePixelMap object.
OH_PixelMap_GetImageInfo (const NativePixelMap *native, OhosPixelMapInfos *info) Obtains the image information of a NativePixelMap object.
OH_PixelMap_AccessPixels (const NativePixelMap *native, void **addr) Obtains the memory address of a NativePixelMap object and locks the memory.
OH_PixelMap_UnAccessPixels (const NativePixelMap *native) Unlocks the memory of a NativePixelMap object. This function is used with OH_PixelMap_AccessPixels in pairs.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Native APIs

harmony 鸿蒙AVCapability

harmony 鸿蒙AVDemuxer

harmony 鸿蒙AVMuxer

harmony 鸿蒙AVScreenCapture

harmony 鸿蒙AVSource

harmony 鸿蒙AudioDecoder

harmony 鸿蒙AudioEncoder

harmony 鸿蒙CodecBase

harmony 鸿蒙Core

0  赞