|
Blender V4.3
|
#include <cctype>#include <cstring>#include "BLI_alloca.h"#include "BLI_endian_defines.h"#include "BLI_endian_switch.h"#include "BLI_fileops.h"#include "BLI_filereader.h"#include "BLI_string.h"#include "blendthumb.hh"Go to the source code of this file.
Functions | |
| static bool | blend_header_check_magic (const char header[12]) |
| static bool | blend_header_is_version_valid (const char header[12]) |
| static int | blend_header_pointer_size (const char header[12]) |
| static bool | blend_header_is_endian_switch_needed (const char header[12]) |
| static void | thumb_data_vertical_flip (Thumbnail *thumb) |
| static int32_t | bytes_to_native_i32 (const uint8_t bytes[4], bool endian_switch) |
| static bool | file_read (FileReader *file, uint8_t *buf, size_t buf_len) |
| static bool | file_seek (FileReader *file, size_t len) |
| static eThumbStatus | blendthumb_extract_from_file_impl (FileReader *file, Thumbnail *thumb, const size_t bhead_size, const bool endian_switch) |
| eThumbStatus | blendthumb_create_thumb_from_file (FileReader *rawfile, Thumbnail *thumb) |
Expose blendthumb_create_thumb_from_file that creates the PNG data but does not write it to a file.
Definition in file blendthumb_extract.cc.
|
static |
Definition at line 24 of file blendthumb_extract.cc.
References BLI_str_startswith(), and ELEM.
Referenced by blendthumb_create_thumb_from_file().
|
static |
Definition at line 55 of file blendthumb_extract.cc.
References B_ENDIAN, ENDIAN_ORDER, and L_ENDIAN.
Referenced by blendthumb_create_thumb_from_file().
|
static |
Definition at line 41 of file blendthumb_extract.cc.
Referenced by blendthumb_create_thumb_from_file().
|
static |
Definition at line 50 of file blendthumb_extract.cc.
Referenced by blendthumb_create_thumb_from_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().
|
static |
Definition at line 116 of file blendthumb_extract.cc.
References BLI_array_alloca, BT_INVALID_THUMB, BT_OK, bytes_to_native_i32(), blender::Array< T, InlineBufferCapacity, Allocator >::data(), Thumbnail::data, endian_switch(), file_read(), file_seek(), Thumbnail::height, MAKE_ID, UNLIKELY, and Thumbnail::width.
Referenced by blendthumb_create_thumb_from_file().
Definition at line 79 of file blendthumb_extract.cc.
References BLI_endian_switch_int32(), data, and endian_switch().
Referenced by blendthumb_extract_from_file_impl().
|
static |
Definition at line 89 of file blendthumb_extract.cc.
Referenced by blendthumb_extract_from_file_impl().
|
static |
Definition at line 94 of file blendthumb_extract.cc.
References blender::Array< T, InlineBufferCapacity, Allocator >::data(), and len.
Referenced by blendthumb_extract_from_file_impl().
|
static |
Definition at line 60 of file blendthumb_extract.cc.
References blender::Array< T, InlineBufferCapacity, Allocator >::data(), Thumbnail::data, free(), Thumbnail::height, Thumbnail::width, and x.
Referenced by blendthumb_create_thumb_from_file().