Blit enumerations

This section gives details on blit enumerations.

vg_lite_blend_t enumeration

This enumeration defines the blending modes supported by some VGLite API functions. S and D represent source and destination non-premultiplied RGB color channels. Sa and Da represent the source and destination alpha channels. SP and DP represent source and destination alpha-premultiplied RGB color channels (SP = S*Sa, DP = D*Da).

Note: VG_LITE_BLEND_*_LVGL modes are supported on all VG cores. On VG cores that do not support gcFEATURE_BIT_VG_LVGL_SUPPORT, the LVGL blend modes are supported by a combination of software and hardware operations. OPENVG_BLEND_* modes can only be supported on GC355 and GC555 cores.

Used in blit functions: vg_lite_blit, vg_lite_blit2, vg_lite_blit_rect.

Used in draw functions: vg_lite_draw, vg_lite_draw_grad, vg_lite_draw_radial_grad, vg_lite_draw_pattern.

vg_lite_blend_t String Values

Description

VG_LITE_BLEND_NONE

S, no blending Non-premultiplied

VG_LITE_BLEND_SRC_OVER

S + D * (1 - Sa) Non-premultiplied

VG_LITE_BLEND_DST_OVER

S * (1 – Da) + D Non-premultiplied

VG_LITE_BLEND_SRC_IN

S * Da Non-premultiplied

VG_LITE_BLEND_DST_IN

D * Sa Non-premultiplied

VG_LITE_BLEND_MULTIPLY

S * (1 - Da) + D * (1 - Sa) + S * D Non-premultiplied

VG_LITE_BLEND_SCREEN

S + D - S * D Non-premultiplied

VG_LITE_BLEND_DARKEN

min(SRC_OVER, DST_OVER) Non-premultiplied

VG_LITE_BLEND_LIGHTEN

max(SRC_OVER, DST_OVER) Non-premultiplied

VG_LITE_BLEND_ADDITIVE

S + D Non-premultiplied

VG_LITE_BLEND_SUBTRACT

D * (1 - Sa) Non-premultiplied

VG_LITE_BLEND_NORMAL_LVGL

S * Sa + D * (1 - Sa) Non-premultiplied (from March 2023)

VG_LITE_BLEND_ADDITIVE_LVGL

(S + D) * Sa + D * (1 - Sa) Non-premultiplied (from March 2023)

VG_LITE_BLEND_SUBTRACT_LVGL

(S - D) * Sa + D * (1 - Sa) Non-premultiplied (from March 2023)

VG_LITE_BLEND_MULTIPLY_LVGL

(S * D) * Sa + D * (1 - Sa) Non-premultiplied (from March 2023)

OpenVG Porter-Duff Blend String Values

(from Aug 2023)

OPENVG_BLEND_NONE

SP, no blending Premultiplied

OPENVG_BLEND_SRC_OVER

(SP + DP * (1 - Sa)) / (Sa + Da * (1 - Sa)) Premultiplied

OPENVG_BLEND_DST_OVER

(SP * (1 - Da) + DP) / (Sa * (1 - Da) + Da) Premultiplied

OPENVG_BLEND_SRC_IN

(SP * Da) / (Sa * Da) Premultiplied

OPENVG_BLEND_DST_IN

(DP * Sa) / (Sa * Da) Premultiplied

OPENVG_BLEND_MULTIPLY

(SP*DP + SP*(1 - Da) + DP*(1 - Sa)) / (Sa + Da*(1 - Sa)) Premultiplied

OPENVG_BLEND_SCREEN

(SP + DP - (SP*DP)) / (Sa + Da*(1 - Sa)) Premultiplied

OPENVG_BLEND_DARKEN

min(SRC_OVER, DST_OVER) Premultiplied

OPENVG_BLEND_LIGHTEN

max(SRC_OVER, DST_OVER) Premultiplied

OPENVG_BLEND_ADDITIVE

(SP + DP) / (Sa + Da) Premultiplied

Parent topic:Blit enumerations

vg_lite_color_t parameter

The common parameter vg_lite_color_t is described in Table 1.

Parent topic:Blit enumerations

vg_lite_color_transform_t structure

Specifies the pixel color_transform values for scale and bias.

