]> bicyclesonthemoon.info Git - ott/enhance/blobdiff - nofading.c
newpixbot online
[ott/enhance] / nofading.c
index 9343e1a42fb34f4da445f1f0b9ef7684d8809b32..f3048ba4542b54bacbf453113e030e1a09c4522a 100644 (file)
@@ -1,7 +1,7 @@
 /*
 nofading.c
 The tool to remove fading from an image
-13.11.2022
+04.12.2022
 
 Copyright (C) 2015, 2022  Balthasar Szczepański
 
@@ -90,7 +90,7 @@ int subtool_nofading (int argc, char **argv, int argi, char **err)
                {"help",                no_argument, NULL, 'h'},
                {0,                     0,           0,    0}
        };
-       char short_options[] = "acfh";
+       char short_options[] = "acfh0";
        
        int opt;
        int r;
@@ -165,7 +165,7 @@ int subtool_nofading (int argc, char **argv, int argi, char **err)
        else
                flags |= CANNOT_BE_INDEXED | IN_WINDOW;
        
-       r = create_pictures(1);
+       r = reserve_pictures(1);
        if (r)
        {
                *err = CREATE_FAILED;
@@ -214,7 +214,7 @@ int subtool_nofading (int argc, char **argv, int argi, char **err)
                        }
                }
                
-               r = action_1picture (
+               r = perform_action_1picture (
                        0,
                        x0, y0, f, width, height, frames,
                        &find_fading_range,
@@ -226,7 +226,7 @@ int subtool_nofading (int argc, char **argv, int argi, char **err)
                        *err = CONVERT_FAILED;
                        return r;
                }
-               r = action_1picture (
+               r = perform_action_1picture (
                        0,
                        x0, y0, f, width, height, frames,
                        &enhance_fading,
@@ -251,7 +251,7 @@ int find_fading_range (ILuint n, struct PixelInfo *p, void *data)
        
        d = data;
        
-       if (p->flags & IS_GRAY)
+       if (p->flags & EFF_GRAY)
        {
                UPDATE_RANGE(p->value, d->green_low, d->green_high);
        }
@@ -267,7 +267,7 @@ int find_fading_range (ILuint n, struct PixelInfo *p, void *data)
                UPDATE_RANGE(p->green, d->green_low, d->green_high);
                UPDATE_RANGE(p->blue,  d->green_low, d->green_high);
        }
-       if ((p->flags & HAS_ALPHA) && (d->enhance_alpha))
+       if ((p->flags & EFF_ALPHA) && (d->enhance_alpha))
        {
                UPDATE_RANGE(p->alpha, d->alpha_low, d->alpha_high);
        }
@@ -292,7 +292,7 @@ int enhance_fading (ILuint n, struct PixelInfo *p, void *data)
        
        d = data;
        
-       if (p->flags & IS_GRAY)
+       if (p->flags & EFF_GRAY)
                p->value = enhance_fading_1ch(p->value, d->green_low, d->green_high, d->max);
        else if (d->individual_channels)
        {
@@ -306,7 +306,7 @@ int enhance_fading (ILuint n, struct PixelInfo *p, void *data)
                p->green = enhance_fading_1ch(p->green, d->green_low, d->green_high, d->max);
                p->blue  = enhance_fading_1ch(p->blue , d->green_low, d->green_high, d->max);
        }
-       if ((p->flags & HAS_ALPHA) && (d->enhance_alpha))
+       if ((p->flags & EFF_ALPHA) && (d->enhance_alpha))
                p->alpha = enhance_fading_1ch(p->alpha, d->alpha_low, d->alpha_high, d->max);
 
        return 0;