Interface PaintImageFunc
- All Superinterfaces:
FunctionPointer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
@Generated("org.javagi.JavaGI")
public interface PaintImageFunc
extends FunctionPointer
Functional interface declaration of the PaintImageFunc callback.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionrun(PaintFuncs funcs, @Nullable MemorySegment paintData, Blob image, int width, int height, Tag format, float slant, @Nullable GlyphExtents extents) A virtual method for thehb_paint_funcs_tto paint a glyph image.default MemorySegmenttoCallback(Arena arena) Creates a native function pointer to theupcall(MemorySegment, MemorySegment, MemorySegment, int, int, int, float, MemorySegment, MemorySegment)method.default intupcall(MemorySegment funcs, MemorySegment paintData, MemorySegment image, int width, int height, int format, float slant, MemorySegment extents, MemorySegment userData) Theupcallmethod is called from native code.
-
Method Details
-
run
Bool run(PaintFuncs funcs, @Nullable MemorySegment paintData, Blob image, int width, int height, Tag format, float slant, @Nullable GlyphExtents extents) A virtual method for the
hb_paint_funcs_tto paint a glyph image.This method is called for glyphs with image blobs in the CBDT, sbix or SVG tables. The
formatidentifies the kind of data that is contained inimage.Possible values includeHB_PAINT_IMAGE_FORMAT_PNG,HB_PAINT_IMAGE_FORMAT_SVGandHB_PAINT_IMAGE_FORMAT_BGRA.The image dimensions and glyph extents are provided if available, and should be used to size and position the image.
- Parameters:
funcs- paint functions objectpaintData- The data accompanying the paint functions in hb_font_paint_glyph()image- the image datawidth- width of the raster image in pixels, or 0height- height of the raster image in pixels, or 0format- the image format as a tagslant- Deprecated. Always set to 0.0.extents- glyph extents for desired rendering- Returns:
- Whether the operation was successful.
- Since:
- 7.0.0
-
upcall
default int upcall(MemorySegment funcs, MemorySegment paintData, MemorySegment image, int width, int height, int format, float slant, MemorySegment extents, MemorySegment userData) Theupcallmethod is called from native code. The parameters are marshaled andrun(PaintFuncs, MemorySegment, Blob, int, int, Tag, float, GlyphExtents)is executed. -
toCallback
Creates a native function pointer to theupcall(MemorySegment, MemorySegment, MemorySegment, int, int, int, float, MemorySegment, MemorySegment)method.- Specified by:
toCallbackin interfaceFunctionPointer- Parameters:
arena- the arena in which the function pointer is allocated- Returns:
- the native function pointer
-