}
else
_isValid = false;
- ThrowPPException(true);
+ ThrowPPException(false);
return(*this);
}
#define AbsoluteValue(x) ((x) < 0 ? -(x) : (x))
#define MagickPI 3.14159265358979323846264338327950288419716939937510
#define DegreesToRadians(x) (MagickPI*(x)/180.0)
-#define ThrowImageException ThrowPPException(_quiet)
+#define ThrowImageException ThrowPPException(quiet())
MagickPPExport const char *Magick::borderGeometryDefault="6x6+0+0";
MagickPPExport const char *Magick::frameGeometryDefault="25x25+6+6";
}
Magick::Image::Image(void)
- : _imgRef(new ImageRef),
- _quiet(false)
+ : _imgRef(new ImageRef)
{
}
Magick::Image::Image(const Blob &blob_)
- : _imgRef(new ImageRef),
- _quiet(false)
+ : _imgRef(new ImageRef)
{
try
{
}
Magick::Image::Image(const Blob &blob_,const Geometry &size_)
- : _imgRef(new ImageRef),
- _quiet(false)
+ : _imgRef(new ImageRef)
{
try
{
Magick::Image::Image(const Blob &blob_,const Geometry &size_,
const size_t depth_)
- : _imgRef(new ImageRef),
- _quiet(false)
+ : _imgRef(new ImageRef)
{
try
{
Magick::Image::Image(const Blob &blob_,const Geometry &size_,
const size_t depth_,const std::string &magick_)
- : _imgRef(new ImageRef),
- _quiet(false)
+ : _imgRef(new ImageRef)
{
try
{
Magick::Image::Image(const Blob &blob_,const Geometry &size_,
const std::string &magick_)
- : _imgRef(new ImageRef),
- _quiet(false)
+ : _imgRef(new ImageRef)
{
try
{
}
Magick::Image::Image(const Geometry &size_,const Color &color_)
- : _imgRef(new ImageRef),
- _quiet(false)
+ : _imgRef(new ImageRef)
{
// xc: prefix specifies an X11 color string
std::string imageSpec("xc:");
}
Magick::Image::Image(const Image &image_)
- : _imgRef(image_._imgRef),
- _quiet(image_._quiet)
+ : _imgRef(image_._imgRef)
{
_imgRef->increase();
}
Magick::Image::Image(const size_t width_,const size_t height_,
const std::string &map_,const StorageType type_,const void *pixels_)
- : _imgRef(new ImageRef),
- _quiet(false)
+ : _imgRef(new ImageRef)
{
try
{
}
Magick::Image::Image(const std::string &imageSpec_)
- : _imgRef(new ImageRef),
- _quiet(false)
+ : _imgRef(new ImageRef)
{
try
{
if (constImage()->directory)
return(std::string(constImage()->directory));
- if (!_quiet)
+ if (!quiet())
throwExceptionExplicit(MagickCore::CorruptImageWarning,
"Image does not contain a directory");
if ((magick_info != 0) && (*magick_info->description != '\0'))
return(std::string(magick_info->description));
- if (!_quiet)
+ if (!quiet())
throwExceptionExplicit(MagickCore::CorruptImageWarning,
"Unrecognized image magick type");
if (constImage()->geometry)
return Geometry(constImage()->geometry);
- if (!_quiet)
+ if (!quiet())
throwExceptionExplicit(MagickCore::OptionWarning,
"Image does not contain a geometry");
if (constImage()->montage)
return Magick::Geometry(constImage()->montage);
- if (!_quiet)
+ if (!quiet())
throwExceptionExplicit(MagickCore::CorruptImageWarning,
"Image does not contain a montage");
void Magick::Image::quiet(const bool quiet_)
{
- _quiet=quiet_;
+ modifyImage();
+ options()->quiet(quiet_);
}
bool Magick::Image::quiet(void) const
{
- return(_quiet);
+ return(constOptions()->quiet());
}
void Magick::Image::renderingIntent(
ClonePPDrawException(wand);
wand=DestroyDrawingWand(wand);
- ThrowPPDrawException(_quiet);
+ ThrowPPDrawException(quiet());
}
}
ClonePPDrawException(wand);
wand=DestroyDrawingWand(wand);
- ThrowPPDrawException(_quiet);
+ ThrowPPDrawException(quiet());
}
}
}
Magick::Image::Image(MagickCore::Image *image_)
- : _imgRef(new ImageRef(image_)),
- _quiet(false)
+ : _imgRef(new ImageRef(image_))
{
}
image == (MagickCore::Image *) NULL)
{
(void) MagickCore::DestroyExceptionInfo(exceptionInfo);
- if (!_quiet)
+ if (!quiet())
throwExceptionExplicit(MagickCore::ImageWarning,
"No image was loaded.");
}
const PixelInfo *target,const bool invert_);
ImageRef *_imgRef;
- bool _quiet;
};
} // end of namespace Magick
// This may look like C code, but it is really -*- C++ -*-
//
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
-// Copyright Dirk Lemstra 2014
+// Copyright Dirk Lemstra 2014-2015
//
// Definition of Options
//
void quantizeTreeDepth(size_t treeDepth_);
size_t quantizeTreeDepth(void) const;
+ // Suppress all warning messages. Error messages are still reported.
+ void quiet(const bool quiet_);
+ bool quiet(void) const;
+
// Units of resolution to interpret density
void resolutionUnits(ResolutionType resolutionUnits_);
ResolutionType resolutionUnits(void) const;
// Assignment not supported
Options& operator=(const Options&);
- MagickCore::ImageInfo *_imageInfo;
+ MagickCore::ImageInfo *_imageInfo;
MagickCore::QuantizeInfo *_quantizeInfo;
- MagickCore::DrawInfo *_drawInfo;
+ MagickCore::DrawInfo *_drawInfo;
+ bool _quiet;
};
} // namespace Magick
sizeof(ImageInfo)))),
_quantizeInfo(static_cast<QuantizeInfo*>(AcquireMagickMemory(
sizeof(QuantizeInfo)))),
- _drawInfo(static_cast<DrawInfo*>(AcquireMagickMemory(sizeof(DrawInfo))))
+ _drawInfo(static_cast<DrawInfo*>(AcquireMagickMemory(sizeof(DrawInfo)))),
+ _quiet(false)
{
// Initialize image info with defaults
GetImageInfo(_imageInfo);
Magick::Options::Options(const Magick::Options& options_)
: _imageInfo(CloneImageInfo(options_._imageInfo )),
_quantizeInfo(CloneQuantizeInfo(options_._quantizeInfo)),
- _drawInfo(CloneDrawInfo(_imageInfo,options_._drawInfo))
+ _drawInfo(CloneDrawInfo(_imageInfo,options_._drawInfo)),
+ _quiet(options_._quiet)
{
}
_drawInfo->fill_pattern=CloneImage(const_cast<MagickCore::Image*>(
fillPattern_),0,0,static_cast<MagickBooleanType>(MagickTrue),
exceptionInfo);
- ThrowPPException(true);
+ ThrowPPException(_quiet);
}
}
GetPPException;
if (*_imageInfo->magick != '\0' )
magick_info = GetMagickInfo(_imageInfo->magick,exceptionInfo);
- ThrowPPException(true);
+ ThrowPPException(_quiet);
if ((magick_info != 0) && (*magick_info->description != '\0'))
return(std::string( magick_info->description));
if (*_imageInfo->magick == '\0')
throwExceptionExplicit(MagickCore::OptionError,
"Unrecognized image format",magick_.c_str());
- ThrowPPException(true);
+ ThrowPPException(_quiet);
}
std::string Magick::Options::magick(void) const
return(_quantizeInfo->tree_depth);
}
+void Magick::Options::quiet(const bool quiet_)
+{
+ _quiet=quiet_;
+}
+
+bool Magick::Options::quiet(void) const
+{
+ return(_quiet);
+}
+
void Magick::Options::resolutionUnits(Magick::ResolutionType resolutionUnits_)
{
_imageInfo->units=resolutionUnits_;
Magick::Options::Options(const MagickCore::ImageInfo* imageInfo_,
const MagickCore::QuantizeInfo* quantizeInfo_,
const MagickCore::DrawInfo* drawInfo_)
-: _imageInfo(0),
- _quantizeInfo(0),
- _drawInfo(0)
+: _imageInfo((MagickCore::ImageInfo* ) NULL),
+ _quantizeInfo((MagickCore::QuantizeInfo* ) NULL),
+ _drawInfo((MagickCore::DrawInfo* ) NULL),
+ _quiet(false)
{
_imageInfo=CloneImageInfo(imageInfo_);
_quantizeInfo=CloneQuantizeInfo(quantizeInfo_);
_rows(0)
{
GetPPException;
- _view=AcquireVirtualCacheView(_image.image(),exceptionInfo),
+ _view=AcquireVirtualCacheView(image_.image(),exceptionInfo),
ThrowPPException(image_.quiet());
}
GetPPException;
Quantum* pixels=GetCacheViewAuthenticPixels(_view,x_,y_,columns_,rows_,
exceptionInfo);
- ThrowPPException(true);
+ ThrowPPException(_image.quiet());
return pixels;
}
GetPPException;
const Quantum* pixels=GetCacheViewVirtualPixels(_view,x_,y_,columns_,rows_,
exceptionInfo);
- ThrowPPException(true);
+ ThrowPPException(_image.quiet());
return pixels;
}
GetPPException;
Quantum* pixels=QueueCacheViewAuthenticPixels(_view,x_,y_,columns_,rows_,
exceptionInfo);
- ThrowPPException(true);
+ ThrowPPException(_image.quiet());
return pixels;
}
{
GetPPException;
SyncCacheViewAuthenticPixels(_view,exceptionInfo);
- ThrowPPException(true);
+ ThrowPPException(_image.quiet());
}
// Return pixel colormap index array
return(_size);
}
-
void Magick::PixelData::init(Magick::Image &image_,const ::ssize_t x_,
const ::ssize_t y_,const size_t width_,const size_t height_,
std::string map_,const StorageType type_)