harmony 鸿蒙drawing_types.h

  • 2025-06-12
  • 浏览 (3)

drawing_types.h

Overview

The drawing_types.h file declares the data types of the canvas, brush, pen, bitmap, and path used to draw 2D graphics.

File to include: <native_drawing/drawing_types.h>

Library: libnative_drawing.so

Since: 8

Related module: Drawing

Summary

Structs

Name Description
struct OH_Drawing_Point2D Describes a two-dimensional coordinate point.
struct OH_Drawing_Point3D Describes a three-dimensional coordinate point.
struct OH_Drawing_Image_Info Describes the image information.
struct OH_Drawing_RectStyle_Info Describes the style of a rectangle.
struct OH_Drawing_String Describes a string of characters encoded in UTF-16.

Types

Name Description
typedef struct OH_Drawing_Array OH_Drawing_Array Defines a struct for an array object, which is used to store multiple objects of the same type.
typedef struct OH_Drawing_String OH_Drawing_String Defines a struct for a string of characters encoded in UTF-16.
typedef struct OH_Drawing_Canvas OH_Drawing_Canvas Defines a struct for a rectangular canvas, on which various shapes, images, and texts can be drawn by using the brush and pen.
typedef struct OH_Drawing_Pen OH_Drawing_Pen Defines a struct for a pen, which is used to describe the style and color to outline a shape.
typedef struct OH_Drawing_Region OH_Drawing_Region Defines a struct for a region, which represents a closed area on the canvas for more accurate graphic control.
typedef struct OH_Drawing_Brush OH_Drawing_Brush Defines a struct for a brush, which is used to describe the style and color to fill in a shape.
typedef struct OH_Drawing_Path OH_Drawing_Path Defines a struct for a path, which is used to customize various shapes.
typedef struct OH_Drawing_PixelMap OH_Drawing_PixelMap Defines a struct for a pixel map, which is used to wrap the real pixel map supported by the image framework.
typedef struct OH_Drawing_Bitmap OH_Drawing_Bitmap Defines a struct for a bitmap, which is a memory area that contains the pixel data of a shape.
typedef struct OH_Drawing_Point OH_Drawing_Point Defines a struct for a coordinate point.
typedef struct OH_Drawing_ColorSpace OH_Drawing_ColorSpace Defines a struct for a color space, which is used to describe the color information.
typedef struct OH_Drawing_Point2D OH_Drawing_Point2D Defines a struct for a two-dimensional coordinate point.
typedef OH_Drawing_Point2D OH_Drawing_Corner_Radii Defines a struct for the radii of a rounded corner. The radii consist of the radius in the x-axis direction and that in the y-axis direction.
typedef struct OH_Drawing_Point3D OH_Drawing_Point3D Defines a struct for a three-dimensional coordinate point.
typedef struct OH_Drawing_PathEffect OH_Drawing_PathEffect Defines a struct for a path effect that affects the stroke.
typedef struct OH_Drawing_Rect OH_Drawing_Rect Defines a struct for a rectangle.
typedef struct OH_Drawing_RoundRect OH_Drawing_RoundRect Defines a struct for a rounded rectangle.
typedef struct OH_Drawing_Matrix OH_Drawing_Matrix Defines a struct for a matrix, which is used to describe coordinate transformation.
typedef struct OH_Drawing_ShaderEffect OH_Drawing_ShaderEffect Defines a struct for a shader effect, which is used to describe the source color of the drawn content.
typedef struct OH_Drawing_ShadowLayer OH_Drawing_ShadowLayer Defines a struct for a shadow, which is used to describe the shadow layer of the drawn content.
typedef struct OH_Drawing_Filter OH_Drawing_Filter Defines a struct for a filter, which consists of a color filter, mask filter, and image filter.
typedef struct OH_Drawing_MaskFilter OH_Drawing_MaskFilter Defines a struct for a mask filter.
typedef struct OH_Drawing_ColorFilter OH_Drawing_ColorFilter Defines a struct for a color filter, which is used to convert a color into a new one.
typedef struct OH_Drawing_ImageFilter OH_Drawing_ImageFilter Defines a struct for an image filter, which is used to operate all color bits that make up image pixels.
typedef struct OH_Drawing_Font OH_Drawing_Font Defines a struct for a font.
typedef struct OH_Drawing_MemoryStream OH_Drawing_MemoryStream Defines a struct for a memory stream.
typedef struct OH_Drawing_FontArguments OH_Drawing_FontArguments Defines a struct for font arguments.
typedef struct OH_Drawing_Typeface OH_Drawing_Typeface Defines a struct for a typeface.
typedef struct OH_Drawing_TextBlob OH_Drawing_TextBlob Defines a struct for a text blob, an immutable container that holds multiple texts. Each text blob consists of glyphs and position.
typedef struct OH_Drawing_Image OH_Drawing_Image Defines a struct for an image that describes a two-dimensional pixel array.
typedef struct OH_Drawing_SamplingOptions OH_Drawing_SamplingOptions Defines a struct for sampling options, which describe the sampling methods for images and bitmaps.
typedef struct OH_Drawing_TextBlobBuilder OH_Drawing_TextBlobBuilder Defines a struct for a text blob builder, which is used to build a text blob.
typedef struct OH_Drawing_GpuContext OH_Drawing_GpuContext Defines a struct for the GPU context, which is used to describe the GPU backend context.
typedef struct OH_Drawing_Surface OH_Drawing_Surface Defines a struct for a surface, which is used to manage the content drawn on the canvas.
typedef enum OH_Drawing_ColorFormat OH_Drawing_ColorFormat Defines an enum for storage formats of bitmap pixels.
typedef enum OH_Drawing_AlphaFormat OH_Drawing_AlphaFormat Defines an enum for alpha formats of bitmap pixels.
typedef enum OH_Drawing_BlendMode OH_Drawing_BlendMode Defines an enum for blend modes. In blend mode, each operation generates a new color for the two colors (source color and target color). These operations are the same for the red, green, and blue color channels (the alpha channel follows a different rule).
typedef struct OH_Drawing_Image_Info OH_Drawing_Image_Info Defines a struct that describes the image information.
typedef struct OH_Drawing_RectStyle_Info OH_Drawing_RectStyle_Info Defines a struct for the style of a rectangle.
typedef enum OH_Drawing_TextEncoding OH_Drawing_TextEncoding Defines an enum for text encoding types.
typedef struct OH_Drawing_FontMgr OH_Drawing_FontMgr Defines a struct for the font manager, which is used for font management.
typedef struct OH_Drawing_FontStyleSet OH_Drawing_FontStyleSet Defines a struct for a font style set, which is used for font style family matching.
typedef struct OH_Drawing_RecordCmdUtils OH_Drawing_RecordCmdUtils Defines the recording command tool, which is used to generate recording commands.
typedef struct OH_Drawing_RecordCmd OH_Drawing_RecordCmd Defines the recording command class, which is used to store the set of recording commands.

