Blender V4.3
customdata_file.cc File Reference
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include "MEM_guardedalloc.h"
#include "BLI_endian_defines.h"
#include "BLI_endian_switch.h"
#include "BLI_fileops.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "BKE_customdata_file.h"

Go to the source code of this file.

Classes

struct  CDataFileHeader
 
struct  CDataFileImageHeader
 
struct  CDataFileMeshHeader
 
struct  CDataFileLayer
 
struct  CDataFile
 

Macros

#define CDF_ENDIAN_LITTLE   0
 
#define CDF_ENDIAN_BIG   1
 
#define CDF_DATA_FLOAT   0
 
#define CDF_VERSION   0
 
#define CDF_SUBVERSION   0
 
#define CDF_TILE_SIZE   64
 

Functions

static int cdf_endian ()
 
CDataFilecdf_create (int type)
 
void cdf_free (CDataFile *cdf)
 
static bool cdf_read_header (CDataFile *cdf)
 
static bool cdf_write_header (CDataFile *cdf)
 
bool cdf_read_open (CDataFile *cdf, const char *filepath)
 
bool cdf_read_layer (CDataFile *cdf, const CDataFileLayer *blay)
 
bool cdf_read_data (CDataFile *cdf, uint size, void *data)
 
void cdf_read_close (CDataFile *cdf)
 
bool cdf_write_open (CDataFile *cdf, const char *filepath)
 
bool cdf_write_layer (CDataFile *, CDataFileLayer *)
 
bool cdf_write_data (CDataFile *cdf, uint size, const void *data)
 
void cdf_write_close (CDataFile *cdf)
 
void cdf_remove (const char *filepath)
 
CDataFileLayercdf_layer_find (CDataFile *cdf, int type, const char *name)
 
CDataFileLayercdf_layer_add (CDataFile *cdf, int type, const char *name, size_t datasize)
 

Macro Definition Documentation

◆ CDF_DATA_FLOAT

#define CDF_DATA_FLOAT   0

Definition at line 28 of file customdata_file.cc.

Referenced by cdf_layer_add(), and cdf_read_header().

◆ CDF_ENDIAN_BIG

#define CDF_ENDIAN_BIG   1

Definition at line 26 of file customdata_file.cc.

Referenced by cdf_endian().

◆ CDF_ENDIAN_LITTLE

#define CDF_ENDIAN_LITTLE   0

Definition at line 25 of file customdata_file.cc.

Referenced by cdf_endian().

◆ CDF_SUBVERSION

#define CDF_SUBVERSION   0

Definition at line 64 of file customdata_file.cc.

Referenced by cdf_write_open().

◆ CDF_TILE_SIZE

#define CDF_TILE_SIZE   64

Definition at line 65 of file customdata_file.cc.

Referenced by cdf_write_open().

◆ CDF_VERSION

#define CDF_VERSION   0

Definition at line 63 of file customdata_file.cc.

Referenced by cdf_read_header(), and cdf_write_open().

Function Documentation

◆ cdf_create()

CDataFile * cdf_create ( int type)

Definition at line 96 of file customdata_file.cc.

References MEM_callocN, and CDataFile::type.

Referenced by CustomData_external_read(), and CustomData_external_write().

◆ cdf_endian()

static int cdf_endian ( )
static

Definition at line 87 of file customdata_file.cc.

References CDF_ENDIAN_BIG, CDF_ENDIAN_LITTLE, ENDIAN_ORDER, and L_ENDIAN.

Referenced by cdf_read_header(), and cdf_write_open().

◆ cdf_free()

void cdf_free ( CDataFile * cdf)

◆ cdf_layer_add()

CDataFileLayer * cdf_layer_add ( CDataFile * cdf,
int type,
const char * name,
size_t datasize )

◆ cdf_layer_find()

CDataFileLayer * cdf_layer_find ( CDataFile * cdf,
int type,
const char * name )

◆ cdf_read_close()

void cdf_read_close ( CDataFile * cdf)

Definition at line 331 of file customdata_file.cc.

References CDataFile::readf.

Referenced by cdf_free(), cdf_read_open(), and CustomData_external_read().

◆ cdf_read_data()

bool cdf_read_data ( CDataFile * cdf,
uint size,
void * data )

◆ cdf_read_header()

◆ cdf_read_layer()

bool cdf_read_layer ( CDataFile * cdf,
const CDataFileLayer * blay )

◆ cdf_read_open()

bool cdf_read_open ( CDataFile * cdf,
const char * filepath )

◆ cdf_remove()

void cdf_remove ( const char * filepath)

Definition at line 408 of file customdata_file.cc.

References BLI_delete().

◆ cdf_write_close()

void cdf_write_close ( CDataFile * cdf)

Definition at line 400 of file customdata_file.cc.

References CDataFile::writef.

Referenced by cdf_free(), and CustomData_external_write().

◆ cdf_write_data()

bool cdf_write_data ( CDataFile * cdf,
uint size,
const void * data )

Definition at line 390 of file customdata_file.cc.

References CDataFile::writef.

Referenced by layerWrite_mdisps().

◆ cdf_write_header()

◆ cdf_write_layer()

bool cdf_write_layer ( CDataFile * cdf,
CDataFileLayer * blay )

Definition at line 385 of file customdata_file.cc.

Referenced by CustomData_external_write().

◆ cdf_write_open()