Blender V4.3
logImageCore.cc File Reference
#include "logImageCore.h"
#include "cineonlib.h"
#include "dpxlib.h"
#include "logmemfile.h"
#include <cmath>
#include <cstdlib>
#include <cstring>
#include "BLI_fileops.h"
#include "BLI_utildefines.h"
#include "IMB_imbuf.hh"
#include "MEM_guardedalloc.h"

Go to the source code of this file.

Functions

static int logImageSetData8 (LogImageFile *logImage, const LogImageElement &logElement, const float *data)
 
static int logImageSetData10 (LogImageFile *logImage, const LogImageElement &logElement, const float *data)
 
static int logImageSetData12 (LogImageFile *logImage, const LogImageElement &logElement, const float *data)
 
static int logImageSetData16 (LogImageFile *logImage, const LogImageElement &logElement, const float *data)
 
static int logImageElementGetData (LogImageFile *logImage, const LogImageElement &logElement, float *data)
 
static int logImageElementGetData1 (LogImageFile *logImage, const LogImageElement &logElement, float *data)
 
static int logImageElementGetData8 (LogImageFile *logImage, const LogImageElement &logElement, float *data)
 
static int logImageElementGetData10 (LogImageFile *logImage, const LogImageElement &logElement, float *data)
 
static int logImageElementGetData10Packed (LogImageFile *logImage, const LogImageElement &logElement, float *data)
 
static int logImageElementGetData12 (LogImageFile *logImage, const LogImageElement &logElement, float *data)
 
static int logImageElementGetData12Packed (LogImageFile *logImage, const LogImageElement &logElement, float *data)
 
static int logImageElementGetData16 (LogImageFile *logImage, const LogImageElement &logElement, float *data)
 
static int convertLogElementToRGBA (const float *src, float *dst, const LogImageFile *logImage, const LogImageElement &logElement, int dstIsLinearRGB)
 
static int convertRGBAToLogElement (const float *src, float *dst, const LogImageFile *logImage, const LogImageElement &logElement, int srcIsLinearRGB)
 
void logImageSetVerbose (int verbosity)
 
int logImageIsDpx (const void *buffer, const uint size)
 
int logImageIsCineon (const void *buffer, const uint size)
 
LogImageFilelogImageOpenFromFile (const char *filepath, int cineon)
 
LogImageFilelogImageOpenFromMemory (const uchar *buffer, uint size)
 
LogImageFilelogImageCreate (const char *filepath, int cineon, int width, int height, int bitsPerSample, int isLogarithmic, int hasAlpha, int referenceWhite, int referenceBlack, float gamma, const char *creator)
 
void logImageClose (LogImageFile *logImage)
 
void logImageGetSize (const LogImageFile *logImage, int *width, int *height, int *depth)
 
static size_t getRowLength (size_t width, const LogImageElement &logElement)
 
size_t getRowLength (size_t width, const LogImageElement *logElement)
 
int logImageSetDataRGBA (LogImageFile *logImage, const float *data, int dataIsLinearRGB)
 
int logImageGetDataRGBA (LogImageFile *logImage, float *data, int dataIsLinearRGB)
 
static int getYUVtoRGBMatrix (float *matrix, const LogImageElement &logElement)
 
static floatgetLinToLogLut (const LogImageFile *logImage, const LogImageElement &logElement)
 
static floatgetLogToLinLut (const LogImageFile *logImage, const LogImageElement &logElement)
 
static floatgetLinToSrgbLut (const LogImageElement &logElement)
 
static floatgetSrgbToLinLut (const LogImageElement &logElement)
 
static int convertRGBA_RGB (const float *src, float *dst, const LogImageFile *logImage, const LogImageElement &logElement, int elementIsSource)
 
static int convertRGB_RGBA (const float *src, float *dst, const LogImageFile *logImage, const LogImageElement &logElement, int elementIsSource)
 
static int convertRGBA_RGBA (const float *src, float *dst, const LogImageFile *logImage, const LogImageElement &logElement, int elementIsSource)
 
static int convertABGR_RGBA (const float *src, float *dst, const LogImageFile *logImage, const LogImageElement &logElement, int elementIsSource)
 
static int convertCbYCr_RGBA (const float *src, float *dst, const LogImageFile *logImage, const LogImageElement &logElement)
 
static int convertCbYCrA_RGBA (const float *src, float *dst, const LogImageFile *logImage, const LogImageElement &logElement)
 
static int convertCbYCrY_RGBA (const float *src, float *dst, const LogImageFile *logImage, const LogImageElement &logElement)
 
static int convertCbYACrYA_RGBA (const float *src, float *dst, const LogImageFile *logImage, const LogImageElement &logElement)
 
static int convertLuminance_RGBA (const float *src, float *dst, const LogImageFile *logImage, const LogImageElement &logElement)
 
static int convertYA_RGBA (const float *src, float *dst, const LogImageFile *logImage, const LogImageElement &logElement)
 

Variables

static int verbose = 0
 

Detailed Description

Cineon image file format library routines.

Definition in file logImageCore.cc.

Function Documentation

◆ convertABGR_RGBA()

◆ convertCbYACrYA_RGBA()

static int convertCbYACrYA_RGBA ( const float * src,
float * dst,
const LogImageFile * logImage,
const LogImageElement & logElement )
static

◆ convertCbYCr_RGBA()

static int convertCbYCr_RGBA ( const float * src,
float * dst,
const LogImageFile * logImage,
const LogImageElement & logElement )
static

