98 if (size <
sizeof(magicNum)) {
101 magicNum = *(
uint *)buffer;
108 if (size <
sizeof(magicNum)) {
111 magicNum = *(
uint *)buffer;
126 if (fread(&magicNum,
sizeof(magicNum), 1, f) != 1) {
146 return dpxOpen(buffer, 1, size);
169 return cineonCreate(filepath, width, height, bitsPerSample, creator);
186 if (logImage !=
nullptr) {
187 if (logImage->
file) {
188 fclose(logImage->
file);
189 logImage->
file =
nullptr;
197 *width = logImage->
width;
198 *height = logImage->
height;
199 *depth = logImage->
depth;
211 return ((width * logElement.
depth - 1) / 32 + 1) * 4;
214 return ((width * logElement.
depth - 1) / 4 + 1) * 4;
218 return ((width * logElement.
depth * 10 - 1) / 32 + 1) * 4;
221 return ((width * logElement.
depth - 1) / 3 + 1) * 4;
226 return ((width * logElement.
depth * 12 - 1) / 32 + 1) * 4;
229 return width * logElement.
depth * 2;
233 return width * logElement.
depth * 2;
255 logImage->
width, logImage->
height, logImage->
depth,
sizeof(
float),
true, __func__);
256 if (elementData ==
nullptr) {
261 data, elementData, logImage, logImage->
element[0], dataIsLinearRGB) != 0)
301 if (row ==
nullptr) {
303 printf(
"DPX/Cineon: Cannot allocate row.\n");
307 memset(row, 0, rowLength);
309 for (
size_t y = 0; y < logImage->
height; y++) {
310 for (
size_t x = 0; x < logImage->
width * logImage->
depth; x++) {
316 printf(
"DPX/Cineon: Error while writing file.\n");
335 if (row ==
nullptr) {
337 printf(
"DPX/Cineon: Cannot allocate row.\n");
342 for (
size_t y = 0; y < logImage->
height; y++) {
347 for (
size_t x = 0; x < logImage->
width * logImage->
depth; x++) {
363 printf(
"DPX/Cineon: Error while writing file.\n");
381 if (row ==
nullptr) {
383 printf(
"DPX/Cineon: Cannot allocate row.\n");
388 for (
size_t y = 0; y < logImage->
height; y++) {
389 for (
size_t x = 0; x < logImage->
width * logImage->
depth; x++) {
397 printf(
"DPX/Cineon: Error while writing file.\n");
415 if (row ==
nullptr) {
417 printf(
"DPX/Cineon: Cannot allocate row.\n");
422 for (
size_t y = 0; y < logImage->
height; y++) {
423 for (
size_t x = 0; x < logImage->
width * logImage->
depth; x++) {
431 printf(
"DPX/Cineon: Error while writing file.\n");
448 int i, j, returnValue, sortedElementData[8], hasAlpha;
449 float *elementData[8];
450 float *elementData_ptr[8];
457 memset(&elementData, 0, 8 *
sizeof(
float *));
470 if (elementData[i] ==
nullptr) {
472 printf(
"DPX/Cineon: Cannot allocate memory for elementData[%d]\n.", i);
474 for (j = 0; j < i; j++) {
475 if (elementData[j] !=
nullptr) {
481 elementData_ptr[i] = elementData[i];
486 printf(
"DPX/Cineon: Cannot read elementData[%d]\n.", i);
488 for (j = 0; j < i; j++) {
489 if (elementData[j] !=
nullptr) {
505 elementData[0], data, logImage, logImage->
element[0], dataIsLinearRGB);
516 memset(&sortedElementData, -1,
sizeof(
int[8]));
530 sortedElementData[0] = i;
541 sortedElementData[1] = i;
552 sortedElementData[2] = i;
557 sortedElementData[mergedElement.
depth - 1] = i;
570 if (mergedElement.
depth == 2) {
573 else if (mergedElement.
depth == 3) {
581 else if (mergedElement.
depth == 4) {
587 if (mergedElement.
depth == 1 || (mergedElement.
depth == 2 && hasAlpha == 1)) {
588 sortedElementData[0] = i;
591 sortedElementData[1] = i;
600 if (mergedElement.
depth == 2) {
603 else if (mergedElement.
depth == 3) {
611 else if (mergedElement.
depth == 4) {
617 if (sortedElementData[0] == -1) {
618 sortedElementData[0] = i;
621 sortedElementData[2] = i;
633 sortedElementData[0] = i;
643 sortedElementData[0] = i;
654 logImage->
width, logImage->
height, mergedElement.
depth,
sizeof(
float),
true, __func__);
655 if (mergedData ==
nullptr) {
657 printf(
"DPX/Cineon: Cannot allocate mergedData.\n");
660 if (elementData[i] !=
nullptr) {
668 while (sampleIndex < logImage->width * logImage->
height * mergedElement.
depth) {
670 for (j = 0; j < logImage->
element[sortedElementData[i]].
depth; j++) {
671 mergedData[sampleIndex++] = *(elementData_ptr[sortedElementData[i]]++);
678 if (elementData[i] !=
nullptr) {
684 mergedData, data, logImage, mergedElement, dataIsLinearRGB);
741 for (
size_t y = 0; y < logImage->
height; y++) {
742 for (
size_t x = 0; x < logImage->
width * logElement.
depth; x += 32) {
745 printf(
"DPX/Cineon: EOF reached\n");
750 for (
int offset = 0; offset < 32 && x + offset < logImage->
width; offset++) {
751 data[y * logImage->
width * logElement.
depth + x + offset] =
float((pixel >> offset) &
767 for (
size_t y = 0; y < logImage->
height; y++) {
771 printf(
"DPX/Cineon: Couldn't seek at %d\n",
int(logElement.
dataOffset + y * rowLength));
776 for (
size_t x = 0; x < logImage->
width * logElement.
depth; x++) {
779 printf(
"DPX/Cineon: EOF reached\n");
804 for (
size_t y = 0; y < logImage->
height; y++) {
806 for (
size_t x = 0; x < logImage->
width * logElement.
depth; x++) {
812 else if (logElement.
packing == 2) {
818 printf(
"DPX/Cineon: EOF reached\n");
824 data[y * logImage->
width * logElement.
depth +
x] =
float((pixel >> offset) & 0x3ff) /
831 for (
size_t y = 0; y < logImage->
height; y++) {
833 for (
size_t x = 0; x < logImage->
width * logElement.
depth; x++) {
839 else if (logElement.
packing == 2) {
845 printf(
"DPX/Cineon: EOF reached\n");
851 data[y * logImage->
width * logElement.
depth +
x] =
float((pixel >> offset) & 0x3ff) /
866 uint pixel, oldPixel;
869 for (
size_t y = 0; y < logImage->
height; y++) {
882 for (
size_t x = 0; x < logImage->
width * logElement.
depth; x++) {
884 offset = 10 - offset2;
888 else if (offset == 32) {
891 else if (offset + 10 > 32) {
893 oldPixel = (pixel >> offset);
894 offset2 = 32 - offset;
902 printf(
"DPX/Cineon: EOF reached\n");
909 float((((pixel << offset2) >> offset) & 0x3ff) | oldPixel) / 1023.0f;
935 for (sampleIndex = 0; sampleIndex < numSamples; sampleIndex++) {
938 printf(
"DPX/Cineon: EOF reached\n");
945 data[sampleIndex] =
float(pixel >> 4) / 4095.0f;
947 else if (logElement.
packing == 2) {
948 data[sampleIndex] =
float(pixel) / 4095.0f;
959 uint pixel, oldPixel;
962 for (
size_t y = 0; y < logImage->
height; y++) {
975 for (
size_t x = 0; x < logImage->
width * logElement.
depth; x++) {
977 offset = 12 - offset2;
981 else if (offset == 32) {
984 else if (offset + 12 > 32) {
986 oldPixel = (pixel >> offset);
987 offset2 = 32 - offset;
995 printf(
"DPX/Cineon: EOF reached\n");
1001 data[y * logImage->
width * logElement.
depth +
x] =
1002 float((((pixel << offset2) >> offset) & 0xfff) | oldPixel) / 4095.0f;
1025 for (sampleIndex = 0; sampleIndex < numSamples; sampleIndex++) {
1028 printf(
"DPX/Cineon: EOF reached\n");
1033 data[sampleIndex] =
float(pixel) / 65535.0f;
1045 float scaleY, scaleCbCr;
1049 scaleY = 1.0f / (refHighData - refLowData);
1050 scaleCbCr = scaleY * ((940.0f - 64.0f) / (960.0f - 64.0f));
1054 matrix[0] = 1.0f * scaleY;
1055 matrix[1] = 1.0f * scaleCbCr;
1056 matrix[2] = 1.0f * scaleCbCr;
1057 matrix[3] = 1.0f * scaleY;
1058 matrix[4] = 1.0f * scaleCbCr;
1059 matrix[5] = 1.0f * scaleCbCr;
1060 matrix[6] = 1.0f * scaleY;
1061 matrix[7] = 1.0f * scaleCbCr;
1062 matrix[8] = 1.0f * scaleCbCr;
1066 matrix[0] = 1.0000f * scaleY;
1067 matrix[1] = 0.0000f * scaleCbCr;
1068 matrix[2] = 1.5756f * scaleCbCr;
1069 matrix[3] = 1.0000f * scaleY;
1070 matrix[4] = -0.2253f * scaleCbCr;
1071 matrix[5] = -0.5000f * scaleCbCr;
1072 matrix[6] = 1.0000f * scaleY;
1073 matrix[7] = 1.8270f * scaleCbCr;
1074 matrix[8] = 0.0000f * scaleCbCr;
1078 matrix[0] = 1.000000f * scaleY;
1079 matrix[1] = 0.000000f * scaleCbCr;
1080 matrix[2] = 1.574800f * scaleCbCr;
1081 matrix[3] = 1.000000f * scaleY;
1082 matrix[4] = -0.187324f * scaleCbCr;
1083 matrix[5] = -0.468124f * scaleCbCr;
1084 matrix[6] = 1.000000f * scaleY;
1085 matrix[7] = 1.855600f * scaleCbCr;
1086 matrix[8] = 0.000000f * scaleCbCr;
1091 matrix[0] = 1.000000f * scaleY;
1092 matrix[1] = 0.000000f * scaleCbCr;
1093 matrix[2] = 1.402000f * scaleCbCr;
1094 matrix[3] = 1.000000f * scaleY;
1095 matrix[4] = -0.344136f * scaleCbCr;
1096 matrix[5] = -0.714136f * scaleCbCr;
1097 matrix[6] = 1.000000f * scaleY;
1098 matrix[7] = 1.772000f * scaleCbCr;
1099 matrix[8] = 0.000000f * scaleCbCr;
1110 float gain, negativeFilmGamma, offset, step;
1114 lut =
static_cast<float *
>(
MEM_mallocN(
sizeof(
float) * lutsize,
"getLinToLogLut"));
1116 negativeFilmGamma = 0.6;
1121 negativeFilmGamma * logImage->
gamma / 1.7f));
1122 offset = gain - logElement.
maxValue;
1124 for (i = 0; i < lutsize; i++) {
1126 log10f(
powf((i + offset) / gain, 1.7f / logImage->
gamma)) /
1127 (step / negativeFilmGamma)) /
1137 float breakPoint, gain, kneeGain, kneeOffset, negativeFilmGamma, offset, step, softClip;
1142 lut =
static_cast<float *
>(
MEM_mallocN(
sizeof(
float) * lutsize,
"getLogToLinLut"));
1146 negativeFilmGamma = 0.6;
1156 negativeFilmGamma * logImage->
gamma / 1.7f));
1157 offset = gain - logElement.
maxValue;
1158 kneeOffset =
powf(10,
1159 (breakPoint - logImage->
referenceWhite) * step / negativeFilmGamma *
1160 logImage->
gamma / 1.7f) *
1163 kneeGain = (logElement.
maxValue - kneeOffset) /
powf(5 * softClip, softClip / 100);
1165 for (i = 0; i < lutsize; i++) {
1166 if (i < logImage->referenceBlack) {
1169 else if (i > breakPoint) {
1170 lut[i] = (
powf(i - breakPoint, softClip / 100) * kneeGain + kneeOffset) /
1175 (
float(i) - logImage->
referenceWhite) * step / negativeFilmGamma *
1176 logImage->
gamma / 1.7f) *
1192 lut =
static_cast<float *
>(
MEM_mallocN(
sizeof(
float) * lutsize,
"getLogToLinLut"));
1194 for (i = 0; i < lutsize; i++) {
1196 if (
col < 0.0031308f) {
1197 lut[i] = (
col < 0.0f) ? 0.0f :
col * 12.92f;
1200 lut[i] = 1.055f *
powf(
col, 1.0f / 2.4f) - 0.055f;
1213 lut =
static_cast<float *
>(
MEM_mallocN(
sizeof(
float) * lutsize,
"getLogToLinLut"));
1215 for (i = 0; i < lutsize; i++) {
1217 if (
col < 0.04045f) {
1218 lut[i] = (
col < 0.0f) ? 0.0f :
col * (1.0f / 12.92f);
1221 lut[i] =
powf((
col + 0.055f) * (1.0f / 1.055f), 2.4f);
1232 int elementIsSource)
1235 const float *src_ptr = src;
1236 float *dst_ptr = dst;
1243 for (i = 0; i < logImage->
width * logImage->
height; i++) {
1244 *(dst_ptr++) = *(src_ptr++);
1245 *(dst_ptr++) = *(src_ptr++);
1246 *(dst_ptr++) = *(src_ptr++);
1256 if (elementIsSource == 1) {
1263 for (i = 0; i < logImage->
width * logImage->
height; i++) {
1277 printf(
"DPX/Cineon: Unknown transfer %d.\n", logElement.
transfer);
1287 int elementIsSource)
1290 const float *src_ptr = src;
1291 float *dst_ptr = dst;
1298 for (i = 0; i < logImage->
width * logImage->
height; i++) {
1299 *(dst_ptr++) = *(src_ptr++);
1300 *(dst_ptr++) = *(src_ptr++);
1301 *(dst_ptr++) = *(src_ptr++);
1302 *(dst_ptr++) = 1.0f;
1311 if (elementIsSource == 1) {
1318 for (i = 0; i < logImage->
width * logImage->
height; i++) {
1322 *(dst_ptr++) = 1.0f;
1332 printf(
"DPX/Cineon: Unknown transfer %d.\n", logElement.
transfer);
1342 int elementIsSource)
1345 const float *src_ptr = src;
1346 float *dst_ptr = dst;
1352 memcpy(dst, src, 4 *
size_t(logImage->
width) *
size_t(logImage->
height) *
sizeof(
float));
1359 if (elementIsSource == 1) {
1366 for (i = 0; i < logImage->
width * logImage->
height; i++) {
1370 *(dst_ptr++) = *(src_ptr++);
1387 int elementIsSource)
1390 const float *src_ptr = src;
1391 float *dst_ptr = dst;
1397 for (i = 0; i < logImage->
width * logImage->
height; i++) {
1399 *(dst_ptr++) = *(src_ptr--);
1400 *(dst_ptr++) = *(src_ptr--);
1401 *(dst_ptr++) = *(src_ptr--);
1402 *(dst_ptr++) = *(src_ptr--);
1411 if (elementIsSource == 1) {
1418 for (i = 0; i < logImage->
width * logImage->
height; i++) {
1423 *(dst_ptr++) = *(src_ptr--);
1443 float conversionMatrix[9], refLowData,
y, cb, cr;
1444 const float *src_ptr = src;
1445 float *dst_ptr = dst;
1453 for (i = 0; i < logImage->
width * logImage->
height; i++) {
1454 cb = *(src_ptr++) - 0.5f;
1455 y = *(src_ptr++) - refLowData;
1456 cr = *(src_ptr++) - 0.5f;
1459 y * conversionMatrix[0] + cb * conversionMatrix[1] + cr * conversionMatrix[2], 0.0f, 1.0f);
1461 y * conversionMatrix[3] + cb * conversionMatrix[4] + cr * conversionMatrix[5], 0.0f, 1.0f);
1463 y * conversionMatrix[6] + cb * conversionMatrix[7] + cr * conversionMatrix[8], 0.0f, 1.0f);
1464 *(dst_ptr++) = 1.0f;
1475 float conversionMatrix[9], refLowData,
y, cb, cr, a;
1476 const float *src_ptr = src;
1477 float *dst_ptr = dst;
1485 for (i = 0; i < logImage->
width * logImage->
height; i++) {
1486 cb = *(src_ptr++) - 0.5f;
1487 y = *(src_ptr++) - refLowData;
1488 cr = *(src_ptr++) - 0.5f;
1492 y * conversionMatrix[0] + cb * conversionMatrix[1] + cr * conversionMatrix[2], 0.0f, 1.0f);
1494 y * conversionMatrix[3] + cb * conversionMatrix[4] + cr * conversionMatrix[5], 0.0f, 1.0f);
1496 y * conversionMatrix[6] + cb * conversionMatrix[7] + cr * conversionMatrix[8], 0.0f, 1.0f);
1508 float conversionMatrix[9], refLowData, y1, y2, cb, cr;
1509 const float *src_ptr = src;
1510 float *dst_ptr = dst;
1518 for (i = 0; i < logImage->
width * logImage->
height / 2; i++) {
1519 cb = *(src_ptr++) - 0.5f;
1520 y1 = *(src_ptr++) - refLowData;
1521 cr = *(src_ptr++) - 0.5f;
1522 y2 = *(src_ptr++) - refLowData;
1524 *(dst_ptr++) =
clamp_float(y1 * conversionMatrix[0] + cb * conversionMatrix[1] +
1525 cr * conversionMatrix[2],
1528 *(dst_ptr++) =
clamp_float(y1 * conversionMatrix[3] + cb * conversionMatrix[4] +
1529 cr * conversionMatrix[5],
1532 *(dst_ptr++) =
clamp_float(y1 * conversionMatrix[6] + cb * conversionMatrix[7] +
1533 cr * conversionMatrix[8],
1536 *(dst_ptr++) = 1.0f;
1537 *(dst_ptr++) =
clamp_float(y2 * conversionMatrix[0] + cb * conversionMatrix[1] +
1538 cr * conversionMatrix[2],
1541 *(dst_ptr++) =
clamp_float(y2 * conversionMatrix[3] + cb * conversionMatrix[4] +
1542 cr * conversionMatrix[5],
1545 *(dst_ptr++) =
clamp_float(y2 * conversionMatrix[6] + cb * conversionMatrix[7] +
1546 cr * conversionMatrix[8],
1549 *(dst_ptr++) = 1.0f;
1560 float conversionMatrix[9], refLowData, y1, y2, cb, cr, a1, a2;
1561 const float *src_ptr = src;
1562 float *dst_ptr = dst;
1570 for (i = 0; i < logImage->
width * logImage->
height / 2; i++) {
1571 cb = *(src_ptr++) - 0.5f;
1572 y1 = *(src_ptr++) - refLowData;
1574 cr = *(src_ptr++) - 0.5f;
1575 y2 = *(src_ptr++) - refLowData;
1578 *(dst_ptr++) =
clamp_float(y1 * conversionMatrix[0] + cb * conversionMatrix[1] +
1579 cr * conversionMatrix[2],
1582 *(dst_ptr++) =
clamp_float(y1 * conversionMatrix[3] + cb * conversionMatrix[4] +
1583 cr * conversionMatrix[5],
1586 *(dst_ptr++) =
clamp_float(y1 * conversionMatrix[6] + cb * conversionMatrix[7] +
1587 cr * conversionMatrix[8],
1591 *(dst_ptr++) =
clamp_float(y2 * conversionMatrix[0] + cb * conversionMatrix[1] +
1592 cr * conversionMatrix[2],
1595 *(dst_ptr++) =
clamp_float(y2 * conversionMatrix[3] + cb * conversionMatrix[4] +
1596 cr * conversionMatrix[5],
1599 *(dst_ptr++) =
clamp_float(y2 * conversionMatrix[6] + cb * conversionMatrix[7] +
1600 cr * conversionMatrix[8],
1614 float conversionMatrix[9], value, refLowData;
1615 const float *src_ptr = src;
1616 float *dst_ptr = dst;
1624 for (i = 0; i < logImage->
width * logImage->
height; i++) {
1625 value =
clamp_float((*(src_ptr++) - refLowData) * conversionMatrix[0], 0.0f, 1.0f);
1626 *(dst_ptr++) = value;
1627 *(dst_ptr++) = value;
1628 *(dst_ptr++) = value;
1629 *(dst_ptr++) = 1.0f;
1640 float conversionMatrix[9], value, refLowData;
1641 const float *src_ptr = src;
1642 float *dst_ptr = dst;
1650 for (i = 0; i < logImage->
width * logImage->
height; i++) {
1651 value =
clamp_float((*(src_ptr++) - refLowData) * conversionMatrix[0], 0.0f, 1.0f);
1652 *(dst_ptr++) = value;
1653 *(dst_ptr++) = value;
1654 *(dst_ptr++) = value;
1655 *(dst_ptr++) = *(src_ptr++);
1716 if (dstIsLinearRGB) {
1721 for (i = 0; i < logImage->
width * logImage->
height; i++) {
1741 const float *srgbSrc;
1742 float *srgbSrc_alloc;
1744 const float *src_ptr = src;
1747 if (srcIsLinearRGB != 0) {
1750 logImage->
width, logImage->
height, 4,
sizeof(
float),
false, __func__);
1751 if (srgbSrc_alloc ==
nullptr) {
1755 memcpy(srgbSrc_alloc,
1757 4 *
size_t(logImage->
width) *
size_t(logImage->
height) *
sizeof(
float));
1758 srgbSrc_ptr = srgbSrc_alloc;
1762 for (i = 0; i < logImage->
width * logImage->
height; i++) {
1770 srgbSrc = srgbSrc_alloc;
1799 if (srcIsLinearRGB != 0) {
File and directory operations.
FILE * BLI_fopen(const char *filepath, const char *mode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void * imb_alloc_pixels(unsigned int x, unsigned int y, unsigned int channels, size_t typesize, bool initialize_pixels, const char *alloc_name)
Read Guarded memory(de)allocation.
LogImageFile * cineonCreate(const char *filepath, int width, int height, int bitsPerSample, const char *creator)
void cineonSetVerbose(int verbosity)
LogImageFile * cineonOpen(const uchar *byteStuff, int fromMemory, size_t bufferSize)
#define CINEON_FILE_MAGIC
void dpxSetVerbose(int verbosity)
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 uchar *byteStuff, int fromMemory, size_t bufferSize)
draw_view in_light_buf[] float
static float * getLinToSrgbLut(const LogImageElement &logElement)
static int logImageElementGetData12(LogImageFile *logImage, const LogImageElement &logElement, float *data)
static int logImageElementGetData12Packed(LogImageFile *logImage, const LogImageElement &logElement, float *data)
static int convertCbYCrA_RGBA(const float *src, float *dst, const LogImageFile *logImage, const LogImageElement &logElement)
int logImageIsDpx(const void *buffer, const uint size)
LogImageFile * logImageOpenFromFile(const char *filepath, int cineon)
int logImageIsCineon(const void *buffer, const uint size)
static size_t getRowLength(size_t width, const LogImageElement &logElement)
static int convertYA_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 logImageSetData8(LogImageFile *logImage, const LogImageElement &logElement, const float *data)
void logImageSetVerbose(int verbosity)
static int logImageSetData10(LogImageFile *logImage, const LogImageElement &logElement, const float *data)
static int convertRGBAToLogElement(const float *src, float *dst, const LogImageFile *logImage, const LogImageElement &logElement, int srcIsLinearRGB)
int logImageSetDataRGBA(LogImageFile *logImage, const float *data, int dataIsLinearRGB)
static int logImageElementGetData1(LogImageFile *logImage, const LogImageElement &logElement, float *data)
static int convertLuminance_RGBA(const float *src, float *dst, const LogImageFile *logImage, const LogImageElement &logElement)
static int convertRGB_RGBA(const float *src, float *dst, const LogImageFile *logImage, const LogImageElement &logElement, int elementIsSource)
static int logImageElementGetData(LogImageFile *logImage, const LogImageElement &logElement, float *data)
static int convertRGBA_RGB(const float *src, float *dst, const LogImageFile *logImage, const LogImageElement &logElement, int elementIsSource)
static float * getLogToLinLut(const LogImageFile *logImage, const LogImageElement &logElement)
static int convertCbYCr_RGBA(const float *src, float *dst, const LogImageFile *logImage, const LogImageElement &logElement)
static float * getSrgbToLinLut(const LogImageElement &logElement)
static int convertABGR_RGBA(const float *src, float *dst, const LogImageFile *logImage, const LogImageElement &logElement, int elementIsSource)
static int logImageSetData12(LogImageFile *logImage, const LogImageElement &logElement, const float *data)
static int logImageElementGetData8(LogImageFile *logImage, const LogImageElement &logElement, float *data)
static int convertRGBA_RGBA(const float *src, float *dst, const LogImageFile *logImage, const LogImageElement &logElement, int elementIsSource)
static int logImageSetData16(LogImageFile *logImage, const LogImageElement &logElement, const float *data)
static int getYUVtoRGBMatrix(float *matrix, const LogImageElement &logElement)
void logImageClose(LogImageFile *logImage)
static int logImageElementGetData16(LogImageFile *logImage, const LogImageElement &logElement, float *data)
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)
static float * getLinToLogLut(const LogImageFile *logImage, const LogImageElement &logElement)
static int logImageElementGetData10(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 logImageElementGetData10Packed(LogImageFile *logImage, const LogImageElement &logElement, float *data)
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)
static int convertCbYACrYA_RGBA(const float *src, float *dst, const LogImageFile *logImage, const LogImageElement &logElement)
BLI_INLINE float clamp_float(float x, float low, float high)
@ transfer_PrintingDensity
BLI_INLINE unsigned short swap_ushort(unsigned short x, int swap)
BLI_INLINE unsigned int swap_uint(unsigned int x, int swap)
BLI_INLINE unsigned int float_uint(float value, unsigned int max)
int logimage_read_uint(uint *x, LogImageFile *logFile)
int logimage_read_ushort(ushort *x, LogImageFile *logFile)
int logimage_read_uchar(uchar *x, LogImageFile *logFile)
int logimage_fseek(LogImageFile *logFile, intptr_t offset, int origin)
int logimage_fwrite(const void *buffer, size_t size, uint count, LogImageFile *logFile)
void *(* MEM_mallocN)(size_t len, const char *str)
void MEM_freeN(void *vmemh)
LogImageElement element[8]