Used in functions: vg_lite_set_color_transform.

vg_lite_color_transform_t members

Type

Description

a_scale

vg_lite_float_t

Scale value for alpha.

a_bias

vg_lite_float_t

Bias value for alpha.

r_scale

vg_lite_float_t

Scale value for red.

r_bias

vg_lite_float_t

Bias value for red.

g_scale

vg_lite_float_t

Scale value for green.

g_bias

vg_lite_float_t

Bias value for green.

b_scale

vg_lite_float_t

Scale value for blue.

b_bias

vg_lite_float_t

Bias value for blue.

Parent topic:Blit enumerations

vg_lite_filter_t enumeration

Specifies the sample-filtering mode in VGLite blit and draw APIs.

Used in blit functions: vg_lite_blit, vg_lite_blit_rect.

Used in draw functions: vg_lite_draw_radial_gradient, vg_lite_draw_pattern.

vg_lite_filter_t string values

Description

VG_LITE_FILTER_POINT

Fetch only the nearest image pixel

VG_LITE_FILTER_LINEAR

Use linear interpolation along a horizontal line

VG_LITE_FILTER_BI_LINEAR

Use a 2x2 box around the image pixel and perform an interpolation

VG_LITE_FILTER_GAUSSIAN

Perform 3x3 gaussian blur with the convolution for image pixel. (from March 2023)

Parent topic:Blit enumerations

vg_lite_color_transform_t structure

Specifies the pixel color_transform values for scale and bias.

Used in functions: vg_lite_set_color_transform.

vg_lite_color_transform_t members

Type

Description

a_scale

vg_lite_float_t

Scale value for alpha.

a_bias

vg_lite_float_t

Bias value for alpha.

r_scale

vg_lite_float_t

Scale value for red.

r_bias

vg_lite_float_t

Bias value for red.

g_scale

vg_lite_float_t

Scale value for green.

g_bias

vg_lite_float_t

Bias value for green.

b_scale

vg_lite_float_t

Scale value for blue.

b_bias

vg_lite_float_t

Bias value for blue.

Parent topic:Blit enumerations

vg_lite_mask_operation_t enumeration

Specifies the mask operation mode in VGLite blit APIs.

Used in functions: vg_lite_blend_masklayer, vg_lite_render_masklayer.

vg_lite_mask_operation_t string values

Description

VG_LITE_CLEAR_MASK

This operation sets all mask values in the region of interest to 0, ignoring the new mask layer.

VG_LITE_FILL_MASK

This operation sets all mask values in the region of interest to 1, ignoring the new mask layer.

VG_LITE_SET_MASK

This operation copies values in the region of interest from the new mask layer, overwriting the previous mask values.

VG_LITE_UNION_MASK

This operation replaces the previous mask in the region of interest by its union with the new mask layer. The resulting values are always greater than or equal to their previous value.

VG_LITE_INTERSECT_MASK

This operation replaces the previous mask in the region of interest by its intersection with the new mask layer. The resulting mask values are always less than or equal to their previous value.

VG_LITE_SUBTRACT_MASK

This operation subtracts the new mask from the previous mask and replaces the previous mask in the region of interest by the resulting mask. The resulting values are always less than or equal to their previous value.

Parent topic:Blit enumerations

vg_lite_orientation_t enumeration

Specifies the mirror orientation in VGLite blit APIs.

Used in functions: vg_lite_set_mirror.

vg_lite_orientation_t string values

Description

VG_LITE_ORIENTATION_TOP_BOTTOM

Target output orientation is from top to bottom (default).

VG_LITE_ORIENTATION_BOTTOM_TOP

Target output orientation is from bottom to top.

Parent topic:Blit enumerations

vg_lite_param_type_t enumeration

Specifies the parameter type in VGLite blit APIs.

Used in functions: vg_lite_get_parameter.

vg_lite_param_type_t string value

Description

VG_LITE_GPU_IDLE_STATE

The count must be 1 for GPU idle state TRUE or FALSE.

VG_LITE_SCISSOR_RECT

The count must be 4n for x, y, right, bottom.

Parent topic:Blit enumerations

Parent topic:Blits for compositing and blending