{"color-correction-collection", StringReference} } },
{ "AutoGamma", { {"channel", MagickChannelOptions} } },
{ "AutoLevel", { {"channel", MagickChannelOptions} } },
+ { "LevelColors", { {"invert", MagickBooleanOptions},
+ {"black-point", RealReference}, {"white-point", RealReference},
+ {"channel", MagickChannelOptions}, {"invert", MagickBooleanOptions} } },
};
static SplayTreeInfo
AutoGammaImage = 254
AutoLevel = 255
AutoLevelImage = 256
+ LevelColors = 257
+ LevelColorsImage = 258
MogrifyRegion = 666
PPCODE:
{
(void) AutoLevelImageChannel(image,channel);
break;
}
+ case 129: /* LevelColors */
+ {
+ MagickPixelPacket
+ black_point,
+ white_point;
+
+ (void) QueryMagickColor("#000000",&black_point,exception);
+ (void) QueryMagickColor("#ffffff",&black_point,exception);
+ if (attribute_flag[1] != 0)
+ (void) QueryMagickColor(argument_list[1].string_reference,
+ &black_point,exception);
+ if (attribute_flag[2] != 0)
+ (void) QueryMagickColor(argument_list[2].string_reference,
+ &white_point,exception);
+ if (attribute_flag[3] != 0)
+ channel=(ChannelType) argument_list[3].long_reference;
+ (void) LevelImageColors(image,channel,&black_point,&white_point,
+ argument_list[0].long_reference != 0 ? MagickTrue : MagickFalse);
+ break;
+ }
}
if (next != (Image *) NULL)
(void) CatchImageException(next);
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% LevelImageColor() will map the given color to "black" and "white"
-% values, limearly spreading out the colors, and level values on a channel by
-% channel bases, as per LevelImage(). The given colors allows you to specify
+% LevelImageColor() maps the given color to "black" and "white" values,
+% linearly spreading out the colors, and level values on a channel by channel
+% bases, as per LevelImage(). The given colors allows you to specify
% different level ranges for each of the color channels seperatally.
%
% If the boolean 'invert' is set true the image values will modifyed in the
%
% The format of the LevelImageColors method is:
%
-% MagickBooleanType LevelImageColors(Image *image,const ChannelType channel,
-% const MagickPixelPacket *black_color,const MagickPixelPacket *white_color,
-% const MagickBooleanType invert)
+% MagickBooleanType LevelImageColors(Image *image,const ChannelType channel,
+% const MagickPixelPacket *black_color,
+% const MagickPixelPacket *white_color,const MagickBooleanType invert)
%
% A description of each parameter follows:
%
LevelizeImageChannel(Image *,const ChannelType,const double,const double,
const double),
LevelImageColors(Image *,const ChannelType,const MagickPixelPacket *,
- const MagickPixelPacket *, const MagickBooleanType),
+ const MagickPixelPacket *,const MagickBooleanType),
LinearStretchImage(Image *,const double,const double),
ModulateImage(Image *,const char *),
NegateImage(Image *,const MagickBooleanType),
"-layers method optimize, merge, or compare image layers",
"-level value adjust the level of image contrast",
"-level-colors color,color",
- " level image using given colors",
+ " level image with the given colors",
"-linear-stretch geometry",
" improve contrast by `stretching with saturation'",
"-liquid-rescale geometry",
p=(const char *) argv[i+1];
GetMagickToken(p,&p,token); /* get black point color */
- if (isalpha((int) token[0]) || (token[0] == '#'))
+ if ((isalpha((int) *token) != 0) || ((*token == '#') != 0))
(void) QueryMagickColor(token,&black_point,exception);
else
- (void) QueryMagickColor("black",&black_point,exception);
+ (void) QueryMagickColor("#000000",&black_point,exception);
if (isalpha((int) token[0]) || (token[0] == '#'))
GetMagickToken(p,&p,token);
- if (token[0] == '\0')
+ if (*token == '\0')
white_point=black_point; /* set everything to that color */
else
{
/*
Get white point color.
*/
- if (!(isalpha((int) token[0]) || (token[0] == '#')))
+ if ((isalpha((int) *token) == 0) && ((*token == '#') == 0))
GetMagickToken(p,&p,token);
- if ((isalpha((int) token[0]) || (token[0] == '#')))
+ if ((isalpha((int) *token) != 0) || ((*token == '#') != 0))
(void) QueryMagickColor(token,&white_point,exception);
else
- (void) QueryMagickColor("white",&white_point,exception);
+ (void) QueryMagickColor("#ffffff",&white_point,exception);
}
(void) LevelImageColors(*image,channel,&black_point,&white_point,
*option == '+' ? MagickTrue : MagickFalse);
"-layers method optimize, merge, or compare image layers",
"-level value adjust the level of image contrast",
"-level-colors color,color",
- " level image using given colors",
+ " level image with the given colors",
"-linear-stretch geometry",
" improve contrast by `stretching with saturation'",
"-liquid-rescale geometry",