Skip to main content

OH_Drawing_ShaderEffectCreateRadialGradientWithLocalMatrix

Function OH_Drawing_ShaderEffectCreateRadialGradientWithLocalMatrix 

Source
pub unsafe extern "C" fn OH_Drawing_ShaderEffectCreateRadialGradientWithLocalMatrix(
    centerPt: *const OH_Drawing_Point2D,
    radius: f32,
    colors: *const u32,
    pos: *const f32,
    size: u32,
    tileMode: OH_Drawing_TileMode,
    matrix: *const OH_Drawing_Matrix,
) -> *mut OH_Drawing_ShaderEffect
Expand description

@brief Creates an OH_Drawing_ShaderEffect object that generates a radial gradient based on the center and radius of a circle. The radial gradient transitions colors from the center to the ending shape in a radial manner. This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. If either centerPt or colors is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned. If tileMode is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is returned.

@param centerPt Center of the circle. @param radius Radius of the gradient. @param colors Colors to distribute in the radial direction. @param pos Relative position of each color in the color array. The array length must be the same as that of *colors . If pos is NULL, colors are evenly distributed in the radial direction. @param size Number of colors and positions (if pos is not NULL). @param tileMode Tile mode of the shader effect. For details about the available options, see {@link OH_Drawing_TileMode} . @param matrix Matrix applied on the shader effect. If matrix is NULL, an identity matrix is applied by default. @return Returns the pointer to the {@link OH_Drawing_ShaderEffect} object created. If NULL is returned, the creation fails. The possible failure cause is that no memory is available or at least one of the parameters centerPt and * colors is NULL. @since 12 @version 1.0