Blender V4.5
blo_core_bhead.cc File Reference
#include "BLI_filereader.h"
#include "BLO_core_bhead.hh"

Go to the source code of this file.

Functions

static void switch_endian_bh4 (BHead4 *bhead)
static void switch_endian_small_bh8 (SmallBHead8 *bhead)
static void switch_endian_large_bh8 (LargeBHead8 *bhead)
static BHead bhead_from_bhead4 (const BHead4 &bhead4)
static const void * old_ptr_from_uint64_ptr (const uint64_t ptr, const bool use_endian_swap)
static BHead bhead_from_small_bhead8 (const SmallBHead8 &small_bhead8, const bool use_endian_swap)
static BHead bhead_from_large_bhead8 (const LargeBHead8 &large_bhead8, const bool use_endian_swap)
std::optional< BHeadBLO_readfile_read_bhead (FileReader *file, const BHeadType type, const bool do_endian_swap)

Function Documentation

◆ bhead_from_bhead4()

BHead bhead_from_bhead4 ( const BHead4 & bhead4)
static

◆ bhead_from_large_bhead8()

BHead bhead_from_large_bhead8 ( const LargeBHead8 & large_bhead8,
const bool use_endian_swap )
static

◆ bhead_from_small_bhead8()

BHead bhead_from_small_bhead8 ( const SmallBHead8 & small_bhead8,
const bool use_endian_swap )
static

◆ BLO_readfile_read_bhead()

std::optional< BHead > BLO_readfile_read_bhead ( FileReader * file,
BHeadType type,
bool do_endian_swap )

Parse the next BHead in the file, increasing the file reader to after the BHead. This automatically converts the stored BHead (one of BHeadType) to the runtime BHead type.

Returns
The next #BHEad or #std::nullopt if the file is exhausted.

Definition at line 94 of file blo_core_bhead.cc.

References BHead4, bhead_from_bhead4(), bhead_from_large_bhead8(), bhead_from_small_bhead8(), BLO_CODE_DATA, BLO_CODE_ENDB, BHead4::code, LargeBHead8::code, SmallBHead8::code, LargeBHead8, FileReader::read, SmallBHead8, switch_endian_bh4(), switch_endian_large_bh8(), and switch_endian_small_bh8().

Referenced by blendthumb_extract_from_file_impl(), and get_bhead().

◆ old_ptr_from_uint64_ptr()

const void * old_ptr_from_uint64_ptr ( const uint64_t ptr,
const bool use_endian_swap )
static

Definition at line 62 of file blo_core_bhead.cc.

References ptr, and uint32_from_uint64_ptr().

Referenced by bhead_from_large_bhead8(), and bhead_from_small_bhead8().

◆ switch_endian_bh4()

void switch_endian_bh4 ( BHead4 * bhead)
static

◆ switch_endian_large_bh8()

void switch_endian_large_bh8 ( LargeBHead8 * bhead)
static

◆ switch_endian_small_bh8()

void switch_endian_small_bh8 ( SmallBHead8 * bhead)
static