@woosh/meep-engine
Version:
Pure JavaScript game engine. Fully featured and production ready.
99 lines • 2.56 kB
TypeScript
export class PNG {
/**
*
* @type {number}
*/
width: number;
/**
*
* @type {number}
*/
height: number;
/**
* Number of bits per channel?
* @type {number}
*/
bitDepth: number;
colorType: number;
compressionMethod: number;
filterMethod: number;
interlaceMethod: number;
/**
* Number of channels in the image
* @example RGB = 3, RGBA = 4, etc.
* @type {number}
*/
colors: number;
alpha: boolean;
pixelBits: number;
palette: any;
/**
*
* @type {Uint8Array|null}
*/
pixels: Uint8Array | null;
/**
* Transparency palette
* @type {Uint8Array|null}
*/
trns: Uint8Array | null;
/**
* Text metadata coming from tEXt chunks
* @type {Object<string>}
*/
text: any;
getWidth(): number;
setWidth(width: any): void;
getHeight(): number;
setHeight(height: any): void;
getBitDepth(): number;
setBitDepth(bitDepth: any): void;
getColorType(): number;
setColorType(colorType: any): void;
getCompressionMethod(): number;
setCompressionMethod(compressionMethod: any): void;
getFilterMethod(): number;
setFilterMethod(filterMethod: any): void;
getInterlaceMethod(): number;
setInterlaceMethod(interlaceMethod: any): void;
/**
*
* @param {Uint8Array} trns
*/
setTRNS(trns: Uint8Array): void;
setPalette(palette: any): void;
getPalette(): any;
/**
* get the pixel color on a certain location in a normalized way
* result is an array: [red, green, blue, alpha]
*/
getPixel(result: any, result_offset: any, x: any, y: any): void;
/**
* Assumes pixels are stored as RGB without A component, will set A to 255
* @param {Uint8Array} destination
*/
getRGBA8Array_fromRGB(destination: Uint8Array): void;
/**
*
* @param {Uint8Array} destination
*/
getRGBA8Array_generic(destination: Uint8Array): void;
/**
* get the pixels of the image as a RGBA array of the form [r1, g1, b1, a1, r2, b2, g2, a2, ...]
* Matches the api of canvas.getImageData
*/
getRGBA8Array(): Uint8Array<ArrayBuffer>;
getUint8Data_case3(): {
data: Uint8Array<ArrayBuffer>;
itemSize: number;
};
/**
* @returns {{itemSize:number, data:Uint8Array, bitDepth: number}}
*/
getUint8Data(): {
itemSize: number;
data: Uint8Array;
bitDepth: number;
};
}
//# sourceMappingURL=PNG.d.ts.map