Files
firestorm/Gameleap/code/mw4/Libraries/Proxies/Targa.hpp
T
Cyd 2b8ca921cb Initial full mirror of c:\VWE (source + assets + toolchain + outputs) via Git LFS
Complete disaster-recovery snapshot: engine/game source, game data assets,
VC6 toolchain + DX SDKs, build outputs, deployed game, and _UNUSED archive.
Large binaries in Git LFS; text preserved byte-for-byte (core.autocrlf=false,
no eol attributes). See RECOVERY.md for the one-clone rebuild procedure.
2026-06-24 21:28:16 -05:00

97 lines
1.4 KiB
C++

#pragma once
#include "Proxies.hpp"
namespace Proxies {
struct TargaHeader {
unsigned char
idLength,
colorMapType,
imageType,
indexLow,
indexHigh,
lengthLow,
lengthHigh,
colorEntrySize,
xOriginLow,
xOriginHigh,
yOriginLow,
yOriginHigh,
widthLow,
widthHigh,
heightLow,
heightHigh,
pixelSize,
flags;
enum {
RGB=2,
RLERGB=10,
XReversed=16,
YReversed=32
};
};
struct TargaColor
{
BYTE
blue,
green,
red;
};
struct TargaColorA
{
BYTE
blue,
green,
red,
alpha;
};
void
WriteTargaFile(
const char* filename,
int width,
int height,
Stuff::DynamicArrayOf<TargaColor> &data
);
void
WriteTargaFile(
const char* filename,
int width,
int height,
Stuff::DynamicArrayOf<TargaColorA> &data
);
void
ReadTargaHeader(
TargaHeader *header,
Stuff::MemoryStream *file,
int *width,
int *height,
unsigned *red_depth,
unsigned *green_depth,
unsigned *blue_depth,
unsigned *alpha_depth
);
void
ReadTargaChannels(
Stuff::MemoryStream *file,
TargaHeader *header,
Stuff::DynamicArrayOf<TargaColor> *data
);
void
ReadTargaChannels(
Stuff::MemoryStream *file,
TargaHeader *header,
Stuff::DynamicArrayOf<TargaColorA> *data
);
}