|
@@ -43,6 +43,7 @@ libdng_new(libdng_info *dng)
|
|
|
dng->color_matrix_1[i] = 0.0f;
|
|
|
dng->color_matrix_2[i] = 0.0f;
|
|
|
dng->forward_matrix_1[i] = 0.0f;
|
|
|
+ dng->forward_matrix_2[i] = 0.0f;
|
|
|
}
|
|
|
dng->color_matrix_1[0] = 1.0f;
|
|
|
dng->color_matrix_1[4] = 1.0f;
|
|
@@ -306,7 +307,7 @@ libdng_set_color_matrix_1(libdng_info *dng, float v1, float v2, float v3, float
|
|
|
{
|
|
|
if (dng == NULL)
|
|
|
return 0;
|
|
|
-
|
|
|
+
|
|
|
dng->color_matrix_1[0] = v1;
|
|
|
dng->color_matrix_1[1] = v2;
|
|
|
dng->color_matrix_1[2] = v3;
|
|
@@ -325,7 +326,7 @@ libdng_set_color_matrix_2(libdng_info *dng, float v1, float v2, float v3, float
|
|
|
{
|
|
|
if (dng == NULL)
|
|
|
return 0;
|
|
|
-
|
|
|
+
|
|
|
dng->color_matrix_2[0] = v1;
|
|
|
dng->color_matrix_2[1] = v2;
|
|
|
dng->color_matrix_2[2] = v3;
|
|
@@ -344,7 +345,7 @@ libdng_set_forward_matrix_1(libdng_info *dng, float v1, float v2, float v3, floa
|
|
|
{
|
|
|
if (dng == NULL)
|
|
|
return 0;
|
|
|
-
|
|
|
+
|
|
|
dng->forward_matrix_1[0] = v1;
|
|
|
dng->forward_matrix_1[1] = v2;
|
|
|
dng->forward_matrix_1[2] = v3;
|
|
@@ -358,6 +359,25 @@ libdng_set_forward_matrix_1(libdng_info *dng, float v1, float v2, float v3, floa
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
+int
|
|
|
+libdng_set_forward_matrix_2(libdng_info *dng, float v1, float v2, float v3, float v4, float v5, float v6, float v7, float v8, float v9)
|
|
|
+{
|
|
|
+ if (dng == NULL)
|
|
|
+ return 0;
|
|
|
+
|
|
|
+ dng->forward_matrix_2[0] = v1;
|
|
|
+ dng->forward_matrix_2[1] = v2;
|
|
|
+ dng->forward_matrix_2[2] = v3;
|
|
|
+ dng->forward_matrix_2[3] = v4;
|
|
|
+ dng->forward_matrix_2[4] = v5;
|
|
|
+ dng->forward_matrix_2[5] = v6;
|
|
|
+ dng->forward_matrix_2[6] = v7;
|
|
|
+ dng->forward_matrix_2[7] = v8;
|
|
|
+ dng->forward_matrix_2[8] = v9;
|
|
|
+
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
int
|
|
|
libdng_write(libdng_info *dng, const char *path, unsigned int width, unsigned int height, const uint8_t *data,
|
|
|
size_t length)
|
|
@@ -410,6 +430,7 @@ libdng_write_with_thumbnail(libdng_info *dng, const char *path, unsigned int wid
|
|
|
TIFFSetField(tif, DNGTAG_COLOR_MATRIX_1, 9, dng->color_matrix_1);
|
|
|
TIFFSetField(tif, DNGTAG_COLOR_MATRIX_2, 9, dng->color_matrix_2);
|
|
|
TIFFSetField(tif, DNGTAG_FORWARD_MATRIX_1, 9, dng->forward_matrix_1);
|
|
|
+ TIFFSetField(tif, DNGTAG_FORWARD_MATRIX_2, 9, dng->forward_matrix_2);
|
|
|
TIFFSetField(tif, DNGTAG_ASSHOTNEUTRAL, 3, dng->neutral);
|
|
|
TIFFSetField(tif, DNGTAG_ANALOGBALANCE, 3, dng->analogbalance);
|
|
|
|