Package limn.graphics


@NullMarked package limn.graphics
Backend-neutral 2D drawing: the immediate-mode Canvas every widget paints through, the values it takes (Color, Paint, Rect, Path2D) and the facades for what a drawing loads and measures: Images, Fonts, TextRulers and Icons rasterized from SVG or bitmaps. Coordinates are logical points and the backend supplies the pixels, so nothing here imports a graphics library.
  • Class
    Description
    What a shape does to the pixels already behind it: a material, not a paint.
    The backdrop blurred along one axis.
    Which way one blur pass runs.
    A transparent pane: the backdrop is not blurred, it is refracted at the rim, the way light bends through the bevelled edge of real glass.
    The backdrop as a cathode-ray tube shows it: bent onto a curved face and striped by the scan.
    The backdrop reduced to squares: redaction, not decoration.
    The backdrop, undisplaced, with its saturation moved.
    An Icon backed by pre-rendered Images (typically PNGs).
    How subsequent Canvas painting combines with what is already on the target.
    Immediate-mode 2D drawing API: what every widget paints through.
    Immutable straight-alpha RGBA color, channels in [0..1].
    A typeface selection: family name, size in logical points, and weight/style (regular / bold / italic / bold-italic).
    The set of font families the running backend can resolve: the bundled faces plus any enumerated from the operating system.
    Registers a font file the application ships, so its family becomes usable by name.
    Process-wide font configuration (mirrors the TextRulers / Ui facade lifecycle).
    The built-in GIF encoder: an animated image with every frame, each with its time, and the turns it asks for; a still image as one picture.
    An offscreen GPU render target owned by the backend: a texture (with its own depth buffer) that something can draw into off-screen and that the 2D Canvas can then composite as one layer via Canvas.drawSurface(limn.graphics.GpuSurface, float, float, float, float).
    A themeable, resolution-independent glyph, conceptually distinct from an Image, which is just a fixed grid of RGBA pixels for display.
    Whether an icon turns around when the interface does.
    An immutable, backend-independent bitmap: RGBA8 pixels, straight (non premultiplied) alpha, row-major, row 0 at the top.
    Decodes encoded image bytes (PNG/JPG/…) into an Image.
    What an encode should produce: the ImageFormat, plus the knobs a lossy format needs.
    Encodes an Image into a file format.
    An encoded image format, named by its IANA media type: what a caller asks Images.encode(Image, ImageFormat) for and what an ImageEncoder declares it can produce.
    Image loading and saving facade.
    Two-stop linear gradient from (x0,y0) (color start) to (x1,y1) (color end), clamped beyond the endpoints.
    How a shape is filled or stroked: a solid Color or a LinearGradient/RadialGradient.
    Mutable 2D path: move/line/quadratic/cubic segments and closed subpaths, in logical points.
    Receives the flattened (curve-free) form of a path.
    Receives a path as it was built: its moves, lines, curves and closes, in order and in the path's own coordinates.
    The toolkit's built-in ImageEncoder: PNG, 8-bit RGBA with straight alpha, which is Image's pixel layout unchanged, so no channel is dropped, no value is quantized, and decoding the result yields the bytes that went in.
    Ear-clipping triangulation of simple (non-self-intersecting) polygons, convex or concave, any winding.
    Two-stop radial gradient: center color at (cx,cy) fading to edge color at distance radius, clamped beyond it.
    A GpuSurface whose pixels can be brought back to the CPU.
    Immutable axis-aligned rectangle in logical points.
    Immutable rounded rectangle with independent corner radii, in logical points.
    How Canvas image drawing samples texels when an Image is drawn at a size other than 1:1.
    Scene-referred pixels read back from a ReadableSurface: RGBA floats, linear light, premultiplied alpha, row-major, row 0 at the top.
    One layer of the shadow a shape casts: the shape's own outline moved by an offset, blurred, in one colour.
    One line of text after shaping: the glyphs a face draws for it, where each one sits, and every geometric question a widget then asks about that line.
    Which side of a char index a caret sits on, and so which of the two points that index can occupy is meant.
    Assembles a ShapedText run by run.
    The two places a caret may sit for one char index, for a caller that stores no side.
    Which way a paragraph reads.
    A caret position: where text is inserted, plus which side of that index the caret is on.
    One shaped stretch: a single face, a single embedding level, a single shaping call, and the unit the backend resolves a face at and batches a draw at.
    One horizontal box of a selection, in logical points from the left edge of the line.
    A themeable vector Icon: keeps the SVG source and lazily draws it (via the installed SvgRenderer) to a cached Image per requested pixel size (a small LRU of 16 sizes).
    SPI that draws SVG: opens a document from SVG text, draws it into pixels at any size, and lets an attribute of one of its elements be changed between two drawings, which is how an animated SVG is played.
    One SVG, opened: measured, drawn and changed until it is closed.
    Measured extents of a single line of text, in logical points, relative to the baseline.
    Measures text without a frame in flight: what widget layout uses (the layout pass runs before painting, when no Canvas exists).
    Process-wide TextRuler registry, installed by the running backend (mirrors the Ui facade lifecycle).