mirror of
https://github.com/ImageMagick/ImageMagick.git
synced 2026-05-31 11:18:42 +02:00
Refactored methods to use AcquireExceptioInfo instead of GetExceptionInfo.
This commit is contained in:
@@ -144,7 +144,7 @@ Magick::ImageMoments::ImageMoments(const MagickCore::Image *image)
|
||||
channel_moments;
|
||||
|
||||
GetPPException;
|
||||
channel_moments=GetImageMoments(image,&exceptionInfo);
|
||||
channel_moments=GetImageMoments(image,exceptionInfo);
|
||||
if (channel_moments != (MagickCore::ChannelMoments *) NULL)
|
||||
{
|
||||
switch(image->colorspace)
|
||||
|
||||
@@ -42,16 +42,12 @@ Magick::CoderInfo::CoderInfo(const std::string &name_)
|
||||
_isWritable(false),
|
||||
_isMultiFrame(false)
|
||||
{
|
||||
ExceptionInfo
|
||||
exceptionInfo;
|
||||
|
||||
const Magick::MagickInfo
|
||||
*magickInfo;
|
||||
|
||||
GetExceptionInfo(&exceptionInfo);
|
||||
magickInfo=GetMagickInfo(name_.c_str(),&exceptionInfo);
|
||||
throwException(exceptionInfo);
|
||||
(void) DestroyExceptionInfo(&exceptionInfo);
|
||||
GetPPException;
|
||||
magickInfo=GetMagickInfo(name_.c_str(),exceptionInfo);
|
||||
ThrowPPException;
|
||||
if (magickInfo == 0)
|
||||
{
|
||||
throwExceptionExplicit(OptionError,"Coder not found",name_.c_str());
|
||||
|
||||
+10
-16
@@ -169,16 +169,13 @@ const Magick::Color& Magick::Color::operator=(const MagickCore::PixelInfo &color
|
||||
|
||||
const Magick::Color& Magick::Color::operator=(const std::string &color_)
|
||||
{
|
||||
ExceptionInfo
|
||||
exception;
|
||||
|
||||
PixelInfo
|
||||
target_color;
|
||||
|
||||
initPixel();
|
||||
GetExceptionInfo(&exception);
|
||||
GetPPException;
|
||||
if (QueryColorCompliance(color_.c_str(),AllCompliance,&target_color,
|
||||
&exception))
|
||||
exceptionInfo))
|
||||
{
|
||||
quantumRed(target_color.red);
|
||||
quantumGreen(target_color.green);
|
||||
@@ -191,11 +188,8 @@ const Magick::Color& Magick::Color::operator=(const std::string &color_)
|
||||
_pixelType=RGBPixel;
|
||||
}
|
||||
else
|
||||
{
|
||||
_isValid = false;
|
||||
throwException(exception);
|
||||
}
|
||||
(void) DestroyExceptionInfo( &exception );
|
||||
_isValid = false;
|
||||
ThrowPPException;
|
||||
|
||||
return(*this);
|
||||
}
|
||||
@@ -334,12 +328,12 @@ double Magick::Color::scaleQuantumToDouble(const Magick::Quantum quantum_)
|
||||
#endif
|
||||
}
|
||||
|
||||
void Magick::Color::initPixel()
|
||||
{
|
||||
_pixel->red=0;
|
||||
_pixel->green=0;
|
||||
_pixel->blue=0;
|
||||
_pixel->alpha=TransparentAlpha;
|
||||
void Magick::Color::initPixel()
|
||||
{
|
||||
_pixel->red=0;
|
||||
_pixel->green=0;
|
||||
_pixel->blue=0;
|
||||
_pixel->alpha=TransparentAlpha;
|
||||
}
|
||||
|
||||
Magick::ColorGray::ColorGray(void)
|
||||
|
||||
+14
-20
@@ -811,11 +811,11 @@ MagickPPExport void Magick::throwExceptionExplicit(
|
||||
return;
|
||||
|
||||
GetPPException;
|
||||
ThrowException(&exceptionInfo,severity_,reason_, description_);
|
||||
ThrowException(exceptionInfo,severity_,reason_, description_);
|
||||
ThrowPPException;
|
||||
}
|
||||
|
||||
MagickPPExport void Magick::throwException(ExceptionInfo &exception_)
|
||||
MagickPPExport void Magick::throwException(ExceptionInfo *exception_)
|
||||
{
|
||||
const ExceptionInfo
|
||||
*p;
|
||||
@@ -827,30 +827,27 @@ MagickPPExport void Magick::throwException(ExceptionInfo &exception_)
|
||||
ExceptionType
|
||||
severity;
|
||||
|
||||
MagickBooleanType
|
||||
relinquish;
|
||||
|
||||
size_t
|
||||
index;
|
||||
|
||||
// Just return if there is no reported error
|
||||
if (exception_.severity == UndefinedException)
|
||||
if (exception_->severity == UndefinedException)
|
||||
return;
|
||||
|
||||
std::string message=formatExceptionMessage(&exception_);
|
||||
std::string message=formatExceptionMessage(exception_);
|
||||
nestedException=(Exception *) NULL;
|
||||
LockSemaphoreInfo(exception_.semaphore);
|
||||
if (exception_.exceptions != (void *) NULL)
|
||||
LockSemaphoreInfo(exception_->semaphore);
|
||||
if (exception_->exceptions != (void *) NULL)
|
||||
{
|
||||
index=GetNumberOfElementsInLinkedList((LinkedListInfo *)
|
||||
exception_.exceptions);
|
||||
exception_->exceptions);
|
||||
while(index > 0)
|
||||
{
|
||||
p=(const ExceptionInfo *) GetValueFromLinkedList((LinkedListInfo *)
|
||||
exception_.exceptions,--index);
|
||||
if ((p->severity != exception_.severity) || (LocaleCompare(p->reason,
|
||||
exception_.reason) != 0) || (LocaleCompare(p->description,
|
||||
exception_.description) != 0))
|
||||
exception_->exceptions,--index);
|
||||
if ((p->severity != exception_->severity) || (LocaleCompare(p->reason,
|
||||
exception_->reason) != 0) || (LocaleCompare(p->description,
|
||||
exception_->description) != 0))
|
||||
{
|
||||
if (nestedException == (Exception *) NULL)
|
||||
nestedException=createException(p);
|
||||
@@ -863,12 +860,9 @@ MagickPPExport void Magick::throwException(ExceptionInfo &exception_)
|
||||
}
|
||||
}
|
||||
}
|
||||
UnlockSemaphoreInfo(exception_.semaphore);
|
||||
severity=exception_.severity;
|
||||
relinquish=exception_.relinquish;
|
||||
DestroyExceptionInfo(&exception_);
|
||||
if (relinquish)
|
||||
GetExceptionInfo(&exception_);
|
||||
UnlockSemaphoreInfo(exception_->semaphore);
|
||||
severity=exception_->severity;
|
||||
DestroyExceptionInfo(exception_);
|
||||
|
||||
switch (severity)
|
||||
{
|
||||
|
||||
@@ -28,7 +28,7 @@ MagickPPExport void Magick::DisableOpenCL(void)
|
||||
{
|
||||
GetPPException;
|
||||
MagickCore::InitImageMagickOpenCL(MagickCore::MAGICK_OPENCL_OFF,NULL,NULL,
|
||||
&exceptionInfo);
|
||||
exceptionInfo);
|
||||
ThrowPPException;
|
||||
}
|
||||
|
||||
@@ -40,12 +40,12 @@ MagickPPExport bool Magick::EnableOpenCL(const bool useCache_)
|
||||
GetPPException;
|
||||
if (useCache_)
|
||||
status=MagickCore::InitImageMagickOpenCL(
|
||||
MagickCore::MAGICK_OPENCL_DEVICE_SELECT_AUTO,NULL,NULL,&exceptionInfo) ==
|
||||
MagickCore::MAGICK_OPENCL_DEVICE_SELECT_AUTO,NULL,NULL,exceptionInfo) ==
|
||||
MagickTrue;
|
||||
else
|
||||
status=MagickCore::InitImageMagickOpenCL(
|
||||
MagickCore::MAGICK_OPENCL_DEVICE_SELECT_AUTO_CLEAR_CACHE,NULL,NULL,
|
||||
&exceptionInfo) == MagickTrue;
|
||||
exceptionInfo) == MagickTrue;
|
||||
ThrowPPException;
|
||||
return(status);
|
||||
}
|
||||
|
||||
+249
-249
File diff suppressed because it is too large
Load Diff
@@ -22,7 +22,7 @@ Magick::ImageRef::ImageRef(void)
|
||||
_mutexLock()
|
||||
{
|
||||
GetPPException;
|
||||
_image=AcquireImage(_options->imageInfo(),&exceptionInfo);
|
||||
_image=AcquireImage(_options->imageInfo(),exceptionInfo);
|
||||
ThrowPPException;
|
||||
}
|
||||
|
||||
|
||||
@@ -417,7 +417,7 @@ namespace Magick
|
||||
|
||||
// Thow exception based on ImageMagick's ExceptionInfo
|
||||
extern MagickPPExport void throwException(
|
||||
MagickCore::ExceptionInfo &exception_);
|
||||
MagickCore::ExceptionInfo *exception_);
|
||||
|
||||
} // namespace Magick
|
||||
|
||||
|
||||
@@ -1212,7 +1212,6 @@ namespace Magick
|
||||
using MagickCore::GetCacheViewVirtualPixels;
|
||||
using MagickCore::GetColorTuple;
|
||||
using MagickCore::GetDrawInfo;
|
||||
using MagickCore::GetExceptionInfo;
|
||||
using MagickCore::GetGeometry;
|
||||
using MagickCore::GetImageArtifact;
|
||||
using MagickCore::GetImageMoments;
|
||||
@@ -1458,8 +1457,8 @@ namespace Magick
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
#define GetPPException \
|
||||
MagickCore::ExceptionInfo \
|
||||
exceptionInfo; \
|
||||
MagickCore::GetExceptionInfo(&exceptionInfo)
|
||||
*exceptionInfo; \
|
||||
exceptionInfo=MagickCore::AcquireExceptionInfo();
|
||||
#define ClonePPDrawException(wand) \
|
||||
MagickCore::ExceptionInfo \
|
||||
*exceptionInfo; \
|
||||
@@ -1471,10 +1470,10 @@ namespace Magick
|
||||
channel_mask; \
|
||||
channel_mask=MagickCore::SetImageChannelMask(image(),channel)
|
||||
#define ThrowPPDrawException \
|
||||
throwException(*exceptionInfo); \
|
||||
throwException(exceptionInfo); \
|
||||
(void) MagickCore::DestroyExceptionInfo(exceptionInfo)
|
||||
#define ThrowPPException \
|
||||
throwException(exceptionInfo); \
|
||||
(void) MagickCore::DestroyExceptionInfo(&exceptionInfo)
|
||||
(void) MagickCore::DestroyExceptionInfo(exceptionInfo)
|
||||
|
||||
#endif // Magick_Include_header
|
||||
|
||||
@@ -74,7 +74,6 @@ namespace Magick
|
||||
::ssize_t _y; // Top ordinate of view
|
||||
size_t _columns; // Width of view
|
||||
size_t _rows; // Height of view
|
||||
MagickCore::ExceptionInfo _exception; // Any thrown exception
|
||||
|
||||
}; // class Pixels
|
||||
|
||||
|
||||
+80
-141
@@ -1914,13 +1914,9 @@ namespace Magick
|
||||
template <class InputIterator>
|
||||
void animateImages( InputIterator first_,
|
||||
InputIterator last_ ) {
|
||||
MagickCore::ExceptionInfo exceptionInfo;
|
||||
MagickCore::GetExceptionInfo( &exceptionInfo );
|
||||
linkImages( first_, last_ );
|
||||
MagickCore::AnimateImages( first_->imageInfo(), first_->image() );
|
||||
unlinkImages( first_, last_ );
|
||||
throwException( exceptionInfo );
|
||||
(void) MagickCore::DestroyExceptionInfo( &exceptionInfo );
|
||||
}
|
||||
|
||||
// Append images from list into single image in either horizontal or
|
||||
@@ -1930,16 +1926,14 @@ namespace Magick
|
||||
InputIterator first_,
|
||||
InputIterator last_,
|
||||
bool stack_ = false) {
|
||||
MagickCore::ExceptionInfo exceptionInfo;
|
||||
MagickCore::GetExceptionInfo( &exceptionInfo );
|
||||
GetPPException;
|
||||
linkImages( first_, last_ );
|
||||
MagickCore::Image* image = MagickCore::AppendImages( first_->image(),
|
||||
(MagickBooleanType) stack_,
|
||||
&exceptionInfo );
|
||||
exceptionInfo );
|
||||
unlinkImages( first_, last_ );
|
||||
appendedImage_->replaceImage( image );
|
||||
throwException( exceptionInfo );
|
||||
(void) MagickCore::DestroyExceptionInfo( &exceptionInfo );
|
||||
ThrowPPException;
|
||||
}
|
||||
|
||||
// Average a set of images.
|
||||
@@ -1948,15 +1942,13 @@ namespace Magick
|
||||
void averageImages( Image *averagedImage_,
|
||||
InputIterator first_,
|
||||
InputIterator last_ ) {
|
||||
MagickCore::ExceptionInfo exceptionInfo;
|
||||
MagickCore::GetExceptionInfo( &exceptionInfo );
|
||||
GetPPException;
|
||||
linkImages( first_, last_ );
|
||||
MagickCore::Image* image = MagickCore::EvaluateImages( first_->image(),
|
||||
MagickCore::MeanEvaluateOperator, &exceptionInfo );
|
||||
MagickCore::MeanEvaluateOperator, exceptionInfo );
|
||||
unlinkImages( first_, last_ );
|
||||
averagedImage_->replaceImage( image );
|
||||
throwException( exceptionInfo );
|
||||
(void) MagickCore::DestroyExceptionInfo( &exceptionInfo );
|
||||
ThrowPPException;
|
||||
}
|
||||
|
||||
// Merge a sequence of images.
|
||||
@@ -1968,13 +1960,12 @@ namespace Magick
|
||||
void coalesceImages( Container *coalescedImages_,
|
||||
InputIterator first_,
|
||||
InputIterator last_ ) {
|
||||
MagickCore::ExceptionInfo exceptionInfo;
|
||||
MagickCore::GetExceptionInfo( &exceptionInfo );
|
||||
GetPPException;
|
||||
|
||||
// Build image list
|
||||
linkImages( first_, last_ );
|
||||
MagickCore::Image* images = MagickCore::CoalesceImages( first_->image(),
|
||||
&exceptionInfo);
|
||||
exceptionInfo);
|
||||
// Unlink image list
|
||||
unlinkImages( first_, last_ );
|
||||
|
||||
@@ -1985,8 +1976,7 @@ namespace Magick
|
||||
insertImages( coalescedImages_, images );
|
||||
|
||||
// Report any error
|
||||
throwException( exceptionInfo );
|
||||
(void) MagickCore::DestroyExceptionInfo( &exceptionInfo );
|
||||
ThrowPPException;
|
||||
}
|
||||
|
||||
// Return format coders matching specified conditions.
|
||||
@@ -2006,10 +1996,9 @@ namespace Magick
|
||||
) {
|
||||
// Obtain first entry in MagickInfo list
|
||||
size_t number_formats;
|
||||
MagickCore::ExceptionInfo exceptionInfo;
|
||||
MagickCore::GetExceptionInfo( &exceptionInfo );
|
||||
GetPPException;
|
||||
char **coder_list =
|
||||
MagickCore::GetMagickList( "*", &number_formats, &exceptionInfo );
|
||||
MagickCore::GetMagickList( "*", &number_formats, exceptionInfo );
|
||||
if( !coder_list )
|
||||
{
|
||||
throwException( exceptionInfo );
|
||||
@@ -2023,7 +2012,7 @@ namespace Magick
|
||||
for ( ::ssize_t i=0; i < (::ssize_t) number_formats; i++)
|
||||
{
|
||||
const MagickCore::MagickInfo *magick_info =
|
||||
MagickCore::GetMagickInfo( coder_list[i], &exceptionInfo );
|
||||
MagickCore::GetMagickInfo( coder_list[i], exceptionInfo );
|
||||
coder_list[i]=(char *)
|
||||
MagickCore::RelinquishMagickMemory( coder_list[i] );
|
||||
|
||||
@@ -2062,8 +2051,7 @@ namespace Magick
|
||||
}
|
||||
}
|
||||
coder_list=(char **) MagickCore::RelinquishMagickMemory( coder_list );
|
||||
throwException( exceptionInfo );
|
||||
(void) MagickCore::DestroyExceptionInfo( &exceptionInfo );
|
||||
ThrowPPException;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -2109,15 +2097,13 @@ namespace Magick
|
||||
template <class Container >
|
||||
void colorHistogram( Container *histogram_, const Image image)
|
||||
{
|
||||
MagickCore::ExceptionInfo exceptionInfo;
|
||||
MagickCore::GetExceptionInfo( &exceptionInfo );
|
||||
GetPPException;
|
||||
|
||||
// Obtain histogram array
|
||||
size_t colors;
|
||||
MagickCore::PixelInfo *histogram_array =
|
||||
MagickCore::GetImageHistogram( image.constImage(), &colors, &exceptionInfo );
|
||||
throwException( exceptionInfo );
|
||||
(void) MagickCore::DestroyExceptionInfo( &exceptionInfo );
|
||||
MagickCore::GetImageHistogram( image.constImage(), &colors, exceptionInfo );
|
||||
ThrowPPException;
|
||||
|
||||
// Clear out container
|
||||
histogram_->clear();
|
||||
@@ -2143,14 +2129,12 @@ namespace Magick
|
||||
InputIterator first_,
|
||||
InputIterator last_,
|
||||
const ChannelType channel_ ) {
|
||||
MagickCore::ExceptionInfo exceptionInfo;
|
||||
MagickCore::GetExceptionInfo( &exceptionInfo );
|
||||
GetPPException;
|
||||
linkImages( first_, last_ );
|
||||
MagickCore::Image* image = CombineImages( first_->image(), channel_, &exceptionInfo );
|
||||
MagickCore::Image* image = CombineImages( first_->image(), channel_, exceptionInfo );
|
||||
unlinkImages( first_, last_ );
|
||||
combinedImage_->replaceImage( image );
|
||||
throwException( exceptionInfo );
|
||||
(void) MagickCore::DestroyExceptionInfo( &exceptionInfo );
|
||||
ThrowPPException;
|
||||
}
|
||||
|
||||
// Break down an image sequence into constituent parts. This is
|
||||
@@ -2159,13 +2143,12 @@ namespace Magick
|
||||
void deconstructImages( Container *deconstructedImages_,
|
||||
InputIterator first_,
|
||||
InputIterator last_ ) {
|
||||
MagickCore::ExceptionInfo exceptionInfo;
|
||||
MagickCore::GetExceptionInfo( &exceptionInfo );
|
||||
GetPPException;
|
||||
|
||||
// Build image list
|
||||
linkImages( first_, last_ );
|
||||
MagickCore::Image* images = DeconstructImages( first_->image(),
|
||||
&exceptionInfo);
|
||||
exceptionInfo);
|
||||
// Unlink image list
|
||||
unlinkImages( first_, last_ );
|
||||
|
||||
@@ -2176,8 +2159,7 @@ namespace Magick
|
||||
insertImages( deconstructedImages_, images );
|
||||
|
||||
// Report any error
|
||||
throwException( exceptionInfo );
|
||||
(void) MagickCore::DestroyExceptionInfo( &exceptionInfo );
|
||||
ThrowPPException;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -2186,13 +2168,11 @@ namespace Magick
|
||||
template <class InputIterator>
|
||||
void displayImages( InputIterator first_,
|
||||
InputIterator last_ ) {
|
||||
MagickCore::ExceptionInfo exceptionInfo;
|
||||
MagickCore::GetExceptionInfo( &exceptionInfo );
|
||||
GetPPException;
|
||||
linkImages( first_, last_ );
|
||||
MagickCore::DisplayImages( first_->imageInfo(), first_->image() );
|
||||
unlinkImages( first_, last_ );
|
||||
throwException( exceptionInfo );
|
||||
(void) MagickCore::DestroyExceptionInfo( &exceptionInfo );
|
||||
ThrowPPException;
|
||||
}
|
||||
|
||||
// Applies a value to the image with an arithmetic, relational,
|
||||
@@ -2204,14 +2184,12 @@ namespace Magick
|
||||
InputIterator first_,
|
||||
InputIterator last_,
|
||||
const MagickEvaluateOperator operator_ ) {
|
||||
MagickCore::ExceptionInfo exceptionInfo;
|
||||
MagickCore::GetExceptionInfo( &exceptionInfo );
|
||||
GetPPException;
|
||||
linkImages( first_, last_ );
|
||||
MagickCore::Image* image = EvaluateImages( first_->image(), operator_, &exceptionInfo );
|
||||
MagickCore::Image* image = EvaluateImages( first_->image(), operator_, exceptionInfo );
|
||||
unlinkImages( first_, last_ );
|
||||
evaluatedImage_->replaceImage( image );
|
||||
throwException( exceptionInfo );
|
||||
(void) MagickCore::DestroyExceptionInfo( &exceptionInfo );
|
||||
ThrowPPException;
|
||||
}
|
||||
|
||||
// Merge a sequence of image frames which represent image layers.
|
||||
@@ -2220,15 +2198,13 @@ namespace Magick
|
||||
void flattenImages( Image *flattendImage_,
|
||||
InputIterator first_,
|
||||
InputIterator last_ ) {
|
||||
MagickCore::ExceptionInfo exceptionInfo;
|
||||
MagickCore::GetExceptionInfo( &exceptionInfo );
|
||||
GetPPException;
|
||||
linkImages( first_, last_ );
|
||||
MagickCore::Image* image = MagickCore::MergeImageLayers( first_->image(),
|
||||
FlattenLayer,&exceptionInfo );
|
||||
FlattenLayer,exceptionInfo );
|
||||
unlinkImages( first_, last_ );
|
||||
flattendImage_->replaceImage( image );
|
||||
throwException( exceptionInfo );
|
||||
(void) MagickCore::DestroyExceptionInfo( &exceptionInfo );
|
||||
ThrowPPException;
|
||||
}
|
||||
|
||||
// Implements the discrete Fourier transform (DFT) of the image either as a
|
||||
@@ -2236,12 +2212,11 @@ namespace Magick
|
||||
template <class Container >
|
||||
void forwardFourierTransformImage( Container *fourierImages_,
|
||||
const Image &image_ ) {
|
||||
MagickCore::ExceptionInfo exceptionInfo;
|
||||
MagickCore::GetExceptionInfo( &exceptionInfo );
|
||||
GetPPException;
|
||||
|
||||
// Build image list
|
||||
MagickCore::Image* images = ForwardFourierTransformImage(
|
||||
image_.constImage(), MagickTrue, &exceptionInfo);
|
||||
image_.constImage(), MagickTrue, exceptionInfo);
|
||||
|
||||
// Ensure container is empty
|
||||
fourierImages_->clear();
|
||||
@@ -2250,19 +2225,17 @@ namespace Magick
|
||||
insertImages( fourierImages_, images );
|
||||
|
||||
// Report any error
|
||||
throwException( exceptionInfo );
|
||||
(void) MagickCore::DestroyExceptionInfo( &exceptionInfo );
|
||||
ThrowPPException;
|
||||
}
|
||||
template <class Container >
|
||||
void forwardFourierTransformImage( Container *fourierImages_,
|
||||
const Image &image_, const bool magnitude_ ) {
|
||||
MagickCore::ExceptionInfo exceptionInfo;
|
||||
MagickCore::GetExceptionInfo( &exceptionInfo );
|
||||
GetPPException;
|
||||
|
||||
// Build image list
|
||||
MagickCore::Image* images = ForwardFourierTransformImage(
|
||||
image_.constImage(), magnitude_ == true ? MagickTrue : MagickFalse,
|
||||
&exceptionInfo);
|
||||
exceptionInfo);
|
||||
|
||||
// Ensure container is empty
|
||||
fourierImages_->clear();
|
||||
@@ -2271,8 +2244,7 @@ namespace Magick
|
||||
insertImages( fourierImages_, images );
|
||||
|
||||
// Report any error
|
||||
throwException( exceptionInfo );
|
||||
(void) MagickCore::DestroyExceptionInfo( &exceptionInfo );
|
||||
ThrowPPException;
|
||||
}
|
||||
|
||||
// Applies a mathematical expression to a sequence of images.
|
||||
@@ -2280,20 +2252,16 @@ namespace Magick
|
||||
void fxImages(Image *fxImage_,InputIterator first_,InputIterator last_,
|
||||
const std::string expression)
|
||||
{
|
||||
MagickCore::ExceptionInfo
|
||||
exceptionInfo;
|
||||
|
||||
MagickCore::Image
|
||||
*image;
|
||||
|
||||
MagickCore::GetExceptionInfo(&exceptionInfo);
|
||||
GetPPException;
|
||||
linkImages(first_,last_);
|
||||
image=FxImageChannel(first_->constImage(),DefaultChannels,
|
||||
expression.c_str(),&exceptionInfo);
|
||||
expression.c_str(),exceptionInfo);
|
||||
unlinkImages(first_,last_);
|
||||
fxImage_->replaceImage(image);
|
||||
throwException(exceptionInfo);
|
||||
(void) DestroyExceptionInfo(&exceptionInfo);
|
||||
ThrowPPException;
|
||||
}
|
||||
|
||||
// Replace the colors of a sequence of images with the closest color
|
||||
@@ -2307,9 +2275,6 @@ namespace Magick
|
||||
bool dither_ = false,
|
||||
bool measureError_ = false ) {
|
||||
|
||||
MagickCore::ExceptionInfo exceptionInfo;
|
||||
MagickCore::GetExceptionInfo( &exceptionInfo );
|
||||
MagickCore::QuantizeInfo quantizeInfo;
|
||||
MagickCore::GetQuantizeInfo( &quantizeInfo );
|
||||
quantizeInfo.dither_method = dither_ ? MagickCore::RiemersmaDitherMethod :
|
||||
MagickCore::NoDitherMethod;
|
||||
@@ -2319,18 +2284,16 @@ namespace Magick
|
||||
if ( exceptionInfo.severity != MagickCore::UndefinedException )
|
||||
{
|
||||
unlinkImages( first_, last_ );
|
||||
throwException( exceptionInfo );
|
||||
}
|
||||
|
||||
MagickCore::Image* image = first_->image();
|
||||
while( image )
|
||||
{
|
||||
// Calculate quantization error
|
||||
MagickCore::ExceptionInfo exceptionInfo;
|
||||
MagickCore::GetExceptionInfo( &exceptionInfo );
|
||||
GetPPException;
|
||||
if ( measureError_ )
|
||||
{
|
||||
MagickCore::GetImageQuantizeError( image, &exceptionInfo );
|
||||
MagickCore::GetImageQuantizeError( image, exceptionInfo );
|
||||
if ( exceptionInfo.severity > MagickCore::UndefinedException )
|
||||
{
|
||||
unlinkImages( first_, last_ );
|
||||
@@ -2339,17 +2302,15 @@ namespace Magick
|
||||
}
|
||||
|
||||
// Udate DirectClass representation of pixels
|
||||
MagickCore::SyncImage( image, &exceptionInfo );
|
||||
MagickCore::SyncImage( image, exceptionInfo );
|
||||
unlinkImages( first_, last_ );
|
||||
throwException( exceptionInfo );
|
||||
(void) MagickCore::DestroyExceptionInfo( &exceptionInfo );
|
||||
ThrowPPException;
|
||||
|
||||
// Next image
|
||||
image=image->next;
|
||||
}
|
||||
|
||||
unlinkImages( first_, last_ );
|
||||
(void) MagickCore::DestroyExceptionInfo( &exceptionInfo );
|
||||
}
|
||||
|
||||
// Composes all the image layers from the current given
|
||||
@@ -2359,14 +2320,12 @@ namespace Magick
|
||||
InputIterator first_,
|
||||
InputIterator last_,
|
||||
const LayerMethod method_ ) {
|
||||
MagickCore::ExceptionInfo exceptionInfo;
|
||||
MagickCore::GetExceptionInfo( &exceptionInfo );
|
||||
GetPPException;
|
||||
linkImages( first_, last_ );
|
||||
MagickCore::Image* image = MergeImageLayers( first_->image(), method_, &exceptionInfo );
|
||||
MagickCore::Image* image = MergeImageLayers( first_->image(), method_, exceptionInfo );
|
||||
unlinkImages( first_, last_ );
|
||||
mergedImage_->replaceImage( image );
|
||||
throwException( exceptionInfo );
|
||||
(void) MagickCore::DestroyExceptionInfo( &exceptionInfo );
|
||||
ThrowPPException;
|
||||
}
|
||||
|
||||
// Create a composite image by combining several separate images.
|
||||
@@ -2396,7 +2355,7 @@ namespace Magick
|
||||
// Do montage
|
||||
GetPPException;
|
||||
images=MagickCore::MontageImages(first_->image(),montageInfo,
|
||||
&exceptionInfo);
|
||||
exceptionInfo);
|
||||
|
||||
// Unlink linked image list
|
||||
unlinkImages(first_,last_);
|
||||
@@ -2425,13 +2384,12 @@ namespace Magick
|
||||
InputIterator first_,
|
||||
InputIterator last_,
|
||||
size_t frames_ ) {
|
||||
MagickCore::ExceptionInfo exceptionInfo;
|
||||
MagickCore::GetExceptionInfo( &exceptionInfo );
|
||||
GetPPException;
|
||||
|
||||
// Build image list
|
||||
linkImages( first_, last_ );
|
||||
MagickCore::Image* images = MagickCore::MorphImages( first_->image(), frames_,
|
||||
&exceptionInfo);
|
||||
exceptionInfo);
|
||||
// Unlink image list
|
||||
unlinkImages( first_, last_ );
|
||||
|
||||
@@ -2442,8 +2400,7 @@ namespace Magick
|
||||
insertImages( morphedImages_, images );
|
||||
|
||||
// Report any error
|
||||
throwException( exceptionInfo );
|
||||
(void) MagickCore::DestroyExceptionInfo( &exceptionInfo );
|
||||
ThrowPPException;
|
||||
}
|
||||
|
||||
// Inlay a number of images to form a single coherent picture.
|
||||
@@ -2451,15 +2408,13 @@ namespace Magick
|
||||
void mosaicImages( Image *mosaicImage_,
|
||||
InputIterator first_,
|
||||
InputIterator last_ ) {
|
||||
MagickCore::ExceptionInfo exceptionInfo;
|
||||
MagickCore::GetExceptionInfo( &exceptionInfo );
|
||||
GetPPException;
|
||||
linkImages( first_, last_ );
|
||||
MagickCore::Image* image = MagickCore::MergeImageLayers( first_->image(),
|
||||
MosaicLayer,&exceptionInfo );
|
||||
MosaicLayer,exceptionInfo );
|
||||
unlinkImages( first_, last_ );
|
||||
mosaicImage_->replaceImage( image );
|
||||
throwException( exceptionInfo );
|
||||
(void) MagickCore::DestroyExceptionInfo( &exceptionInfo );
|
||||
ThrowPPException;
|
||||
}
|
||||
|
||||
// Compares each image the GIF disposed forms of the previous image in
|
||||
@@ -2470,11 +2425,10 @@ namespace Magick
|
||||
void optimizeImageLayers( Container *optimizedImages_,
|
||||
InputIterator first_,
|
||||
InputIterator last_ ) {
|
||||
MagickCore::ExceptionInfo exceptionInfo;
|
||||
MagickCore::GetExceptionInfo( &exceptionInfo );
|
||||
GetPPException;
|
||||
|
||||
linkImages( first_, last_ );
|
||||
MagickCore::Image* images = OptimizeImageLayers( first_->image(), &exceptionInfo );
|
||||
MagickCore::Image* images = OptimizeImageLayers( first_->image(), exceptionInfo );
|
||||
|
||||
unlinkImages( first_, last_ );
|
||||
|
||||
@@ -2482,8 +2436,7 @@ namespace Magick
|
||||
|
||||
insertImages( optimizedImages_, images );
|
||||
|
||||
throwException( exceptionInfo );
|
||||
(void) MagickCore::DestroyExceptionInfo( &exceptionInfo );
|
||||
ThrowPPException;
|
||||
}
|
||||
|
||||
// optimizeImagePlusLayers is exactly as optimizeImageLayers, but may
|
||||
@@ -2493,11 +2446,10 @@ namespace Magick
|
||||
void optimizePlusImageLayers( Container *optimizedImages_,
|
||||
InputIterator first_,
|
||||
InputIterator last_ ) {
|
||||
MagickCore::ExceptionInfo exceptionInfo;
|
||||
MagickCore::GetExceptionInfo( &exceptionInfo );
|
||||
GetPPException;
|
||||
|
||||
linkImages( first_, last_ );
|
||||
MagickCore::Image* images = OptimizePlusImageLayers( first_->image(), &exceptionInfo );
|
||||
MagickCore::Image* images = OptimizePlusImageLayers( first_->image(), exceptionInfo );
|
||||
|
||||
unlinkImages( first_, last_ );
|
||||
|
||||
@@ -2505,8 +2457,7 @@ namespace Magick
|
||||
|
||||
insertImages( optimizedImages_, images );
|
||||
|
||||
throwException( exceptionInfo );
|
||||
(void) MagickCore::DestroyExceptionInfo( &exceptionInfo );
|
||||
ThrowPPDrawException;
|
||||
}
|
||||
|
||||
// Adds the names of the profiles from the image to the container.
|
||||
@@ -2533,8 +2484,7 @@ namespace Magick
|
||||
void quantizeImages( InputIterator first_,
|
||||
InputIterator last_,
|
||||
bool measureError_ = false ) {
|
||||
MagickCore::ExceptionInfo exceptionInfo;
|
||||
MagickCore::GetExceptionInfo( &exceptionInfo );
|
||||
GetPPException;
|
||||
|
||||
linkImages( first_, last_ );
|
||||
|
||||
@@ -2543,7 +2493,6 @@ namespace Magick
|
||||
if ( exceptionInfo.severity > MagickCore::UndefinedException )
|
||||
{
|
||||
unlinkImages( first_, last_ );
|
||||
throwException( exceptionInfo );
|
||||
}
|
||||
|
||||
MagickCore::Image* image = first_->image();
|
||||
@@ -2551,17 +2500,17 @@ namespace Magick
|
||||
{
|
||||
// Calculate quantization error
|
||||
if ( measureError_ )
|
||||
MagickCore::GetImageQuantizeError( image, &exceptionInfo );
|
||||
MagickCore::GetImageQuantizeError( image, exceptionInfo );
|
||||
|
||||
// Update DirectClass representation of pixels
|
||||
MagickCore::SyncImage( image, &exceptionInfo );
|
||||
MagickCore::SyncImage( image, exceptionInfo );
|
||||
|
||||
// Next image
|
||||
image=image->next;
|
||||
}
|
||||
|
||||
unlinkImages( first_, last_ );
|
||||
(void) MagickCore::DestroyExceptionInfo( &exceptionInfo );
|
||||
ThrowPPException;
|
||||
}
|
||||
|
||||
// Read images into existing container (appending to container)
|
||||
@@ -2572,27 +2521,23 @@ namespace Magick
|
||||
MagickCore::ImageInfo *imageInfo = MagickCore::CloneImageInfo(0);
|
||||
imageSpec_.copy( imageInfo->filename, MaxTextExtent-1 );
|
||||
imageInfo->filename[ imageSpec_.length() ] = 0;
|
||||
MagickCore::ExceptionInfo exceptionInfo;
|
||||
MagickCore::GetExceptionInfo( &exceptionInfo );
|
||||
MagickCore::Image* images = MagickCore::ReadImage( imageInfo, &exceptionInfo );
|
||||
GetPPException;
|
||||
MagickCore::Image* images = MagickCore::ReadImage( imageInfo, exceptionInfo );
|
||||
MagickCore::DestroyImageInfo(imageInfo);
|
||||
insertImages( sequence_, images);
|
||||
throwException( exceptionInfo );
|
||||
(void) MagickCore::DestroyExceptionInfo( &exceptionInfo );
|
||||
ThrowPPException;
|
||||
}
|
||||
template <class Container>
|
||||
void readImages( Container *sequence_,
|
||||
const Blob &blob_ ) {
|
||||
MagickCore::ImageInfo *imageInfo = MagickCore::CloneImageInfo(0);
|
||||
MagickCore::ExceptionInfo exceptionInfo;
|
||||
MagickCore::GetExceptionInfo( &exceptionInfo );
|
||||
GetPPException;
|
||||
MagickCore::Image *images = MagickCore::BlobToImage( imageInfo,
|
||||
blob_.data(),
|
||||
blob_.length(), &exceptionInfo );
|
||||
blob_.length(), exceptionInfo );
|
||||
MagickCore::DestroyImageInfo(imageInfo);
|
||||
insertImages( sequence_, images );
|
||||
throwException( exceptionInfo );
|
||||
(void) MagickCore::DestroyExceptionInfo( &exceptionInfo );
|
||||
ThrowPPException;
|
||||
}
|
||||
|
||||
// Returns a separate grayscale image for each channel specified.
|
||||
@@ -2600,17 +2545,15 @@ namespace Magick
|
||||
void separateImages( Container *separatedImages_,
|
||||
const Image &image_,
|
||||
const ChannelType channel_ ) {
|
||||
MagickCore::ExceptionInfo exceptionInfo;
|
||||
MagickCore::GetExceptionInfo( &exceptionInfo );
|
||||
GetPPException;
|
||||
|
||||
MagickCore::Image* images = MagickCore::SeparateImages( image_.constImage(), &exceptionInfo );
|
||||
MagickCore::Image* images = MagickCore::SeparateImages( image_.constImage(), exceptionInfo );
|
||||
|
||||
separatedImages_->clear();
|
||||
|
||||
insertImages( separatedImages_, images );
|
||||
|
||||
throwException( exceptionInfo );
|
||||
(void) MagickCore::DestroyExceptionInfo( &exceptionInfo );
|
||||
ThrowPPException;
|
||||
}
|
||||
|
||||
// Smush images from list into single image in either horizontal or
|
||||
@@ -2625,7 +2568,7 @@ namespace Magick
|
||||
GetPPException;
|
||||
linkImages(first_,last_);
|
||||
newImage=MagickCore::SmushImages(first_->constImage(),
|
||||
(MagickBooleanType) stack_,offset_,&exceptionInfo);
|
||||
(MagickBooleanType) stack_,offset_,exceptionInfo);
|
||||
unlinkImages(first_,last_);
|
||||
smushedImage_->replaceImage(newImage);
|
||||
ThrowPPException;
|
||||
@@ -2640,24 +2583,22 @@ namespace Magick
|
||||
|
||||
first_->adjoin( adjoin_ );
|
||||
|
||||
MagickCore::ExceptionInfo exceptionInfo;
|
||||
MagickCore::GetExceptionInfo( &exceptionInfo );
|
||||
GetPPException;
|
||||
|
||||
linkImages( first_, last_ );
|
||||
::ssize_t errorStat = MagickCore::WriteImages( first_->constImageInfo(),
|
||||
first_->image(),
|
||||
imageSpec_.c_str(),
|
||||
&exceptionInfo );
|
||||
exceptionInfo );
|
||||
unlinkImages( first_, last_ );
|
||||
|
||||
if ( errorStat != false )
|
||||
{
|
||||
(void) MagickCore::DestroyExceptionInfo( &exceptionInfo );
|
||||
(void) MagickCore::DestroyExceptionInfo( exceptionInfo );
|
||||
return;
|
||||
}
|
||||
|
||||
throwException( exceptionInfo );
|
||||
(void) MagickCore::DestroyExceptionInfo( &exceptionInfo );
|
||||
ThrowPPException;
|
||||
}
|
||||
// Write images to BLOB
|
||||
template <class InputIterator>
|
||||
@@ -2670,19 +2611,17 @@ namespace Magick
|
||||
|
||||
linkImages( first_, last_ );
|
||||
|
||||
MagickCore::ExceptionInfo exceptionInfo;
|
||||
MagickCore::GetExceptionInfo( &exceptionInfo );
|
||||
GetPPException;
|
||||
size_t length = 2048; // Efficient size for small images
|
||||
void* data = MagickCore::ImagesToBlob( first_->imageInfo(),
|
||||
first_->image(),
|
||||
&length,
|
||||
&exceptionInfo);
|
||||
exceptionInfo);
|
||||
blob_->updateNoCopy( data, length, Magick::Blob::MallocAllocator );
|
||||
|
||||
unlinkImages( first_, last_ );
|
||||
|
||||
throwException( exceptionInfo );
|
||||
(void) MagickCore::DestroyExceptionInfo( &exceptionInfo );
|
||||
ThrowPPException;
|
||||
}
|
||||
|
||||
} // namespace Magick
|
||||
|
||||
@@ -255,7 +255,7 @@ void Magick::Options::fillPattern(const MagickCore::Image *fillPattern_)
|
||||
GetPPException;
|
||||
_drawInfo->fill_pattern=CloneImage(const_cast<MagickCore::Image*>(
|
||||
fillPattern_),0,0,static_cast<MagickBooleanType>(MagickTrue),
|
||||
&exceptionInfo);
|
||||
exceptionInfo);
|
||||
ThrowPPException;
|
||||
}
|
||||
}
|
||||
@@ -315,7 +315,7 @@ std::string Magick::Options::format(void) const
|
||||
|
||||
GetPPException;
|
||||
if (*_imageInfo->magick != '\0' )
|
||||
magick_info = GetMagickInfo(_imageInfo->magick,&exceptionInfo);
|
||||
magick_info = GetMagickInfo(_imageInfo->magick,exceptionInfo);
|
||||
ThrowPPException;
|
||||
|
||||
if ((magick_info != 0) && (*magick_info->description != '\0'))
|
||||
@@ -339,11 +339,11 @@ void Magick::Options::magick(const std::string &magick_)
|
||||
FormatLocaleString(_imageInfo->filename,MaxTextExtent,"%.1024s:",
|
||||
magick_.c_str());
|
||||
GetPPException;
|
||||
SetImageInfo(_imageInfo,1,&exceptionInfo);
|
||||
SetImageInfo(_imageInfo,1,exceptionInfo);
|
||||
if (*_imageInfo->magick == '\0')
|
||||
throwExceptionExplicit(OptionWarning, "Unrecognized image format",
|
||||
magick_.c_str());
|
||||
(void) DestroyExceptionInfo(&exceptionInfo);
|
||||
ThrowPPException;
|
||||
}
|
||||
|
||||
std::string Magick::Options::magick(void) const
|
||||
@@ -589,7 +589,7 @@ void Magick::Options::strokePattern(const MagickCore::Image *strokePattern_)
|
||||
{
|
||||
GetPPException;
|
||||
_drawInfo->stroke_pattern=CloneImage( const_cast<MagickCore::Image*>(
|
||||
strokePattern_),0,0,MagickTrue,&exceptionInfo);
|
||||
strokePattern_),0,0,MagickTrue,exceptionInfo);
|
||||
ThrowPPException;
|
||||
}
|
||||
}
|
||||
|
||||
+17
-23
@@ -17,24 +17,20 @@
|
||||
|
||||
Magick::Pixels::Pixels(Magick::Image &image_)
|
||||
: _image(image_),
|
||||
_view(AcquireVirtualCacheView(_image.image(),&_exception)),
|
||||
_x(0),
|
||||
_y(0),
|
||||
_columns(0),
|
||||
_rows(0)
|
||||
{
|
||||
GetExceptionInfo(&_exception);
|
||||
|
||||
if (!_view)
|
||||
throwExceptionExplicit(OptionError,"Empty view detected.");
|
||||
GetPPException;
|
||||
_view=AcquireVirtualCacheView(_image.image(),exceptionInfo),
|
||||
ThrowPPException;
|
||||
}
|
||||
|
||||
Magick::Pixels::~Pixels(void)
|
||||
{
|
||||
if (_view)
|
||||
_view=DestroyCacheView(_view);
|
||||
|
||||
(void) DestroyExceptionInfo(&_exception);
|
||||
}
|
||||
|
||||
Magick::Quantum* Magick::Pixels::get(const ssize_t x_,const ssize_t y_,
|
||||
@@ -45,11 +41,10 @@ Magick::Quantum* Magick::Pixels::get(const ssize_t x_,const ssize_t y_,
|
||||
_columns=columns_;
|
||||
_rows=rows_;
|
||||
|
||||
GetPPException;
|
||||
Quantum* pixels=GetCacheViewAuthenticPixels(_view,x_,y_,columns_,rows_,
|
||||
&_exception);
|
||||
|
||||
if (!pixels)
|
||||
throwException(_exception);
|
||||
exceptionInfo);
|
||||
ThrowPPException;
|
||||
|
||||
return pixels;
|
||||
}
|
||||
@@ -62,11 +57,10 @@ const Magick::Quantum* Magick::Pixels::getConst(const ssize_t x_,
|
||||
_columns=columns_;
|
||||
_rows=rows_;
|
||||
|
||||
GetPPException;
|
||||
const Quantum* pixels=GetCacheViewVirtualPixels(_view,x_,y_,columns_,rows_,
|
||||
&_exception);
|
||||
|
||||
if (!pixels)
|
||||
throwException(_exception);
|
||||
exceptionInfo);
|
||||
ThrowPPException;
|
||||
|
||||
return pixels;
|
||||
}
|
||||
@@ -86,19 +80,19 @@ Magick::Quantum* Magick::Pixels::set(const ssize_t x_,const ssize_t y_,
|
||||
_columns=columns_;
|
||||
_rows=rows_;
|
||||
|
||||
GetPPException;
|
||||
Quantum* pixels=QueueCacheViewAuthenticPixels(_view,x_,y_,columns_,rows_,
|
||||
&_exception);
|
||||
|
||||
if (!pixels)
|
||||
throwException(_exception);
|
||||
exceptionInfo);
|
||||
ThrowPPException;
|
||||
|
||||
return pixels;
|
||||
}
|
||||
|
||||
void Magick::Pixels::sync(void)
|
||||
{
|
||||
if(!SyncCacheViewAuthenticPixels(_view,&_exception))
|
||||
throwException(_exception);
|
||||
GetPPException;
|
||||
SyncCacheViewAuthenticPixels(_view,exceptionInfo);
|
||||
ThrowPPException;
|
||||
}
|
||||
|
||||
// Return pixel colormap index array
|
||||
@@ -198,8 +192,8 @@ void Magick::PixelData::init(Magick::Image &image_,const ::ssize_t x_,
|
||||
|
||||
GetPPException;
|
||||
MagickCore::ExportImagePixels(image_.image(),x_,y_,width_,height_,
|
||||
map_.c_str(),type_,_data,&exceptionInfo);
|
||||
if (exceptionInfo.severity != UndefinedException)
|
||||
map_.c_str(),type_,_data,exceptionInfo);
|
||||
if (exceptionInfo->severity != UndefinedException)
|
||||
relinquish();
|
||||
ThrowPPException;
|
||||
}
|
||||
|
||||
@@ -39,15 +39,15 @@ extern "C" {
|
||||
*message; \
|
||||
\
|
||||
ExceptionInfo \
|
||||
exception; \
|
||||
*exception; \
|
||||
\
|
||||
GetExceptionInfo(&exception); \
|
||||
exception=AcquireExceptionInfo(); \
|
||||
message=GetExceptionMessage(errno); \
|
||||
(void) ThrowMagickException(&exception,GetMagickModule(),severity, \
|
||||
(void) ThrowMagickException(exception,GetMagickModule(),severity, \
|
||||
tag == (const char *) NULL ? "unknown" : tag,"`%s'",message); \
|
||||
message=DestroyString(message); \
|
||||
CatchException(&exception); \
|
||||
(void) DestroyExceptionInfo(&exception); \
|
||||
CatchException(exception); \
|
||||
(void) DestroyExceptionInfo(exception); \
|
||||
MagickCoreTerminus(); \
|
||||
_exit((int) (severity-FatalErrorException)+1); \
|
||||
}
|
||||
@@ -89,6 +89,9 @@ extern "C" {
|
||||
return(MagickFalse); \
|
||||
}
|
||||
|
||||
extern MagickPrivate void
|
||||
InitializeExceptionInfo(ExceptionInfo *);
|
||||
|
||||
#if defined(__cplusplus) || defined(c_plusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
+35
-35
@@ -107,12 +107,12 @@ MagickExport ExceptionInfo *AcquireExceptionInfo(void)
|
||||
exception=(ExceptionInfo *) AcquireMagickMemory(sizeof(*exception));
|
||||
if (exception == (ExceptionInfo *) NULL)
|
||||
ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
|
||||
GetExceptionInfo(exception);
|
||||
InitializeExceptionInfo(exception);
|
||||
exception->relinquish=MagickTrue;
|
||||
return(exception);
|
||||
}
|
||||
|
||||
/*
|
||||
/*l
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% %
|
||||
% %
|
||||
@@ -247,7 +247,7 @@ MagickExport ExceptionInfo *CloneExceptionInfo(ExceptionInfo *exception)
|
||||
clone_exception=(ExceptionInfo *) AcquireMagickMemory(sizeof(*exception));
|
||||
if (clone_exception == (ExceptionInfo *) NULL)
|
||||
ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
|
||||
GetExceptionInfo(clone_exception);
|
||||
InitializeExceptionInfo(clone_exception);
|
||||
InheritException(clone_exception,exception);
|
||||
clone_exception->relinquish=MagickTrue;
|
||||
return(clone_exception);
|
||||
@@ -433,38 +433,6 @@ MagickExport ExceptionInfo *DestroyExceptionInfo(ExceptionInfo *exception)
|
||||
% %
|
||||
% %
|
||||
% %
|
||||
% G e t E x c e p t i o n I n f o %
|
||||
% %
|
||||
% %
|
||||
% %
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%
|
||||
% GetExceptionInfo() initializes an exception to default values.
|
||||
%
|
||||
% The format of the GetExceptionInfo method is:
|
||||
%
|
||||
% GetExceptionInfo(ExceptionInfo *exception)
|
||||
%
|
||||
% A description of each parameter follows:
|
||||
%
|
||||
% o exception: the exception info.
|
||||
%
|
||||
*/
|
||||
MagickExport void GetExceptionInfo(ExceptionInfo *exception)
|
||||
{
|
||||
assert(exception != (ExceptionInfo *) NULL);
|
||||
(void) ResetMagickMemory(exception,0,sizeof(*exception));
|
||||
exception->severity=UndefinedException;
|
||||
exception->exceptions=(void *) NewLinkedList(0);
|
||||
exception->semaphore=AcquireSemaphoreInfo();
|
||||
exception->signature=MagickSignature;
|
||||
}
|
||||
|
||||
/*
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% %
|
||||
% %
|
||||
% %
|
||||
% G e t E x c e p t i o n M e s s a g e %
|
||||
% %
|
||||
% %
|
||||
@@ -675,6 +643,38 @@ MagickExport void InheritException(ExceptionInfo *exception,
|
||||
% %
|
||||
% %
|
||||
% %
|
||||
% I n i t i a l i z e t E x c e p t i o n I n f o %
|
||||
% %
|
||||
% %
|
||||
% %
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%
|
||||
% InitializeExceptionInfo() initializes an exception to default values.
|
||||
%
|
||||
% The format of the InitializeExceptionInfo method is:
|
||||
%
|
||||
% InitializeExceptionInfo(ExceptionInfo *exception)
|
||||
%
|
||||
% A description of each parameter follows:
|
||||
%
|
||||
% o exception: the exception info.
|
||||
%
|
||||
*/
|
||||
MagickPrivate void InitializeExceptionInfo(ExceptionInfo *exception)
|
||||
{
|
||||
assert(exception != (ExceptionInfo *) NULL);
|
||||
(void) ResetMagickMemory(exception,0,sizeof(*exception));
|
||||
exception->severity=UndefinedException;
|
||||
exception->exceptions=(void *) NewLinkedList(0);
|
||||
exception->semaphore=AcquireSemaphoreInfo();
|
||||
exception->signature=MagickSignature;
|
||||
}
|
||||
|
||||
/*
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% %
|
||||
% %
|
||||
% %
|
||||
% M a g i c k E r r o r %
|
||||
% %
|
||||
% %
|
||||
|
||||
@@ -161,7 +161,6 @@ extern MagickExport MagickBooleanType
|
||||
extern MagickExport void
|
||||
CatchException(ExceptionInfo *),
|
||||
ClearMagickException(ExceptionInfo *),
|
||||
GetExceptionInfo(ExceptionInfo *),
|
||||
InheritException(ExceptionInfo *,const ExceptionInfo *),
|
||||
MagickError(const ExceptionType,const char *,const char *),
|
||||
MagickFatalError(const ExceptionType,const char *,const char *),
|
||||
|
||||
@@ -411,7 +411,6 @@ extern "C" {
|
||||
#define GetDrawInfo PrependMagickMethod(GetDrawInfo)
|
||||
#define GetElapsedTime PrependMagickMethod(GetElapsedTime)
|
||||
#define GetEnvironmentValue PrependMagickMethod(GetEnvironmentValue)
|
||||
#define GetExceptionInfo PrependMagickMethod(GetExceptionInfo)
|
||||
#define GetExceptionMessage PrependMagickMethod(GetExceptionMessage)
|
||||
#define GetExecutionPath PrependMagickMethod(GetExecutionPath)
|
||||
#define GetFirstImageInList PrependMagickMethod(GetFirstImageInList)
|
||||
@@ -635,6 +634,7 @@ extern "C" {
|
||||
#define ImportQuantumPixels PrependMagickMethod(ImportQuantumPixels)
|
||||
#define increase PrependMagickMethod(increase)
|
||||
#define InheritException PrependMagickMethod(InheritException)
|
||||
#define InitializeExceptionInfo PrependMagickMethod(InitializeExceptionInfo)
|
||||
#define InitializeMagick PrependMagickMethod(InitializeMagick)
|
||||
#define InitializeSignature PrependMagickMethod(InitializeSignature)
|
||||
#define InjectImageBlob PrependMagickMethod(InjectImageBlob)
|
||||
|
||||
@@ -75,14 +75,14 @@ extern "C" {
|
||||
#define ThrowXWindowException(severity,tag,context) \
|
||||
{ \
|
||||
ExceptionInfo \
|
||||
exception; \
|
||||
*exception; \
|
||||
\
|
||||
GetExceptionInfo(&exception); \
|
||||
(void) ThrowMagickException(&exception,GetMagickModule(),severity, \
|
||||
exception=AcquireExceptionInfo(); \
|
||||
(void) ThrowMagickException(exception,GetMagickModule(),severity, \
|
||||
tag == (const char *) NULL ? "unknown" : tag,"'%s': %s",context, \
|
||||
strerror(errno)); \
|
||||
CatchException(&exception); \
|
||||
(void) DestroyExceptionInfo(&exception); \
|
||||
CatchException(exception); \
|
||||
(void) DestroyExceptionInfo(exception); \
|
||||
}
|
||||
#define ThrowXWindowFatalException(severity,tag,context) \
|
||||
{ \
|
||||
|
||||
@@ -35,13 +35,13 @@ extern "C" {
|
||||
#define ThrowWandFatalException(severity,tag,context) \
|
||||
{ \
|
||||
ExceptionInfo \
|
||||
exception; \
|
||||
*exception; \
|
||||
\
|
||||
GetExceptionInfo(&exception); \
|
||||
(void) ThrowMagickException(&exception,GetMagickModule(),severity,tag, \
|
||||
exception=AcquireExceptionInfo(); \
|
||||
(void) ThrowMagickException(exception,GetMagickModule(),severity,tag, \
|
||||
"`%s'",context); \
|
||||
CatchException(&exception); \
|
||||
(void) DestroyExceptionInfo(&exception); \
|
||||
CatchException(exception); \
|
||||
(void) DestroyExceptionInfo(exception); \
|
||||
MagickWandTerminus(); \
|
||||
_exit((int) (severity-FatalErrorException)+1); \
|
||||
}
|
||||
|
||||
+3
-2
@@ -629,7 +629,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
*draw_info;
|
||||
|
||||
ExceptionInfo
|
||||
exception;
|
||||
*exception;
|
||||
|
||||
GeometryInfo
|
||||
geometry_info;
|
||||
@@ -665,7 +665,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
*/
|
||||
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
|
||||
" SAX.startElement(%s",tag);
|
||||
GetExceptionInfo(&exception);
|
||||
exception=AcquireExceptionInfo();
|
||||
msl_info=(MSLInfo *) context;
|
||||
n=msl_info->n;
|
||||
keyword=(const char *) NULL;
|
||||
@@ -7322,6 +7322,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
|
||||
}
|
||||
if ( value != NULL )
|
||||
value=DestroyString(value);
|
||||
(void) DestroyExceptionInfo(exception);
|
||||
(void) LogMagickEvent(CoderEvent,GetMagickModule()," )");
|
||||
}
|
||||
|
||||
|
||||
@@ -730,7 +730,6 @@ static void SVGStartDocument(void *context)
|
||||
*/
|
||||
(void) LogMagickEvent(CoderEvent,GetMagickModule()," SAX.startDocument()");
|
||||
svg_info=(SVGInfo *) context;
|
||||
GetExceptionInfo(svg_info->exception);
|
||||
parser=svg_info->parser;
|
||||
svg_info->document=xmlNewDoc(parser->version);
|
||||
if (svg_info->document == (xmlDocPtr) NULL)
|
||||
|
||||
+4
-8
@@ -862,9 +862,9 @@ static void ipa_device_begin(wmfAPI * API)
|
||||
*image_info;
|
||||
|
||||
ExceptionInfo
|
||||
exception;
|
||||
*exception;
|
||||
|
||||
GetExceptionInfo(&exception);
|
||||
exception=AcquireExceptionInfo();
|
||||
|
||||
image_info = CloneImageInfo((ImageInfo *) 0);
|
||||
(void) CopyMagickString(image_info->filename,ddata->image_info->texture,
|
||||
@@ -872,7 +872,8 @@ static void ipa_device_begin(wmfAPI * API)
|
||||
if ( ddata->image_info->size )
|
||||
CloneString(&image_info->size,ddata->image_info->size);
|
||||
|
||||
image = ReadImage(image_info,&exception);
|
||||
image = ReadImage(image_info,exception);
|
||||
(void) DestroyExceptionInfo(exception);
|
||||
image_info=DestroyImageInfo(image_info);
|
||||
if (image)
|
||||
{
|
||||
@@ -1860,14 +1861,9 @@ static void util_set_brush(wmfAPI * API, wmfDC * dc, const BrushApply brush_appl
|
||||
const Image
|
||||
*image;
|
||||
|
||||
ExceptionInfo
|
||||
exception;
|
||||
|
||||
MagickWand
|
||||
*magick_wand;
|
||||
|
||||
GetExceptionInfo(&exception);
|
||||
|
||||
image = (Image*)brush_bmp->data;
|
||||
|
||||
mode = CopyCompositeOp; /* Default is copy */
|
||||
|
||||
Reference in New Issue
Block a user