summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-02-14 10:28:16 -0500
committerSolomon Peachy <pizza@shaftnet.org>2020-02-14 10:28:16 -0500
commit5002369c4f75120593be1e97ba96013c30c1437f (patch)
tree0a5342a2f592e4f7285a6a0ef78b8015347f12e4
parentc491fb7db99b8717707da1ab80a31974290b8c33 (diff)
downloadselphy_print-5002369c4f75120593be1e97ba96013c30c1437f.tar.gz
selphy_print-5002369c4f75120593be1e97ba96013c30c1437f.tar.bz2
selphy_print-5002369c4f75120593be1e97ba96013c30c1437f.zip
lib70x: Wrong Blue->Yellow gamma base used in the CP98xx gamma code.
-rw-r--r--lib70x/libMitsuD70ImageReProcess.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/lib70x/libMitsuD70ImageReProcess.c b/lib70x/libMitsuD70ImageReProcess.c
index 9826eb3..3fd4a74 100644
--- a/lib70x/libMitsuD70ImageReProcess.c
+++ b/lib70x/libMitsuD70ImageReProcess.c
@@ -52,7 +52,7 @@
*/
-#define LIB_VERSION "0.8.2"
+#define LIB_VERSION "0.8.3"
#include <stdio.h>
#include <stdint.h>
@@ -785,7 +785,7 @@ static void CImageEffect70_CalcFCC(struct CImageEffect70 *data)
static void CImageEffect70_CalcHTD(struct CImageEffect70 *data, const double *in, double *out)
{
- int cur_row, offset;
+ uint32_t cur_row, offset;
double *hk;
double *last, *first;
unsigned int i, k;
@@ -1510,9 +1510,9 @@ struct mitsu98xx_data {
/* @ 1576 */ double GammaAdj[3]; /* Assumed to be same order as tables (BGR?) */
/* @ 1600 */ struct CP98xx_WMAM WMAM;
/* @11920 */ double sharp_coef[11]; /* 0 is off, 1-10 are the levels. Default is 5. [4 in settings] */
- /* @12008 */ uint32_t KHStart;
- /* @12012 */ uint32_t KHEnd;
- /* @12016 */ uint32_t KHStep;
+ /* @12008 */ int32_t KHStart;
+ /* @12012 */ int32_t KHEnd;
+ /* @12016 */ int32_t KHStep;
/* @12020 */ double KH[256];
/* @14068 */
} __attribute__((packed));
@@ -1731,7 +1731,7 @@ static int CP98xx_DoCorrectGammaTbl(struct CP98xx_GammaParams *Gamma,
(baseKH * (Gamma->GNMrc[i] - baseRC)) + 0.5;
Gamma->GNMrc[i] = baseGM +
(baseKH * (Gamma->GNMgm[i] - baseGM)) + 0.5;
- Gamma->GNMby[i] = baseGM +
+ Gamma->GNMby[i] = baseBY +
(baseKH * (Gamma->GNMby[i] - baseBY)) + 0.5;
}
@@ -2294,14 +2294,13 @@ static int CP98xx_DoWMAM(struct CP98xx_WMAM *wmam, struct BandImage *img, int al
iVar4 = 0;
}
for ( ; iVar4 > 0 ; iVar4--) {
- col = (*pdVar3 + 0.50000000);
- if (col < 0) {
+ int16_t val = (*pdVar3 + 0.50000000);
+ if (val < 0) {
*imgBuf = 0;
} else {
- if (col < 0x1000) {
- *imgBuf = col;
- }
- else {
+ if (val < 0x1000) {
+ *imgBuf = val;
+ } else {
*imgBuf = 0xfff;
}
}