Blender
V3.3
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#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 |
Typedefs | |
typedef struct CDataFileHeader | CDataFileHeader |
typedef struct CDataFileImageHeader | CDataFileImageHeader |
typedef struct CDataFileMeshHeader | CDataFileMeshHeader |
Functions | |
static int | cdf_endian (void) |
CDataFile * | cdf_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, CDataFileLayer *blay) |
bool | cdf_read_data (CDataFile *cdf, unsigned int size, void *data) |
void | cdf_read_close (CDataFile *cdf) |
bool | cdf_write_open (CDataFile *cdf, const char *filepath) |
bool | cdf_write_layer (CDataFile *UNUSED(cdf), CDataFileLayer *UNUSED(blay)) |
bool | cdf_write_data (CDataFile *cdf, unsigned int size, void *data) |
void | cdf_write_close (CDataFile *cdf) |
void | cdf_remove (const char *filepath) |
CDataFileLayer * | cdf_layer_find (CDataFile *cdf, int type, const char *name) |
CDataFileLayer * | cdf_layer_add (CDataFile *cdf, int type, const char *name, size_t datasize) |
#define CDF_DATA_FLOAT 0 |
Definition at line 26 of file customdata_file.c.
#define CDF_ENDIAN_BIG 1 |
Definition at line 24 of file customdata_file.c.
#define CDF_ENDIAN_LITTLE 0 |
Definition at line 23 of file customdata_file.c.
#define CDF_SUBVERSION 0 |
Definition at line 62 of file customdata_file.c.
#define CDF_TILE_SIZE 64 |
Definition at line 63 of file customdata_file.c.
#define CDF_VERSION 0 |
Definition at line 61 of file customdata_file.c.
typedef struct CDataFileHeader CDataFileHeader |
typedef struct CDataFileImageHeader CDataFileImageHeader |
typedef struct CDataFileMeshHeader CDataFileMeshHeader |
CDataFile* cdf_create | ( | int | type | ) |
Definition at line 94 of file customdata_file.c.
References MEM_callocN, CDataFile::type, and type.
Referenced by CustomData_external_read(), and CustomData_external_write().
|
static |
Definition at line 85 of file customdata_file.c.
References CDF_ENDIAN_BIG, CDF_ENDIAN_LITTLE, ENDIAN_ORDER, and L_ENDIAN.
Referenced by cdf_read_header(), and cdf_write_open().
Definition at line 103 of file customdata_file.c.
References cdf_read_close(), cdf_write_close(), CDataFile::layer, and MEM_freeN.
Referenced by CustomData_external_read(), and CustomData_external_write().
CDataFileLayer* cdf_layer_add | ( | CDataFile * | cdf, |
int | type, | ||
const char * | name, | ||
size_t | datasize | ||
) |
Definition at line 428 of file customdata_file.c.
References BLI_strncpy(), CDF_DATA_FLOAT, CDF_LAYER_NAME_MAX, CDataFileLayer::datasize, CDataFileLayer::datatype, CDataFile::layer, MEM_calloc_arrayN, CDataFileLayer::name, CDataFileLayer::structbytes, CDataFile::totlayer, CDataFileLayer::type, and type.
Referenced by CustomData_external_write().
CDataFileLayer* cdf_layer_find | ( | CDataFile * | cdf, |
int | type, | ||
const char * | name | ||
) |
Definition at line 412 of file customdata_file.c.
References Freestyle::a, CDataFile::layer, CDataFileLayer::name, NULL, STREQ, CDataFile::totlayer, CDataFileLayer::type, and type.
Referenced by CustomData_external_read(), and CustomData_external_write().
Definition at line 328 of file customdata_file.c.
References NULL, and CDataFile::readf.
Referenced by cdf_free(), cdf_read_open(), and CustomData_external_read().
Definition at line 313 of file customdata_file.c.
References BLI_endian_switch_float_array(), data, CDataFile::readf, size(), and CDataFile::switchendian.
Referenced by layerRead_mdisps().
Definition at line 117 of file customdata_file.c.
References Freestyle::a, BLI_endian_switch_int32(), BLI_endian_switch_uint64(), BLI_fseek(), CDataFile::btype, CDF_DATA_FLOAT, cdf_endian(), CDF_TYPE_IMAGE, CDF_TYPE_MESH, CDF_VERSION, CDataFile::dataoffset, CDataFileLayer::datasize, CDataFileLayer::datatype, ELEM, CDataFileHeader::endian, CDataFile::header, CDataFileHeader::ID, CDataFile::image, image(), CDataFile::layer, MEM_calloc_arrayN, CDataFile::mesh, mesh, offset, CDataFile::readf, CDataFileHeader::structbytes, CDataFileLayer::structbytes, CDataFile::switchendian, CDataFileHeader::totlayer, CDataFile::totlayer, CDataFileHeader::type, CDataFileLayer::type, and CDataFileHeader::version.
Referenced by cdf_read_open().
bool cdf_read_layer | ( | CDataFile * | cdf, |
CDataFileLayer * | blay | ||
) |
Definition at line 295 of file customdata_file.c.
References Freestyle::a, BLI_fseek(), CDataFile::dataoffset, CDataFileLayer::datasize, CDataFile::layer, offset, CDataFile::readf, and CDataFile::totlayer.
Referenced by CustomData_external_read().
Definition at line 271 of file customdata_file.c.
References BLI_fopen(), cdf_read_close(), cdf_read_header(), CDataFile::header, CDataFile::readf, CDataFileHeader::type, and CDataFile::type.
Referenced by CustomData_external_read().
void cdf_remove | ( | const char * | filepath | ) |
Definition at line 405 of file customdata_file.c.
References BLI_delete().
Definition at line 397 of file customdata_file.c.
References NULL, and CDataFile::writef.
Referenced by cdf_free(), and CustomData_external_write().
Definition at line 387 of file customdata_file.c.
References data, size(), and CDataFile::writef.
Referenced by layerWrite_mdisps().
Definition at line 232 of file customdata_file.c.
References Freestyle::a, CDataFile::btype, CDF_TYPE_IMAGE, CDF_TYPE_MESH, CDataFile::header, CDataFile::image, image(), CDataFile::layer, CDataFile::mesh, mesh, CDataFileHeader::totlayer, CDataFileHeader::type, and CDataFile::writef.
Referenced by cdf_write_open().
bool cdf_write_layer | ( | CDataFile * | UNUSEDcdf, |
CDataFileLayer * | UNUSEDblay | ||
) |
Definition at line 382 of file customdata_file.c.
Definition at line 336 of file customdata_file.c.
References BLI_fopen(), CDataFile::btype, cdf_endian(), CDF_SUBVERSION, CDF_TILE_SIZE, CDF_TYPE_IMAGE, CDF_TYPE_MESH, CDF_VERSION, cdf_write_header(), CDataFileHeader::endian, CDataFile::header, CDataFileHeader::ID, CDataFile::image, image(), CDataFile::mesh, mesh, CDataFileHeader::structbytes, CDataFileHeader::subversion, CDataFileHeader::totlayer, CDataFile::totlayer, CDataFileHeader::type, CDataFile::type, CDataFileHeader::version, and CDataFile::writef.
Referenced by CustomData_external_write().