% MagickCore Image Compression/Decompression Methods %
% %
% Software Design %
-% John Cristy %
+% Cristy %
% May 1993 %
% %
% %
-% Copyright 1999-2011 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
while (runlength < 11)
InputBit(bit);
do { InputBit(bit); } while ((int) bit == 0);
- image->x_resolution=204.0;
- image->y_resolution=196.0;
+ image->resolution.x=204.0;
+ image->resolution.y=196.0;
image->units=PixelsPerInchResolution;
- image_view=AcquireCacheView(image);
+ image_view=AcquireAuthenticCacheView(image,exception);
for (y=0; ((y < (ssize_t) image->rows) && (null_lines < 3)); )
{
register Quantum
{
index=(Quantum) (*p++);
SetPixelIndex(image,index,q);
- SetPixelPacket(image,image->colormap+(ssize_t) index,q);
+ SetPixelInfoPixel(image,image->colormap+(ssize_t) index,q);
q+=GetPixelChannels(image);
}
if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
#define OutputBit(count) \
{ \
+DisableMSCWarning(4127) \
if (count > 0) \
byte=byte | bit; \
+RestoreMSCWarning \
bit>>=1; \
if ((int) (bit & 0xff) == 0) \
{ \
ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
inject_image->filename);
(void) ResetMagickMemory(scanline,0,width*sizeof(*scanline));
- huffman_image=CloneImage(inject_image,0,0,MagickTrue,&image->exception);
+ huffman_image=CloneImage(inject_image,0,0,MagickTrue,exception);
if (huffman_image == (Image *) NULL)
{
scanline=(unsigned char *) RelinquishMagickMemory(scanline);
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;
}
#else
MagickExport MagickBooleanType ZLIBEncodeImage(Image *image,
- const size_t magick_unused(length),unsigned char *magick_unused(pixels))
+ const size_t magick_unused(length),unsigned char *magick_unused(pixels),
+ ExceptionInfo *exception)
{
assert(image != (Image *) NULL);
assert(image->signature == MagickSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
- (void) ThrowMagickException(&image->exception,GetMagickModule(),
- MissingDelegateError,"DelegateLibrarySupportNotBuiltIn","`%s' (ZIP)",
- image->filename);
+ (void) ThrowMagickException(exception,GetMagickModule(),MissingDelegateError,
+ "DelegateLibrarySupportNotBuiltIn","'%s' (ZIP)",image->filename);
return(MagickFalse);
}
#endif