}
// Remap image colors with closest color from reference image
-void Magick::Image::map ( const Image &mapImage_ , const bool dither_ )
+void Magick::Image::map ( const Image &mapImage_, const bool dither_ )
{
ExceptionInfo exceptionInfo;
GetExceptionInfo( &exceptionInfo );
}
// Floodfill designated area with replacement alpha value
-void Magick::Image::matteFloodfill ( const Color &target_ ,
+void Magick::Image::matteFloodfill ( const Color &target_,
const unsigned int alpha_,
const ssize_t x_, const ssize_t y_,
const Magick::PaintMethod method_ )
throwException( exceptionInfo );
(void) DestroyExceptionInfo( &exceptionInfo );
}
-
+
// Negate image. Set grayscale_ to true to effect grayscale values
// only
void Magick::Image::negate ( const bool grayscale_ )
ExceptionInfo exceptionInfo;
GetExceptionInfo( &exceptionInfo );
modifyImage();
- NegateImage ( image(), grayscale_ == true ? MagickTrue : MagickFalse,
- &exceptionInfo );
+ NegateImage( image(), (MagickBooleanType) grayscale_, &exceptionInfo );
+ throwException( exceptionInfo );
+ (void) DestroyExceptionInfo( &exceptionInfo );
+}
+
+void Magick::Image::negateChannel ( const ChannelType channel_,
+ const bool grayscale_ )
+{
+ ExceptionInfo exceptionInfo;
+ GetExceptionInfo( &exceptionInfo );
+ modifyImage();
+ ChannelType channel_mask = SetImageChannelMask( image(), channel_ );
+ NegateImage( image(), (MagickBooleanType) grayscale_, &exceptionInfo );
+ SetPixelChannelMask( image(), channel_mask );
throwException( exceptionInfo );
(void) DestroyExceptionInfo( &exceptionInfo );
}
void magnify ( void );
// Remap image colors with closest color from reference image
- void map ( const Image &mapImage_ ,
+ void map ( const Image &mapImage_,
const bool dither_ = false );
// Floodfill designated area with replacement alpha value
- void matteFloodfill ( const Color &target_ ,
+ void matteFloodfill ( const Color &target_,
const unsigned int alpha_,
const ::ssize_t x_, const ::ssize_t y_,
const PaintMethod method_ );
// Negate colors in image. Set grayscale to only negate grayscale
// values in image.
void negate ( const bool grayscale_ = false );
+ void negateChannel ( const ChannelType channel_,
+ const bool grayscale_ = false );
// Normalize image (increase contrast by normalizing the pixel
// values to span the full range of color values)