274 Status decode(
const std::shared_ptr<u8>& data,
size_t data_size);
309 Status wrap(
size_t w,
size_t h,
size_t bpp,
size_t flags,
const std::shared_ptr<u8>& data,
size_t ofs);
321 Status transform(
size_t transforms);
330 Status transform_to(
size_t new_flags);
344 const std::vector<MIPLevel>&
GetMIPLevels()
const {
return m_MIPLevels; }
351 u32 get_average_color()
const;
360 size_t img_size()
const;
363 void UpdateMIPLevels();
394 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);
450 #endif // INCLUDED_TEX const Status TEX_INVALID_COLOR_TYPE
Definition: tex.h:118
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:508
const std::vector< MIPLevel > & GetMIPLevels() const
Definition: tex.h:344
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:382
Stores all data describing an image.
Definition: tex.h:208
const Status TEX_COMPRESSED
Definition: tex.h:121
u32 dataSize
Definition: tex.h:215
size_t m_Flags
see TexFlags and "Format Conversion" in docs.
Definition: tex.h:242
~Tex()
Definition: tex.h:244
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:235
const Status TEX_FMT_INVALID
Definition: tex.h:117
uint32_t u32
Definition: types.h:39
size_t m_Width
Definition: tex.h:237
const Status TEX_NOT_8BIT_PRECISION
Definition: tex.h:119
size_t m_Bpp
Definition: tex.h:239
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:128
size_t tex_hdr_size(const VfsPath &filename)
return the minimum header size (i.e.
Definition: tex.cpp:701
u32 height
Definition: tex.h:217
const Status TEX_UNKNOWN_FORMAT
Definition: tex.h:115
i64 Status
Error handling system.
Definition: status.h:169
Introduction
Definition: debug.h:407
we need a special value for DXT1a to avoid having to consider flags & TEX_ALPHA to determine S3TC typ...
Definition: tex.h:156
const Status TEX_INVALID_DATA
Definition: tex.h:127
std::vector< MIPLevel > m_MIPLevels
Definition: tex.h:365
const char * extension
Definition: mongoose.cpp:1741
const Status TEX_INVALID_LAYOUT
Definition: tex.h:120
#define RESTRICT
Definition: code_annotation.h:332
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:394
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:565
size_t m_Height
Definition: tex.h:238
u32 width
Definition: tex.h:216
const Status TEX_INVALID_SIZE
Definition: tex.h:122
std::shared_ptr< u8 > m_Data
file buffer or image data.
Definition: tex.h:225
u8 * data
Definition: tex.h:214
size_t m_DataSize
Definition: tex.h:227
TexFlags
flags describing the pixel format.
Definition: tex.h:140