64 fileClock = time(
nullptr);
65 fileTime = localtime(&fileClock);
74 for (i = 0; i < 3; i++) {
133 if (cineon ==
nullptr) {
135 printf(
"Cineon: Failed to malloc cineon file structure.\n");
144 cineon->
file =
nullptr;
152 printf(
"Cineon: Not enough data for header.\n");
162 printf(
"Cineon: File is MSB.\n");
168 printf(
"Cineon: File is LSB.\n");
206 if (cineon->
depth == 1) {
212 else if (cineon->
depth == 3) {
233 printf(
"Cineon: Cineon image depth unsupported: %d\n", cineon->
depth);
306 cineon->
gamma = 1.7f;
311 printf(
" Element %d:\n", i);
329 printf(
"----------------------------\n");
337 const char *shortFilename =
nullptr;
341 if (cineon ==
nullptr) {
343 printf(
"cineon: Failed to malloc cineon file structure.\n");
349 cineon->
width = width;
367 cineon->
gamma = 1.7f;
370 if (shortFilename ==
nullptr) {
371 shortFilename = filepath;
378 if (cineon->
file ==
nullptr) {
380 printf(
"cineon: Couldn't open file %s\n", filepath);
388 if (fwrite(&header,
sizeof(header), 1, cineon->
file) == 0) {
390 printf(
"cineon: Couldn't write image header\n");
File and directory operations.
Read Blender memory allocation and freeing.
#define CINEON_FILE_MAGIC
#define CINEON_UNDEFINED_U32
#define CINEON_UNDEFINED_R32
void * MEM_new_uninitialized(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
size_t getRowLength(size_t width, const LogImageElement *logElement)
char * STRNCPY(char(&dst)[N], const char *src)
FILE * BLI_fopen(const char *filepath, const char *mode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void logImageClose(LogImageFile *logImage)
BLI_INLINE unsigned int swap_uint(unsigned int x, int swap)
void cineonSetVerbose(int verbosity)
LogImageFile * cineonOpen(const uchar *buffer, size_t bufferSize)
@ transfer_PrintingDensity
int logimage_fread(void *buffer, size_t size, uint count, LogImageFile *logFile)
BLI_INLINE float swap_float(float x, int swap)
static void fillCineonMainHeader(LogImageFile *cineon, CineonMainHeader *header, const char *filepath, const char *creator)
LogImageFile * cineonCreate(const char *filepath, int width, int height, const char *creator)
CineonImageHeader imageHeader
CineonFileHeader fileHeader
unsigned char * memCursor
LogImageElement element[8]
unsigned char * memBuffer