Enums

Name Description
OH_Drawing_ColorFormat {
COLOR_FORMAT_UNKNOWN, COLOR_FORMAT_ALPHA_8, COLOR_FORMAT_RGB_565, COLOR_FORMAT_ARGB_4444,
COLOR_FORMAT_RGBA_8888, COLOR_FORMAT_BGRA_8888
}
Enumerates the storage formats of bitmap pixels.
OH_Drawing_AlphaFormat { ALPHA_FORMAT_UNKNOWN, ALPHA_FORMAT_OPAQUE, ALPHA_FORMAT_PREMUL, ALPHA_FORMAT_UNPREMUL } Enumerates the alpha formats of bitmap pixels.
OH_Drawing_BlendMode {
BLEND_MODE_CLEAR, BLEND_MODE_SRC, BLEND_MODE_DST, BLEND_MODE_SRC_OVER,
BLEND_MODE_DST_OVER, BLEND_MODE_SRC_IN, BLEND_MODE_DST_IN, BLEND_MODE_SRC_OUT,
BLEND_MODE_DST_OUT, BLEND_MODE_SRC_ATOP, BLEND_MODE_DST_ATOP, BLEND_MODE_XOR,
BLEND_MODE_PLUS, BLEND_MODE_MODULATE, BLEND_MODE_SCREEN, BLEND_MODE_OVERLAY,
BLEND_MODE_DARKEN, BLEND_MODE_LIGHTEN, BLEND_MODE_COLOR_DODGE, BLEND_MODE_COLOR_BURN,
BLEND_MODE_HARD_LIGHT, BLEND_MODE_SOFT_LIGHT, BLEND_MODE_DIFFERENCE, BLEND_MODE_EXCLUSION,
BLEND_MODE_MULTIPLY, BLEND_MODE_HUE, BLEND_MODE_SATURATION, BLEND_MODE_COLOR,
BLEND_MODE_LUMINOSITY
}
Enumerates the blend modes. In blend mode, each operation generates a new color for the two colors (source color and target color). These operations are the same for the red, green, and blue color channels (the alpha channel follows a different rule).
OH_Drawing_TextEncoding { TEXT_ENCODING_UTF8, TEXT_ENCODING_UTF16, TEXT_ENCODING_UTF32, TEXT_ENCODING_GLYPH_ID } Enumerates the text encoding types.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙ArkGraphics 2D

harmony 鸿蒙BufferHandle

harmony 鸿蒙ColorSpacePrimaries

harmony 鸿蒙DisplaySoloist_ExpectedRateRange

harmony 鸿蒙_drawing

harmony 鸿蒙NativeColorSpaceManager

harmony 鸿蒙NativeDisplaySoloist

harmony 鸿蒙NativeVsync

harmony 鸿蒙NativeWindow

harmony 鸿蒙OH_Drawing_BitmapFormat

0  赞