yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze_graphics.h
Go to the documentation of this file.
1#ifndef YAZE_GRAPHICS_H
2#define YAZE_GRAPHICS_H
3
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13#include <stdbool.h>
14#include <stdint.h>
15
21typedef struct yaze_bitmap {
22 int width;
23 int height;
24 uint8_t bpp;
25 uint8_t* data;
27
39yaze_bitmap yaze_load_bitmap(const char* filename);
40
48void yaze_free_bitmap(yaze_bitmap* bitmap);
49
60yaze_bitmap yaze_create_bitmap(int width, int height, uint8_t bpp);
61
68typedef struct snes_color {
69 uint16_t red;
70 uint16_t green;
71 uint16_t blue;
73
82snes_color yaze_rgb_to_snes_color(uint8_t r, uint8_t g, uint8_t b);
83
92void yaze_snes_color_to_rgb(snes_color color, uint8_t* r, uint8_t* g, uint8_t* b);
93
100typedef struct snes_palette {
101 uint16_t id;
102 uint16_t size;
105
113snes_palette* yaze_create_palette(uint16_t id, uint16_t size);
114
121
128typedef struct snes_tile8 {
129 uint32_t id;
130 uint32_t palette_id;
131 uint8_t data[64];
133
142snes_tile8 yaze_convert_tile_bpp(const snes_tile8* tile, uint8_t from_bpp, uint8_t to_bpp);
143
151
155
156typedef struct snes_tile32 {
157 uint16_t t0;
158 uint16_t t1;
159 uint16_t t2;
160 uint16_t t3;
162
163#ifdef __cplusplus
164}
165#endif
166
167#endif // YAZE_GRAPHICS_H
SNES color in 15-bit RGB format (BGR555)
uint16_t green
uint16_t red
uint16_t blue
SNES color palette.
snes_color * colors
snes_tile_info tiles[4]
8x8 SNES tile data
uint32_t id
uint8_t data[64]
uint32_t palette_id
Bitmap data structure.
uint8_t * data
snes_color yaze_rgb_to_snes_color(uint8_t r, uint8_t g, uint8_t b)
Convert RGB888 color to SNES color.
Definition yaze.cc:329
struct snes_palette snes_palette
SNES color palette.
yaze_bitmap yaze_load_bitmap(const char *filename)
Load a bitmap from file.
Definition yaze.cc:182
struct snes_tile_info snes_tile_info
struct snes_tile32 snes_tile32
struct yaze_bitmap yaze_bitmap
Bitmap data structure.
snes_palette * yaze_create_palette(uint16_t id, uint16_t size)
Create an empty palette.
struct snes_color snes_color
SNES color in 15-bit RGB format (BGR555)
snes_tile8 yaze_convert_tile_bpp(const snes_tile8 *tile, uint8_t from_bpp, uint8_t to_bpp)
Convert tile data between different bit depths.
yaze_bitmap yaze_create_bitmap(int width, int height, uint8_t bpp)
Create an empty bitmap.
Definition yaze.cc:313
struct snes_tile16 snes_tile16
struct snes_tile8 snes_tile8
8x8 SNES tile data
void yaze_free_bitmap(yaze_bitmap *bitmap)
Free bitmap data.
Definition yaze.cc:303
void yaze_free_palette(snes_palette *palette)
Free palette memory.
void yaze_snes_color_to_rgb(snes_color color, uint8_t *r, uint8_t *g, uint8_t *b)
Convert SNES color to RGB888.
Definition yaze.cc:337