25#define CDF_ENDIAN_LITTLE 0
26#define CDF_ENDIAN_BIG 1
28#define CDF_DATA_FLOAT 0
64#define CDF_SUBVERSION 0
65#define CDF_TILE_SIZE 64
125 FILE *f = cdf->
readf;
135 if (memcmp(header->
ID,
"BCDF",
sizeof(header->
ID)) != 0) {
158 if (
BLI_fseek(f, offset, SEEK_SET) != 0) {
175 offset += image->structbytes;
188 offset += mesh->structbytes;
192 if (
BLI_fseek(f, offset, SEEK_SET) != 0) {
204 for (a = 0; a < header->
totlayer; a++) {
205 layer = &cdf->
layer[a];
222 offset += layer->structbytes;
225 if (
BLI_fseek(f, offset, SEEK_SET) != 0) {
263 for (a = 0; a < header->
totlayer; a++) {
264 layer = &cdf->
layer[a];
305 for (a = 0; a < cdf->
totlayer; a++) {
306 if (&cdf->
layer[a] == blay) {
319 if (!fread(data, size, 1, cdf->
readf)) {
335 cdf->
readf =
nullptr;
393 if (!fwrite(data, size, 1, cdf->
writef)) {
420 for (a = 0; a < cdf->
totlayer; a++) {
421 layer = &cdf->
layer[a];
423 if (layer->type == type &&
STREQ(layer->name, name)) {
441 cdf->
layer = newlayer;
449 layer->datasize = datasize;
#define CDF_LAYER_NAME_MAX
struct CDataFileLayer CDataFileLayer
BLI_INLINE void BLI_endian_switch_uint64(uint64_t *val) ATTR_NONNULL(1)
void BLI_endian_switch_float_array(float *val, int size) ATTR_NONNULL(1)
BLI_INLINE void BLI_endian_switch_int32(int *val) ATTR_NONNULL(1)
File and directory operations.
FILE * BLI_fopen(const char *filepath, const char *mode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
int BLI_delete(const char *path, bool dir, bool recursive) ATTR_NONNULL()
int BLI_fseek(FILE *stream, int64_t offset, int whence)
#define STRNCPY(dst, src)
Read Guarded memory(de)allocation.
input_tx image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "preview_img") .compute_source("compositor_compute_preview.glsl") .do_static_compilation(true)
void cdf_remove(const char *filepath)
CDataFile * cdf_create(int type)
bool cdf_read_layer(CDataFile *cdf, const CDataFileLayer *blay)
#define CDF_ENDIAN_LITTLE
bool cdf_write_open(CDataFile *cdf, const char *filepath)
static bool cdf_read_header(CDataFile *cdf)
bool cdf_read_data(CDataFile *cdf, uint size, void *data)
static bool cdf_write_header(CDataFile *cdf)
CDataFileLayer * cdf_layer_find(CDataFile *cdf, int type, const char *name)
void cdf_read_close(CDataFile *cdf)
CDataFileLayer * cdf_layer_add(CDataFile *cdf, int type, const char *name, size_t datasize)
bool cdf_write_data(CDataFile *cdf, uint size, const void *data)
void cdf_write_close(CDataFile *cdf)
void cdf_free(CDataFile *cdf)
bool cdf_read_open(CDataFile *cdf, const char *filepath)
bool cdf_write_layer(CDataFile *, CDataFileLayer *)
void *(* MEM_calloc_arrayN)(size_t len, size_t size, const char *str)
void MEM_freeN(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
unsigned __int64 uint64_t
CDataFileImageHeader image
union CDataFile::@81 btype