% MagickCore Image Compression/Decompression Methods %
% %
% Software Design %
-% John Cristy %
+% Cristy %
% May 1993 %
% %
% %
-% Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2014 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 "MagickCore/studio.h"
+#include "MagickCore/attribute.h"
#include "MagickCore/blob.h"
#include "MagickCore/blob-private.h"
#include "MagickCore/color-private.h"
#include "MagickCore/pixel-accessor.h"
#include "MagickCore/resource_.h"
#include "MagickCore/string_.h"
-#if defined(MAGICKCORE_TIFF_DELEGATE)
-#if defined(MAGICKCORE_HAVE_TIFFCONF_H)
-#include "tiffconf.h"
-#endif
-#include "tiffio.h"
-#define CCITTParam "-1"
-#else
-#define CCITTParam "0"
-#endif
#if defined(MAGICKCORE_ZLIB_DELEGATE)
#include "zlib.h"
#endif
#define OutputBit(count) \
{ \
+DisableMSCWarning(4127) \
if (count > 0) \
byte=byte | bit; \
+RestoreMSCWarning \
bit>>=1; \
if ((int) (bit & 0xff) == 0) \
{ \
for (x=0; x < (ssize_t) huffman_image->columns; x++)
{
*q++=(unsigned char) (GetPixelIntensity(huffman_image,p) >=
- ((MagickRealType) QuantumRange/2.0) ? 0 : 1);
+ ((double) QuantumRange/2.0) ? 0 : 1);
p+=GetPixelChannels(huffman_image);
}
/*
% The format of the LZWEncodeImage method is:
%
% MagickBooleanType LZWEncodeImage(Image *image,const size_t length,
-% unsigned char *pixels,ExceptionInfo *exception)
+% unsigned char *restrict pixels,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
*/
MagickExport MagickBooleanType LZWEncodeImage(Image *image,const size_t length,
- unsigned char *pixels,ExceptionInfo *exception)
+ unsigned char *restrict pixels,ExceptionInfo *exception)
{
#define LZWClr 256UL /* Clear Table Marker */
#define LZWEod 257UL /* End of Data marker */
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
assert(pixels != (unsigned char *) NULL);
+ assert(exception != (ExceptionInfo *) NULL);
+ assert(exception->signature == MagickSignature);
table=(TableType *) AcquireQuantumMemory(1UL << 12,sizeof(*table));
if (table == (TableType *) NULL)
return(MagickFalse);
% The format of the PackbitsEncodeImage method is:
%
% MagickBooleanType PackbitsEncodeImage(Image *image,const size_t length,
-% unsigned char *pixels)
+% unsigned char *restrict pixels)
%
% A description of each parameter follows:
%
%
*/
MagickExport MagickBooleanType PackbitsEncodeImage(Image *image,
- const size_t length,unsigned char *pixels,ExceptionInfo *exception)
+ const size_t length,unsigned char *restrict pixels,ExceptionInfo *exception)
{
int
count;
% The format of the ZLIBEncodeImage method is:
%
% MagickBooleanType ZLIBEncodeImage(Image *image,const size_t length,
-% unsigned char *pixels,ExceptionInfo *exception)
+% unsigned char *restrict pixels,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
}
MagickExport MagickBooleanType ZLIBEncodeImage(Image *image,const size_t length,
- unsigned char *pixels,ExceptionInfo *exception)
+ unsigned char *restrict pixels,ExceptionInfo *exception)
{
int
status;
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
(void) ThrowMagickException(exception,GetMagickModule(),MissingDelegateError,
- "DelegateLibrarySupportNotBuiltIn","`%s' (ZIP)",image->filename);
+ "DelegateLibrarySupportNotBuiltIn","'%s' (ZIP)",image->filename);
return(MagickFalse);
}
#endif