/** * * @param {Channel} channel * @param {number} conditionNumber * @returns {string} */ export function makeAccessorFunctionName(channel: Channel, conditionNumber: number): string; /** * @typedef {object} AccessorParts * @prop {Channel} channel * @prop {string} accessorGlsl * @prop {string} accessorFunctionName * @prop {string} [attributeName] * @prop {string} [attributeGlsl] * @prop {string} [uniformName] * @prop {string} [uniformGlsl] * @prop {(x: any) => any} [adjuster] */ /** * Generates GLSL code for a constant value. * * @param {Channel} channel * @param {number} conditionNumber * @param {number | number[] | string | boolean} value * @returns {AccessorParts} */ export function generateConstantValueGlsl(channel: Channel, conditionNumber: number, value: number | number[] | string | boolean): AccessorParts; /** * Generates GLSL code for a dynamic, parameter-driven values. These are mainly * used as dynamic mark properties that map to encoding channels. * * @param {Channel} channel * @param {number} conditionNumber * @returns {AccessorParts} */ export function generateDynamicValueGlslAndUniform(channel: Channel, conditionNumber: number): AccessorParts; /** * @param {Channel} channel * @param {any} scale * @param {number} conditionNumber * @param {Channel[]} [sharedQuantitativeChannels] Channels that share the same quantitative field * @returns {AccessorParts} */ export function generateDataGlsl(channel: Channel, scale: any, conditionNumber: number, sharedQuantitativeChannels?: Channel[]): AccessorParts; /** * @param {Channel} channel * @param {any} scale * @param {number} conditionNumber * @returns {AccessorParts} */ export function generateDatumGlslAndUniform(channel: Channel, scale: any, conditionNumber: number): AccessorParts; /** * * @param {Channel} channel * @param {any} scale * @param {import("../spec/channel.js").ChannelDef} channelDef */ export function generateScaleGlsl(channel: Channel, scale: any, channelDef: import("../spec/channel.js").ChannelDef): { glsl: string; domainUniformName: string; domainUniform: string; rangeUniformName: string; rangeUniform: string; }; /** * * @param {Channel} channel * @param {import("../types/encoder.js").EncodingBranch[]} branches */ export function generateConditionalEncoderGlsl(channel: Channel, branches: import("../types/encoder.js").EncodingBranch[]): string; /** * @param {Channel} channel */ export function getScaledDataTypeForChannel(channel: Channel): "float" | "vec3" | "uint"; /** * * @param {import("../types/encoder.js").VegaScale} scale * @param {import("../spec/channel.js").Channel} channel */ export function getAttributeAndArrayTypes(scale: import("../types/encoder.js").VegaScale, channel: import("../spec/channel.js").Channel): { attributeType: string; arrayConstructor: Uint32ArrayConstructor | Uint16ArrayConstructor | Float32ArrayConstructor; } & { numComponents: number; discrete: boolean; hp: boolean; largeHp: boolean; }; /** * True if scale needs more than 24 bits (float32) of precision. * * @param {string} type */ export function isHighPrecisionScale(type: string): type is "index" | "locus"; /** * True if Uint32 cannot represent the domain. * * @param {number[]} domain */ export function isLargeGenome(domain: number[]): boolean; /** * @param {number} x Must be an integer * @param {number[]} [arr] */ export function splitHighPrecision(x: number, arr?: number[]): number[]; /** * @param {number} x Must be an integer * @param {number[]} [arr] */ export function splitLargeHighPrecision(x: number, arr?: number[]): number[]; /** * @param {number[]} domain */ export function toHighPrecisionDomainUniform(domain: number[]): number[]; /** * @typedef {[string, boolean]} FieldKey Tuple: [channel, isQuantitative]] */ /** * Finds duplicated quantitative fields in the encoding block. * They need to be uploaded to the GPU only once. * * @param {Partial>} encoders */ export function dedupeEncodingFields(encoders: Partial>): InternMap; /** * @param {import("../spec/channel.js").Channel | import("../spec/channel.js").Channel[]} channel */ export function makeAttributeName(channel: import("../spec/channel.js").Channel | import("../spec/channel.js").Channel[]): string; /** * @param {string[]} conditions * @param {string[]} statements * @returns {string} */ export function ifElseGlsl(conditions: string[], statements: string[]): string; export const ATTRIBUTE_PREFIX: "attr_"; export const DOMAIN_PREFIX: "uDomain_"; export const RANGE_PREFIX: "range_"; export const ACCESSOR_FUNCTION_PREFIX: "accessor_"; export const SCALE_FUNCTION_PREFIX: "scale_"; export const SCALED_FUNCTION_PREFIX: "getScaled_"; export const RANGE_TEXTURE_PREFIX: "uRangeTexture_"; export const PARAM_PREFIX: "uParam_"; export const SELECTION_CHECKER_PREFIX: "checkSelection_"; export const HIGH_PRECISION_SPLIT_BITS: 12; export const HIGH_PRECISION_SPLIT_BASE: number; export const HIGH_PRECISION_SPLIT_MASK: number; export function getRangeForGlsl(scale: any, channel: Channel): number[]; export type Channel = import("../spec/channel.js").Channel; export type AccessorParts = { channel: Channel; accessorGlsl: string; accessorFunctionName: string; attributeName?: string; attributeGlsl?: string; uniformName?: string; uniformGlsl?: string; adjuster?: (x: any) => any; }; /** * Turns a number or number array to float or vec[234] string. */ export type VectorizedValue = string & { type: string; numComponents: number; }; /** * Tuple: [channel, isQuantitative]] */ export type FieldKey = [string, boolean]; import { InternMap } from "internmap"; //# sourceMappingURL=glslScaleGenerator.d.ts.map