1*2d1272b8SAndroid Build Coastguard Worker /* 2*2d1272b8SAndroid Build Coastguard Worker * Copyright © 2022 Matthias Clasen 3*2d1272b8SAndroid Build Coastguard Worker * 4*2d1272b8SAndroid Build Coastguard Worker * This is part of HarfBuzz, a text shaping library. 5*2d1272b8SAndroid Build Coastguard Worker * 6*2d1272b8SAndroid Build Coastguard Worker * Permission is hereby granted, without written agreement and without 7*2d1272b8SAndroid Build Coastguard Worker * license or royalty fees, to use, copy, modify, and distribute this 8*2d1272b8SAndroid Build Coastguard Worker * software and its documentation for any purpose, provided that the 9*2d1272b8SAndroid Build Coastguard Worker * above copyright notice and the following two paragraphs appear in 10*2d1272b8SAndroid Build Coastguard Worker * all copies of this software. 11*2d1272b8SAndroid Build Coastguard Worker * 12*2d1272b8SAndroid Build Coastguard Worker * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR 13*2d1272b8SAndroid Build Coastguard Worker * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 14*2d1272b8SAndroid Build Coastguard Worker * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN 15*2d1272b8SAndroid Build Coastguard Worker * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 16*2d1272b8SAndroid Build Coastguard Worker * DAMAGE. 17*2d1272b8SAndroid Build Coastguard Worker * 18*2d1272b8SAndroid Build Coastguard Worker * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, 19*2d1272b8SAndroid Build Coastguard Worker * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20*2d1272b8SAndroid Build Coastguard Worker * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 21*2d1272b8SAndroid Build Coastguard Worker * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO 22*2d1272b8SAndroid Build Coastguard Worker * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 23*2d1272b8SAndroid Build Coastguard Worker */ 24*2d1272b8SAndroid Build Coastguard Worker 25*2d1272b8SAndroid Build Coastguard Worker #if !defined(HB_H_IN) && !defined(HB_NO_SINGLE_HEADER_ERROR) 26*2d1272b8SAndroid Build Coastguard Worker #error "Include <hb.h> instead." 27*2d1272b8SAndroid Build Coastguard Worker #endif 28*2d1272b8SAndroid Build Coastguard Worker 29*2d1272b8SAndroid Build Coastguard Worker #ifndef HB_PAINT_H 30*2d1272b8SAndroid Build Coastguard Worker #define HB_PAINT_H 31*2d1272b8SAndroid Build Coastguard Worker 32*2d1272b8SAndroid Build Coastguard Worker #include "hb-common.h" 33*2d1272b8SAndroid Build Coastguard Worker 34*2d1272b8SAndroid Build Coastguard Worker HB_BEGIN_DECLS 35*2d1272b8SAndroid Build Coastguard Worker 36*2d1272b8SAndroid Build Coastguard Worker 37*2d1272b8SAndroid Build Coastguard Worker /** 38*2d1272b8SAndroid Build Coastguard Worker * hb_paint_funcs_t: 39*2d1272b8SAndroid Build Coastguard Worker * 40*2d1272b8SAndroid Build Coastguard Worker * Glyph paint callbacks. 41*2d1272b8SAndroid Build Coastguard Worker * 42*2d1272b8SAndroid Build Coastguard Worker * The callbacks assume that the caller maintains a stack 43*2d1272b8SAndroid Build Coastguard Worker * of current transforms, clips and intermediate surfaces, 44*2d1272b8SAndroid Build Coastguard Worker * as evidenced by the pairs of push/pop callbacks. The 45*2d1272b8SAndroid Build Coastguard Worker * push/pop calls will be properly nested, so it is fine 46*2d1272b8SAndroid Build Coastguard Worker * to store the different kinds of object on a single stack. 47*2d1272b8SAndroid Build Coastguard Worker * 48*2d1272b8SAndroid Build Coastguard Worker * Not all callbacks are required for all kinds of glyphs. 49*2d1272b8SAndroid Build Coastguard Worker * For rendering COLRv0 or non-color outline glyphs, the 50*2d1272b8SAndroid Build Coastguard Worker * gradient callbacks are not needed, and the composite 51*2d1272b8SAndroid Build Coastguard Worker * callback only needs to handle simple alpha compositing 52*2d1272b8SAndroid Build Coastguard Worker * (#HB_PAINT_COMPOSITE_MODE_SRC_OVER). 53*2d1272b8SAndroid Build Coastguard Worker * 54*2d1272b8SAndroid Build Coastguard Worker * The paint-image callback is only needed for glyphs 55*2d1272b8SAndroid Build Coastguard Worker * with image blobs in the CBDT, sbix or SVG tables. 56*2d1272b8SAndroid Build Coastguard Worker * 57*2d1272b8SAndroid Build Coastguard Worker * The custom-palette-color callback is only necessary if 58*2d1272b8SAndroid Build Coastguard Worker * you want to override colors from the font palette with 59*2d1272b8SAndroid Build Coastguard Worker * custom colors. 60*2d1272b8SAndroid Build Coastguard Worker * 61*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 62*2d1272b8SAndroid Build Coastguard Worker **/ 63*2d1272b8SAndroid Build Coastguard Worker typedef struct hb_paint_funcs_t hb_paint_funcs_t; 64*2d1272b8SAndroid Build Coastguard Worker 65*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN hb_paint_funcs_t * 66*2d1272b8SAndroid Build Coastguard Worker hb_paint_funcs_create (void); 67*2d1272b8SAndroid Build Coastguard Worker 68*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN hb_paint_funcs_t * 69*2d1272b8SAndroid Build Coastguard Worker hb_paint_funcs_get_empty (void); 70*2d1272b8SAndroid Build Coastguard Worker 71*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN hb_paint_funcs_t * 72*2d1272b8SAndroid Build Coastguard Worker hb_paint_funcs_reference (hb_paint_funcs_t *funcs); 73*2d1272b8SAndroid Build Coastguard Worker 74*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN void 75*2d1272b8SAndroid Build Coastguard Worker hb_paint_funcs_destroy (hb_paint_funcs_t *funcs); 76*2d1272b8SAndroid Build Coastguard Worker 77*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN hb_bool_t 78*2d1272b8SAndroid Build Coastguard Worker hb_paint_funcs_set_user_data (hb_paint_funcs_t *funcs, 79*2d1272b8SAndroid Build Coastguard Worker hb_user_data_key_t *key, 80*2d1272b8SAndroid Build Coastguard Worker void * data, 81*2d1272b8SAndroid Build Coastguard Worker hb_destroy_func_t destroy, 82*2d1272b8SAndroid Build Coastguard Worker hb_bool_t replace); 83*2d1272b8SAndroid Build Coastguard Worker 84*2d1272b8SAndroid Build Coastguard Worker 85*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN void * 86*2d1272b8SAndroid Build Coastguard Worker hb_paint_funcs_get_user_data (const hb_paint_funcs_t *funcs, 87*2d1272b8SAndroid Build Coastguard Worker hb_user_data_key_t *key); 88*2d1272b8SAndroid Build Coastguard Worker 89*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN void 90*2d1272b8SAndroid Build Coastguard Worker hb_paint_funcs_make_immutable (hb_paint_funcs_t *funcs); 91*2d1272b8SAndroid Build Coastguard Worker 92*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN hb_bool_t 93*2d1272b8SAndroid Build Coastguard Worker hb_paint_funcs_is_immutable (hb_paint_funcs_t *funcs); 94*2d1272b8SAndroid Build Coastguard Worker 95*2d1272b8SAndroid Build Coastguard Worker /** 96*2d1272b8SAndroid Build Coastguard Worker * hb_paint_push_transform_func_t: 97*2d1272b8SAndroid Build Coastguard Worker * @funcs: paint functions object 98*2d1272b8SAndroid Build Coastguard Worker * @paint_data: The data accompanying the paint functions in hb_font_paint_glyph() 99*2d1272b8SAndroid Build Coastguard Worker * @xx: xx component of the transform matrix 100*2d1272b8SAndroid Build Coastguard Worker * @yx: yx component of the transform matrix 101*2d1272b8SAndroid Build Coastguard Worker * @xy: xy component of the transform matrix 102*2d1272b8SAndroid Build Coastguard Worker * @yy: yy component of the transform matrix 103*2d1272b8SAndroid Build Coastguard Worker * @dx: dx component of the transform matrix 104*2d1272b8SAndroid Build Coastguard Worker * @dy: dy component of the transform matrix 105*2d1272b8SAndroid Build Coastguard Worker * @user_data: User data pointer passed to hb_paint_funcs_set_push_transform_func() 106*2d1272b8SAndroid Build Coastguard Worker * 107*2d1272b8SAndroid Build Coastguard Worker * A virtual method for the #hb_paint_funcs_t to apply 108*2d1272b8SAndroid Build Coastguard Worker * a transform to subsequent paint calls. 109*2d1272b8SAndroid Build Coastguard Worker * 110*2d1272b8SAndroid Build Coastguard Worker * This transform is applied after the current transform, 111*2d1272b8SAndroid Build Coastguard Worker * and remains in effect until a matching call to 112*2d1272b8SAndroid Build Coastguard Worker * the #hb_paint_funcs_pop_transform_func_t vfunc. 113*2d1272b8SAndroid Build Coastguard Worker * 114*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 115*2d1272b8SAndroid Build Coastguard Worker */ 116*2d1272b8SAndroid Build Coastguard Worker typedef void (*hb_paint_push_transform_func_t) (hb_paint_funcs_t *funcs, 117*2d1272b8SAndroid Build Coastguard Worker void *paint_data, 118*2d1272b8SAndroid Build Coastguard Worker float xx, float yx, 119*2d1272b8SAndroid Build Coastguard Worker float xy, float yy, 120*2d1272b8SAndroid Build Coastguard Worker float dx, float dy, 121*2d1272b8SAndroid Build Coastguard Worker void *user_data); 122*2d1272b8SAndroid Build Coastguard Worker 123*2d1272b8SAndroid Build Coastguard Worker /** 124*2d1272b8SAndroid Build Coastguard Worker * hb_paint_pop_transform_func_t: 125*2d1272b8SAndroid Build Coastguard Worker * @funcs: paint functions object 126*2d1272b8SAndroid Build Coastguard Worker * @paint_data: The data accompanying the paint functions in hb_font_paint_glyph() 127*2d1272b8SAndroid Build Coastguard Worker * @user_data: User data pointer passed to hb_paint_funcs_set_pop_transform_func() 128*2d1272b8SAndroid Build Coastguard Worker * 129*2d1272b8SAndroid Build Coastguard Worker * A virtual method for the #hb_paint_funcs_t to undo 130*2d1272b8SAndroid Build Coastguard Worker * the effect of a prior call to the #hb_paint_funcs_push_transform_func_t 131*2d1272b8SAndroid Build Coastguard Worker * vfunc. 132*2d1272b8SAndroid Build Coastguard Worker * 133*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 134*2d1272b8SAndroid Build Coastguard Worker */ 135*2d1272b8SAndroid Build Coastguard Worker typedef void (*hb_paint_pop_transform_func_t) (hb_paint_funcs_t *funcs, 136*2d1272b8SAndroid Build Coastguard Worker void *paint_data, 137*2d1272b8SAndroid Build Coastguard Worker void *user_data); 138*2d1272b8SAndroid Build Coastguard Worker 139*2d1272b8SAndroid Build Coastguard Worker /** 140*2d1272b8SAndroid Build Coastguard Worker * hb_paint_color_glyph_func_t: 141*2d1272b8SAndroid Build Coastguard Worker * @funcs: paint functions object 142*2d1272b8SAndroid Build Coastguard Worker * @paint_data: The data accompanying the paint functions in hb_font_paint_glyph() 143*2d1272b8SAndroid Build Coastguard Worker * @glyph: the glyph ID 144*2d1272b8SAndroid Build Coastguard Worker * @font: the font 145*2d1272b8SAndroid Build Coastguard Worker * @user_data: User data pointer passed to hb_paint_funcs_set_color_glyph_func() 146*2d1272b8SAndroid Build Coastguard Worker * 147*2d1272b8SAndroid Build Coastguard Worker * A virtual method for the #hb_paint_funcs_t to render a color glyph by glyph index. 148*2d1272b8SAndroid Build Coastguard Worker * 149*2d1272b8SAndroid Build Coastguard Worker * Return value: %true if the glyph was painted, %false otherwise. 150*2d1272b8SAndroid Build Coastguard Worker * 151*2d1272b8SAndroid Build Coastguard Worker * Since: 8.2.0 152*2d1272b8SAndroid Build Coastguard Worker */ 153*2d1272b8SAndroid Build Coastguard Worker typedef hb_bool_t (*hb_paint_color_glyph_func_t) (hb_paint_funcs_t *funcs, 154*2d1272b8SAndroid Build Coastguard Worker void *paint_data, 155*2d1272b8SAndroid Build Coastguard Worker hb_codepoint_t glyph, 156*2d1272b8SAndroid Build Coastguard Worker hb_font_t *font, 157*2d1272b8SAndroid Build Coastguard Worker void *user_data); 158*2d1272b8SAndroid Build Coastguard Worker 159*2d1272b8SAndroid Build Coastguard Worker /** 160*2d1272b8SAndroid Build Coastguard Worker * hb_paint_push_clip_glyph_func_t: 161*2d1272b8SAndroid Build Coastguard Worker * @funcs: paint functions object 162*2d1272b8SAndroid Build Coastguard Worker * @paint_data: The data accompanying the paint functions in hb_font_paint_glyph() 163*2d1272b8SAndroid Build Coastguard Worker * @glyph: the glyph ID 164*2d1272b8SAndroid Build Coastguard Worker * @font: the font 165*2d1272b8SAndroid Build Coastguard Worker * @user_data: User data pointer passed to hb_paint_funcs_set_push_clip_glyph_func() 166*2d1272b8SAndroid Build Coastguard Worker * 167*2d1272b8SAndroid Build Coastguard Worker * A virtual method for the #hb_paint_funcs_t to clip 168*2d1272b8SAndroid Build Coastguard Worker * subsequent paint calls to the outline of a glyph. 169*2d1272b8SAndroid Build Coastguard Worker * 170*2d1272b8SAndroid Build Coastguard Worker * The coordinates of the glyph outline are interpreted according 171*2d1272b8SAndroid Build Coastguard Worker * to the current transform. 172*2d1272b8SAndroid Build Coastguard Worker * 173*2d1272b8SAndroid Build Coastguard Worker * This clip is applied in addition to the current clip, 174*2d1272b8SAndroid Build Coastguard Worker * and remains in effect until a matching call to 175*2d1272b8SAndroid Build Coastguard Worker * the #hb_paint_funcs_pop_clip_func_t vfunc. 176*2d1272b8SAndroid Build Coastguard Worker * 177*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 178*2d1272b8SAndroid Build Coastguard Worker */ 179*2d1272b8SAndroid Build Coastguard Worker typedef void (*hb_paint_push_clip_glyph_func_t) (hb_paint_funcs_t *funcs, 180*2d1272b8SAndroid Build Coastguard Worker void *paint_data, 181*2d1272b8SAndroid Build Coastguard Worker hb_codepoint_t glyph, 182*2d1272b8SAndroid Build Coastguard Worker hb_font_t *font, 183*2d1272b8SAndroid Build Coastguard Worker void *user_data); 184*2d1272b8SAndroid Build Coastguard Worker 185*2d1272b8SAndroid Build Coastguard Worker /** 186*2d1272b8SAndroid Build Coastguard Worker * hb_paint_push_clip_rectangle_func_t: 187*2d1272b8SAndroid Build Coastguard Worker * @funcs: paint functions object 188*2d1272b8SAndroid Build Coastguard Worker * @paint_data: The data accompanying the paint functions in hb_font_paint_glyph() 189*2d1272b8SAndroid Build Coastguard Worker * @xmin: min X for the rectangle 190*2d1272b8SAndroid Build Coastguard Worker * @ymin: min Y for the rectangle 191*2d1272b8SAndroid Build Coastguard Worker * @xmax: max X for the rectangle 192*2d1272b8SAndroid Build Coastguard Worker * @ymax: max Y for the rectangle 193*2d1272b8SAndroid Build Coastguard Worker * @user_data: User data pointer passed to hb_paint_funcs_set_push_clip_rectangle_func() 194*2d1272b8SAndroid Build Coastguard Worker * 195*2d1272b8SAndroid Build Coastguard Worker * A virtual method for the #hb_paint_funcs_t to clip 196*2d1272b8SAndroid Build Coastguard Worker * subsequent paint calls to a rectangle. 197*2d1272b8SAndroid Build Coastguard Worker * 198*2d1272b8SAndroid Build Coastguard Worker * The coordinates of the rectangle are interpreted according 199*2d1272b8SAndroid Build Coastguard Worker * to the current transform. 200*2d1272b8SAndroid Build Coastguard Worker * 201*2d1272b8SAndroid Build Coastguard Worker * This clip is applied in addition to the current clip, 202*2d1272b8SAndroid Build Coastguard Worker * and remains in effect until a matching call to 203*2d1272b8SAndroid Build Coastguard Worker * the #hb_paint_funcs_pop_clip_func_t vfunc. 204*2d1272b8SAndroid Build Coastguard Worker * 205*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 206*2d1272b8SAndroid Build Coastguard Worker */ 207*2d1272b8SAndroid Build Coastguard Worker typedef void (*hb_paint_push_clip_rectangle_func_t) (hb_paint_funcs_t *funcs, 208*2d1272b8SAndroid Build Coastguard Worker void *paint_data, 209*2d1272b8SAndroid Build Coastguard Worker float xmin, float ymin, 210*2d1272b8SAndroid Build Coastguard Worker float xmax, float ymax, 211*2d1272b8SAndroid Build Coastguard Worker void *user_data); 212*2d1272b8SAndroid Build Coastguard Worker 213*2d1272b8SAndroid Build Coastguard Worker /** 214*2d1272b8SAndroid Build Coastguard Worker * hb_paint_pop_clip_func_t: 215*2d1272b8SAndroid Build Coastguard Worker * @funcs: paint functions object 216*2d1272b8SAndroid Build Coastguard Worker * @paint_data: The data accompanying the paint functions in hb_font_paint_glyph() 217*2d1272b8SAndroid Build Coastguard Worker * @user_data: User data pointer passed to hb_paint_funcs_set_pop_clip_func() 218*2d1272b8SAndroid Build Coastguard Worker * 219*2d1272b8SAndroid Build Coastguard Worker * A virtual method for the #hb_paint_funcs_t to undo 220*2d1272b8SAndroid Build Coastguard Worker * the effect of a prior call to the #hb_paint_funcs_push_clip_glyph_func_t 221*2d1272b8SAndroid Build Coastguard Worker * or #hb_paint_funcs_push_clip_rectangle_func_t vfuncs. 222*2d1272b8SAndroid Build Coastguard Worker * 223*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 224*2d1272b8SAndroid Build Coastguard Worker */ 225*2d1272b8SAndroid Build Coastguard Worker typedef void (*hb_paint_pop_clip_func_t) (hb_paint_funcs_t *funcs, 226*2d1272b8SAndroid Build Coastguard Worker void *paint_data, 227*2d1272b8SAndroid Build Coastguard Worker void *user_data); 228*2d1272b8SAndroid Build Coastguard Worker 229*2d1272b8SAndroid Build Coastguard Worker /** 230*2d1272b8SAndroid Build Coastguard Worker * hb_paint_color_func_t: 231*2d1272b8SAndroid Build Coastguard Worker * @funcs: paint functions object 232*2d1272b8SAndroid Build Coastguard Worker * @paint_data: The data accompanying the paint functions in hb_font_paint_glyph() 233*2d1272b8SAndroid Build Coastguard Worker * @is_foreground: whether the color is the foreground 234*2d1272b8SAndroid Build Coastguard Worker * @color: The color to use, unpremultiplied 235*2d1272b8SAndroid Build Coastguard Worker * @user_data: User data pointer passed to hb_paint_funcs_set_color_func() 236*2d1272b8SAndroid Build Coastguard Worker * 237*2d1272b8SAndroid Build Coastguard Worker * A virtual method for the #hb_paint_funcs_t to paint a 238*2d1272b8SAndroid Build Coastguard Worker * color everywhere within the current clip. 239*2d1272b8SAndroid Build Coastguard Worker * 240*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 241*2d1272b8SAndroid Build Coastguard Worker */ 242*2d1272b8SAndroid Build Coastguard Worker typedef void (*hb_paint_color_func_t) (hb_paint_funcs_t *funcs, 243*2d1272b8SAndroid Build Coastguard Worker void *paint_data, 244*2d1272b8SAndroid Build Coastguard Worker hb_bool_t is_foreground, 245*2d1272b8SAndroid Build Coastguard Worker hb_color_t color, 246*2d1272b8SAndroid Build Coastguard Worker void *user_data); 247*2d1272b8SAndroid Build Coastguard Worker 248*2d1272b8SAndroid Build Coastguard Worker /** 249*2d1272b8SAndroid Build Coastguard Worker * HB_PAINT_IMAGE_FORMAT_PNG: 250*2d1272b8SAndroid Build Coastguard Worker * 251*2d1272b8SAndroid Build Coastguard Worker * Tag identifying PNG images in #hb_paint_image_func_t callbacks. 252*2d1272b8SAndroid Build Coastguard Worker * 253*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 254*2d1272b8SAndroid Build Coastguard Worker */ 255*2d1272b8SAndroid Build Coastguard Worker #define HB_PAINT_IMAGE_FORMAT_PNG HB_TAG('p','n','g',' ') 256*2d1272b8SAndroid Build Coastguard Worker 257*2d1272b8SAndroid Build Coastguard Worker /** 258*2d1272b8SAndroid Build Coastguard Worker * HB_PAINT_IMAGE_FORMAT_SVG: 259*2d1272b8SAndroid Build Coastguard Worker * 260*2d1272b8SAndroid Build Coastguard Worker * Tag identifying SVG images in #hb_paint_image_func_t callbacks. 261*2d1272b8SAndroid Build Coastguard Worker * 262*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 263*2d1272b8SAndroid Build Coastguard Worker */ 264*2d1272b8SAndroid Build Coastguard Worker #define HB_PAINT_IMAGE_FORMAT_SVG HB_TAG('s','v','g',' ') 265*2d1272b8SAndroid Build Coastguard Worker 266*2d1272b8SAndroid Build Coastguard Worker /** 267*2d1272b8SAndroid Build Coastguard Worker * HB_PAINT_IMAGE_FORMAT_BGRA: 268*2d1272b8SAndroid Build Coastguard Worker * 269*2d1272b8SAndroid Build Coastguard Worker * Tag identifying raw pixel-data images in #hb_paint_image_func_t callbacks. 270*2d1272b8SAndroid Build Coastguard Worker * The data is in BGRA pre-multiplied sRGBA color-space format. 271*2d1272b8SAndroid Build Coastguard Worker * 272*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 273*2d1272b8SAndroid Build Coastguard Worker */ 274*2d1272b8SAndroid Build Coastguard Worker #define HB_PAINT_IMAGE_FORMAT_BGRA HB_TAG('B','G','R','A') 275*2d1272b8SAndroid Build Coastguard Worker 276*2d1272b8SAndroid Build Coastguard Worker /** 277*2d1272b8SAndroid Build Coastguard Worker * hb_paint_image_func_t: 278*2d1272b8SAndroid Build Coastguard Worker * @funcs: paint functions object 279*2d1272b8SAndroid Build Coastguard Worker * @paint_data: The data accompanying the paint functions in hb_font_paint_glyph() 280*2d1272b8SAndroid Build Coastguard Worker * @image: the image data 281*2d1272b8SAndroid Build Coastguard Worker * @width: width of the raster image in pixels, or 0 282*2d1272b8SAndroid Build Coastguard Worker * @height: height of the raster image in pixels, or 0 283*2d1272b8SAndroid Build Coastguard Worker * @format: the image format as a tag 284*2d1272b8SAndroid Build Coastguard Worker * @slant: the synthetic slant ratio to be applied to the image during rendering 285*2d1272b8SAndroid Build Coastguard Worker * @extents: (nullable): glyph extents for desired rendering 286*2d1272b8SAndroid Build Coastguard Worker * @user_data: User data pointer passed to hb_paint_funcs_set_image_func() 287*2d1272b8SAndroid Build Coastguard Worker * 288*2d1272b8SAndroid Build Coastguard Worker * A virtual method for the #hb_paint_funcs_t to paint a glyph image. 289*2d1272b8SAndroid Build Coastguard Worker * 290*2d1272b8SAndroid Build Coastguard Worker * This method is called for glyphs with image blobs in the CBDT, 291*2d1272b8SAndroid Build Coastguard Worker * sbix or SVG tables. The @format identifies the kind of data that 292*2d1272b8SAndroid Build Coastguard Worker * is contained in @image. Possible values include #HB_PAINT_IMAGE_FORMAT_PNG, 293*2d1272b8SAndroid Build Coastguard Worker * #HB_PAINT_IMAGE_FORMAT_SVG and #HB_PAINT_IMAGE_FORMAT_BGRA. 294*2d1272b8SAndroid Build Coastguard Worker * 295*2d1272b8SAndroid Build Coastguard Worker * The image dimensions and glyph extents are provided if available, 296*2d1272b8SAndroid Build Coastguard Worker * and should be used to size and position the image. 297*2d1272b8SAndroid Build Coastguard Worker * 298*2d1272b8SAndroid Build Coastguard Worker * Return value: Whether the operation was successful. 299*2d1272b8SAndroid Build Coastguard Worker * 300*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 301*2d1272b8SAndroid Build Coastguard Worker */ 302*2d1272b8SAndroid Build Coastguard Worker typedef hb_bool_t (*hb_paint_image_func_t) (hb_paint_funcs_t *funcs, 303*2d1272b8SAndroid Build Coastguard Worker void *paint_data, 304*2d1272b8SAndroid Build Coastguard Worker hb_blob_t *image, 305*2d1272b8SAndroid Build Coastguard Worker unsigned int width, 306*2d1272b8SAndroid Build Coastguard Worker unsigned int height, 307*2d1272b8SAndroid Build Coastguard Worker hb_tag_t format, 308*2d1272b8SAndroid Build Coastguard Worker float slant, 309*2d1272b8SAndroid Build Coastguard Worker hb_glyph_extents_t *extents, 310*2d1272b8SAndroid Build Coastguard Worker void *user_data); 311*2d1272b8SAndroid Build Coastguard Worker 312*2d1272b8SAndroid Build Coastguard Worker /** 313*2d1272b8SAndroid Build Coastguard Worker * hb_color_stop_t: 314*2d1272b8SAndroid Build Coastguard Worker * @offset: the offset of the color stop 315*2d1272b8SAndroid Build Coastguard Worker * @is_foreground: whether the color is the foreground 316*2d1272b8SAndroid Build Coastguard Worker * @color: the color, unpremultiplied 317*2d1272b8SAndroid Build Coastguard Worker * 318*2d1272b8SAndroid Build Coastguard Worker * Information about a color stop on a color line. 319*2d1272b8SAndroid Build Coastguard Worker * 320*2d1272b8SAndroid Build Coastguard Worker * Color lines typically have offsets ranging between 0 and 1, 321*2d1272b8SAndroid Build Coastguard Worker * but that is not required. 322*2d1272b8SAndroid Build Coastguard Worker * 323*2d1272b8SAndroid Build Coastguard Worker * Note: despite @color being unpremultiplied here, interpolation in 324*2d1272b8SAndroid Build Coastguard Worker * gradients shall happen in premultiplied space. See the OpenType spec 325*2d1272b8SAndroid Build Coastguard Worker * [COLR](https://learn.microsoft.com/en-us/typography/opentype/spec/colr) 326*2d1272b8SAndroid Build Coastguard Worker * section for details. 327*2d1272b8SAndroid Build Coastguard Worker * 328*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 329*2d1272b8SAndroid Build Coastguard Worker */ 330*2d1272b8SAndroid Build Coastguard Worker typedef struct { 331*2d1272b8SAndroid Build Coastguard Worker float offset; 332*2d1272b8SAndroid Build Coastguard Worker hb_bool_t is_foreground; 333*2d1272b8SAndroid Build Coastguard Worker hb_color_t color; 334*2d1272b8SAndroid Build Coastguard Worker } hb_color_stop_t; 335*2d1272b8SAndroid Build Coastguard Worker 336*2d1272b8SAndroid Build Coastguard Worker /** 337*2d1272b8SAndroid Build Coastguard Worker * hb_paint_extend_t: 338*2d1272b8SAndroid Build Coastguard Worker * @HB_PAINT_EXTEND_PAD: Outside the defined interval, 339*2d1272b8SAndroid Build Coastguard Worker * the color of the closest color stop is used. 340*2d1272b8SAndroid Build Coastguard Worker * @HB_PAINT_EXTEND_REPEAT: The color line is repeated over 341*2d1272b8SAndroid Build Coastguard Worker * repeated multiples of the defined interval 342*2d1272b8SAndroid Build Coastguard Worker * @HB_PAINT_EXTEND_REFLECT: The color line is repeated over 343*2d1272b8SAndroid Build Coastguard Worker * repeated intervals, as for the repeat mode. 344*2d1272b8SAndroid Build Coastguard Worker * However, in each repeated interval, the ordering of 345*2d1272b8SAndroid Build Coastguard Worker * color stops is the reverse of the adjacent interval. 346*2d1272b8SAndroid Build Coastguard Worker * 347*2d1272b8SAndroid Build Coastguard Worker * The values of this enumeration determine how color values 348*2d1272b8SAndroid Build Coastguard Worker * outside the minimum and maximum defined offset on a #hb_color_line_t 349*2d1272b8SAndroid Build Coastguard Worker * are determined. 350*2d1272b8SAndroid Build Coastguard Worker * 351*2d1272b8SAndroid Build Coastguard Worker * See the OpenType spec [COLR](https://learn.microsoft.com/en-us/typography/opentype/spec/colr) 352*2d1272b8SAndroid Build Coastguard Worker * section for details. 353*2d1272b8SAndroid Build Coastguard Worker * 354*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 355*2d1272b8SAndroid Build Coastguard Worker */ 356*2d1272b8SAndroid Build Coastguard Worker typedef enum { 357*2d1272b8SAndroid Build Coastguard Worker HB_PAINT_EXTEND_PAD, 358*2d1272b8SAndroid Build Coastguard Worker HB_PAINT_EXTEND_REPEAT, 359*2d1272b8SAndroid Build Coastguard Worker HB_PAINT_EXTEND_REFLECT 360*2d1272b8SAndroid Build Coastguard Worker } hb_paint_extend_t; 361*2d1272b8SAndroid Build Coastguard Worker 362*2d1272b8SAndroid Build Coastguard Worker typedef struct hb_color_line_t hb_color_line_t; 363*2d1272b8SAndroid Build Coastguard Worker 364*2d1272b8SAndroid Build Coastguard Worker /** 365*2d1272b8SAndroid Build Coastguard Worker * hb_color_line_get_color_stops_func_t: 366*2d1272b8SAndroid Build Coastguard Worker * @color_line: a #hb_color_line_t object 367*2d1272b8SAndroid Build Coastguard Worker * @color_line_data: the data accompanying @color_line 368*2d1272b8SAndroid Build Coastguard Worker * @start: the index of the first color stop to return 369*2d1272b8SAndroid Build Coastguard Worker * @count: (inout) (optional): Input = the maximum number of feature tags to return; 370*2d1272b8SAndroid Build Coastguard Worker * Output = the actual number of feature tags returned (may be zero) 371*2d1272b8SAndroid Build Coastguard Worker * @color_stops: (out) (array length=count) (optional): Array of #hb_color_stop_t to populate 372*2d1272b8SAndroid Build Coastguard Worker * @user_data: the data accompanying this method 373*2d1272b8SAndroid Build Coastguard Worker * 374*2d1272b8SAndroid Build Coastguard Worker * A virtual method for the #hb_color_line_t to fetch color stops. 375*2d1272b8SAndroid Build Coastguard Worker * 376*2d1272b8SAndroid Build Coastguard Worker * Return value: the total number of color stops in @color_line 377*2d1272b8SAndroid Build Coastguard Worker * 378*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 379*2d1272b8SAndroid Build Coastguard Worker */ 380*2d1272b8SAndroid Build Coastguard Worker typedef unsigned int (*hb_color_line_get_color_stops_func_t) (hb_color_line_t *color_line, 381*2d1272b8SAndroid Build Coastguard Worker void *color_line_data, 382*2d1272b8SAndroid Build Coastguard Worker unsigned int start, 383*2d1272b8SAndroid Build Coastguard Worker unsigned int *count, 384*2d1272b8SAndroid Build Coastguard Worker hb_color_stop_t *color_stops, 385*2d1272b8SAndroid Build Coastguard Worker void *user_data); 386*2d1272b8SAndroid Build Coastguard Worker 387*2d1272b8SAndroid Build Coastguard Worker /** 388*2d1272b8SAndroid Build Coastguard Worker * hb_color_line_get_extend_func_t: 389*2d1272b8SAndroid Build Coastguard Worker * @color_line: a #hb_color_line_t object 390*2d1272b8SAndroid Build Coastguard Worker * @color_line_data: the data accompanying @color_line 391*2d1272b8SAndroid Build Coastguard Worker * @user_data: the data accompanying this method 392*2d1272b8SAndroid Build Coastguard Worker * 393*2d1272b8SAndroid Build Coastguard Worker * A virtual method for the @hb_color_line_t to fetches the extend mode. 394*2d1272b8SAndroid Build Coastguard Worker * 395*2d1272b8SAndroid Build Coastguard Worker * Return value: the extend mode of @color_line 396*2d1272b8SAndroid Build Coastguard Worker * 397*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 398*2d1272b8SAndroid Build Coastguard Worker */ 399*2d1272b8SAndroid Build Coastguard Worker typedef hb_paint_extend_t (*hb_color_line_get_extend_func_t) (hb_color_line_t *color_line, 400*2d1272b8SAndroid Build Coastguard Worker void *color_line_data, 401*2d1272b8SAndroid Build Coastguard Worker void *user_data); 402*2d1272b8SAndroid Build Coastguard Worker 403*2d1272b8SAndroid Build Coastguard Worker /** 404*2d1272b8SAndroid Build Coastguard Worker * hb_color_line_t: 405*2d1272b8SAndroid Build Coastguard Worker * 406*2d1272b8SAndroid Build Coastguard Worker * A struct containing color information for a gradient. 407*2d1272b8SAndroid Build Coastguard Worker * 408*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 409*2d1272b8SAndroid Build Coastguard Worker */ 410*2d1272b8SAndroid Build Coastguard Worker struct hb_color_line_t { 411*2d1272b8SAndroid Build Coastguard Worker void *data; 412*2d1272b8SAndroid Build Coastguard Worker 413*2d1272b8SAndroid Build Coastguard Worker hb_color_line_get_color_stops_func_t get_color_stops; 414*2d1272b8SAndroid Build Coastguard Worker void *get_color_stops_user_data; 415*2d1272b8SAndroid Build Coastguard Worker 416*2d1272b8SAndroid Build Coastguard Worker hb_color_line_get_extend_func_t get_extend; 417*2d1272b8SAndroid Build Coastguard Worker void *get_extend_user_data; 418*2d1272b8SAndroid Build Coastguard Worker 419*2d1272b8SAndroid Build Coastguard Worker void *reserved0; 420*2d1272b8SAndroid Build Coastguard Worker void *reserved1; 421*2d1272b8SAndroid Build Coastguard Worker void *reserved2; 422*2d1272b8SAndroid Build Coastguard Worker void *reserved3; 423*2d1272b8SAndroid Build Coastguard Worker void *reserved5; 424*2d1272b8SAndroid Build Coastguard Worker void *reserved6; 425*2d1272b8SAndroid Build Coastguard Worker void *reserved7; 426*2d1272b8SAndroid Build Coastguard Worker void *reserved8; 427*2d1272b8SAndroid Build Coastguard Worker }; 428*2d1272b8SAndroid Build Coastguard Worker 429*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN unsigned int 430*2d1272b8SAndroid Build Coastguard Worker hb_color_line_get_color_stops (hb_color_line_t *color_line, 431*2d1272b8SAndroid Build Coastguard Worker unsigned int start, 432*2d1272b8SAndroid Build Coastguard Worker unsigned int *count, 433*2d1272b8SAndroid Build Coastguard Worker hb_color_stop_t *color_stops); 434*2d1272b8SAndroid Build Coastguard Worker 435*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN hb_paint_extend_t 436*2d1272b8SAndroid Build Coastguard Worker hb_color_line_get_extend (hb_color_line_t *color_line); 437*2d1272b8SAndroid Build Coastguard Worker 438*2d1272b8SAndroid Build Coastguard Worker /** 439*2d1272b8SAndroid Build Coastguard Worker * hb_paint_linear_gradient_func_t: 440*2d1272b8SAndroid Build Coastguard Worker * @funcs: paint functions object 441*2d1272b8SAndroid Build Coastguard Worker * @paint_data: The data accompanying the paint functions in hb_font_paint_glyph() 442*2d1272b8SAndroid Build Coastguard Worker * @color_line: Color information for the gradient 443*2d1272b8SAndroid Build Coastguard Worker * @x0: X coordinate of the first point 444*2d1272b8SAndroid Build Coastguard Worker * @y0: Y coordinate of the first point 445*2d1272b8SAndroid Build Coastguard Worker * @x1: X coordinate of the second point 446*2d1272b8SAndroid Build Coastguard Worker * @y1: Y coordinate of the second point 447*2d1272b8SAndroid Build Coastguard Worker * @x2: X coordinate of the third point 448*2d1272b8SAndroid Build Coastguard Worker * @y2: Y coordinate of the third point 449*2d1272b8SAndroid Build Coastguard Worker * @user_data: User data pointer passed to hb_paint_funcs_set_linear_gradient_func() 450*2d1272b8SAndroid Build Coastguard Worker * 451*2d1272b8SAndroid Build Coastguard Worker * A virtual method for the #hb_paint_funcs_t to paint a linear 452*2d1272b8SAndroid Build Coastguard Worker * gradient everywhere within the current clip. 453*2d1272b8SAndroid Build Coastguard Worker * 454*2d1272b8SAndroid Build Coastguard Worker * The @color_line object contains information about the colors of the gradients. 455*2d1272b8SAndroid Build Coastguard Worker * It is only valid for the duration of the callback, you cannot keep it around. 456*2d1272b8SAndroid Build Coastguard Worker * 457*2d1272b8SAndroid Build Coastguard Worker * The coordinates of the points are interpreted according 458*2d1272b8SAndroid Build Coastguard Worker * to the current transform. 459*2d1272b8SAndroid Build Coastguard Worker * 460*2d1272b8SAndroid Build Coastguard Worker * See the OpenType spec [COLR](https://learn.microsoft.com/en-us/typography/opentype/spec/colr) 461*2d1272b8SAndroid Build Coastguard Worker * section for details on how the points define the direction 462*2d1272b8SAndroid Build Coastguard Worker * of the gradient, and how to interpret the @color_line. 463*2d1272b8SAndroid Build Coastguard Worker * 464*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 465*2d1272b8SAndroid Build Coastguard Worker */ 466*2d1272b8SAndroid Build Coastguard Worker typedef void (*hb_paint_linear_gradient_func_t) (hb_paint_funcs_t *funcs, 467*2d1272b8SAndroid Build Coastguard Worker void *paint_data, 468*2d1272b8SAndroid Build Coastguard Worker hb_color_line_t *color_line, 469*2d1272b8SAndroid Build Coastguard Worker float x0, float y0, 470*2d1272b8SAndroid Build Coastguard Worker float x1, float y1, 471*2d1272b8SAndroid Build Coastguard Worker float x2, float y2, 472*2d1272b8SAndroid Build Coastguard Worker void *user_data); 473*2d1272b8SAndroid Build Coastguard Worker 474*2d1272b8SAndroid Build Coastguard Worker /** 475*2d1272b8SAndroid Build Coastguard Worker * hb_paint_radial_gradient_func_t: 476*2d1272b8SAndroid Build Coastguard Worker * @funcs: paint functions object 477*2d1272b8SAndroid Build Coastguard Worker * @paint_data: The data accompanying the paint functions in hb_font_paint_glyph() 478*2d1272b8SAndroid Build Coastguard Worker * @color_line: Color information for the gradient 479*2d1272b8SAndroid Build Coastguard Worker * @x0: X coordinate of the first circle's center 480*2d1272b8SAndroid Build Coastguard Worker * @y0: Y coordinate of the first circle's center 481*2d1272b8SAndroid Build Coastguard Worker * @r0: radius of the first circle 482*2d1272b8SAndroid Build Coastguard Worker * @x1: X coordinate of the second circle's center 483*2d1272b8SAndroid Build Coastguard Worker * @y1: Y coordinate of the second circle's center 484*2d1272b8SAndroid Build Coastguard Worker * @r1: radius of the second circle 485*2d1272b8SAndroid Build Coastguard Worker * @user_data: User data pointer passed to hb_paint_funcs_set_radial_gradient_func() 486*2d1272b8SAndroid Build Coastguard Worker * 487*2d1272b8SAndroid Build Coastguard Worker * A virtual method for the #hb_paint_funcs_t to paint a radial 488*2d1272b8SAndroid Build Coastguard Worker * gradient everywhere within the current clip. 489*2d1272b8SAndroid Build Coastguard Worker * 490*2d1272b8SAndroid Build Coastguard Worker * The @color_line object contains information about the colors of the gradients. 491*2d1272b8SAndroid Build Coastguard Worker * It is only valid for the duration of the callback, you cannot keep it around. 492*2d1272b8SAndroid Build Coastguard Worker * 493*2d1272b8SAndroid Build Coastguard Worker * The coordinates of the points are interpreted according 494*2d1272b8SAndroid Build Coastguard Worker * to the current transform. 495*2d1272b8SAndroid Build Coastguard Worker * 496*2d1272b8SAndroid Build Coastguard Worker * See the OpenType spec [COLR](https://learn.microsoft.com/en-us/typography/opentype/spec/colr) 497*2d1272b8SAndroid Build Coastguard Worker * section for details on how the points define the direction 498*2d1272b8SAndroid Build Coastguard Worker * of the gradient, and how to interpret the @color_line. 499*2d1272b8SAndroid Build Coastguard Worker * 500*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 501*2d1272b8SAndroid Build Coastguard Worker */ 502*2d1272b8SAndroid Build Coastguard Worker typedef void (*hb_paint_radial_gradient_func_t) (hb_paint_funcs_t *funcs, 503*2d1272b8SAndroid Build Coastguard Worker void *paint_data, 504*2d1272b8SAndroid Build Coastguard Worker hb_color_line_t *color_line, 505*2d1272b8SAndroid Build Coastguard Worker float x0, float y0, float r0, 506*2d1272b8SAndroid Build Coastguard Worker float x1, float y1, float r1, 507*2d1272b8SAndroid Build Coastguard Worker void *user_data); 508*2d1272b8SAndroid Build Coastguard Worker 509*2d1272b8SAndroid Build Coastguard Worker /** 510*2d1272b8SAndroid Build Coastguard Worker * hb_paint_sweep_gradient_func_t: 511*2d1272b8SAndroid Build Coastguard Worker * @funcs: paint functions object 512*2d1272b8SAndroid Build Coastguard Worker * @paint_data: The data accompanying the paint functions in hb_font_paint_glyph() 513*2d1272b8SAndroid Build Coastguard Worker * @color_line: Color information for the gradient 514*2d1272b8SAndroid Build Coastguard Worker * @x0: X coordinate of the circle's center 515*2d1272b8SAndroid Build Coastguard Worker * @y0: Y coordinate of the circle's center 516*2d1272b8SAndroid Build Coastguard Worker * @start_angle: the start angle, in radians 517*2d1272b8SAndroid Build Coastguard Worker * @end_angle: the end angle, in radians 518*2d1272b8SAndroid Build Coastguard Worker * @user_data: User data pointer passed to hb_paint_funcs_set_sweep_gradient_func() 519*2d1272b8SAndroid Build Coastguard Worker * 520*2d1272b8SAndroid Build Coastguard Worker * A virtual method for the #hb_paint_funcs_t to paint a sweep 521*2d1272b8SAndroid Build Coastguard Worker * gradient everywhere within the current clip. 522*2d1272b8SAndroid Build Coastguard Worker * 523*2d1272b8SAndroid Build Coastguard Worker * The @color_line object contains information about the colors of the gradients. 524*2d1272b8SAndroid Build Coastguard Worker * It is only valid for the duration of the callback, you cannot keep it around. 525*2d1272b8SAndroid Build Coastguard Worker * 526*2d1272b8SAndroid Build Coastguard Worker * The coordinates of the points are interpreted according 527*2d1272b8SAndroid Build Coastguard Worker * to the current transform. 528*2d1272b8SAndroid Build Coastguard Worker * 529*2d1272b8SAndroid Build Coastguard Worker * See the OpenType spec [COLR](https://learn.microsoft.com/en-us/typography/opentype/spec/colr) 530*2d1272b8SAndroid Build Coastguard Worker * section for details on how the points define the direction 531*2d1272b8SAndroid Build Coastguard Worker * of the gradient, and how to interpret the @color_line. 532*2d1272b8SAndroid Build Coastguard Worker * 533*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 534*2d1272b8SAndroid Build Coastguard Worker */ 535*2d1272b8SAndroid Build Coastguard Worker typedef void (*hb_paint_sweep_gradient_func_t) (hb_paint_funcs_t *funcs, 536*2d1272b8SAndroid Build Coastguard Worker void *paint_data, 537*2d1272b8SAndroid Build Coastguard Worker hb_color_line_t *color_line, 538*2d1272b8SAndroid Build Coastguard Worker float x0, float y0, 539*2d1272b8SAndroid Build Coastguard Worker float start_angle, 540*2d1272b8SAndroid Build Coastguard Worker float end_angle, 541*2d1272b8SAndroid Build Coastguard Worker void *user_data); 542*2d1272b8SAndroid Build Coastguard Worker 543*2d1272b8SAndroid Build Coastguard Worker /** 544*2d1272b8SAndroid Build Coastguard Worker * hb_paint_composite_mode_t: 545*2d1272b8SAndroid Build Coastguard Worker * @HB_PAINT_COMPOSITE_MODE_CLEAR: clear destination layer (bounded) 546*2d1272b8SAndroid Build Coastguard Worker * @HB_PAINT_COMPOSITE_MODE_SRC: replace destination layer (bounded) 547*2d1272b8SAndroid Build Coastguard Worker * @HB_PAINT_COMPOSITE_MODE_SRC_OVER: draw source layer on top of destination layer 548*2d1272b8SAndroid Build Coastguard Worker * (bounded) 549*2d1272b8SAndroid Build Coastguard Worker * @HB_PAINT_COMPOSITE_MODE_SRC_IN: draw source where there was destination content 550*2d1272b8SAndroid Build Coastguard Worker * (unbounded) 551*2d1272b8SAndroid Build Coastguard Worker * @HB_PAINT_COMPOSITE_MODE_SRC_OUT: draw source where there was no destination 552*2d1272b8SAndroid Build Coastguard Worker * content (unbounded) 553*2d1272b8SAndroid Build Coastguard Worker * @HB_PAINT_COMPOSITE_MODE_SRC_ATOP: draw source on top of destination content and 554*2d1272b8SAndroid Build Coastguard Worker * only there 555*2d1272b8SAndroid Build Coastguard Worker * @HB_PAINT_COMPOSITE_MODE_DEST: ignore the source 556*2d1272b8SAndroid Build Coastguard Worker * @HB_PAINT_COMPOSITE_MODE_DEST_OVER: draw destination on top of source 557*2d1272b8SAndroid Build Coastguard Worker * @HB_PAINT_COMPOSITE_MODE_DEST_IN: leave destination only where there was 558*2d1272b8SAndroid Build Coastguard Worker * source content (unbounded) 559*2d1272b8SAndroid Build Coastguard Worker * @HB_PAINT_COMPOSITE_MODE_DEST_OUT: leave destination only where there was no 560*2d1272b8SAndroid Build Coastguard Worker * source content 561*2d1272b8SAndroid Build Coastguard Worker * @HB_PAINT_COMPOSITE_MODE_DEST_ATOP: leave destination on top of source content 562*2d1272b8SAndroid Build Coastguard Worker * and only there (unbounded) 563*2d1272b8SAndroid Build Coastguard Worker * @HB_PAINT_COMPOSITE_MODE_XOR: source and destination are shown where there is only 564*2d1272b8SAndroid Build Coastguard Worker * one of them 565*2d1272b8SAndroid Build Coastguard Worker * @HB_PAINT_COMPOSITE_MODE_PLUS: source and destination layers are accumulated 566*2d1272b8SAndroid Build Coastguard Worker * @HB_PAINT_COMPOSITE_MODE_MULTIPLY: source and destination layers are multiplied. 567*2d1272b8SAndroid Build Coastguard Worker * This causes the result to be at least as dark as the darker inputs. 568*2d1272b8SAndroid Build Coastguard Worker * @HB_PAINT_COMPOSITE_MODE_SCREEN: source and destination are complemented and 569*2d1272b8SAndroid Build Coastguard Worker * multiplied. This causes the result to be at least as light as the lighter 570*2d1272b8SAndroid Build Coastguard Worker * inputs. 571*2d1272b8SAndroid Build Coastguard Worker * @HB_PAINT_COMPOSITE_MODE_OVERLAY: multiplies or screens, depending on the 572*2d1272b8SAndroid Build Coastguard Worker * lightness of the destination color. 573*2d1272b8SAndroid Build Coastguard Worker * @HB_PAINT_COMPOSITE_MODE_DARKEN: replaces the destination with the source if it 574*2d1272b8SAndroid Build Coastguard Worker * is darker, otherwise keeps the source. 575*2d1272b8SAndroid Build Coastguard Worker * @HB_PAINT_COMPOSITE_MODE_LIGHTEN: replaces the destination with the source if it 576*2d1272b8SAndroid Build Coastguard Worker * is lighter, otherwise keeps the source. 577*2d1272b8SAndroid Build Coastguard Worker * @HB_PAINT_COMPOSITE_MODE_COLOR_DODGE: brightens the destination color to reflect 578*2d1272b8SAndroid Build Coastguard Worker * the source color. 579*2d1272b8SAndroid Build Coastguard Worker * @HB_PAINT_COMPOSITE_MODE_COLOR_BURN: darkens the destination color to reflect 580*2d1272b8SAndroid Build Coastguard Worker * the source color. 581*2d1272b8SAndroid Build Coastguard Worker * @HB_PAINT_COMPOSITE_MODE_HARD_LIGHT: Multiplies or screens, dependent on source 582*2d1272b8SAndroid Build Coastguard Worker * color. 583*2d1272b8SAndroid Build Coastguard Worker * @HB_PAINT_COMPOSITE_MODE_SOFT_LIGHT: Darkens or lightens, dependent on source 584*2d1272b8SAndroid Build Coastguard Worker * color. 585*2d1272b8SAndroid Build Coastguard Worker * @HB_PAINT_COMPOSITE_MODE_DIFFERENCE: Takes the difference of the source and 586*2d1272b8SAndroid Build Coastguard Worker * destination color. 587*2d1272b8SAndroid Build Coastguard Worker * @HB_PAINT_COMPOSITE_MODE_EXCLUSION: Produces an effect similar to difference, but 588*2d1272b8SAndroid Build Coastguard Worker * with lower contrast. 589*2d1272b8SAndroid Build Coastguard Worker * @HB_PAINT_COMPOSITE_MODE_HSL_HUE: Creates a color with the hue of the source 590*2d1272b8SAndroid Build Coastguard Worker * and the saturation and luminosity of the target. 591*2d1272b8SAndroid Build Coastguard Worker * @HB_PAINT_COMPOSITE_MODE_HSL_SATURATION: Creates a color with the saturation 592*2d1272b8SAndroid Build Coastguard Worker * of the source and the hue and luminosity of the target. Painting with 593*2d1272b8SAndroid Build Coastguard Worker * this mode onto a gray area produces no change. 594*2d1272b8SAndroid Build Coastguard Worker * @HB_PAINT_COMPOSITE_MODE_HSL_COLOR: Creates a color with the hue and saturation 595*2d1272b8SAndroid Build Coastguard Worker * of the source and the luminosity of the target. This preserves the gray 596*2d1272b8SAndroid Build Coastguard Worker * levels of the target and is useful for coloring monochrome images or 597*2d1272b8SAndroid Build Coastguard Worker * tinting color images. 598*2d1272b8SAndroid Build Coastguard Worker * @HB_PAINT_COMPOSITE_MODE_HSL_LUMINOSITY: Creates a color with the luminosity of 599*2d1272b8SAndroid Build Coastguard Worker * the source and the hue and saturation of the target. This produces an 600*2d1272b8SAndroid Build Coastguard Worker * inverse effect to @HB_PAINT_COMPOSITE_MODE_HSL_COLOR. 601*2d1272b8SAndroid Build Coastguard Worker * 602*2d1272b8SAndroid Build Coastguard Worker * The values of this enumeration describe the compositing modes 603*2d1272b8SAndroid Build Coastguard Worker * that can be used when combining temporary redirected drawing 604*2d1272b8SAndroid Build Coastguard Worker * with the backdrop. 605*2d1272b8SAndroid Build Coastguard Worker * 606*2d1272b8SAndroid Build Coastguard Worker * See the OpenType spec [COLR](https://learn.microsoft.com/en-us/typography/opentype/spec/colr) 607*2d1272b8SAndroid Build Coastguard Worker * section for details. 608*2d1272b8SAndroid Build Coastguard Worker * 609*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 610*2d1272b8SAndroid Build Coastguard Worker */ 611*2d1272b8SAndroid Build Coastguard Worker typedef enum { 612*2d1272b8SAndroid Build Coastguard Worker HB_PAINT_COMPOSITE_MODE_CLEAR, 613*2d1272b8SAndroid Build Coastguard Worker HB_PAINT_COMPOSITE_MODE_SRC, 614*2d1272b8SAndroid Build Coastguard Worker HB_PAINT_COMPOSITE_MODE_DEST, 615*2d1272b8SAndroid Build Coastguard Worker HB_PAINT_COMPOSITE_MODE_SRC_OVER, 616*2d1272b8SAndroid Build Coastguard Worker HB_PAINT_COMPOSITE_MODE_DEST_OVER, 617*2d1272b8SAndroid Build Coastguard Worker HB_PAINT_COMPOSITE_MODE_SRC_IN, 618*2d1272b8SAndroid Build Coastguard Worker HB_PAINT_COMPOSITE_MODE_DEST_IN, 619*2d1272b8SAndroid Build Coastguard Worker HB_PAINT_COMPOSITE_MODE_SRC_OUT, 620*2d1272b8SAndroid Build Coastguard Worker HB_PAINT_COMPOSITE_MODE_DEST_OUT, 621*2d1272b8SAndroid Build Coastguard Worker HB_PAINT_COMPOSITE_MODE_SRC_ATOP, 622*2d1272b8SAndroid Build Coastguard Worker HB_PAINT_COMPOSITE_MODE_DEST_ATOP, 623*2d1272b8SAndroid Build Coastguard Worker HB_PAINT_COMPOSITE_MODE_XOR, 624*2d1272b8SAndroid Build Coastguard Worker HB_PAINT_COMPOSITE_MODE_PLUS, 625*2d1272b8SAndroid Build Coastguard Worker HB_PAINT_COMPOSITE_MODE_SCREEN, 626*2d1272b8SAndroid Build Coastguard Worker HB_PAINT_COMPOSITE_MODE_OVERLAY, 627*2d1272b8SAndroid Build Coastguard Worker HB_PAINT_COMPOSITE_MODE_DARKEN, 628*2d1272b8SAndroid Build Coastguard Worker HB_PAINT_COMPOSITE_MODE_LIGHTEN, 629*2d1272b8SAndroid Build Coastguard Worker HB_PAINT_COMPOSITE_MODE_COLOR_DODGE, 630*2d1272b8SAndroid Build Coastguard Worker HB_PAINT_COMPOSITE_MODE_COLOR_BURN, 631*2d1272b8SAndroid Build Coastguard Worker HB_PAINT_COMPOSITE_MODE_HARD_LIGHT, 632*2d1272b8SAndroid Build Coastguard Worker HB_PAINT_COMPOSITE_MODE_SOFT_LIGHT, 633*2d1272b8SAndroid Build Coastguard Worker HB_PAINT_COMPOSITE_MODE_DIFFERENCE, 634*2d1272b8SAndroid Build Coastguard Worker HB_PAINT_COMPOSITE_MODE_EXCLUSION, 635*2d1272b8SAndroid Build Coastguard Worker HB_PAINT_COMPOSITE_MODE_MULTIPLY, 636*2d1272b8SAndroid Build Coastguard Worker HB_PAINT_COMPOSITE_MODE_HSL_HUE, 637*2d1272b8SAndroid Build Coastguard Worker HB_PAINT_COMPOSITE_MODE_HSL_SATURATION, 638*2d1272b8SAndroid Build Coastguard Worker HB_PAINT_COMPOSITE_MODE_HSL_COLOR, 639*2d1272b8SAndroid Build Coastguard Worker HB_PAINT_COMPOSITE_MODE_HSL_LUMINOSITY 640*2d1272b8SAndroid Build Coastguard Worker } hb_paint_composite_mode_t; 641*2d1272b8SAndroid Build Coastguard Worker 642*2d1272b8SAndroid Build Coastguard Worker /** 643*2d1272b8SAndroid Build Coastguard Worker * hb_paint_push_group_func_t: 644*2d1272b8SAndroid Build Coastguard Worker * @funcs: paint functions object 645*2d1272b8SAndroid Build Coastguard Worker * @paint_data: The data accompanying the paint functions in hb_font_paint_glyph() 646*2d1272b8SAndroid Build Coastguard Worker * @user_data: User data pointer passed to hb_paint_funcs_set_push_group_func() 647*2d1272b8SAndroid Build Coastguard Worker * 648*2d1272b8SAndroid Build Coastguard Worker * A virtual method for the #hb_paint_funcs_t to use 649*2d1272b8SAndroid Build Coastguard Worker * an intermediate surface for subsequent paint calls. 650*2d1272b8SAndroid Build Coastguard Worker * 651*2d1272b8SAndroid Build Coastguard Worker * The drawing will be redirected to an intermediate surface 652*2d1272b8SAndroid Build Coastguard Worker * until a matching call to the #hb_paint_funcs_pop_group_func_t 653*2d1272b8SAndroid Build Coastguard Worker * vfunc. 654*2d1272b8SAndroid Build Coastguard Worker * 655*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 656*2d1272b8SAndroid Build Coastguard Worker */ 657*2d1272b8SAndroid Build Coastguard Worker typedef void (*hb_paint_push_group_func_t) (hb_paint_funcs_t *funcs, 658*2d1272b8SAndroid Build Coastguard Worker void *paint_data, 659*2d1272b8SAndroid Build Coastguard Worker void *user_data); 660*2d1272b8SAndroid Build Coastguard Worker 661*2d1272b8SAndroid Build Coastguard Worker /** 662*2d1272b8SAndroid Build Coastguard Worker * hb_paint_pop_group_func_t: 663*2d1272b8SAndroid Build Coastguard Worker * @funcs: paint functions object 664*2d1272b8SAndroid Build Coastguard Worker * @paint_data: The data accompanying the paint functions in hb_font_paint_glyph() 665*2d1272b8SAndroid Build Coastguard Worker * @mode: the compositing mode to use 666*2d1272b8SAndroid Build Coastguard Worker * @user_data: User data pointer passed to hb_paint_funcs_set_pop_group_func() 667*2d1272b8SAndroid Build Coastguard Worker * 668*2d1272b8SAndroid Build Coastguard Worker * A virtual method for the #hb_paint_funcs_t to undo 669*2d1272b8SAndroid Build Coastguard Worker * the effect of a prior call to the #hb_paint_funcs_push_group_func_t 670*2d1272b8SAndroid Build Coastguard Worker * vfunc. 671*2d1272b8SAndroid Build Coastguard Worker * 672*2d1272b8SAndroid Build Coastguard Worker * This call stops the redirection to the intermediate surface, 673*2d1272b8SAndroid Build Coastguard Worker * and then composites it on the previous surface, using the 674*2d1272b8SAndroid Build Coastguard Worker * compositing mode passed to this call. 675*2d1272b8SAndroid Build Coastguard Worker * 676*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 677*2d1272b8SAndroid Build Coastguard Worker */ 678*2d1272b8SAndroid Build Coastguard Worker typedef void (*hb_paint_pop_group_func_t) (hb_paint_funcs_t *funcs, 679*2d1272b8SAndroid Build Coastguard Worker void *paint_data, 680*2d1272b8SAndroid Build Coastguard Worker hb_paint_composite_mode_t mode, 681*2d1272b8SAndroid Build Coastguard Worker void *user_data); 682*2d1272b8SAndroid Build Coastguard Worker 683*2d1272b8SAndroid Build Coastguard Worker /** 684*2d1272b8SAndroid Build Coastguard Worker * hb_paint_custom_palette_color_func_t: 685*2d1272b8SAndroid Build Coastguard Worker * @funcs: paint functions object 686*2d1272b8SAndroid Build Coastguard Worker * @paint_data: The data accompanying the paint functions in hb_font_paint_glyph() 687*2d1272b8SAndroid Build Coastguard Worker * @color_index: the color index 688*2d1272b8SAndroid Build Coastguard Worker * @color: (out): fetched color 689*2d1272b8SAndroid Build Coastguard Worker * @user_data: User data pointer passed to hb_paint_funcs_set_pop_group_func() 690*2d1272b8SAndroid Build Coastguard Worker * 691*2d1272b8SAndroid Build Coastguard Worker * A virtual method for the #hb_paint_funcs_t to fetch a color from the custom 692*2d1272b8SAndroid Build Coastguard Worker * color palette. 693*2d1272b8SAndroid Build Coastguard Worker * 694*2d1272b8SAndroid Build Coastguard Worker * Custom palette colors override the colors from the fonts selected color 695*2d1272b8SAndroid Build Coastguard Worker * palette. It is not necessary to override all palette entries; for entries 696*2d1272b8SAndroid Build Coastguard Worker * that should be taken from the font palette, return `false`. 697*2d1272b8SAndroid Build Coastguard Worker * 698*2d1272b8SAndroid Build Coastguard Worker * This function might get called multiple times, but the custom palette is 699*2d1272b8SAndroid Build Coastguard Worker * expected to remain unchanged for duration of a hb_font_paint_glyph() call. 700*2d1272b8SAndroid Build Coastguard Worker * 701*2d1272b8SAndroid Build Coastguard Worker * Return value: `true` if found, `false` otherwise 702*2d1272b8SAndroid Build Coastguard Worker * 703*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 704*2d1272b8SAndroid Build Coastguard Worker */ 705*2d1272b8SAndroid Build Coastguard Worker typedef hb_bool_t (*hb_paint_custom_palette_color_func_t) (hb_paint_funcs_t *funcs, 706*2d1272b8SAndroid Build Coastguard Worker void *paint_data, 707*2d1272b8SAndroid Build Coastguard Worker unsigned int color_index, 708*2d1272b8SAndroid Build Coastguard Worker hb_color_t *color, 709*2d1272b8SAndroid Build Coastguard Worker void *user_data); 710*2d1272b8SAndroid Build Coastguard Worker 711*2d1272b8SAndroid Build Coastguard Worker 712*2d1272b8SAndroid Build Coastguard Worker /** 713*2d1272b8SAndroid Build Coastguard Worker * hb_paint_funcs_set_push_transform_func: 714*2d1272b8SAndroid Build Coastguard Worker * @funcs: A paint functions struct 715*2d1272b8SAndroid Build Coastguard Worker * @func: (closure user_data) (destroy destroy) (scope notified): The push-transform callback 716*2d1272b8SAndroid Build Coastguard Worker * @user_data: Data to pass to @func 717*2d1272b8SAndroid Build Coastguard Worker * @destroy: (nullable): Function to call when @user_data is no longer needed 718*2d1272b8SAndroid Build Coastguard Worker * 719*2d1272b8SAndroid Build Coastguard Worker * Sets the push-transform callback on the paint functions struct. 720*2d1272b8SAndroid Build Coastguard Worker * 721*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 722*2d1272b8SAndroid Build Coastguard Worker */ 723*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN void 724*2d1272b8SAndroid Build Coastguard Worker hb_paint_funcs_set_push_transform_func (hb_paint_funcs_t *funcs, 725*2d1272b8SAndroid Build Coastguard Worker hb_paint_push_transform_func_t func, 726*2d1272b8SAndroid Build Coastguard Worker void *user_data, 727*2d1272b8SAndroid Build Coastguard Worker hb_destroy_func_t destroy); 728*2d1272b8SAndroid Build Coastguard Worker 729*2d1272b8SAndroid Build Coastguard Worker /** 730*2d1272b8SAndroid Build Coastguard Worker * hb_paint_funcs_set_pop_transform_func: 731*2d1272b8SAndroid Build Coastguard Worker * @funcs: A paint functions struct 732*2d1272b8SAndroid Build Coastguard Worker * @func: (closure user_data) (destroy destroy) (scope notified): The pop-transform callback 733*2d1272b8SAndroid Build Coastguard Worker * @user_data: Data to pass to @func 734*2d1272b8SAndroid Build Coastguard Worker * @destroy: (nullable): Function to call when @user_data is no longer needed 735*2d1272b8SAndroid Build Coastguard Worker * 736*2d1272b8SAndroid Build Coastguard Worker * Sets the pop-transform callback on the paint functions struct. 737*2d1272b8SAndroid Build Coastguard Worker * 738*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 739*2d1272b8SAndroid Build Coastguard Worker */ 740*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN void 741*2d1272b8SAndroid Build Coastguard Worker hb_paint_funcs_set_pop_transform_func (hb_paint_funcs_t *funcs, 742*2d1272b8SAndroid Build Coastguard Worker hb_paint_pop_transform_func_t func, 743*2d1272b8SAndroid Build Coastguard Worker void *user_data, 744*2d1272b8SAndroid Build Coastguard Worker hb_destroy_func_t destroy); 745*2d1272b8SAndroid Build Coastguard Worker 746*2d1272b8SAndroid Build Coastguard Worker /** 747*2d1272b8SAndroid Build Coastguard Worker * hb_paint_funcs_set_color_glyph_func: 748*2d1272b8SAndroid Build Coastguard Worker * @funcs: A paint functions struct 749*2d1272b8SAndroid Build Coastguard Worker * @func: (closure user_data) (destroy destroy) (scope notified): The color-glyph callback 750*2d1272b8SAndroid Build Coastguard Worker * @user_data: Data to pass to @func 751*2d1272b8SAndroid Build Coastguard Worker * @destroy: (nullable): Function to call when @user_data is no longer needed 752*2d1272b8SAndroid Build Coastguard Worker * 753*2d1272b8SAndroid Build Coastguard Worker * Sets the color-glyph callback on the paint functions struct. 754*2d1272b8SAndroid Build Coastguard Worker * 755*2d1272b8SAndroid Build Coastguard Worker * Since: 8.2.0 756*2d1272b8SAndroid Build Coastguard Worker */ 757*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN void 758*2d1272b8SAndroid Build Coastguard Worker hb_paint_funcs_set_color_glyph_func (hb_paint_funcs_t *funcs, 759*2d1272b8SAndroid Build Coastguard Worker hb_paint_color_glyph_func_t func, 760*2d1272b8SAndroid Build Coastguard Worker void *user_data, 761*2d1272b8SAndroid Build Coastguard Worker hb_destroy_func_t destroy); 762*2d1272b8SAndroid Build Coastguard Worker 763*2d1272b8SAndroid Build Coastguard Worker /** 764*2d1272b8SAndroid Build Coastguard Worker * hb_paint_funcs_set_push_clip_glyph_func: 765*2d1272b8SAndroid Build Coastguard Worker * @funcs: A paint functions struct 766*2d1272b8SAndroid Build Coastguard Worker * @func: (closure user_data) (destroy destroy) (scope notified): The push-clip-glyph callback 767*2d1272b8SAndroid Build Coastguard Worker * @user_data: Data to pass to @func 768*2d1272b8SAndroid Build Coastguard Worker * @destroy: (nullable): Function to call when @user_data is no longer needed 769*2d1272b8SAndroid Build Coastguard Worker * 770*2d1272b8SAndroid Build Coastguard Worker * Sets the push-clip-glyph callback on the paint functions struct. 771*2d1272b8SAndroid Build Coastguard Worker * 772*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 773*2d1272b8SAndroid Build Coastguard Worker */ 774*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN void 775*2d1272b8SAndroid Build Coastguard Worker hb_paint_funcs_set_push_clip_glyph_func (hb_paint_funcs_t *funcs, 776*2d1272b8SAndroid Build Coastguard Worker hb_paint_push_clip_glyph_func_t func, 777*2d1272b8SAndroid Build Coastguard Worker void *user_data, 778*2d1272b8SAndroid Build Coastguard Worker hb_destroy_func_t destroy); 779*2d1272b8SAndroid Build Coastguard Worker 780*2d1272b8SAndroid Build Coastguard Worker /** 781*2d1272b8SAndroid Build Coastguard Worker * hb_paint_funcs_set_push_clip_rectangle_func: 782*2d1272b8SAndroid Build Coastguard Worker * @funcs: A paint functions struct 783*2d1272b8SAndroid Build Coastguard Worker * @func: (closure user_data) (destroy destroy) (scope notified): The push-clip-rectangle callback 784*2d1272b8SAndroid Build Coastguard Worker * @user_data: Data to pass to @func 785*2d1272b8SAndroid Build Coastguard Worker * @destroy: (nullable): Function to call when @user_data is no longer needed 786*2d1272b8SAndroid Build Coastguard Worker * 787*2d1272b8SAndroid Build Coastguard Worker * Sets the push-clip-rect callback on the paint functions struct. 788*2d1272b8SAndroid Build Coastguard Worker * 789*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 790*2d1272b8SAndroid Build Coastguard Worker */ 791*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN void 792*2d1272b8SAndroid Build Coastguard Worker hb_paint_funcs_set_push_clip_rectangle_func (hb_paint_funcs_t *funcs, 793*2d1272b8SAndroid Build Coastguard Worker hb_paint_push_clip_rectangle_func_t func, 794*2d1272b8SAndroid Build Coastguard Worker void *user_data, 795*2d1272b8SAndroid Build Coastguard Worker hb_destroy_func_t destroy); 796*2d1272b8SAndroid Build Coastguard Worker 797*2d1272b8SAndroid Build Coastguard Worker /** 798*2d1272b8SAndroid Build Coastguard Worker * hb_paint_funcs_set_pop_clip_func: 799*2d1272b8SAndroid Build Coastguard Worker * @funcs: A paint functions struct 800*2d1272b8SAndroid Build Coastguard Worker * @func: (closure user_data) (destroy destroy) (scope notified): The pop-clip callback 801*2d1272b8SAndroid Build Coastguard Worker * @user_data: Data to pass to @func 802*2d1272b8SAndroid Build Coastguard Worker * @destroy: (nullable): Function to call when @user_data is no longer needed 803*2d1272b8SAndroid Build Coastguard Worker * 804*2d1272b8SAndroid Build Coastguard Worker * Sets the pop-clip callback on the paint functions struct. 805*2d1272b8SAndroid Build Coastguard Worker * 806*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 807*2d1272b8SAndroid Build Coastguard Worker */ 808*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN void 809*2d1272b8SAndroid Build Coastguard Worker hb_paint_funcs_set_pop_clip_func (hb_paint_funcs_t *funcs, 810*2d1272b8SAndroid Build Coastguard Worker hb_paint_pop_clip_func_t func, 811*2d1272b8SAndroid Build Coastguard Worker void *user_data, 812*2d1272b8SAndroid Build Coastguard Worker hb_destroy_func_t destroy); 813*2d1272b8SAndroid Build Coastguard Worker 814*2d1272b8SAndroid Build Coastguard Worker /** 815*2d1272b8SAndroid Build Coastguard Worker * hb_paint_funcs_set_color_func: 816*2d1272b8SAndroid Build Coastguard Worker * @funcs: A paint functions struct 817*2d1272b8SAndroid Build Coastguard Worker * @func: (closure user_data) (destroy destroy) (scope notified): The paint-color callback 818*2d1272b8SAndroid Build Coastguard Worker * @user_data: Data to pass to @func 819*2d1272b8SAndroid Build Coastguard Worker * @destroy: (nullable): Function to call when @user_data is no longer needed 820*2d1272b8SAndroid Build Coastguard Worker * 821*2d1272b8SAndroid Build Coastguard Worker * Sets the paint-color callback on the paint functions struct. 822*2d1272b8SAndroid Build Coastguard Worker * 823*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 824*2d1272b8SAndroid Build Coastguard Worker */ 825*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN void 826*2d1272b8SAndroid Build Coastguard Worker hb_paint_funcs_set_color_func (hb_paint_funcs_t *funcs, 827*2d1272b8SAndroid Build Coastguard Worker hb_paint_color_func_t func, 828*2d1272b8SAndroid Build Coastguard Worker void *user_data, 829*2d1272b8SAndroid Build Coastguard Worker hb_destroy_func_t destroy); 830*2d1272b8SAndroid Build Coastguard Worker 831*2d1272b8SAndroid Build Coastguard Worker /** 832*2d1272b8SAndroid Build Coastguard Worker * hb_paint_funcs_set_image_func: 833*2d1272b8SAndroid Build Coastguard Worker * @funcs: A paint functions struct 834*2d1272b8SAndroid Build Coastguard Worker * @func: (closure user_data) (destroy destroy) (scope notified): The paint-image callback 835*2d1272b8SAndroid Build Coastguard Worker * @user_data: Data to pass to @func 836*2d1272b8SAndroid Build Coastguard Worker * @destroy: (nullable): Function to call when @user_data is no longer needed 837*2d1272b8SAndroid Build Coastguard Worker * 838*2d1272b8SAndroid Build Coastguard Worker * Sets the paint-image callback on the paint functions struct. 839*2d1272b8SAndroid Build Coastguard Worker * 840*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 841*2d1272b8SAndroid Build Coastguard Worker */ 842*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN void 843*2d1272b8SAndroid Build Coastguard Worker hb_paint_funcs_set_image_func (hb_paint_funcs_t *funcs, 844*2d1272b8SAndroid Build Coastguard Worker hb_paint_image_func_t func, 845*2d1272b8SAndroid Build Coastguard Worker void *user_data, 846*2d1272b8SAndroid Build Coastguard Worker hb_destroy_func_t destroy); 847*2d1272b8SAndroid Build Coastguard Worker 848*2d1272b8SAndroid Build Coastguard Worker /** 849*2d1272b8SAndroid Build Coastguard Worker * hb_paint_funcs_set_linear_gradient_func: 850*2d1272b8SAndroid Build Coastguard Worker * @funcs: A paint functions struct 851*2d1272b8SAndroid Build Coastguard Worker * @func: (closure user_data) (destroy destroy) (scope notified): The linear-gradient callback 852*2d1272b8SAndroid Build Coastguard Worker * @user_data: Data to pass to @func 853*2d1272b8SAndroid Build Coastguard Worker * @destroy: (nullable): Function to call when @user_data is no longer needed 854*2d1272b8SAndroid Build Coastguard Worker * 855*2d1272b8SAndroid Build Coastguard Worker * Sets the linear-gradient callback on the paint functions struct. 856*2d1272b8SAndroid Build Coastguard Worker * 857*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 858*2d1272b8SAndroid Build Coastguard Worker */ 859*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN void 860*2d1272b8SAndroid Build Coastguard Worker hb_paint_funcs_set_linear_gradient_func (hb_paint_funcs_t *funcs, 861*2d1272b8SAndroid Build Coastguard Worker hb_paint_linear_gradient_func_t func, 862*2d1272b8SAndroid Build Coastguard Worker void *user_data, 863*2d1272b8SAndroid Build Coastguard Worker hb_destroy_func_t destroy); 864*2d1272b8SAndroid Build Coastguard Worker 865*2d1272b8SAndroid Build Coastguard Worker /** 866*2d1272b8SAndroid Build Coastguard Worker * hb_paint_funcs_set_radial_gradient_func: 867*2d1272b8SAndroid Build Coastguard Worker * @funcs: A paint functions struct 868*2d1272b8SAndroid Build Coastguard Worker * @func: (closure user_data) (destroy destroy) (scope notified): The radial-gradient callback 869*2d1272b8SAndroid Build Coastguard Worker * @user_data: Data to pass to @func 870*2d1272b8SAndroid Build Coastguard Worker * @destroy: (nullable): Function to call when @user_data is no longer needed 871*2d1272b8SAndroid Build Coastguard Worker * 872*2d1272b8SAndroid Build Coastguard Worker * Sets the radial-gradient callback on the paint functions struct. 873*2d1272b8SAndroid Build Coastguard Worker * 874*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 875*2d1272b8SAndroid Build Coastguard Worker */ 876*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN void 877*2d1272b8SAndroid Build Coastguard Worker hb_paint_funcs_set_radial_gradient_func (hb_paint_funcs_t *funcs, 878*2d1272b8SAndroid Build Coastguard Worker hb_paint_radial_gradient_func_t func, 879*2d1272b8SAndroid Build Coastguard Worker void *user_data, 880*2d1272b8SAndroid Build Coastguard Worker hb_destroy_func_t destroy); 881*2d1272b8SAndroid Build Coastguard Worker 882*2d1272b8SAndroid Build Coastguard Worker /** 883*2d1272b8SAndroid Build Coastguard Worker * hb_paint_funcs_set_sweep_gradient_func: 884*2d1272b8SAndroid Build Coastguard Worker * @funcs: A paint functions struct 885*2d1272b8SAndroid Build Coastguard Worker * @func: (closure user_data) (destroy destroy) (scope notified): The sweep-gradient callback 886*2d1272b8SAndroid Build Coastguard Worker * @user_data: Data to pass to @func 887*2d1272b8SAndroid Build Coastguard Worker * @destroy: (nullable): Function to call when @user_data is no longer needed 888*2d1272b8SAndroid Build Coastguard Worker * 889*2d1272b8SAndroid Build Coastguard Worker * Sets the sweep-gradient callback on the paint functions struct. 890*2d1272b8SAndroid Build Coastguard Worker * 891*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 892*2d1272b8SAndroid Build Coastguard Worker */ 893*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN void 894*2d1272b8SAndroid Build Coastguard Worker hb_paint_funcs_set_sweep_gradient_func (hb_paint_funcs_t *funcs, 895*2d1272b8SAndroid Build Coastguard Worker hb_paint_sweep_gradient_func_t func, 896*2d1272b8SAndroid Build Coastguard Worker void *user_data, 897*2d1272b8SAndroid Build Coastguard Worker hb_destroy_func_t destroy); 898*2d1272b8SAndroid Build Coastguard Worker 899*2d1272b8SAndroid Build Coastguard Worker /** 900*2d1272b8SAndroid Build Coastguard Worker * hb_paint_funcs_set_push_group_func: 901*2d1272b8SAndroid Build Coastguard Worker * @funcs: A paint functions struct 902*2d1272b8SAndroid Build Coastguard Worker * @func: (closure user_data) (destroy destroy) (scope notified): The push-group callback 903*2d1272b8SAndroid Build Coastguard Worker * @user_data: Data to pass to @func 904*2d1272b8SAndroid Build Coastguard Worker * @destroy: (nullable): Function to call when @user_data is no longer needed 905*2d1272b8SAndroid Build Coastguard Worker * 906*2d1272b8SAndroid Build Coastguard Worker * Sets the push-group callback on the paint functions struct. 907*2d1272b8SAndroid Build Coastguard Worker * 908*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 909*2d1272b8SAndroid Build Coastguard Worker */ 910*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN void 911*2d1272b8SAndroid Build Coastguard Worker hb_paint_funcs_set_push_group_func (hb_paint_funcs_t *funcs, 912*2d1272b8SAndroid Build Coastguard Worker hb_paint_push_group_func_t func, 913*2d1272b8SAndroid Build Coastguard Worker void *user_data, 914*2d1272b8SAndroid Build Coastguard Worker hb_destroy_func_t destroy); 915*2d1272b8SAndroid Build Coastguard Worker 916*2d1272b8SAndroid Build Coastguard Worker /** 917*2d1272b8SAndroid Build Coastguard Worker * hb_paint_funcs_set_pop_group_func: 918*2d1272b8SAndroid Build Coastguard Worker * @funcs: A paint functions struct 919*2d1272b8SAndroid Build Coastguard Worker * @func: (closure user_data) (destroy destroy) (scope notified): The pop-group callback 920*2d1272b8SAndroid Build Coastguard Worker * @user_data: Data to pass to @func 921*2d1272b8SAndroid Build Coastguard Worker * @destroy: (nullable): Function to call when @user_data is no longer needed 922*2d1272b8SAndroid Build Coastguard Worker * 923*2d1272b8SAndroid Build Coastguard Worker * Sets the pop-group callback on the paint functions struct. 924*2d1272b8SAndroid Build Coastguard Worker * 925*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 926*2d1272b8SAndroid Build Coastguard Worker */ 927*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN void 928*2d1272b8SAndroid Build Coastguard Worker hb_paint_funcs_set_pop_group_func (hb_paint_funcs_t *funcs, 929*2d1272b8SAndroid Build Coastguard Worker hb_paint_pop_group_func_t func, 930*2d1272b8SAndroid Build Coastguard Worker void *user_data, 931*2d1272b8SAndroid Build Coastguard Worker hb_destroy_func_t destroy); 932*2d1272b8SAndroid Build Coastguard Worker 933*2d1272b8SAndroid Build Coastguard Worker /** 934*2d1272b8SAndroid Build Coastguard Worker * hb_paint_funcs_set_custom_palette_color_func: 935*2d1272b8SAndroid Build Coastguard Worker * @funcs: A paint functions struct 936*2d1272b8SAndroid Build Coastguard Worker * @func: (closure user_data) (destroy destroy) (scope notified): The custom-palette-color callback 937*2d1272b8SAndroid Build Coastguard Worker * @user_data: Data to pass to @func 938*2d1272b8SAndroid Build Coastguard Worker * @destroy: (nullable): Function to call when @user_data is no longer needed 939*2d1272b8SAndroid Build Coastguard Worker * 940*2d1272b8SAndroid Build Coastguard Worker * Sets the custom-palette-color callback on the paint functions struct. 941*2d1272b8SAndroid Build Coastguard Worker * 942*2d1272b8SAndroid Build Coastguard Worker * Since: 7.0.0 943*2d1272b8SAndroid Build Coastguard Worker */ 944*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN void 945*2d1272b8SAndroid Build Coastguard Worker hb_paint_funcs_set_custom_palette_color_func (hb_paint_funcs_t *funcs, 946*2d1272b8SAndroid Build Coastguard Worker hb_paint_custom_palette_color_func_t func, 947*2d1272b8SAndroid Build Coastguard Worker void *user_data, 948*2d1272b8SAndroid Build Coastguard Worker hb_destroy_func_t destroy); 949*2d1272b8SAndroid Build Coastguard Worker /* 950*2d1272b8SAndroid Build Coastguard Worker * Manual API 951*2d1272b8SAndroid Build Coastguard Worker */ 952*2d1272b8SAndroid Build Coastguard Worker 953*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN void 954*2d1272b8SAndroid Build Coastguard Worker hb_paint_push_transform (hb_paint_funcs_t *funcs, void *paint_data, 955*2d1272b8SAndroid Build Coastguard Worker float xx, float yx, 956*2d1272b8SAndroid Build Coastguard Worker float xy, float yy, 957*2d1272b8SAndroid Build Coastguard Worker float dx, float dy); 958*2d1272b8SAndroid Build Coastguard Worker 959*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN void 960*2d1272b8SAndroid Build Coastguard Worker hb_paint_pop_transform (hb_paint_funcs_t *funcs, void *paint_data); 961*2d1272b8SAndroid Build Coastguard Worker 962*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN hb_bool_t 963*2d1272b8SAndroid Build Coastguard Worker hb_paint_color_glyph (hb_paint_funcs_t *funcs, void *paint_data, 964*2d1272b8SAndroid Build Coastguard Worker hb_codepoint_t glyph, 965*2d1272b8SAndroid Build Coastguard Worker hb_font_t *font); 966*2d1272b8SAndroid Build Coastguard Worker 967*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN void 968*2d1272b8SAndroid Build Coastguard Worker hb_paint_push_clip_glyph (hb_paint_funcs_t *funcs, void *paint_data, 969*2d1272b8SAndroid Build Coastguard Worker hb_codepoint_t glyph, 970*2d1272b8SAndroid Build Coastguard Worker hb_font_t *font); 971*2d1272b8SAndroid Build Coastguard Worker 972*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN void 973*2d1272b8SAndroid Build Coastguard Worker hb_paint_push_clip_rectangle (hb_paint_funcs_t *funcs, void *paint_data, 974*2d1272b8SAndroid Build Coastguard Worker float xmin, float ymin, 975*2d1272b8SAndroid Build Coastguard Worker float xmax, float ymax); 976*2d1272b8SAndroid Build Coastguard Worker 977*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN void 978*2d1272b8SAndroid Build Coastguard Worker hb_paint_pop_clip (hb_paint_funcs_t *funcs, void *paint_data); 979*2d1272b8SAndroid Build Coastguard Worker 980*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN void 981*2d1272b8SAndroid Build Coastguard Worker hb_paint_color (hb_paint_funcs_t *funcs, void *paint_data, 982*2d1272b8SAndroid Build Coastguard Worker hb_bool_t is_foreground, 983*2d1272b8SAndroid Build Coastguard Worker hb_color_t color); 984*2d1272b8SAndroid Build Coastguard Worker 985*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN void 986*2d1272b8SAndroid Build Coastguard Worker hb_paint_image (hb_paint_funcs_t *funcs, void *paint_data, 987*2d1272b8SAndroid Build Coastguard Worker hb_blob_t *image, 988*2d1272b8SAndroid Build Coastguard Worker unsigned int width, 989*2d1272b8SAndroid Build Coastguard Worker unsigned int height, 990*2d1272b8SAndroid Build Coastguard Worker hb_tag_t format, 991*2d1272b8SAndroid Build Coastguard Worker float slant, 992*2d1272b8SAndroid Build Coastguard Worker hb_glyph_extents_t *extents); 993*2d1272b8SAndroid Build Coastguard Worker 994*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN void 995*2d1272b8SAndroid Build Coastguard Worker hb_paint_linear_gradient (hb_paint_funcs_t *funcs, void *paint_data, 996*2d1272b8SAndroid Build Coastguard Worker hb_color_line_t *color_line, 997*2d1272b8SAndroid Build Coastguard Worker float x0, float y0, 998*2d1272b8SAndroid Build Coastguard Worker float x1, float y1, 999*2d1272b8SAndroid Build Coastguard Worker float x2, float y2); 1000*2d1272b8SAndroid Build Coastguard Worker 1001*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN void 1002*2d1272b8SAndroid Build Coastguard Worker hb_paint_radial_gradient (hb_paint_funcs_t *funcs, void *paint_data, 1003*2d1272b8SAndroid Build Coastguard Worker hb_color_line_t *color_line, 1004*2d1272b8SAndroid Build Coastguard Worker float x0, float y0, 1005*2d1272b8SAndroid Build Coastguard Worker float r0, 1006*2d1272b8SAndroid Build Coastguard Worker float x1, float y1, 1007*2d1272b8SAndroid Build Coastguard Worker float r1); 1008*2d1272b8SAndroid Build Coastguard Worker 1009*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN void 1010*2d1272b8SAndroid Build Coastguard Worker hb_paint_sweep_gradient (hb_paint_funcs_t *funcs, void *paint_data, 1011*2d1272b8SAndroid Build Coastguard Worker hb_color_line_t *color_line, 1012*2d1272b8SAndroid Build Coastguard Worker float x0, float y0, 1013*2d1272b8SAndroid Build Coastguard Worker float start_angle, float end_angle); 1014*2d1272b8SAndroid Build Coastguard Worker 1015*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN void 1016*2d1272b8SAndroid Build Coastguard Worker hb_paint_push_group (hb_paint_funcs_t *funcs, void *paint_data); 1017*2d1272b8SAndroid Build Coastguard Worker 1018*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN void 1019*2d1272b8SAndroid Build Coastguard Worker hb_paint_pop_group (hb_paint_funcs_t *funcs, void *paint_data, 1020*2d1272b8SAndroid Build Coastguard Worker hb_paint_composite_mode_t mode); 1021*2d1272b8SAndroid Build Coastguard Worker 1022*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN hb_bool_t 1023*2d1272b8SAndroid Build Coastguard Worker hb_paint_custom_palette_color (hb_paint_funcs_t *funcs, void *paint_data, 1024*2d1272b8SAndroid Build Coastguard Worker unsigned int color_index, 1025*2d1272b8SAndroid Build Coastguard Worker hb_color_t *color); 1026*2d1272b8SAndroid Build Coastguard Worker 1027*2d1272b8SAndroid Build Coastguard Worker HB_END_DECLS 1028*2d1272b8SAndroid Build Coastguard Worker 1029*2d1272b8SAndroid Build Coastguard Worker #endif /* HB_PAINT_H */ 1030