Blender
V3.3
|
Go to the source code of this file.
Classes | |
struct | Thumbnail |
Macros | |
#define | MAKE_ID(a, b, c, d) ((int)(d) << 24 | (int)(c) << 16 | (b) << 8 | (a)) |
Enumerations | |
enum | eThumbStatus { BT_OK = 0 , BT_FILE_ERR = 1 , BT_COMPRES_ERR = 2 , BT_DECOMPRESS_ERR = 3 , BT_INVALID_FILE = 4 , BT_EARLY_VERSION = 5 , BT_INVALID_THUMB = 6 , BT_ERROR = 9 } |
Functions | |
std::optional< blender::Vector< uint8_t > > | blendthumb_create_png_data_from_thumb (const Thumbnail *thumb) |
eThumbStatus | blendthumb_create_thumb_from_file (struct FileReader *rawfile, Thumbnail *thumb) |
Shared thumbnail extraction logic.
Used for both MS-Windows DLL and Unix command line.
Definition in file blendthumb.hh.
#define MAKE_ID | ( | a, | |
b, | |||
c, | |||
d | |||
) | ((int)(d) << 24 | (int)(c) << 16 | (b) << 8 | (a)) |
Definition at line 52 of file blendthumb.hh.
enum eThumbStatus |
Enumerator | |
---|---|
BT_OK | |
BT_FILE_ERR | |
BT_COMPRES_ERR | |
BT_DECOMPRESS_ERR | |
BT_INVALID_FILE | |
BT_EARLY_VERSION | |
BT_INVALID_THUMB | |
BT_ERROR |
Definition at line 27 of file blendthumb.hh.
std::optional<blender::Vector<uint8_t> > blendthumb_create_png_data_from_thumb | ( | const Thumbnail * | thumb | ) |
Definition at line 82 of file blendthumb_png.cc.
References BLI_assert, Thumbnail::data, filtered_rows_from_thumb(), Thumbnail::height, blender::Array< T, InlineBufferCapacity, Allocator >::is_empty(), MAKE_ID, png_chunk_create(), PNG_CHUNK_EXTRA, png_extend_native_int32(), blender::Vector< T, InlineBufferCapacity, Allocator >::reserve(), Thumbnail::width, and zlib_compress().
Referenced by extract_png_from_blend_file().
eThumbStatus blendthumb_create_thumb_from_file | ( | struct FileReader * | rawfile, |
Thumbnail * | thumb | ||
) |
This function extracts the thumbnail from the .blend file into thumb. Returns BT_OK for success and the relevant error code otherwise.
Definition at line 170 of file blendthumb_extract.cc.
References blend_header_check_magic(), blend_header_is_endian_switch_needed(), blend_header_is_version_valid(), blend_header_pointer_size(), blendthumb_extract_from_file_impl(), BLI_file_magic_is_gzip(), BLI_file_magic_is_zstd(), BLI_filereader_new_gzip(), BLI_filereader_new_zstd(), BLI_str_startswith(), BT_EARLY_VERSION, BT_ERROR, BT_INVALID_FILE, BT_OK, FileReader::close, err, file, FileReader::read, FileReader::seek, and thumb_data_vertical_flip().
Referenced by extract_png_from_blend_file(), and CBlendThumb::GetThumbnail().