% July 1992 %
% %
% %
-% Copyright 1999-2009 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2013 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 declarations.
*/
-#include "magick/studio.h"
-#include "magick/blob.h"
-#include "magick/blob-private.h"
-#include "magick/cache.h"
-#include "magick/colorspace.h"
-#include "magick/exception.h"
-#include "magick/exception-private.h"
-#include "magick/image.h"
-#include "magick/image-private.h"
-#include "magick/list.h"
-#include "magick/magick.h"
-#include "magick/memory_.h"
-#include "magick/monitor.h"
-#include "magick/monitor-private.h"
-#include "magick/quantum-private.h"
-#include "magick/static.h"
-#include "magick/string_.h"
-#include "magick/module.h"
+#include "MagickCore/studio.h"
+#include "MagickCore/blob.h"
+#include "MagickCore/blob-private.h"
+#include "MagickCore/cache.h"
+#include "MagickCore/colorspace.h"
+#include "MagickCore/exception.h"
+#include "MagickCore/exception-private.h"
+#include "MagickCore/image.h"
+#include "MagickCore/image-private.h"
+#include "MagickCore/list.h"
+#include "MagickCore/magick.h"
+#include "MagickCore/memory_.h"
+#include "MagickCore/module.h"
+#include "MagickCore/monitor.h"
+#include "MagickCore/monitor-private.h"
+#include "MagickCore/pixel-accessor.h"
+#include "MagickCore/quantum-private.h"
+#include "MagickCore/resource_.h"
+#include "MagickCore/static.h"
+#include "MagickCore/string_.h"
+#include "MagickCore/string-private.h"
+#include "MagickCore/thread-private.h"
\f
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Image
*image;
- long
- y;
-
MagickBooleanType
status;
cube_size,
level;
- CacheView
- *image_view;
+ ssize_t
+ y;
/*
Create HALD color lookup table image.
image_info->filename);
assert(exception != (ExceptionInfo *) NULL);
assert(exception->signature == MagickSignature);
- image=AcquireImage(image_info);
+ image=AcquireImage(image_info,exception);
level=0;
if (*image_info->filename != '\0')
- level=(unsigned long) atol(image_info->filename);
+ level=StringToUnsignedLong(image_info->filename);
if (level < 2)
level=8;
status=MagickTrue;
cube_size=level*level;
- image->columns=(unsigned long) (level*cube_size);
- image->rows=(unsigned long) (level*cube_size);
- image_view=AcquireCacheView(image);
-#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(dynamic,4) shared(status)
-#endif
- for (y=0; y < (long) image->rows; y+=(long) level)
+ image->columns=(size_t) (level*cube_size);
+ image->rows=(size_t) (level*cube_size);
+ for (y=0; y < (ssize_t) image->rows; y+=(ssize_t) level)
{
- long
+ ssize_t
blue,
green,
red;
- register PixelPacket
- *__restrict q;
+ register Quantum
+ *restrict q;
if (status == MagickFalse)
continue;
- q=QueueCacheViewAuthenticPixels(image_view,0,y,image->columns,
- (unsigned long) level,exception);
- if (q == (PixelPacket *) NULL)
+ q=QueueAuthenticPixels(image,0,y,image->columns,(size_t) level,
+ exception);
+ if (q == (Quantum *) NULL)
{
status=MagickFalse;
continue;
}
- blue=y/(long) level;
- for (green=0; green < (long) cube_size; green++)
+ blue=y/(ssize_t) level;
+ for (green=0; green < (ssize_t) cube_size; green++)
{
- for (red=0; red < (long) cube_size; red++)
+ for (red=0; red < (ssize_t) cube_size; red++)
{
- q->red=RoundToQuantum(QuantumRange*red/(cube_size-1.0));
- q->green=RoundToQuantum(QuantumRange*green/(cube_size-1.0));
- q->blue=RoundToQuantum(QuantumRange*blue/(cube_size-1.0));
- q->opacity=OpaqueOpacity;
- q++;
+ SetPixelRed(image,ClampToQuantum(QuantumRange*red/(cube_size-1.0)),q);
+ SetPixelGreen(image,ClampToQuantum(QuantumRange*green/(cube_size-1.0)),
+ q);
+ SetPixelBlue(image,ClampToQuantum(QuantumRange*blue/(cube_size-1.0)),q);
+ SetPixelAlpha(image,OpaqueAlpha,q);
+ q+=GetPixelChannels(image);
}
}
- if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
+ if (SyncAuthenticPixels(image,exception) == MagickFalse)
status=MagickFalse;
}
- image_view=DestroyCacheView(image_view);
return(GetFirstImageInList(image));
}
\f
%
% The format of the RegisterHALDImage method is:
%
-% unsigned long RegisterHALDImage(void)
+% size_t RegisterHALDImage(void)
%
*/
-ModuleExport unsigned long RegisterHALDImage(void)
+ModuleExport size_t RegisterHALDImage(void)
{
MagickInfo
*entry;
entry=SetMagickInfo("HALD");
entry->decoder=(DecodeImageHandler *) ReadHALDImage;
entry->adjoin=MagickFalse;
- entry->format_type=ExplicitFormatType;
+ entry->format_type=ImplicitFormatType;
entry->raw=MagickTrue;
entry->endian_support=MagickTrue;
entry->description=ConstantString("Identity Hald color lookup table image");