UNPKG

image-in-browser

Version:

Package for encoding / decoding images, transforming images, applying filters, drawing primitives on images on the client side (no need for server Node.js)

56 lines (55 loc) 1.87 kB
/** @format */ /** * Utility class for various bit manipulation operations. */ export declare class PvrBitUtility { /** * Checks if a number is a power of 2. * @param {number} x - The number to check. * @returns {boolean} True if the number is a power of 2, otherwise false. */ static isPowerOf2(x: number): boolean; /** * Rotates the bits of a number to the right. * @param {number} value - The number whose bits are to be rotated. * @param {number} shift - The number of positions to rotate. * @returns {number} The result of the bit rotation. */ static rotateRight(value: number, shift: number): number; /** * Lookup table for scaling 5-bit values to 8-bit values. */ static readonly bitScale5To8: number[]; /** * Lookup table for scaling 4-bit values to 8-bit values. */ static readonly bitScale4To8: number[]; /** * Lookup table for scaling 3-bit values to 8-bit values. */ static readonly bitScale3To8: number[]; /** * Lookup table for scaling 8-bit values to 5-bit values using floor. */ static readonly bitScale8To5Floor: number[]; /** * Lookup table for scaling 8-bit values to 4-bit values using floor. */ static readonly bitScale8To4Floor: number[]; /** * Lookup table for scaling 8-bit values to 3-bit values using floor. */ static readonly bitScale8To3Floor: number[]; /** * Lookup table for scaling 8-bit values to 5-bit values using ceil. */ static readonly bitScale8To5Ceil: number[]; /** * Lookup table for scaling 8-bit values to 4-bit values using ceil. */ static readonly bitScale8To4Ceil: number[]; /** * Lookup table for scaling 8-bit values to 3-bit values using ceil. */ static readonly bitScale8To3Ceil: number[]; }