/
TGAFile.h
37 lines (32 loc) · 949 Bytes
/
TGAFile.h
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
#pragma once
#include "ImageFile.h"
#include <string>
//Carga archivos de imagenes TGA
//Limitaciones:
// - Soporta solo formatos RGB y RGBA
// - No soporta paletas de colores
// - No soporta datos comprimidos
// - No lee metadatos
class TGAFile: public ImageFile
{
private:
//Encabezado de archivos TGA
#pragma pack(push, 1)
struct {
char idlength;
char colourmaptype;
char datatypecode;
short int colourmaporigin; // --
short int colourmaplength; // | Especificacion del mapa de colores(si es que tiene)
char colourmapdepth; // --
short int x_origin; // --
short int y_origin; // |
short width; // | Especificacion de la Imagen
short height; // |
char bitsperpixel; // |
char imagedescriptor; // --
} m_Header;
#pragma pack(pop)
//Carga la imagen del stream de dato, sea cual sea la fuente de este
void _Load(std::istream& Stream);
};