Jazz2::Scripting::Legacy::jjPIXELMAP class

A rectangular buffer of palette-indexed pixels.

Reference-counted, editable image of 8-bit palette indices that scripts read and write per pixel. It can be built from a tile, an animation frame, a texture, a region of a tile layer, an image file or a blank size, and saved back into a tile, an animation frame or an image file. The bridge for procedural graphics editing.

Public static functions

static auto CreateFromTile() -> jjPIXELMAP*
Returns a new instance built from a single tile.
static auto CreateFromSize(std::uint32_t width, std::uint32_t height) -> jjPIXELMAP*
Returns a new instance of the given size.
static auto CreateFromFrame(const jjANIMFRAME* animFrame) -> jjPIXELMAP*
Returns a new instance built from an animation frame.
static auto CreateFromLayer(std::uint32_t left, std::uint32_t top, std::uint32_t width, std::uint32_t height, std::uint32_t layer) -> jjPIXELMAP*
Returns a new instance built from a region of a tile layer.
static auto CreateFromLayerObject(std::uint32_t left, std::uint32_t top, std::uint32_t width, std::uint32_t height, const jjLAYER* layer) -> jjPIXELMAP*
Returns a new instance built from a region of the given layer.
static auto CreateFromTexture(std::uint32_t animFrame) -> jjPIXELMAP*
Returns a new instance built from a texture.
static auto CreateFromFilename(const String& filename, const jjPAL* palette, std::uint8_t threshold) -> jjPIXELMAP*
Returns a new instance built from an image file, mapped onto the given palette.

Constructors, destructors, conversion operators

jjPIXELMAP()
Creates a new instance.
~jjPIXELMAP()

Public functions

void AddRef()
Increments the reference count.
void Release()
Decrements the reference count.
auto operator=(const jjPIXELMAP& o) -> jjPIXELMAP&
auto GetPixel(std::uint32_t x, std::uint32_t y) -> std::uint8_t
auto saveToTile(std::uint16_t tileID, bool hFlip) const -> bool
Saves the pixel map into a tile.
auto saveToFrame(jjANIMFRAME* frame) const -> bool
Saves the pixel map into an animation frame.
auto saveToFile(const String& filename, const jjPAL& palette) const -> bool
Saves the pixel map to an image file using the given palette.

Public variables

std::uint32_t width
Width in pixels.
std::uint32_t height
Height in pixels.