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

Types

Name Description
OH_Drawing_Canvas Defines a rectangular canvas on which various shapes, images, and texts can be drawn by using the brush and pen.
OH_Drawing_Pen Defines a pen, which is used to describe the style and color to outline a shape.
OH_Drawing_Brush Defines a brush, which is used to describe the style and color to fill in a shape.
OH_Drawing_Path Defines a path, which is used to customize various shapes.
OH_Drawing_Bitmap Defines a bitmap, which is a memory area that contains the pixel data of a shape.
OH_Drawing_Point Defines a coordinate point.
OH_Drawing_Rect Defines a rectangle.
OH_Drawing_RoundRect Defines a rounded rectangle.
OH_Drawing_Matrix Defines a matrix, which is used to describe coordinate transformation.
OH_Drawing_ShaderEffect Defines a shader, which is used to describe the source color of the drawn content.
OH_Drawing_Filter Defines a filter, which consists of a color filter and mask filter.
OH_Drawing_MaskFilter Defines a mask filter, which is used to convert the mask into a new one.
OH_Drawing_ColorFilter Defines a color filter, which is used to convert a color into a new one.
OH_Drawing_Font Defines a font.
OH_Drawing_Typeface Defines a typeface.
OH_Drawing_TextBlob Defines a TextBlob, an immutable container that holds multiple texts. Each text line consists of a glyph and position.
OH_Drawing_TextBlobBuilder Defines a TextBlob builder, which is used to build a TextBlob.

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 on the four channels (red, green, blue, and alpha). The operations for the alpha channel are used as examples.