% MagicCore Methods to Acquire / Destroy Quantum Pixels %
% %
% Software Design %
-% John Cristy %
+% Cristy %
% October 1998 %
% %
% %
-% Copyright 1999-2008 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 %
if (image == (const Image *) NULL)
return(quantum_info);
status=SetQuantumDepth(image,quantum_info,image->depth);
+ quantum_info->endian=image->endian;
if (status == MagickFalse)
quantum_info=DestroyQuantumInfo(quantum_info);
- quantum_info->endian=image->endian;
return(quantum_info);
}
\f
if (quantum_info->pixels != (unsigned char **) NULL)
DestroyQuantumPixels(quantum_info);
if (quantum_info->semaphore != (SemaphoreInfo *) NULL)
- DestroySemaphoreInfo(&quantum_info->semaphore);
+ RelinquishSemaphoreInfo(&quantum_info->semaphore);
quantum_info->signature=(~MagickSignature);
quantum_info=(QuantumInfo *) RelinquishMagickMemory(quantum_info);
return(quantum_info);
% %
% %
% %
+% G e t Q u a n t u m E n d i a n %
+% %
+% %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% GetQuantumEndian() returns the quantum endian of the image.
+%
+% The endian of the GetQuantumEndian method is:
+%
+% EndianType GetQuantumEndian(const QuantumInfo *quantum_info)
+%
+% A description of each parameter follows:
+%
+% o quantum_info: the quantum info.
+%
+*/
+MagickExport EndianType GetQuantumEndian(const QuantumInfo *quantum_info)
+{
+ assert(quantum_info != (QuantumInfo *) NULL);
+ assert(quantum_info->signature == MagickSignature);
+ return(quantum_info->endian);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% %
+% %
% G e t Q u a n t u m F o r m a t %
% %
% %
quantum_info->maximum=1.0;
quantum_info->scale=QuantumRange;
quantum_info->pack=MagickTrue;
- quantum_info->semaphore=AllocateSemaphoreInfo();
+ quantum_info->semaphore=AcquireSemaphoreInfo();
quantum_info->signature=MagickSignature;
if (image_info == (const ImageInfo *) NULL)
return;
}
if (quantum_info->pixels != (unsigned char **) NULL)
DestroyQuantumPixels(quantum_info);
- status=AcquireQuantumPixels(quantum_info,(6+quantum_info->pad)*image->columns*
- ((quantum_info->depth+7)/8)); /* allow for CMYKA + RLE byte + pad */
+ status=AcquireQuantumPixels(quantum_info,(MaxPixelChannels+quantum_info->pad)*
+ image->columns*((quantum_info->depth+7)/8));
return(status);
}
\f
% %
% %
% %
+% S e t Q u a n t u m E n d i a n %
+% %
+% %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% SetQuantumEndian() sets the quantum endian.
+%
+% The endian of the SetQuantumEndian method is:
+%
+% MagickBooleanType SetQuantumEndian(const Image *image,
+% QuantumInfo *quantum_info,const EndianType endian)
+%
+% A description of each parameter follows:
+%
+% o image: the image.
+%
+% o quantum_info: the quantum info.
+%
+% o endian: the quantum endian.
+%
+*/
+MagickExport MagickBooleanType SetQuantumEndian(const Image *image,
+ QuantumInfo *quantum_info,const EndianType endian)
+{
+ assert(image != (Image *) NULL);
+ assert(image->signature == MagickSignature);
+ if (image->debug != MagickFalse)
+ (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
+ assert(quantum_info != (QuantumInfo *) NULL);
+ assert(quantum_info->signature == MagickSignature);
+ quantum_info->endian=endian;
+ return(SetQuantumDepth(image,quantum_info,quantum_info->depth));
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% %
+% %
% S e t Q u a n t u m F o r m a t %
% %
% %