265 Status decode(
const shared_ptr<u8>& data,
size_t data_size);
300 Status wrap(
size_t w,
size_t h,
size_t bpp,
size_t flags,
const shared_ptr<u8>& data,
size_t ofs);
312 Status transform(
size_t transforms);
321 Status transform_to(
size_t new_flags);
340 u32 get_average_color()
const;
349 size_t img_size()
const;
379 typedef void (*
MipmapCB)(
size_t level,
size_t level_w,
size_t level_h,
const u8*
RESTRICT level_data,
size_t level_data_size,
void*
RESTRICT cbData);
435 #endif // INCLUDED_TEX const Status TEX_INVALID_COLOR_TYPE
Definition: tex.h:118
size_t m_Width
Definition: tex.h:228
void tex_set_global_orientation(int orientation)
Set the orientation to which all loaded images will automatically be converted (excepting file format...
Definition: tex.cpp:513
const Status TEX_CODEC_CANNOT_HANDLE
Definition: tex.h:132
const int TEX_BASE_LEVEL_ONLY
special value for levels_to_skip: the callback will only be called for the base mipmap level (i...
Definition: tex.h:367
const Status TEX_COMPRESSED
Definition: tex.h:121
size_t m_Flags
see TexFlags and "Format Conversion" in docs.
Definition: tex.h:233
flags & TEX_DXT is a field indicating compression.
Definition: tex.h:149
mask
Definition: tex.h:199
indicates the image contains an alpha channel.
Definition: tex.h:171
provides a memory range that can be expanded but doesn't waste physical memory or relocate itself...
Definition: dynarray.h:39
const Status TEX_INCOMPLETE_HEADER
Definition: tex.h:116
indicates the image is 8bpp greyscale.
Definition: tex.h:178
indicates B and R pixel components are exchanged.
Definition: tex.h:163
uint8_t u8
Definition: types.h:37
flags & TEX_ORIENTATION is a field indicating orientation, i.e.
Definition: tex.h:190
size_t m_Ofs
offset to image data in file.
Definition: tex.h:226
const Status TEX_FMT_INVALID
Definition: tex.h:117
uint32_t u32
Definition: types.h:39
const Status TEX_NOT_8BIT_PRECISION
Definition: tex.h:119
shared_ptr< u8 > m_Data
file buffer or image data.
Definition: tex.h:216
void tex_util_foreach_mipmap(size_t w, size_t h, size_t bpp, const u8 *data, int levels_to_skip, size_t data_padding, MipmapCB cb, void *RESTRICT cbData)
for a series of mipmaps stored from base to highest, call back for each level.
Definition: tex.cpp:132
size_t m_DataSize
Definition: tex.h:218
size_t tex_hdr_size(const VfsPath &filename)
return the minimum header size (i.e.
Definition: tex.cpp:705
const Status TEX_UNKNOWN_FORMAT
Definition: tex.h:115
i64 Status
Error handling system.
Definition: status.h:171
stores all data describing an image.
Definition: tex.h:209
~Tex()
Definition: tex.h:235
Introduction
Definition: debug.h:404
we need a special value for DXT1a to avoid having to consider flags & TEX_ALPHA to determine S3TC typ...
Definition: tex.h:156
size_t m_Height
Definition: tex.h:229
const Status TEX_INVALID_DATA
Definition: tex.h:127
const char * extension
Definition: mongoose.cpp:1733
const Status TEX_INVALID_LAYOUT
Definition: tex.h:120
#define RESTRICT
Definition: code_annotation.h:320
void(* MipmapCB)(size_t level, size_t level_w, size_t level_h, const u8 *RESTRICT level_data, size_t level_data_size, void *RESTRICT cbData)
callback function for each mipmap level.
Definition: tex.h:379
bool tex_is_known_extension(const VfsPath &pathname)
Is the file's extension that of a texture format supported by tex_load?
Definition: tex.cpp:570
size_t m_Bpp
Definition: tex.h:230
const Status TEX_INVALID_SIZE
Definition: tex.h:122
TexFlags
flags describing the pixel format.
Definition: tex.h:140