Bitmap
The Bitmap class is used for direct pixel manipulation(for example setting a pixel colour, transparency etc). It also provides a factory method for creating new instances of Context
Constructor Summary
Public Constructor | ||
public |
constructor(w: number, h: number, options: any) Creates an instance of Bitmap. |
Method Summary
Public Methods | ||
public |
calculateIndex(x: number, y: number): number Calculate Index |
|
public |
Context factory. |
|
public |
getPixelRGBA(x: number, y: number): number Get the RGBA value of an individual pixel as a hexadecimal number(See NAMED_COLORS for examples) |
|
public |
setPixelRGBA(x: number, y: number, rgba: number): void Set the RGBA(Red, Green, Blue, Alpha) values on an individual pixel level |
|
public |
Set the individual red, green, blue and alpha levels of an individual pixel |
Public Constructors
Public Members
public data: ArrayBuffer source
Public Methods
public getPixelRGBA(x: number, y: number): number source
Get the RGBA value of an individual pixel as a hexadecimal number(See NAMED_COLORS for examples)
public setPixelRGBA(x: number, y: number, rgba: number): void source
Set the RGBA(Red, Green, Blue, Alpha) values on an individual pixel level
Params:
Name | Type | Attribute | Description |
x | number | X axis position |
|
y | number | Y axis position |
|
rgba | number | A hex representation of the RGBA value of the pixel. See NAMED_COLORS for examples |
Return:
void |