1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#![allow(non_snake_case)]
use crate::drawing::shader_effect::OH_Drawing_TileMode;
use crate::drawing::types::{
OH_Drawing_Image, OH_Drawing_Matrix, OH_Drawing_Point2D, OH_Drawing_SamplingOptions,
OH_Drawing_ShaderEffect,
};
extern "C" {
/** @brief Creates an <b>OH_Drawing_ShaderEffect</b> that generates a shader with single color.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@param color Indicates the color used by the shader.
@return Returns the pointer to the <b>OH_Drawing_ShaderEffect</b> object created.
If nullptr is returned, the creation fails.
The possible cause of the failure is that the available memory is empty.
@since 12
@version 1.0*/
pub fn OH_Drawing_ShaderEffectCreateColorShader(color: u32) -> *mut OH_Drawing_ShaderEffect;
/** @brief Creates an <b>OH_Drawing_ShaderEffect</b> that generates a linear gradient between the two specified points.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@param startPt Indicates the start point for the gradient.
@param endPt Indicates the end point for the gradient.
@param colors Indicates the colors to be distributed between the two points.
@param pos Indicates the relative position of each corresponding color in the colors array.
If pos is nullptr, the colors are evenly distributed between the start and end point.
@param size Indicates the number of colors and pos(if pos is not nullptr).
@param OH_Drawing_TileMode Indicates the tile mode.
@param OH_Drawing_Matrix Indicates the pointer to an <b>OH_Drawing_Matrix</b> object,
which represents the local matrix of the created <b>OH_Drawing_ShaderEffect</b> object.
If matrix is nullptr, defaults to the identity matrix.
@return Returns the pointer to the <b>OH_Drawing_ShaderEffect</b> object created.
If nullptr is returned, the creation fails.
The possible cause of the failure is any of startPt, endPt, colors and pos is nullptr.
@since 12
@version 1.0*/
pub fn OH_Drawing_ShaderEffectCreateLinearGradientWithLocalMatrix(
startPt: *const OH_Drawing_Point2D,
endPt: *const OH_Drawing_Point2D,
colors: *const u32,
pos: *const f32,
size: u32,
arg1: OH_Drawing_TileMode,
arg2: *const OH_Drawing_Matrix,
) -> *mut OH_Drawing_ShaderEffect;
/** @brief Creates an <b>OH_Drawing_ShaderEffect</b> that generates a radial gradient given the center and radius.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@param centerPt Indicates the center of the circle for the gradient.
@param radius Indicates the radius of the circle for this gradient.
@param colors Indicates the colors to be distributed between the two points.
@param pos Indicates the relative position of each corresponding color in the colors array.
@param size Indicates the number of colors and pos.
@param OH_Drawing_TileMode Indicates the tile mode.
@param OH_Drawing_Matrix Indicates the pointer to an <b>OH_Drawing_Matrix</b> object,
which represents the local matrix of the created <b>OH_Drawing_ShaderEffect</b> object.
If matrix is nullptr, defaults to the identity matrix.
@return Returns the pointer to the <b>OH_Drawing_ShaderEffect</b> object created.
If nullptr is returned, the creation fails.
The possible cause of the failure is any of centerPt, colors and pos is nullptr.
@since 12
@version 1.0*/
pub fn OH_Drawing_ShaderEffectCreateRadialGradientWithLocalMatrix(
centerPt: *const OH_Drawing_Point2D,
radius: f32,
colors: *const u32,
pos: *const f32,
size: u32,
arg1: OH_Drawing_TileMode,
arg2: *const OH_Drawing_Matrix,
) -> *mut OH_Drawing_ShaderEffect;
/** @brief Creates an <b>OH_Drawing_ShaderEffect</b> that generates a image shader.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@param OH_Drawing_Image Indicates the pointer to an <b>OH_Drawing_Image</b> object.
@param tileX Indicates the tileX.
@param tileY Indicates the tileY.
@param OH_Drawing_SamplingOptions Indicates the pointer to an <b>OH_Drawing_SamplingOptions</b> object.
@param OH_Drawing_Matrix Indicates the pointer to an <b>OH_Drawing_Matrix</b> object.
If matrix is nullptr, defaults to the identity matrix.
@return Returns the pointer to the <b>OH_Drawing_ShaderEffect</b> object created.
@since 12
@version 1.0*/
pub fn OH_Drawing_ShaderEffectCreateImageShader(
arg1: *mut OH_Drawing_Image,
tileX: OH_Drawing_TileMode,
tileY: OH_Drawing_TileMode,
arg2: *const OH_Drawing_SamplingOptions,
arg3: *const OH_Drawing_Matrix,
) -> *mut OH_Drawing_ShaderEffect;
/** @brief Creates an <b>OH_Drawing_ShaderEffect</b> that generates a conical gradient given two circles.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@param startPt Indicates the center of the start circle for the gradient.
@param startRadius Indicates the radius of the start circle for this gradient.
@param endPt Indicates the center of the start circle for the gradient.
@param endRadius Indicates the radius of the start circle for this gradient.
@param colors Indicates the colors to be distributed between the two points.
@param pos Indicates the relative position of each corresponding color in the colors array.
@param size Indicates the number of colors and pos.
@param OH_Drawing_TileMode Indicates the tile mode.
@param OH_Drawing_Matrix Indicates the pointer to an <b>OH_Drawing_Matrix</b> object,
which represents the local matrix of the created <b>OH_Drawing_ShaderEffect</b> object.
If matrix is nullptr, defaults to the identity matrix.
@return Returns the pointer to the <b>OH_Drawing_ShaderEffect</b> object created.
If nullptr is returned, the creation fails.
The possible cause of the failure is any of startPt, endPt, colors and pos is nullptr.
@since 12
@version 1.0*/
pub fn OH_Drawing_ShaderEffectCreateTwoPointConicalGradient(
startPt: *const OH_Drawing_Point2D,
startRadius: f32,
endPt: *const OH_Drawing_Point2D,
endRadius: f32,
colors: *const u32,
pos: *const f32,
size: u32,
arg1: OH_Drawing_TileMode,
arg2: *const OH_Drawing_Matrix,
) -> *mut OH_Drawing_ShaderEffect;
}