2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6 % QQQ U U AAA N N TTTTT U U M M %
7 % Q Q U U A A NN N T U U MM MM %
8 % Q Q U U AAAAA N N N T U U M M M %
9 % Q QQ U U A A N NN T U U M M %
10 % QQQQ UUU A A N N T UUU M M %
12 % MagicCore Methods to Acquire / Destroy Quantum Pixels %
19 % Copyright 1999-2008 ImageMagick Studio LLC, a non-profit organization %
20 % dedicated to making software imaging solutions freely available. %
22 % You may not use this file except in compliance with the License. You may %
23 % obtain a copy of the License at %
25 % http://www.imagemagick.org/script/license.php %
27 % Unless required by applicable law or agreed to in writing, software %
28 % distributed under the License is distributed on an "AS IS" BASIS, %
29 % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %
30 % See the License for the specific language governing permissions and %
31 % limitations under the License. %
33 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
41 #include "magick/studio.h"
42 #include "magick/property.h"
43 #include "magick/blob.h"
44 #include "magick/blob-private.h"
45 #include "magick/color-private.h"
46 #include "magick/exception.h"
47 #include "magick/exception-private.h"
48 #include "magick/cache.h"
49 #include "magick/constitute.h"
50 #include "magick/delegate.h"
51 #include "magick/geometry.h"
52 #include "magick/list.h"
53 #include "magick/magick.h"
54 #include "magick/memory_.h"
55 #include "magick/monitor.h"
56 #include "magick/option.h"
57 #include "magick/pixel.h"
58 #include "magick/pixel-private.h"
59 #include "magick/quantum.h"
60 #include "magick/quantum-private.h"
61 #include "magick/resource_.h"
62 #include "magick/semaphore.h"
63 #include "magick/statistic.h"
64 #include "magick/stream.h"
65 #include "magick/string_.h"
66 #include "magick/string-private.h"
67 #include "magick/thread-private.h"
68 #include "magick/utility.h"
73 #define QuantumSignature 0xab
79 DestroyQuantumPixels(QuantumInfo *);
82 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
86 % A c q u i r e Q u a n t u m I n f o %
90 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
92 % AcquireQuantumInfo() allocates the QuantumInfo structure.
94 % The format of the AcquireQuantumInfo method is:
96 % QuantumInfo *AcquireQuantumInfo(const ImageInfo *image_info,Image *image)
98 % A description of each parameter follows:
100 % o image_info: the image info.
102 % o image: the image.
106 static inline size_t MagickMax(const size_t x,
114 MagickExport QuantumInfo *AcquireQuantumInfo(const ImageInfo *image_info,
123 quantum_info=(QuantumInfo *) AcquireMagickMemory(sizeof(*quantum_info));
124 if (quantum_info == (QuantumInfo *) NULL)
125 ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
126 quantum_info->signature=MagickSignature;
127 GetQuantumInfo(image_info,quantum_info);
128 if (image == (const Image *) NULL)
129 return(quantum_info);
130 status=SetQuantumDepth(image,quantum_info,image->depth);
131 if (status == MagickFalse)
132 quantum_info=DestroyQuantumInfo(quantum_info);
133 return(quantum_info);
137 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
141 + A c q u i r e Q u a n t u m P i x e l s %
145 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
147 % AcquireQuantumPixels() allocates the unsigned char structure.
149 % The format of the AcquireQuantumPixels method is:
151 % MagickBooleanType AcquireQuantumPixels(QuantumInfo *quantum_info,
152 % const size_t extent)
154 % A description of each parameter follows:
156 % o quantum_info: the quantum info.
158 % o extent: the quantum info.
161 static MagickBooleanType AcquireQuantumPixels(QuantumInfo *quantum_info,
167 assert(quantum_info != (QuantumInfo *) NULL);
168 assert(quantum_info->signature == MagickSignature);
169 quantum_info->number_threads=GetOpenMPMaximumThreads();
170 quantum_info->pixels=(unsigned char **) AcquireQuantumMemory(
171 quantum_info->number_threads,sizeof(*quantum_info->pixels));
172 if (quantum_info->pixels == (unsigned char **) NULL)
174 quantum_info->extent=extent;
175 (void) ResetMagickMemory(quantum_info->pixels,0,
176 quantum_info->number_threads*sizeof(*quantum_info->pixels));
177 for (i=0; i < (ssize_t) quantum_info->number_threads; i++)
179 quantum_info->pixels[i]=(unsigned char *) AcquireQuantumMemory(extent+1,
180 sizeof(**quantum_info->pixels));
181 if (quantum_info->pixels[i] == (unsigned char *) NULL)
183 (void) ResetMagickMemory(quantum_info->pixels[i],0,(extent+1)*
184 sizeof(**quantum_info->pixels));
185 quantum_info->pixels[i][extent]=QuantumSignature;
191 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
195 % D e s t r o y Q u a n t u m I n f o %
199 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
201 % DestroyQuantumInfo() deallocates memory associated with the QuantumInfo
204 % The format of the DestroyQuantumInfo method is:
206 % QuantumInfo *DestroyQuantumInfo(QuantumInfo *quantum_info)
208 % A description of each parameter follows:
210 % o quantum_info: the quantum info.
213 MagickExport QuantumInfo *DestroyQuantumInfo(QuantumInfo *quantum_info)
215 assert(quantum_info != (QuantumInfo *) NULL);
216 assert(quantum_info->signature == MagickSignature);
217 if (quantum_info->pixels != (unsigned char **) NULL)
218 DestroyQuantumPixels(quantum_info);
219 if (quantum_info->semaphore != (SemaphoreInfo *) NULL)
220 DestroySemaphoreInfo(&quantum_info->semaphore);
221 quantum_info->signature=(~MagickSignature);
222 quantum_info=(QuantumInfo *) RelinquishMagickMemory(quantum_info);
223 return(quantum_info);
227 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
231 + D e s t r o y Q u a n t u m P i x e l s %
235 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
237 % DestroyQuantumPixels() destroys the quantum pixels.
239 % The format of the DestroyQuantumPixels() method is:
241 % void DestroyQuantumPixels(QuantumInfo *quantum_info)
243 % A description of each parameter follows:
245 % o quantum_info: the quantum info.
248 static void DestroyQuantumPixels(QuantumInfo *quantum_info)
253 assert(quantum_info != (QuantumInfo *) NULL);
254 assert(quantum_info->signature == MagickSignature);
255 assert(quantum_info->pixels != (unsigned char **) NULL);
256 for (i=0; i < (ssize_t) quantum_info->number_threads; i++)
257 if (quantum_info->pixels[i] != (unsigned char *) NULL)
260 Did we overrun our quantum buffer?
262 assert(quantum_info->pixels[i][quantum_info->extent] ==
264 quantum_info->pixels[i]=(unsigned char *) RelinquishMagickMemory(
265 quantum_info->pixels[i]);
267 quantum_info->pixels=(unsigned char **) RelinquishMagickMemory(
268 quantum_info->pixels);
272 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
276 % G e t Q u a n t u m E x t e n t %
280 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
282 % GetQuantumExtent() returns the quantum pixel buffer extent.
284 % The format of the GetQuantumExtent method is:
286 % size_t GetQuantumExtent(Image *image,const QuantumInfo *quantum_info,
287 % const QuantumType quantum_type)
289 % A description of each parameter follows:
291 % o image: the image.
293 % o quantum_info: the quantum info.
295 % o quantum_type: Declare which pixel components to transfer (red, green,
296 % blue, opacity, RGB, or RGBA).
299 MagickExport size_t GetQuantumExtent(const Image *image,
300 const QuantumInfo *quantum_info,const QuantumType quantum_type)
305 assert(quantum_info != (QuantumInfo *) NULL);
306 assert(quantum_info->signature == MagickSignature);
308 switch (quantum_type)
310 case GrayAlphaQuantum: packet_size=2; break;
311 case IndexAlphaQuantum: packet_size=2; break;
312 case RGBQuantum: packet_size=3; break;
313 case BGRQuantum: packet_size=3; break;
314 case RGBAQuantum: packet_size=4; break;
315 case RGBOQuantum: packet_size=4; break;
316 case BGRAQuantum: packet_size=4; break;
317 case CMYKQuantum: packet_size=4; break;
318 case CMYKAQuantum: packet_size=5; break;
321 if (quantum_info->pack == MagickFalse)
322 return((size_t) (packet_size*image->columns*((quantum_info->depth+7)/8)));
323 return((size_t) ((packet_size*image->columns*quantum_info->depth+7)/8));
327 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
331 % G e t Q u a n t u m I n f o %
335 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
337 % GetQuantumInfo() initializes the QuantumInfo structure to default values.
339 % The format of the GetQuantumInfo method is:
341 % GetQuantumInfo(const ImageInfo *image_info,QuantumInfo *quantum_info)
343 % A description of each parameter follows:
345 % o image_info: the image info.
347 % o quantum_info: the quantum info.
350 MagickExport void GetQuantumInfo(const ImageInfo *image_info,
351 QuantumInfo *quantum_info)
356 assert(quantum_info != (QuantumInfo *) NULL);
357 (void) ResetMagickMemory(quantum_info,0,sizeof(*quantum_info));
358 quantum_info->quantum=8;
359 quantum_info->maximum=1.0;
360 quantum_info->scale=QuantumRange;
361 quantum_info->pack=MagickTrue;
362 quantum_info->semaphore=AllocateSemaphoreInfo();
363 quantum_info->signature=MagickSignature;
364 if (image_info == (const ImageInfo *) NULL)
366 option=GetImageOption(image_info,"quantum:format");
367 if (option != (char *) NULL)
368 quantum_info->format=(QuantumFormatType) ParseMagickOption(
369 MagickQuantumFormatOptions,MagickFalse,option);
370 option=GetImageOption(image_info,"quantum:minimum");
371 if (option != (char *) NULL)
372 quantum_info->minimum=StringToDouble(option);
373 option=GetImageOption(image_info,"quantum:maximum");
374 if (option != (char *) NULL)
375 quantum_info->maximum=StringToDouble(option);
376 if ((quantum_info->minimum == 0.0) && (quantum_info->maximum == 0.0))
377 quantum_info->scale=0.0;
379 if (quantum_info->minimum == quantum_info->maximum)
381 quantum_info->scale=(MagickRealType) QuantumRange/quantum_info->minimum;
382 quantum_info->minimum=0.0;
385 quantum_info->scale=(MagickRealType) QuantumRange/(quantum_info->maximum-
386 quantum_info->minimum);
387 option=GetImageOption(image_info,"quantum:scale");
388 if (option != (char *) NULL)
389 quantum_info->scale=StringToDouble(option);
390 option=GetImageOption(image_info,"quantum:polarity");
391 if (option != (char *) NULL)
392 quantum_info->min_is_white=LocaleCompare(option,"min-is-white") == 0 ?
393 MagickTrue : MagickFalse;
397 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
401 % G e t Q u a n t u m P i x e l s %
405 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
407 % GetQuantumPixels() returns the quantum pixels.
409 % The format of the GetQuantumPixels method is:
411 % unsigned char *QuantumPixels GetQuantumPixels(
412 % const QuantumInfo *quantum_info)
414 % A description of each parameter follows:
416 % o image: the image.
419 MagickExport unsigned char *GetQuantumPixels(const QuantumInfo *quantum_info)
422 id = GetOpenMPThreadId();
424 assert(quantum_info != (QuantumInfo *) NULL);
425 assert(quantum_info->signature == MagickSignature);
426 return(quantum_info->pixels[id]);
430 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
434 % G e t Q u a n t u m T y p e %
438 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
440 % GetQuantumType() returns the quantum type of the image.
442 % The format of the GetQuantumType method is:
444 % QuantumType GetQuantumType(Image *image,ExceptionInfo *exception)
446 % A description of each parameter follows:
448 % o image: the image.
451 MagickExport QuantumType GetQuantumType(Image *image,ExceptionInfo *exception)
456 assert(image != (Image *) NULL);
457 assert(image->signature == MagickSignature);
458 if (image->debug != MagickFalse)
459 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
460 quantum_type=RGBQuantum;
461 if (image->matte != MagickFalse)
462 quantum_type=RGBAQuantum;
463 if (image->colorspace == CMYKColorspace)
465 quantum_type=CMYKQuantum;
466 if (image->matte != MagickFalse)
467 quantum_type=CMYKAQuantum;
469 if (IsGrayImage(image,exception) != MagickFalse)
471 quantum_type=GrayQuantum;
472 if (image->matte != MagickFalse)
473 quantum_type=GrayAlphaQuantum;
476 if (image->storage_class == PseudoClass)
478 quantum_type=IndexQuantum;
479 if (image->matte != MagickFalse)
480 quantum_type=IndexAlphaQuantum;
482 return(quantum_type);
486 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
490 % S e t Q u a n t u m F o r m a t %
494 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
496 % SetQuantumAlphaType() sets the quantum format.
498 % The format of the SetQuantumAlphaType method is:
500 % void SetQuantumAlphaType(QuantumInfo *quantum_info,
501 % const QuantumAlphaType type)
503 % A description of each parameter follows:
505 % o quantum_info: the quantum info.
507 % o type: the alpha type (e.g. associate).
510 MagickExport void SetQuantumAlphaType(QuantumInfo *quantum_info,
511 const QuantumAlphaType type)
513 assert(quantum_info != (QuantumInfo *) NULL);
514 assert(quantum_info->signature == MagickSignature);
515 quantum_info->alpha_type=type;
519 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
523 % S e t Q u a n t u m D e p t h %
527 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
529 % SetQuantumDepth() sets the quantum depth.
531 % The format of the SetQuantumDepth method is:
533 % MagickBooleanType SetQuantumDepth(const Image *image,
534 % QuantumInfo *quantum_info,const size_t depth)
536 % A description of each parameter follows:
538 % o image: the image.
540 % o quantum_info: the quantum info.
542 % o depth: the quantum depth.
545 MagickExport MagickBooleanType SetQuantumDepth(const Image *image,
546 QuantumInfo *quantum_info,const size_t depth)
552 Allocate the quantum pixel buffer.
554 assert(image != (Image *) NULL);
555 assert(image->signature == MagickSignature);
556 if (image->debug != MagickFalse)
557 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
558 assert(quantum_info != (QuantumInfo *) NULL);
559 assert(quantum_info->signature == MagickSignature);
560 quantum_info->depth=depth;
561 if (quantum_info->format == FloatingPointQuantumFormat)
563 if (quantum_info->depth > 32)
564 quantum_info->depth=64;
566 if (quantum_info->depth > 16)
567 quantum_info->depth=32;
569 quantum_info->depth=16;
571 if (quantum_info->pixels != (unsigned char **) NULL)
572 DestroyQuantumPixels(quantum_info);
573 status=AcquireQuantumPixels(quantum_info,(6+quantum_info->pad)*image->columns*
574 ((quantum_info->depth+7)/8)); /* allow for CMYKA + RLE byte + pad */
579 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
583 % S e t Q u a n t u m F o r m a t %
587 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
589 % SetQuantumFormat() sets the quantum format.
591 % The format of the SetQuantumFormat method is:
593 % MagickBooleanType SetQuantumFormat(const Image *image,
594 % QuantumInfo *quantum_info,const QuantumFormatType format)
596 % A description of each parameter follows:
598 % o image: the image.
600 % o quantum_info: the quantum info.
602 % o format: the quantum format.
605 MagickExport MagickBooleanType SetQuantumFormat(const Image *image,
606 QuantumInfo *quantum_info,const QuantumFormatType format)
608 assert(image != (Image *) NULL);
609 assert(image->signature == MagickSignature);
610 if (image->debug != MagickFalse)
611 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
612 assert(quantum_info != (QuantumInfo *) NULL);
613 assert(quantum_info->signature == MagickSignature);
614 quantum_info->format=format;
615 return(SetQuantumDepth(image,quantum_info,quantum_info->depth));
619 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
623 % S e t Q u a n t u m I m a g e T y p e %
627 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
629 % SetQuantumImageType() sets the image type based on the quantum type.
631 % The format of the SetQuantumImageType method is:
633 % void ImageType SetQuantumImageType(Image *image,
634 % const QuantumType quantum_type)
636 % A description of each parameter follows:
638 % o image: the image.
640 % o quantum_type: Declare which pixel components to transfer (red, green,
641 % blue, opacity, RGB, or RGBA).
644 MagickExport void SetQuantumImageType(Image *image,
645 const QuantumType quantum_type)
647 assert(image != (Image *) NULL);
648 assert(image->signature == MagickSignature);
649 if (image->debug != MagickFalse)
650 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
651 switch (quantum_type)
654 case IndexAlphaQuantum:
656 image->type=PaletteType;
660 case GrayAlphaQuantum:
662 image->type=GrayscaleType;
663 if (image->depth == 1)
664 image->type=BilevelType;
674 image->type=ColorSeparationType;
679 image->type=TrueColorType;
686 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
690 % S e t Q u a n t u m P a c k %
694 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
696 % SetQuantumPack() sets the quantum pack flag.
698 % The format of the SetQuantumPack method is:
700 % void SetQuantumPack(QuantumInfo *quantum_info,
701 % const MagickBooleanType pack)
703 % A description of each parameter follows:
705 % o quantum_info: the quantum info.
707 % o pack: the pack flag.
710 MagickExport void SetQuantumPack(QuantumInfo *quantum_info,
711 const MagickBooleanType pack)
713 assert(quantum_info != (QuantumInfo *) NULL);
714 assert(quantum_info->signature == MagickSignature);
715 quantum_info->pack=pack;
720 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
724 % S e t Q u a n t u m P a d %
728 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
730 % SetQuantumPad() sets the quantum pad.
732 % The format of the SetQuantumPad method is:
734 % MagickBooleanType SetQuantumPad(const Image *image,
735 % QuantumInfo *quantum_info,const size_t pad)
737 % A description of each parameter follows:
739 % o image: the image.
741 % o quantum_info: the quantum info.
743 % o pad: the quantum pad.
746 MagickExport MagickBooleanType SetQuantumPad(const Image *image,
747 QuantumInfo *quantum_info,const size_t pad)
749 assert(image != (Image *) NULL);
750 assert(image->signature == MagickSignature);
751 if (image->debug != MagickFalse)
752 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
753 assert(quantum_info != (QuantumInfo *) NULL);
754 assert(quantum_info->signature == MagickSignature);
755 quantum_info->pad=pad;
756 return(SetQuantumDepth(image,quantum_info,quantum_info->depth));
760 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
764 % S e t Q u a n t u m M i n I s W h i t e %
768 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
770 % SetQuantumMinIsWhite() sets the quantum min-is-white flag.
772 % The format of the SetQuantumMinIsWhite method is:
774 % void SetQuantumMinIsWhite(QuantumInfo *quantum_info,
775 % const MagickBooleanType min_is_white)
777 % A description of each parameter follows:
779 % o quantum_info: the quantum info.
781 % o min_is_white: the min-is-white flag.
784 MagickExport void SetQuantumMinIsWhite(QuantumInfo *quantum_info,
785 const MagickBooleanType min_is_white)
787 assert(quantum_info != (QuantumInfo *) NULL);
788 assert(quantum_info->signature == MagickSignature);
789 quantum_info->min_is_white=min_is_white;
793 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
797 % S e t Q u a n t u m Q u a n t u m %
801 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
803 % SetQuantumQuantum() sets the quantum quantum.
805 % The format of the SetQuantumQuantum method is:
807 % void SetQuantumQuantum(QuantumInfo *quantum_info,
808 % const size_t quantum)
810 % A description of each parameter follows:
812 % o quantum_info: the quantum info.
814 % o quantum: the quantum quantum.
817 MagickExport void SetQuantumQuantum(QuantumInfo *quantum_info,
818 const size_t quantum)
820 assert(quantum_info != (QuantumInfo *) NULL);
821 assert(quantum_info->signature == MagickSignature);
822 quantum_info->quantum=quantum;
826 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
830 % S e t Q u a n t u m S c a l e %
834 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
836 % SetQuantumScale() sets the quantum scale.
838 % The format of the SetQuantumScale method is:
840 % void SetQuantumScale(QuantumInfo *quantum_info,const double scale)
842 % A description of each parameter follows:
844 % o quantum_info: the quantum info.
846 % o scale: the quantum scale.
849 MagickExport void SetQuantumScale(QuantumInfo *quantum_info,const double scale)
851 assert(quantum_info != (QuantumInfo *) NULL);
852 assert(quantum_info->signature == MagickSignature);
853 quantum_info->scale=scale;