]> bicyclesonthemoon.info Git - ott/enhance/blobdiff - diff.c
palette tools online
[ott/enhance] / diff.c
diff --git a/diff.c b/diff.c
index 23b7054f8f1fb716ea173c4e286ebe8a687a6379..83c14c9b8cdbe2dc9cbb682f10ee149316fa2a7d 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -1,7 +1,7 @@
 /*
 diff.c
 see the difference!
-29.11.2022
+30.11.2022
 
 Copyright (C) 2022  Balthasar SzczepaƄski
 
@@ -52,7 +52,6 @@ struct diff_data
 };
 
 int difference (ILuint n, struct PixelInfo *p, void *data);
-int palette_mix (ILuint n, struct PixelInfo *p, void *data);
 static inline ILuint diff_1ch (ILint64 x, ILint64 y, ILint64 A, ILint64 B, ILint64 F);
 
 char DIFF_MISSING_ARGS[] = "Missing parameters.\ndiff inPixA inPixB outPix [RA GA BA [RB GB BB]]\n";
@@ -227,7 +226,7 @@ int subtool_diff (int argc, char **argv, int argi, char **err)
                        id,
                        xyf0, xyf0, xyf0,
                        0, 0, 0,
-                       &palette_mix,
+                       &palette_mix_index,
                        flags,
                        &data
                );
@@ -276,22 +275,12 @@ int difference (ILuint n, struct PixelInfo *p, void *data)
        p[2].red   = diff_1ch(p[0].red,   p[1].red,   d->r_a, d->r_b, d->max);
        p[2].green = diff_1ch(p[0].green, p[1].green, d->g_a, d->g_b, d->max);
        p[2].blue  = diff_1ch(p[0].blue,  p[1].blue,  d->b_a, d->b_b, d->max);
-       if (p[2].flags & HAS_ALPHA)
+       if (p[2].flags & EFF_ALPHA)
                p[2].alpha = (p[0].alpha + p[1].alpha) / 2; /* no better idea */
        
        return 0;
 }
 
-int palette_mix (ILuint n, struct PixelInfo *p, void *data)
-{
-       if (n < 3)
-               return EIO;
-       
-       p[2].index = p[0].index * p[0].info.palette_num_cols + p[1].index;
-       
-       return 0;
-}
-
 static inline ILuint diff_1ch (ILint64 x, ILint64 y, ILint64 A, ILint64 B, ILint64 F)
 {
        ILint64 v;