Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
n64graphics_ci.h
Go to the documentation of this file.
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
const char * n64graphics_get_read_version(void)
Definition: n64graphics.c:497
int rgba2rawci(uint8_t *raw, uint8_t *out_palette, int *pal_len, const rgba *img, int width, int height, int depth)
Definition: n64graphics_ci.c:105
const char * n64graphics_get_write_version(void)
Definition: n64graphics.c:502
rgba * rawci2rgba(const uint8_t *rawci, const uint8_t *palette, int width, int height, int depth)
Definition: n64graphics.c:167
struct _ia ia
uint8_t alpha
Definition: n64graphics.h:12
int rgba2png(const char *png_filename, const rgba *img, int width, int height)
Definition: n64graphics.c:318
uint8_t blue
Definition: n64graphics.h:11
uint8_t green
Definition: n64graphics.h:10
rgba * raw2rgba(const uint8_t *raw, int width, int height, int depth)
Definition: n64graphics.c:37
Definition: n64graphics.h:7
Definition: n64graphics.h:15
struct _rgba rgba
rgba * png2rgba(const char *png_filename, int *width, int *height)
Definition: n64graphics.c:372
uint8_t red
Definition: n64graphics.h:9