Blender
V3.3
|
#include <cstring>
#include <optional>
#include <zlib.h>
#include "blendthumb.hh"
#include "BLI_endian_defines.h"
#include "BLI_endian_switch.h"
#include "BLI_vector.hh"
Go to the source code of this file.
Macros | |
#define | PNG_CHUNK_EXTRA 12 |
Functions | |
static void | png_extend_native_int32 (blender::Vector< uint8_t > &output, int32_t data) |
static void | png_chunk_create (blender::Vector< uint8_t > &output, const uint32_t tag, const blender::Vector< uint8_t > &data) |
static blender::Vector< uint8_t > | filtered_rows_from_thumb (const Thumbnail *thumb) |
static std::optional< blender::Vector< uint8_t > > | zlib_compress (const blender::Vector< uint8_t > &data) |
std::optional< blender::Vector< uint8_t > > | blendthumb_create_png_data_from_thumb (const Thumbnail *thumb) |
Expose blendthumb_create_png_data_from_thumb that creates the PNG data but does not write it to a file.
Definition in file blendthumb_png.cc.
#define PNG_CHUNK_EXTRA 12 |
The number of bytes each chunk uses on top of the data that's written.
Definition at line 30 of file blendthumb_png.cc.
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().
|
static |
Definition at line 46 of file blendthumb_png.cc.
References BLI_assert, Thumbnail::data, Thumbnail::height, and Thumbnail::width.
Referenced by blendthumb_create_png_data_from_thumb().
|
static |
Definition at line 32 of file blendthumb_png.cc.
References data, output, and png_extend_native_int32().
Referenced by blendthumb_create_png_data_from_thumb().
|
static |
Definition at line 21 of file blendthumb_png.cc.
References BLI_endian_switch_int32(), data, ENDIAN_ORDER, L_ENDIAN, and output.
Referenced by blendthumb_create_png_data_from_thumb(), and png_chunk_create().
|
static |
Definition at line 62 of file blendthumb_png.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::data(), data, and blender::Vector< T, InlineBufferCapacity, Allocator >::resize().
Referenced by blendthumb_create_png_data_from_thumb().