@woosh/meep-engine
Version:
Pure JavaScript game engine. Fully featured and production ready.
106 lines • 2.6 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;
/**
*
* @type {Uint8Array|null}
*/
palette: Uint8Array | null;
/**
*
* @type {Uint8Array|null}
*/
pixels: Uint8Array | null;
/**
* Transparency palette
* @type {Uint8Array|null}
*/
transparency_lookup: 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;
/**
*
* @param {number} compressionMethod
*/
setCompressionMethod(compressionMethod: number): void;
/**
*
* @param {number} filterMethod
*/
setFilterMethod(filterMethod: number): void;
getInterlaceMethod(): number;
setInterlaceMethod(interlaceMethod: any): void;
/**
*
* @param {Uint8Array} palette
*/
setPalette(palette: Uint8Array): void;
/**
* 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;
getUint8Data_case3(): {
data: Uint8Array;
itemSize: number;
};
/**
* @returns {{itemSize:number, data:Uint8Array, bitDepth: number}}
*/
getUint8Data(): {
itemSize: number;
data: Uint8Array;
bitDepth: number;
};
}
//# sourceMappingURL=PNG.d.ts.map