|
Blender V4.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 (FileReader *rawfile, Thumbnail *thumb) |
Shared thumbnail extraction logic.
Used for both MS-Windows DLL and Unix command line.
Definition in file blendthumb.hh.
Definition at line 53 of file blendthumb.hh.
Referenced by blendthumb_create_png_data_from_thumb(), and blendthumb_extract_from_file_impl().
| 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 28 of file blendthumb.hh.
| std::optional< blender::Vector< uint8_t > > blendthumb_create_png_data_from_thumb | ( | const Thumbnail * | thumb | ) |
Definition at line 83 of file blendthumb_png.cc.
References BLI_assert, Thumbnail::data, blender::Vector< T, InlineBufferCapacity, Allocator >::extend_unchecked(), 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(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), Thumbnail::width, and zlib_compress().
Referenced by extract_png_from_blend_file().
| eThumbStatus blendthumb_create_thumb_from_file | ( | 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 171 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, endian_switch(), FileReader::read, FileReader::seek, and thumb_data_vertical_flip().
Referenced by extract_png_from_blend_file(), and CBlendThumb::GetThumbnail().