27 int width, height, depth;
33 if (image ==
nullptr) {
34 printf(
"DPX/Cineon: error opening image.\n");
41 if (ibuf ==
nullptr) {
56 ibuf->
ftype = use_cineon ? IMB_FTYPE_CINEON : IMB_FTYPE_DPX;
72 const uchar *rect_ptr;
73 int x,
y, depth, bitspersample, rvalue;
76 printf(
"DPX/Cineon: saving in memory is not supported.\n");
82 depth = (ibuf->
planes + 7) >> 3;
83 if (depth > 4 || depth < 3) {
84 printf(
"DPX/Cineon: unsupported depth: %d for file: '%s'\n", depth, filepath);
119 if (logImage ==
nullptr) {
120 printf(
"DPX/Cineon: error creating file.\n");
129 "fbuf in imb_save_dpx_cineon");
131 for (
y = 0;
y < ibuf->
y;
y++) {
132 float *dst_ptr = fbuf + (4 * (size_t(ibuf->
y -
y - 1) * size_t(ibuf->
x)));
135 memcpy(dst_ptr, src_ptr, 4 * ibuf->
x *
sizeof(
float));
148 "fbuf in imb_save_dpx_cineon");
149 if (fbuf ==
nullptr) {
150 printf(
"DPX/Cineon: error allocating memory.\n");
154 for (
y = 0;
y < ibuf->
y;
y++) {
155 fbuf_ptr = fbuf + (4 * (size_t(ibuf->
y -
y - 1) * size_t(ibuf->
x)));
157 for (
x = 0;
x < ibuf->
x;
x++) {
158 fbuf_ptr[0] =
float(rect_ptr[0]) / 255.0f;
159 fbuf_ptr[1] =
float(rect_ptr[1]) / 255.0f;
160 fbuf_ptr[2] =
float(rect_ptr[2]) / 255.0f;
161 fbuf_ptr[3] = (depth == 4) ? (
float(rect_ptr[3]) / 255.0f) : 1.0f;
void IMB_flipy(ImBuf *ibuf)
void IMB_byte_from_float(ImBuf *ibuf)
void IMB_freeImBuf(ImBuf *ibuf)
ImBuf * IMB_allocImBuf(unsigned int x, unsigned int y, unsigned char planes, unsigned int flags)
Read Guarded memory(de)allocation.
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
static int imb_save_dpx_cineon(ImBuf *ibuf, const char *filepath, int use_cineon, int flags)
bool imb_save_cineon(ImBuf *buf, const char *filepath, int flags)
ImBuf * imb_load_cineon(const uchar *mem, size_t size, int flags, ImFileColorSpace &r_colorspace)
bool imb_is_a_cineon(const uchar *mem, size_t size)
static ImBuf * imb_load_dpx_cineon(const uchar *mem, size_t size, int use_cineon, int flags, ImFileColorSpace &r_colorspace)
int logImageIsCineon(const void *buffer, const uint size)
void logImageSetVerbose(int verbosity)
int logImageSetDataRGBA(LogImageFile *logImage, const float *data, int dataIsLinearRGB)
void logImageClose(LogImageFile *logImage)
LogImageFile * logImageCreate(const char *filepath, int cineon, int width, int height, int bitsPerSample, int isLogarithmic, int hasAlpha, int referenceWhite, int referenceBlack, float gamma, const char *creator)
int logImageGetDataRGBA(LogImageFile *logImage, float *data, int dataIsLinearRGB)
LogImageFile * logImageOpenFromMemory(const uchar *buffer, uint size)
void logImageGetSize(const LogImageFile *logImage, int *width, int *height, int *depth)
void * MEM_malloc_arrayN(size_t len, size_t size, const char *str)
void MEM_freeN(void *vmemh)
ImBufFloatBuffer float_buffer
ImbFormatOptions foptions
ImBufByteBuffer byte_buffer