◆ convertCbYCrA_RGBA()

static int convertCbYCrA_RGBA ( const float * src,
float * dst,
const LogImageFile * logImage,
const LogImageElement & logElement )
static

◆ convertCbYCrY_RGBA()

static int convertCbYCrY_RGBA ( const float * src,
float * dst,
const LogImageFile * logImage,
const LogImageElement & logElement )
static

◆ convertLogElementToRGBA()

◆ convertLuminance_RGBA()

static int convertLuminance_RGBA ( const float * src,
float * dst,
const LogImageFile * logImage,
const LogImageElement & logElement )
static

◆ convertRGB_RGBA()

◆ convertRGBA_RGB()

◆ convertRGBA_RGBA()

◆ convertRGBAToLogElement()

◆ convertYA_RGBA()

static int convertYA_RGBA ( const float * src,
float * dst,
const LogImageFile * logImage,
const LogImageElement & logElement )
static

◆ getLinToLogLut()

◆ getLinToSrgbLut()

static float * getLinToSrgbLut ( const LogImageElement & logElement)
static

Definition at line 1186 of file logImageCore.cc.

References col, float, LogImageElement::maxValue, MEM_mallocN, and powf.

Referenced by convertRGBAToLogElement().

◆ getLogToLinLut()

◆ getRowLength() [1/2]

◆ getRowLength() [2/2]

size_t getRowLength ( size_t width,
const LogImageElement * logElement )

Definition at line 238 of file logImageCore.cc.

References getRowLength().

◆ getSrgbToLinLut()

static float * getSrgbToLinLut ( const LogImageElement & logElement)
static

Definition at line 1207 of file logImageCore.cc.

References col, float, LogImageElement::maxValue, MEM_mallocN, and powf.

Referenced by convertLogElementToRGBA().

◆ getYUVtoRGBMatrix()

◆ logImageClose()

void logImageClose ( LogImageFile * logImage)

◆ logImageCreate()

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 )

Definition at line 155 of file logImageCore.cc.

References cineonCreate(), and dpxCreate().

Referenced by imb_save_dpx_cineon().

◆ logImageElementGetData()

◆ logImageElementGetData1()

static int logImageElementGetData1 ( LogImageFile * logImage,
const LogImageElement & logElement,
float * data )
static

◆ logImageElementGetData10()

◆ logImageElementGetData10Packed()

static int logImageElementGetData10Packed ( LogImageFile * logImage,
const LogImageElement & logElement,
float * data )
static

◆ logImageElementGetData12()

◆ logImageElementGetData12Packed()

static int logImageElementGetData12Packed ( LogImageFile * logImage,
const LogImageElement & logElement,
float * data )
static

◆ logImageElementGetData16()

static int logImageElementGetData16 ( LogImageFile * logImage,
const LogImageElement & logElement,
float * data )
static

◆ logImageElementGetData8()

static int logImageElementGetData8 ( LogImageFile * logImage,
const LogImageElement & logElement,
float * data )
static

◆ logImageGetDataRGBA()

◆ logImageGetSize()

void logImageGetSize ( const LogImageFile * logImage,
int * width,
int * height,
int * depth )

Definition at line 195 of file logImageCore.cc.

References LogImageFile::depth, LogImageFile::height, and LogImageFile::width.

Referenced by imb_load_dpx_cineon().

◆ logImageIsCineon()

int logImageIsCineon ( const void * buffer,
const uint size )

Definition at line 105 of file logImageCore.cc.

References CINEON_FILE_MAGIC, and swap_uint().

Referenced by imb_is_a_cineon(), logImageOpenFromFile(), and logImageOpenFromMemory().

◆ logImageIsDpx()

int logImageIsDpx ( const void * buffer,
const uint size )

Definition at line 95 of file logImageCore.cc.

References DPX_FILE_MAGIC, and swap_uint().

Referenced by logImageOpenFromFile(), and logImageOpenFromMemory().

◆ logImageOpenFromFile()

LogImageFile * logImageOpenFromFile ( const char * filepath,
int cineon )

Definition at line 115 of file logImageCore.cc.

References BLI_fopen(), cineonOpen(), dpxOpen(), logImageIsCineon(), and logImageIsDpx().

◆ logImageOpenFromMemory()

LogImageFile * logImageOpenFromMemory ( const uchar * buffer,
uint size )

Definition at line 143 of file logImageCore.cc.

References cineonOpen(), dpxOpen(), logImageIsCineon(), and logImageIsDpx().

Referenced by imb_load_dpx_cineon().

◆ logImageSetData10()

static int logImageSetData10 ( LogImageFile * logImage,
const LogImageElement & logElement,
const float * data )
static

◆ logImageSetData12()

static int logImageSetData12 ( LogImageFile * logImage,
const LogImageElement & logElement,
const float * data )
static

◆ logImageSetData16()

static int logImageSetData16 ( LogImageFile * logImage,
const LogImageElement & logElement,
const float * data )
static

◆ logImageSetData8()

static int logImageSetData8 ( LogImageFile * logImage,
const LogImageElement & logElement,
const float * data )
static

◆ logImageSetDataRGBA()

◆ logImageSetVerbose()

void logImageSetVerbose ( int verbosity)

Definition at line 84 of file logImageCore.cc.

References cineonSetVerbose(), dpxSetVerbose(), and verbose.

Referenced by imb_load_dpx_cineon(), and imb_save_dpx_cineon().

Variable Documentation

◆ verbose