% May 1993 %
% %
% %
-% 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 %
%
% The format of the HuffmanDecodeImage method is:
%
-% MagickBooleanType HuffmanDecodeImage(Image *image)
+% MagickBooleanType HuffmanDecodeImage(Image *image,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
% o image: the image.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
static inline size_t MagickMax(const size_t x,const size_t y)
return(y);
}
-MagickExport MagickBooleanType HuffmanDecodeImage(Image *image)
+MagickExport MagickBooleanType HuffmanDecodeImage(Image *image,
+ ExceptionInfo *exception)
{
#define HashSize 1021
#define MBHashA 293
const HuffmanTable
*entry;
- ExceptionInfo
- *exception;
-
HuffmanTable
**mb_hash,
**mw_hash;
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;
- exception=(&image->exception);
- image_view=AcquireCacheView(image);
+ image_view=AcquireAuthenticCacheView(image,exception);
for (y=0; ((y < (ssize_t) image->rows) && (null_lines < 3)); )
{
register Quantum
*/
p=scanline;
q=QueueCacheViewAuthenticPixels(image_view,0,y,image->columns,1,exception);
- if (q == (const Quantum *) NULL)
+ if (q == (Quantum *) NULL)
break;
for (x=0; x < (ssize_t) image->columns; x++)
{
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)
% The format of the HuffmanEncodeImage method is:
%
% MagickBooleanType HuffmanEncodeImage(const ImageInfo *image_info,
-% Image *image,Image *inject_image)
+% Image *image,Image *inject_image,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o inject_image: inject into the image stream.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
MagickExport MagickBooleanType HuffmanEncodeImage(const ImageInfo *image_info,
- Image *image,Image *inject_image)
+ Image *image,Image *inject_image,ExceptionInfo *exception)
{
#define HuffmanOutputCode(entry) \
{ \
const HuffmanTable
*entry;
- ExceptionInfo
- *exception;
-
int
k,
runlength;
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);
return(MagickFalse);
}
- (void) SetImageType(huffman_image,BilevelType);
+ (void) SetImageType(huffman_image,BilevelType,exception);
byte='\0';
bit=(unsigned char) 0x80;
if (LocaleCompare(image_info->magick,"FAX") != 0)
/*
Compress to 1D Huffman pixels.
*/
- exception=(&huffman_image->exception);
q=scanline;
for (y=0; y < (ssize_t) huffman_image->rows; y++)
{
% The format of the LZWEncodeImage method is:
%
% MagickBooleanType LZWEncodeImage(Image *image,const size_t length,
-% unsigned char *pixels)
+% unsigned char *pixels,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
% o pixels: the address of an unsigned array of characters containing the
% pixels to compress.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
MagickExport MagickBooleanType LZWEncodeImage(Image *image,const size_t length,
- unsigned char *pixels)
+ unsigned char *pixels,ExceptionInfo *exception)
{
#define LZWClr 256UL /* Clear Table Marker */
#define LZWEod 257UL /* End of Data marker */
%
*/
MagickExport MagickBooleanType PackbitsEncodeImage(Image *image,
- const size_t length,unsigned char *pixels)
+ const size_t length,unsigned char *pixels,ExceptionInfo *exception)
{
int
count;
% The format of the ZLIBEncodeImage method is:
%
% MagickBooleanType ZLIBEncodeImage(Image *image,const size_t length,
-% unsigned char *pixels)
+% unsigned char *pixels,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
% o pixels: the address of an unsigned array of characters containing the
% pixels to compress.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
static voidpf AcquireZIPMemory(voidpf context,unsigned int items,
}
MagickExport MagickBooleanType ZLIBEncodeImage(Image *image,const size_t length,
- unsigned char *pixels)
+ unsigned char *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