17 #include <sys/types.h>
66 fileTime = localtime(&fileClock);
127 const char *filepath = (
const char *)byteStuff;
132 printf(
"DPX: Failed to malloc dpx file structure.\n");
143 if (fromMemory == 0) {
148 printf(
"DPX: Failed to open file \"%s\".\n", filepath);
159 dpx->
memBuffer = (
unsigned char *)byteStuff;
160 dpx->
memCursor = (
unsigned char *)byteStuff;
166 printf(
"DPX: Not enough data for header in \"%s\".\n", byteStuff);
176 printf(
"DPX: File is MSB.\n");
182 printf(
"DPX: File is LSB.\n");
198 printf(
"DPX: Wrong number of elements: %d\n", dpx->
numElements);
209 printf(
"DPX: Wrong image dimension: %dx%d\n", dpx->
width, dpx->
height);
258 printf(
"DPX: Unsupported image depth: %d\n", dpx->
depth);
267 printf(
"DPX: Unsupported bitsPerSample for elements %d: %d\n",
280 printf(
"DPX: Unsupported packing for element %d: %d\n", i, dpx->
element[i].
packing);
294 printf(
"DPX: Image header is corrupted.\n");
386 printf(
" Element %d:\n", i);
400 printf(
"Gamma: %f\n", dpx->
gamma);
404 printf(
"----------------------------\n");
421 const char *shortFilename =
NULL;
422 unsigned char pad[6044];
427 printf(
"DPX: Failed to malloc dpx file structure.\n");
440 switch (bitsPerSample) {
454 printf(
"DPX: bitsPerSample not supported: %d\n", bitsPerSample);
471 if (isLogarithmic == 0) {
484 if (referenceWhite > 0) {
491 if (referenceBlack > 0) {
506 if (shortFilename ==
NULL) {
507 shortFilename = filepath;
517 printf(
"DPX: Couldn't open file %s\n", filepath);
525 if (fwrite(&header,
sizeof(header), 1, dpx->
file) == 0) {
527 printf(
"DPX: Couldn't write image header\n");
535 memset(&
pad, 0, 6044);
536 if (fwrite(&
pad, 6044, 1, dpx->
file) == 0) {
538 printf(
"DPX: Couldn't write image header\n");
File and directory operations.
FILE * BLI_fopen(const char *filepath, const char *mode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
Read Guarded memory(de)allocation.
int pad[32 - sizeof(int)]
void dpxSetVerbose(int verbosity)
static void fillDpxMainHeader(LogImageFile *dpx, DpxMainHeader *header, const char *filename, const char *creator)
LogImageFile * dpxCreate(const char *filepath, int width, int height, int bitsPerSample, int hasAlpha, int isLogarithmic, int referenceWhite, int referenceBlack, float gamma, const char *creator)
LogImageFile * dpxOpen(const unsigned char *byteStuff, int fromMemory, size_t bufferSize)
#define DPX_UNDEFINED_U32
#define DPX_UNDEFINED_R32
#define IS_DPX_UNDEFINED_R32(x)
void logImageClose(LogImageFile *logImage)
size_t getRowLength(size_t width, LogImageElement logElement)
BLI_INLINE float swap_float(float x, int swap)
@ transfer_PrintingDensity
BLI_INLINE unsigned short swap_ushort(unsigned short x, int swap)
BLI_INLINE unsigned int swap_uint(unsigned int x, int swap)
int logimage_fread(void *buffer, size_t size, unsigned int count, LogImageFile *logFile)
void *(* MEM_mallocN)(size_t len, const char *str)
DpxTelevisionHeader televisionHeader
DpxImageHeader imageHeader
unsigned char * memBuffer
unsigned char * memCursor
LogImageElement element[8]