![]() |
Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
|
#include "precompiled.h"#include "tex_codec.h"#include <string.h>#include <stdlib.h>#include "lib/allocators/shared_ptr.h"#include "tex.h"
Functions | |
| Status | tex_codec_for_filename (const OsPath &extension, const ITexCodec **c) |
| Find codec that recognizes the desired output file extension. More... | |
| Status | tex_codec_for_header (const u8 *file, size_t file_size, const ITexCodec **c) |
| find codec that recognizes the header's magic field. More... | |
| Status | tex_codec_transform (Tex *t, size_t transforms) |
| transform the texture's pixel format. More... | |
| std::vector< RowPtr > | tex_codec_alloc_rows (const u8 *data, size_t h, size_t pitch, size_t src_flags, size_t dst_orientation) |
| 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. More... | |
Variables | |
| TexCodecDds | DdsCodec |
| TexCodecPng | PngCodec |
| TexCodecTga | TgaCodec |
| TexCodecBmp | BmpCodec |
| static const ITexCodec * | codecs [] |
| static const int | codecs_len = sizeof(codecs) / sizeof(ITexCodec*) |
| std::vector< RowPtr > tex_codec_alloc_rows | ( | const u8 * | data, |
| size_t | h, | ||
| size_t | pitch, | ||
| size_t | src_flags, | ||
| size_t | dst_orientation | ||
| ) |
Find codec that recognizes the desired output file extension.
| extension | |
| c | (out) vtbl of responsible codec |
find codec that recognizes the header's magic field.
| data | typically contents of file, but need only include the (first 4 bytes of) header. |
| data_size | [bytes] |
| c | (out) vtbl of responsible codec |
transform the texture's pixel format.
tries each codec's transform method once, or until one indicates success.
| t | texture object |
| transforms | OR-ed combination of TEX_* flags that are to be changed. |
| 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.
| t | input texture object |
| transforms | transformations to be applied to pixel format |
| hdr | header data |
| hdr_size | [bytes] |
| da | output data array (will be expanded as necessary) |
| TexCodecBmp BmpCodec |
|
static |
| TexCodecDds DdsCodec |
| TexCodecPng PngCodec |
| TexCodecTga TgaCodec |