libmsx
C library for MSX
|
Tile-mapping for 8x8px 1bpp bitmap images. More...
Enumerations | |
enum | ImOp { IM_IDENTITY = 0 , IM_COPY = IM_IDENTITY , IM_COMPLEMENT = 1 , IM_TRANSPOSE = (1 << 5) , IM_FLIP_VERT = (1 << 6) , IM_FLIP_HORZ = (1 << 7) , IM_ROTATE_90 = (IM_TRANSPOSE | IM_FLIP_HORZ) , IM_ROTATE_180 = (IM_FLIP_VERT | IM_FLIP_HORZ) , IM_ROTATE_270 = (IM_TRANSPOSE | IM_FLIP_VERT) , IM_ANTITRANSPOSE = (IM_TRANSPOSE | IM_FLIP_VERT | IM_FLIP_HORZ) } |
Enumeration of unary operators for images. More... | |
Functions | |
void | im_tilemap_BM8x8 (const BM8x8 tileset[256], size_t n, const uint8_t tilemap[][2], BM8x8 *dst) |
MSX Construct a set of 8x8 pixels 1bpp tile images from tileset and tilemap. | |
void | im_tilemap_v_BM8x8 (const BM8x8 tileset[256], size_t n, const uint8_t tilemap[][2]) |
MSX Construct a set of 8x8 pixels 1bpp tile images from tileset and tilemap. | |
Tile-mapping for 8x8px 1bpp bitmap images.
OPERATOR | ROM/RAM to RAM | ROM/RAM to VRAM |
---|---|---|
TILE MAPPING | im_tilemap_BM8x8() | im_tilemap_v_BM8x8() |
enum ImOp |
Enumeration of unary operators for images.
These can be specified as operator identifier of tilemap element.
Enumerator | |
---|---|
IM_IDENTITY | Identity transformation. Corresponds to im_copy_BM8x8(), im_copy_v_BM8x8(). |
IM_COPY | Synonym for IM_IDENTITY. |
IM_COMPLEMENT | Bitwise NOT (complement). Corresponds to im_cmpl_BM8x8(), im_cmpl_v_BM8x8(). |
IM_TRANSPOSE | Transposition around the main diagonal. Corresponds to im_tr_BM8x8(), im_tr_v_BM8x8(). |
IM_FLIP_VERT | Flip vertically. Corresponds to im_vflip_BM8x8(), im_vflip_v_BM8x8(). |
IM_FLIP_HORZ | Flip horizontally. Corresponds to im_hflip_BM8x8(), im_hflip_v_BM8x8(). |
IM_ROTATE_90 | Rotate 90 degrees clockwise. Corresponds to im_rot90_BM8x8(), im_rot90_v_BM8x8(). |
IM_ROTATE_180 | Rotate 180 degrees. Corresponds to im_rot180_BM8x8(), im_rot180_v_BM8x8(). |
IM_ROTATE_270 | Rotate 270 degrees clockwise. Corresponds to im_rot270_BM8x8(), im_rot270_v_BM8x8(). |
IM_ANTITRANSPOSE | Transposition around the antidiagonal. Corresponds to im_adtr_BM8x8(), im_adtr_v_BM8x8(). |
void im_tilemap_BM8x8 | ( | const BM8x8 | tileset[256], |
size_t | n, | ||
const uint8_t | tilemap[][2], | ||
BM8x8 * | dst | ||
) |
MSX
Construct a set of 8x8 pixels 1bpp tile images from tileset and tilemap.
Tile, Tileset, and Tilemap are similar to Pixel, Color palette, and Indexed color image respectively.
An indexed color image is an array/matrix of pixels. The representation of each pixel (i.e. color) is specified by its index into a color palette.
A tilemap image, on the other hand, is an array/matrix of tiles. The representation of each tile is usually specified by the tileset index (and optional attributes).
The concepts of Tile, Tileset, and Tilemap in this function are defined as follows:
enum ImOp
).The below pseudo code shows what the function performs:
tileset | Pointer to source tileset (256 sets of 8x8px 1bpp images). |
n | Number of elements of the tilemap . |
tilemap | Pointer to n element array of 2-byte cells.
|
dst | Pointer to destination n elements array of 8x8px 1bpp images. |
void im_tilemap_v_BM8x8 | ( | const BM8x8 | tileset[256], |
size_t | n, | ||
const uint8_t | tilemap[][2] | ||
) |
MSX
Construct a set of 8x8 pixels 1bpp tile images from tileset and tilemap.
A variant of im_tilemap_BM8x8(). (writes output to VRAM instead of RAM).
The below pseudo code shows what the function performs:
tileset | Pointer to source tileset (256 sets of 8x8px 1bpp images). |
n | Number of elements of the tilemap . |
tilemap | Pointer to n element array of 2-byte cells.
|