Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MorsGames
GitHub Repository: MorsGames/sm64plus
Path: blob/master/tools/n64graphics_ci_dir/n64graphics_ci.h
7857 views
1
#ifndef N64GRAPHICS_CI_H_
2
#define N64GRAPHICS_CI_H_
3
4
#include <stdint.h>
5
6
// intermediate formats
7
typedef struct _rgba
8
{
9
uint8_t red;
10
uint8_t green;
11
uint8_t blue;
12
uint8_t alpha;
13
} rgba;
14
15
typedef struct _ia
16
{
17
uint8_t intensity;
18
uint8_t alpha;
19
} ia;
20
21
// N64 raw RGBA16/RGBA32 -> intermediate RGBA
22
rgba *raw2rgba(const uint8_t *raw, int width, int height, int depth);
23
24
// N64 raw CI + palette -> intermediate RGBA
25
rgba *rawci2rgba(const uint8_t *rawci, const uint8_t *palette, int width, int height, int depth);
26
27
// intermediate RGBA -> N64 raw CI + palette
28
int rgba2rawci(uint8_t *raw, uint8_t *out_palette, int *pal_len, const rgba *img, int width, int height, int depth);
29
30
// PNG file -> intermediate RGBA
31
rgba *png2rgba(const char *png_filename, int *width, int *height);
32
33
// intermediate RGBA write to PNG file
34
int rgba2png(const char *png_filename, const rgba *img, int width, int height);
35
36
// get version of underlying graphics reading library
37
const char *n64graphics_get_read_version(void);
38
39
// get version of underlying graphics writing library
40
const char *n64graphics_get_write_version(void);
41
42
#endif
43
44