|
Blender V5.0
|
#include <cctype>#include <cstring>#include "BLI_alloca.h"#include "BLI_endian_defines.h"#include "BLI_fileops.h"#include "BLI_filereader.h"#include "BLI_string.h"#include "BLO_core_bhead.hh"#include "BLO_core_blend_header.hh"#include "blendthumb.hh"Go to the source code of this file.
Functions | |
| static void | thumb_data_vertical_flip (Thumbnail *thumb) |
| static int32_t | bytes_to_native_i32 (const uint8_t bytes[4]) |
| 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 BlenderHeader &header) |
| 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.
| 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 139 of file blendthumb_extract.cc.
References blendthumb_extract_from_file_impl(), BLI_assert, BLI_file_magic_is_gzip(), BLI_file_magic_is_zstd(), BLI_filereader_new_gzip(), BLI_filereader_new_zstd(), BLI_str_startswith(), BLO_readfile_blender_header_decode(), BT_EARLY_VERSION, BT_ERROR, BT_INVALID_FILE, BT_OK, FileReader::close, BlenderHeader::endian, ENDIAN_ORDER, BlenderHeader::file_version, L_ENDIAN, FileReader::read, FileReader::seek, and thumb_data_vertical_flip().
Referenced by extract_png_from_blend_file(), generate_nsimage_for_file(), and CBlendThumb::GetThumbnail().
|
static |
Definition at line 83 of file blendthumb_extract.cc.
References BlenderHeader::bhead_type(), BLI_assert, BLO_readfile_read_bhead(), BT_INVALID_THUMB, BT_OK, bytes_to_native_i32(), Array< T, InlineBufferCapacity, Allocator >::data(), Thumbnail::data, BlenderHeader::endian, file_read(), file_seek(), Thumbnail::height, L_ENDIAN, MAKE_ID, and Thumbnail::width.
Referenced by blendthumb_create_thumb_from_file().
|
static |
Definition at line 47 of file blendthumb_extract.cc.
References data.
Referenced by blendthumb_extract_from_file_impl().
|
static |
Definition at line 56 of file blendthumb_extract.cc.
References FileReader::read.
Referenced by blendthumb_extract_from_file_impl(), and BLI_filereader_new_file().
|
static |
Definition at line 61 of file blendthumb_extract.cc.
References blender::Array< T, InlineBufferCapacity, Allocator >::data(), len, FileReader::read, and FileReader::seek.
Referenced by blendthumb_extract_from_file_impl(), and BLI_filereader_new_file().
|
static |
Definition at line 28 of file blendthumb_extract.cc.
References free(), thumb_data_vertical_flip(), top, x, and y.
Referenced by blendthumb_create_thumb_from_file(), and thumb_data_vertical_flip().