diff options
Diffstat (limited to 'magick/operator.c')
-rw-r--r-- | magick/operator.c | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/magick/operator.c b/magick/operator.c index 5653741..34c88cc 100644 --- a/magick/operator.c +++ b/magick/operator.c @@ -1,5 +1,5 @@ /* -% Copyright (C) 2004 - 2018 GraphicsMagick Group +% Copyright (C) 2004 - 2022 GraphicsMagick Group % % This program is covered by multiple licenses, which are described in % Copyright.txt. You should have received a copy of Copyright.txt with this @@ -520,11 +520,13 @@ QuantumAssignCB(void *mutable_data, return (MagickPass); } +#if 0 #define ApplyChannelDepth(parameter) \ { \ for (i=0; i < npixels; i++) \ parameter=scale*((parameter)/scale); \ } +#endif #if MaxRGB > MaxMap # define CrushChannelDepth(parameter) (scale*((parameter)/scale)) #else @@ -548,7 +550,7 @@ QuantumDepthCB(void *mutable_data, unsigned int depth; - register unsigned int + unsigned int scale; register long @@ -585,16 +587,20 @@ QuantumDepthCB(void *mutable_data, if (mutable_context->channel_lut != (Quantum *) NULL) { - for (i=0; i <= (long) MaxMap; i++) - mutable_context->channel_lut[i] = scale*(i/scale); + unsigned int + li; + + for (li=0; li <= MaxMap; li++) + mutable_context->channel_lut[li] = scale*(li/scale); } } -#else - ARG_NOT_USED(*mutable_context); -#endif if (MagickFail == status) return status; +#else + ARG_NOT_USED(*mutable_context); + ARG_NOT_USED(status); +#endif switch (immutable_context->channel) { @@ -771,11 +777,13 @@ QuantumGammaCB(void *mutable_data, 1.0/immutable_context->double_value)); } } + + if (MagickFail == status) + return status; #else ARG_NOT_USED(*mutable_context); + ARG_NOT_USED(status); #endif - if (MagickFail == status) - return status; switch (immutable_context->channel) { @@ -951,12 +959,12 @@ QuantumLogCB(void *mutable_data, } } } + if (MagickFail == status) + return status; #else ARG_NOT_USED(*mutable_context); + ARG_NOT_USED(status); #endif - if (MagickFail == status) - return status; - switch (immutable_context->channel) { case RedChannel: @@ -1585,11 +1593,13 @@ QuantumPowCB(void *mutable_data, immutable_context->double_value)); } } + + if (MagickFail == status) + return status; #else ARG_NOT_USED(*mutable_context); + ARG_NOT_USED(status); #endif - if (MagickFail == status) - return status; switch (immutable_context->channel) { |