/** * LCD subpixel rendering support * * LCD displays have RGB subpixels that can be individually addressed * to achieve higher effective resolution. This module provides: * 1. Subpixel rendering (3x horizontal resolution) * 2. FIR filtering to reduce color fringing */ import type { GlyphPath } from "../render/path.ts"; import type { Bitmap } from "./types.ts"; /** * LCD filter weights for reducing color fringing * These are based on FreeType's default LCD filter */ export declare const LCD_FILTER_LIGHT: number[]; export declare const LCD_FILTER_DEFAULT: number[]; export declare const LCD_FILTER_LEGACY: number[]; /** * LCD rendering mode */ export declare enum LcdMode { /** Horizontal RGB subpixels (most common) */ RGB = 0, /** Horizontal BGR subpixels */ BGR = 1, /** Vertical RGB subpixels */ RGB_V = 2, /** Vertical BGR subpixels */ BGR_V = 3 } /** * Rasterize a glyph with LCD subpixel rendering * * The algorithm: * 1. Render at 3x horizontal resolution * 2. Apply FIR filter to reduce color fringing * 3. Output RGB values per pixel * * @param path Glyph path to rasterize * @param width Width in pixels * @param height Height in pixels * @param scale Scale factor from font units to pixels * @param offsetX X offset in pixels * @param offsetY Y offset in pixels * @param mode LCD subpixel mode (RGB, BGR, RGB_V, BGR_V) * @param filterWeights FIR filter coefficients for reducing color fringing * @returns Bitmap with LCD subpixel data (3 bytes per pixel) */ export declare function rasterizeLcd(path: GlyphPath, width: number, height: number, scale: number, offsetX: number, offsetY: number, mode?: LcdMode, filterWeights?: number[]): Bitmap; /** * Convert LCD bitmap to RGBA for display * Uses gamma-corrected blending against a background color * * @param lcd LCD bitmap to convert * @param bgColor Background color as RGB (0-255 each) * @param fgColor Foreground color as RGB (0-255 each) * @returns RGBA pixel array (4 bytes per pixel) */ export declare function lcdToRGBA(lcd: Bitmap, bgColor?: [number, number, number], fgColor?: [number, number, number]): Uint8Array;