UNPKG

webglimpse

Version:

Webglimpse is a data visualization library for the web.

43 lines (42 loc) 1.97 kB
import { Cache } from './util/cache'; import { Texture2D, ImageDrawer } from './texture'; import { Color } from './color'; import { TwoKeyCache, ThreeKeyCache, SixKeyCache } from './util/multikey_cache'; import { BoundsUnmodifiable } from './bounds'; export declare const getTextWidth: (font: string, text: string) => number; export declare class TextTexture2D extends Texture2D { private _jBaseline; get jBaseline(): number; constructor(w: number, h: number, jBaseline: number, minFilter: number, magFilter: number, draw: ImageDrawer); yAnchor(textFrac: number): number; } export declare function newTextTextureCache(font: string, color: Color): Cache<TextTexture2D>; export declare function newTextTextureCache2(font: string): TwoKeyCache<TextTexture2D>; export declare function newTextTextureCache3(): ThreeKeyCache<TextTexture2D>; export declare function newTextTextureCache6(): SixKeyCache<TextTexture2D>; export declare type TextTextureFactory = (color: Color, text: string, bgColor?: Color, bgPadding?: number, bgBorderRadius?: number) => TextTexture2D; export declare function createTextTextureFactory(font: string): TextTextureFactory; export declare function newTextHintsCache(font: string): Cache<Texture2D>; export declare class HintedTextRenderer { private textRenderer_VERTSHADER; private textRenderer_FRAGSHADER; private program; private u_XyFrac; private u_Anchor; private u_ImageSize; private u_ViewportSize; private u_Alpha; private u_Hints; private a_ImageFrac; private imageFracData; private wViewport; private hViewport; constructor(); begin(gl: WebGLRenderingContext, viewport: BoundsUnmodifiable): void; draw(gl: WebGLRenderingContext, hints: Texture2D, xFrac: number, yFrac: number, options?: { xAnchor?: number; yAnchor?: number; color?: Color; }): void; end(gl: WebGLRenderingContext): void; }