Skip to content

1681-engine / pixel / PackedPixels

Class: PackedPixels ​

Defined in: src/pixel/spritePixels.ts:14

A frame's opaque pixels packed in typed arrays (12 bytes a pixel instead of an object each). Iterating hands out one reused SpritePixel, so read it in the loop and keep nothing of it; at(i) reads one into a given object.

Implements ​

Constructors ​

Constructor ​

ts
new PackedPixels(
   dx, 
   dy, 
   color, 
   length
): PackedPixels;

Defined in: src/pixel/spritePixels.ts:15

Parameters ​

ParameterType
dxFloat32Array
dyFloat32Array
colorUint32Array
lengthnumber

Returns ​

PackedPixels

Properties ​

color ​

ts
readonly color: Uint32Array;

Defined in: src/pixel/spritePixels.ts:18


dx ​

ts
readonly dx: Float32Array;

Defined in: src/pixel/spritePixels.ts:16


dy ​

ts
readonly dy: Float32Array;

Defined in: src/pixel/spritePixels.ts:17


length ​

ts
readonly length: number;

Defined in: src/pixel/spritePixels.ts:19

Methods ​

[iterator]() ​

ts
iterator: Iterator<SpritePixel>;

Defined in: src/pixel/spritePixels.ts:22

Returns ​

Iterator<SpritePixel>

Implementation of ​

ts
Iterable.[iterator]

Released under the MIT License.