% October 2001 %
% %
% %
-% Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
#include "MagickCore/memory_.h"
#include "MagickCore/pixel-accessor.h"
#include "MagickCore/prepress.h"
+#include "MagickCore/resource_.h"
#include "MagickCore/registry.h"
#include "MagickCore/semaphore.h"
#include "MagickCore/splay-tree.h"
#include "MagickCore/string_.h"
+#include "MagickCore/thread-private.h"
\f
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% The format of the GetImageTotalInkDensity method is:
%
-% double GetImageTotalInkDensity(const Image *image)
+% double GetImageTotalInkDensity(const Image *image,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
% o image: the image.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
-MagickExport double GetImageTotalInkDensity(Image *image)
+MagickExport double GetImageTotalInkDensity(Image *image,
+ ExceptionInfo *exception)
{
CacheView
*image_view;
double
total_ink_density;
- ExceptionInfo
- *exception;
-
MagickBooleanType
status;
assert(image->signature == MagickSignature);
if (image->colorspace != CMYKColorspace)
{
- (void) ThrowMagickException(&image->exception,GetMagickModule(),
- ImageError,"ColorSeparatedImageRequired","`%s'",image->filename);
+ (void) ThrowMagickException(exception,GetMagickModule(),ImageError,
+ "ColorSeparatedImageRequired","'%s'",image->filename);
return(0.0);
}
status=MagickTrue;
total_ink_density=0.0;
- exception=(&image->exception);
- image_view=AcquireCacheView(image);
+ image_view=AcquireVirtualCacheView(image,exception);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(dynamic,4) shared(status)
+ #pragma omp parallel for schedule(static,4) shared(status) \
+ dynamic_number_threads(image,image->columns,image->rows,1)
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
GetPixelBlue(image,p)+GetPixelBlack(image,p);
if (density > total_ink_density)
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp critical (MagickCore_GetImageTotalInkDensity)
+ #pragma omp critical (MagickCore_GetImageTotalInkDensity)
#endif
{
if (density > total_ink_density)