summaryrefslogtreecommitdiff
path: root/tools/src/gbagfx/gfx.h
blob: d7dc5e668a4e98fe7c40f81b9e3862a5263784f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright (c) 2015 YamaArashi

#ifndef GFX_H
#define GFX_H

#include <stdint.h>
#include <stdbool.h>

struct Color {
    unsigned char red;
    unsigned char green;
    unsigned char blue;
};

struct Palette {
    struct Color colors[256];
    int numColors;
};

struct Image {
    int width;
    int height;
    int bitDepth;
    unsigned char* pixels;
    bool hasPalette;
    struct Palette palette;
    bool hasTransparency;
};

void ReadImage(char* path, int tilesWidth, int bitDepth, int tileWidth, int tileHeight, struct Image* image,
               bool invertColors);
void WriteImage(char* path, int numTiles, int bitDepth, int tileWidth, int tileHeight, struct Image* image,
                bool invertColors);
void FreeImage(struct Image* image);
void ReadGbaPalette(char* path, struct Palette* palette);
void WriteGbaPalette(char* path, struct Palette* palette);

#endif // GFX_H