SayoriOS 0.3.3

tga.h
1 #pragma once
2
3 #include <common.h>
4
5 enum {
6 TGA_MODE_NO_IMG = 0,
7 TGA_MODE_UC_CMI = 1,
8 TGA_MODE_UC_RGB = 2,
9 TGA_MODE_UC_BWI = 3,
10 TGA_MODE_RL_CMI = 9,
11 TGA_MODE_RL_RGB = 10,
12 TGA_MODE_CP_BWI = 11,
13 TGA_MODE_CP_HDR = 32,
14 TGA_MODE_UC_PQR = 33,
15 };
16
17 typedef struct {
18 unsigned char image_id; // must be zero
19 unsigned char colormap; // must be zero
20 unsigned char image_type; // must be 2
21 unsigned short cmaporig;
22 unsigned short cmaplen; // must be zero
23 unsigned char cmapent; // must be zero
24 unsigned short x; // what
25 unsigned short y; // what
26 unsigned short w; // image's width
27 unsigned short h; // image's height
28 unsigned char bpp; // must be 32
29 unsigned char image_descriptor; // must be 40
30 } __attribute__((packed)) tga_header_t;
31
32 bool tga_extract_info(const char* path, tga_header_t* out_meta);
33 int tga_extract_pixels(const char* path, uint32_t* pixel_buf);
34 int tga_extract_pixels_from_data(const char* raw_data, uint32_t* pixel_buf);
common.h
Основные определения ядра
__attribute__
struct registers __attribute__((packed))
Структура данных пакета от мыши
Definition: psf.h:19