27 #include "precompiled.h"
98 return extension == L
".tga";
121 const size_t bpp = hdr->
bpp;
156 size_t transforms = t->flags;
172 const size_t hdr_size =
sizeof(hdr);
Status tex_codec_write(Tex *t, size_t transforms, const void *hdr, size_t hdr_size, DynArray *da)
apply transforms and then copy header and image into output buffer.
#define UNUSED(param)
mark a function parameter as unused and avoid the corresponding compiler warning. ...
const Status TEX_CODEC_CANNOT_HANDLE
indicates the image contains an alpha channel.
provides a memory range that can be expanded but doesn't waste physical memory or relocate itself...
indicates the image is 8bpp greyscale.
indicates B and R pixel components are exchanged.
flags & TEX_ORIENTATION is a field indicating orientation, i.e.
static bool tga_is_ext(const OsPath &extension)
#define BIT(n)
pretty much the same as Bit<unsigned>.
i64 Status
Error handling system.
stores all data describing an image.
static size_t tga_hdr_size(const u8 *file)
const Status TEX_INVALID_LAYOUT
u16 read_le16(const void *p)
read a little-endian number from memory into native byte order.
#define TEX_CODEC_REGISTER(name)
build codec vtbl and register it.
static Status tga_decode(rpU8 data, size_t size, Tex *RESTRICT t)
#define WARN_RETURN(status)
static bool tga_is_hdr(const u8 *file)
static Status tga_encode(Tex *RESTRICT t, DynArray *RESTRICT da)
static Status tga_transform(Tex *t, size_t transforms)