From 6a3d581a642ec5b3c8759e67cd18fb77cf32854c Mon Sep 17 00:00:00 2001 From: Cristy Date: Thu, 16 Feb 2017 10:41:42 -0500 Subject: [PATCH] alphaColor deprecated and changed to matteColor in Magick++ to remain compatible with IMv6 --- Magick++/lib/Image.cpp | 16 ++++++++-------- Magick++/lib/Magick++/Image.h | 4 ++-- Magick++/lib/Magick++/Montage.h | 6 +++--- Magick++/lib/Magick++/Options.h | 4 ++-- Magick++/lib/Magick++/STL.h | 6 +++--- Magick++/lib/Montage.cpp | 18 +++++++++--------- Magick++/lib/Options.cpp | 8 ++++---- Magick++/lib/STL.cpp | 8 ++++---- Magick++/tests/attributes.cpp | 16 ++++++++-------- 9 files changed, 43 insertions(+), 43 deletions(-) diff --git a/Magick++/lib/Image.cpp b/Magick++/lib/Image.cpp index 34a367b8d..52de0a0bf 100644 --- a/Magick++/lib/Image.cpp +++ b/Magick++/lib/Image.cpp @@ -327,27 +327,27 @@ bool Magick::Image::alpha(void) const return(false); } -void Magick::Image::alphaColor(const Color &alphaColor_) +void Magick::Image::matteColor(const Color &matteColor_) { modifyImage(); - if (alphaColor_.isValid()) + if (matteColor_.isValid()) { - image()->alpha_color=alphaColor_; - options()->alphaColor(alphaColor_); + image()->matte_color=matteColor_; + options()->matteColor(matteColor_); } else { // Set to default matte color Color tmpColor("#BDBDBD"); - image()->alpha_color=tmpColor; - options()->alphaColor(tmpColor); + image()->matte_color=tmpColor; + options()->matteColor(tmpColor); } } -Magick::Color Magick::Image::alphaColor(void) const +Magick::Color Magick::Image::matteColor(void) const { - return(Color(constImage()->alpha_color)); + return(Color(constImage()->matte_color)); } void Magick::Image::animationDelay(const size_t delay_) diff --git a/Magick++/lib/Magick++/Image.h b/Magick++/lib/Magick++/Image.h index 89901d037..68bb56db0 100644 --- a/Magick++/lib/Magick++/Image.h +++ b/Magick++/lib/Magick++/Image.h @@ -106,8 +106,8 @@ namespace Magick bool alpha(void) const; // Transparent color - void alphaColor(const Color &alphaColor_); - Color alphaColor(void) const; + void matteColor(const Color &matteColor_); + Color matteColor(void) const; // Time in 1/100ths of a second which must expire before // displaying the next image in an animated sequence. diff --git a/Magick++/lib/Magick++/Montage.h b/Magick++/lib/Magick++/Montage.h index 3b604b890..61a161df0 100644 --- a/Magick++/lib/Magick++/Montage.h +++ b/Magick++/lib/Magick++/Montage.h @@ -121,8 +121,8 @@ namespace Magick ~MontageFramed(void); // Frame foreground color - void alphaColor(const Color &alphaColor_); - Color alphaColor(void) const; + void matteColor(const Color &matteColor_); + Color matteColor(void) const; // Frame border color void borderColor(const Color &borderColor_); @@ -145,7 +145,7 @@ namespace Magick private: - Color _alphaColor; + Color _matteColor; Color _borderColor; size_t _borderWidth; Geometry _frame; diff --git a/Magick++/lib/Magick++/Options.h b/Magick++/lib/Magick++/Options.h index 57f09adac..e7b127de9 100644 --- a/Magick++/lib/Magick++/Options.h +++ b/Magick++/lib/Magick++/Options.h @@ -43,8 +43,8 @@ namespace Magick bool adjoin(void) const; // Transparent color - void alphaColor(const Color &alphaColor_); - Color alphaColor(void) const; + void matteColor(const Color &matteColor_); + Color matteColor(void) const; // Image background color void backgroundColor(const Color &color_); diff --git a/Magick++/lib/Magick++/STL.h b/Magick++/lib/Magick++/STL.h index 862afc85b..0506cfa05 100644 --- a/Magick++/lib/Magick++/STL.h +++ b/Magick++/lib/Magick++/STL.h @@ -1551,15 +1551,15 @@ namespace Magick }; // Transparent color - class MagickPPExport alphaColorImage + class MagickPPExport matteColorImage { public: - alphaColorImage( const Color &alphaColor_ ); + matteColorImage( const Color &matteColor_ ); void operator()( Image &image_ ) const; private: - Color _alphaColor; + Color _matteColor; }; // Indicate that image is black and white diff --git a/Magick++/lib/Montage.cpp b/Magick++/lib/Montage.cpp index 4c0d47e9c..f82367e49 100644 --- a/Magick++/lib/Montage.cpp +++ b/Magick++/lib/Montage.cpp @@ -181,8 +181,8 @@ void Magick::Montage::updateMontageInfo(MontageInfo &montageInfo_ ) const { (void) MagickCore::ResetMagickMemory(&montageInfo_,0,sizeof(montageInfo_)); - // alpha_color - montageInfo_.alpha_color=Color(); + // matte_color + montageInfo_.matte_color=Color(); // background_color montageInfo_.background_color=_backgroundColor; // border_color @@ -230,7 +230,7 @@ void Magick::Montage::updateMontageInfo(MontageInfo &montageInfo_ ) const // Magick::MontageFramed::MontageFramed(void) - : _alphaColor("#bdbdbd"), + : _matteColor("#bdbdbd"), _borderColor("#dfdfdf"), _borderWidth(0), _frame() @@ -241,14 +241,14 @@ Magick::MontageFramed::~MontageFramed(void) { } -void Magick::MontageFramed::alphaColor(const Magick::Color &alphaColor_) +void Magick::MontageFramed::matteColor(const Magick::Color &matteColor_) { - _alphaColor=alphaColor_; + _matteColor=matteColor_; } -Magick::Color Magick::MontageFramed::alphaColor(void) const +Magick::Color Magick::MontageFramed::matteColor(void) const { - return(_alphaColor); + return(_matteColor); } void Magick::MontageFramed::borderColor(const Magick::Color &borderColor_) @@ -286,8 +286,8 @@ void Magick::MontageFramed::updateMontageInfo(MontageInfo &montageInfo_) const // Do base updates Montage::updateMontageInfo(montageInfo_); - // alpha_color - montageInfo_.alpha_color = _alphaColor; + // matte_color + montageInfo_.matte_color = _matteColor; // border_color montageInfo_.border_color=_borderColor; // border_width diff --git a/Magick++/lib/Options.cpp b/Magick++/lib/Options.cpp index 8cb0fec3a..447d78da6 100644 --- a/Magick++/lib/Options.cpp +++ b/Magick++/lib/Options.cpp @@ -73,14 +73,14 @@ bool Magick::Options::adjoin(void) const return(static_cast(_imageInfo->adjoin)); } -void Magick::Options::alphaColor(const Color &alphaColor_) +void Magick::Options::matteColor(const Color &matteColor_) { - _imageInfo->alpha_color=alphaColor_; + _imageInfo->matte_color=matteColor_; } -Magick::Color Magick::Options::alphaColor(void) const +Magick::Color Magick::Options::matteColor(void) const { - return(Magick::Color(_imageInfo->alpha_color)); + return(Magick::Color(_imageInfo->matte_color)); } void Magick::Options::backgroundColor(const Color &color_) diff --git a/Magick++/lib/STL.cpp b/Magick++/lib/STL.cpp index 77868b3f4..827f1bee4 100644 --- a/Magick++/lib/STL.cpp +++ b/Magick++/lib/STL.cpp @@ -1412,13 +1412,13 @@ void Magick::alphaFlagImage::operator()( Magick::Image &image_ ) const } // Transparent color -Magick::alphaColorImage::alphaColorImage( const Color &alphaColor_ ) - : _alphaColor( alphaColor_ ) +Magick::matteColorImage::matteColorImage( const Color &matteColor_ ) + : _matteColor( matteColor_ ) { } -void Magick::alphaColorImage::operator()( Magick::Image &image_ ) const +void Magick::matteColorImage::operator()( Magick::Image &image_ ) const { - image_.alphaColor( _alphaColor ); + image_.matteColor( _matteColor ); } // Indicate that image is black and white diff --git a/Magick++/tests/attributes.cpp b/Magick++/tests/attributes.cpp index 99a4bf3a5..d7dcbfb7b 100644 --- a/Magick++/tests/attributes.cpp +++ b/Magick++/tests/attributes.cpp @@ -930,28 +930,28 @@ int main( int /*argc*/, char ** argv) image.alpha(false); // - // alphaColor + // matteColor // // Test default - if ( image.alphaColor() != Color("#BDBDBD") ) + if ( image.matteColor() != Color("#BDBDBD") ) { ++failures; cout << "Line: " << __LINE__ - << ", alphaColor default is not #BDBDBD as expected" << endl; + << ", matteColor default is not #BDBDBD as expected" << endl; } // Test set/get - image.alphaColor(ColorRGB(0.5,0.5,1)); - if ( image.alphaColor() != ColorRGB(0.5,0.5,1) ) + image.matteColor(ColorRGB(0.5,0.5,1)); + if ( image.matteColor() != ColorRGB(0.5,0.5,1) ) { ++failures; - cout << "Line: " << __LINE__ << ", alphaColor set/get failed" << endl; + cout << "Line: " << __LINE__ << ", matteColor set/get failed" << endl; } // Test unset - image.alphaColor( Color() ); + image.matteColor( Color() ); - image.alphaColor("#BDBDBD"); + image.matteColor("#BDBDBD"); // // meanErrorPerPixel -- 2.50.1