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 unsigned long MagickMax(const unsigned long x,
107 const unsigned long y)
114 MagickExport QuantumInfo *AcquireQuantumInfo(const ImageInfo *image_info,
123 quantum_info=(QuantumInfo *) AcquireAlignedMemory(1,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 sizeof(*quantum_info->pixels));
177 for (i=0; i < (long) 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 < (long) quantum_info->number_threads; i++)
258 assert(quantum_info->pixels[i][quantum_info->extent] == QuantumSignature);
259 quantum_info->pixels[i]=(unsigned char *) RelinquishMagickMemory(
260 quantum_info->pixels[i]);
262 quantum_info->pixels=(unsigned char **) RelinquishMagickMemory(
263 quantum_info->pixels);
267 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
271 % G e t Q u a n t u m E x t e n t %
275 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
277 % GetQuantumExtent() returns the quantum pixel buffer extent.
279 % The format of the GetQuantumExtent method is:
281 % size_t GetQuantumExtent(Image *image,const QuantumInfo *quantum_info,
282 % const QuantumType quantum_type)
284 % A description of each parameter follows:
286 % o image: the image.
288 % o quantum_info: the quantum info.
290 % o quantum_type: Declare which pixel components to transfer (red, green,
291 % blue, opacity, RGB, or RGBA).
294 MagickExport size_t GetQuantumExtent(const Image *image,
295 const QuantumInfo *quantum_info,const QuantumType quantum_type)
300 assert(quantum_info != (QuantumInfo *) NULL);
301 assert(quantum_info->signature == MagickSignature);
303 switch (quantum_type)
305 case GrayAlphaQuantum: packet_size=2; break;
306 case IndexAlphaQuantum: packet_size=2; break;
307 case RGBQuantum: packet_size=3; break;
308 case RGBAQuantum: packet_size=4; break;
309 case BGRAQuantum: packet_size=4; break;
310 case RGBOQuantum: packet_size=4; break;
311 case CMYKQuantum: packet_size=4; break;
312 case CMYKAQuantum: packet_size=5; break;
315 if (quantum_info->pack == MagickFalse)
316 return((size_t) (packet_size*image->columns*((quantum_info->depth+7)/8)));
317 return((size_t) ((packet_size*image->columns*quantum_info->depth+7)/8));
321 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
325 % G e t Q u a n t u m I n f o %
329 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
331 % GetQuantumInfo() initializes the QuantumInfo structure to default values.
333 % The format of the GetQuantumInfo method is:
335 % GetQuantumInfo(const ImageInfo *image_info,QuantumInfo *quantum_info)
337 % A description of each parameter follows:
339 % o image_info: the image info.
341 % o quantum_info: the quantum info.
344 MagickExport void GetQuantumInfo(const ImageInfo *image_info,
345 QuantumInfo *quantum_info)
350 assert(quantum_info != (QuantumInfo *) NULL);
351 (void) ResetMagickMemory(quantum_info,0,sizeof(*quantum_info));
352 quantum_info->quantum=8;
353 quantum_info->maximum=1.0;
354 quantum_info->scale=QuantumRange;
355 quantum_info->pack=MagickTrue;
356 quantum_info->semaphore=AllocateSemaphoreInfo();
357 quantum_info->signature=MagickSignature;
358 if (image_info == (const ImageInfo *) NULL)
360 option=GetImageOption(image_info,"quantum:format");
361 if (option != (char *) NULL)
362 quantum_info->format=(QuantumFormatType) ParseMagickOption(
363 MagickQuantumFormatOptions,MagickFalse,option);
364 option=GetImageOption(image_info,"quantum:minimum");
365 if (option != (char *) NULL)
366 quantum_info->minimum=StringToDouble(option);
367 option=GetImageOption(image_info,"quantum:maximum");
368 if (option != (char *) NULL)
369 quantum_info->maximum=StringToDouble(option);
370 if ((quantum_info->minimum == 0.0) && (quantum_info->maximum == 0.0))
371 quantum_info->scale=0.0;
373 if (quantum_info->minimum == quantum_info->maximum)
375 quantum_info->scale=(MagickRealType) QuantumRange/quantum_info->minimum;
376 quantum_info->minimum=0.0;
379 quantum_info->scale=(MagickRealType) QuantumRange/(quantum_info->maximum-
380 quantum_info->minimum);
381 option=GetImageOption(image_info,"quantum:scale");
382 if (option != (char *) NULL)
383 quantum_info->scale=StringToDouble(option);
384 option=GetImageOption(image_info,"quantum:polarity");
385 if (option != (char *) NULL)
386 quantum_info->min_is_white=LocaleCompare(option,"min-is-white") == 0 ?
387 MagickTrue : MagickFalse;
391 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
395 % G e t Q u a n t u m P i x e l s %
399 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
401 % GetQuantumPixels() returns the quantum pixels.
403 % The format of the GetQuantumPixels method is:
405 % unsigned char *QuantumPixels GetQuantumPixels(
406 % const QuantumInfo *quantum_info)
408 % A description of each parameter follows:
410 % o image: the image.
413 MagickExport unsigned char *GetQuantumPixels(const QuantumInfo *quantum_info)
418 assert(quantum_info != (QuantumInfo *) NULL);
419 assert(quantum_info->signature == MagickSignature);
420 id=GetOpenMPThreadId();
421 return(quantum_info->pixels[id]);
425 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
429 % G e t Q u a n t u m T y p e %
433 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
435 % GetQuantumType() returns the quantum type of the image.
437 % The format of the GetQuantumType method is:
439 % QuantumType GetQuantumType(Image *image,ExceptionInfo *exception)
441 % A description of each parameter follows:
443 % o image: the image.
446 MagickExport QuantumType GetQuantumType(Image *image,ExceptionInfo *exception)
451 assert(image != (Image *) NULL);
452 assert(image->signature == MagickSignature);
453 if (image->debug != MagickFalse)
454 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
455 quantum_type=RGBQuantum;
456 if (image->matte != MagickFalse)
457 quantum_type=RGBAQuantum;
458 if (image->colorspace == CMYKColorspace)
460 quantum_type=CMYKQuantum;
461 if (image->matte != MagickFalse)
462 quantum_type=CMYKAQuantum;
464 if (IsGrayImage(image,exception) != MagickFalse)
466 quantum_type=GrayQuantum;
467 if (image->matte != MagickFalse)
468 quantum_type=GrayAlphaQuantum;
471 if (image->storage_class == PseudoClass)
473 quantum_type=IndexQuantum;
474 if (image->matte != MagickFalse)
475 quantum_type=IndexAlphaQuantum;
477 return(quantum_type);
481 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
485 % S e t Q u a n t u m F o r m a t %
489 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
491 % SetQuantumAlphaType() sets the quantum format.
493 % The format of the SetQuantumAlphaType method is:
495 % void SetQuantumAlphaType(QuantumInfo *quantum_info,
496 % const QuantumAlphaType type)
498 % A description of each parameter follows:
500 % o quantum_info: the quantum info.
502 % o type: the alpha type (e.g. associate).
505 MagickExport void SetQuantumAlphaType(QuantumInfo *quantum_info,
506 const QuantumAlphaType type)
508 assert(quantum_info != (QuantumInfo *) NULL);
509 assert(quantum_info->signature == MagickSignature);
510 quantum_info->alpha_type=type;
514 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
518 % S e t Q u a n t u m D e p t h %
522 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
524 % SetQuantumDepth() sets the quantum depth.
526 % The format of the SetQuantumDepth method is:
528 % MagickBooleanType SetQuantumDepth(const Image *image,
529 % QuantumInfo *quantum_info,const unsigned long depth)
531 % A description of each parameter follows:
533 % o image: the image.
535 % o quantum_info: the quantum info.
537 % o depth: the quantum depth.
540 MagickExport MagickBooleanType SetQuantumDepth(const Image *image,
541 QuantumInfo *quantum_info,const unsigned long depth)
547 Allocate the quantum pixel buffer.
549 assert(image != (Image *) NULL);
550 assert(image->signature == MagickSignature);
551 if (image->debug != MagickFalse)
552 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
553 assert(quantum_info != (QuantumInfo *) NULL);
554 assert(quantum_info->signature == MagickSignature);
555 quantum_info->depth=depth;
556 if (quantum_info->format == FloatingPointQuantumFormat)
558 if (quantum_info->depth > 32)
559 quantum_info->depth=64;
561 if (quantum_info->depth > 16)
562 quantum_info->depth=32;
564 quantum_info->depth=16;
566 if (quantum_info->pixels != (unsigned char **) NULL)
567 DestroyQuantumPixels(quantum_info);
568 status=AcquireQuantumPixels(quantum_info,(6+quantum_info->pad)*image->columns*
569 ((quantum_info->depth+7)/8)); /* allow for CMYKA + RLE byte + pad */
574 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
578 % S e t Q u a n t u m F o r m a t %
582 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
584 % SetQuantumFormat() sets the quantum format.
586 % The format of the SetQuantumFormat method is:
588 % MagickBooleanType SetQuantumFormat(const Image *image,
589 % QuantumInfo *quantum_info,const QuantumFormatType format)
591 % A description of each parameter follows:
593 % o image: the image.
595 % o quantum_info: the quantum info.
597 % o format: the quantum format.
600 MagickExport MagickBooleanType SetQuantumFormat(const Image *image,
601 QuantumInfo *quantum_info,const QuantumFormatType format)
603 assert(image != (Image *) NULL);
604 assert(image->signature == MagickSignature);
605 if (image->debug != MagickFalse)
606 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
607 assert(quantum_info != (QuantumInfo *) NULL);
608 assert(quantum_info->signature == MagickSignature);
609 quantum_info->format=format;
610 return(SetQuantumDepth(image,quantum_info,quantum_info->depth));
614 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
618 % S e t Q u a n t u m I m a g e T y p e %
622 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
624 % SetQuantumImageType() sets the image type based on the quantum type.
626 % The format of the SetQuantumImageType method is:
628 % void ImageType SetQuantumImageType(Image *image,
629 % const QuantumType quantum_type)
631 % A description of each parameter follows:
633 % o image: the image.
635 % o quantum_type: Declare which pixel components to transfer (red, green,
636 % blue, opacity, RGB, or RGBA).
639 MagickExport void SetQuantumImageType(Image *image,
640 const QuantumType quantum_type)
642 assert(image != (Image *) NULL);
643 assert(image->signature == MagickSignature);
644 if (image->debug != MagickFalse)
645 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
646 switch (quantum_type)
649 case IndexAlphaQuantum:
651 image->type=PaletteType;
655 case GrayAlphaQuantum:
657 image->type=GrayscaleType;
658 if (image->depth == 1)
659 image->type=BilevelType;
669 image->type=ColorSeparationType;
674 image->type=TrueColorType;
681 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
685 % S e t Q u a n t u m P a c k %
689 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
691 % SetQuantumPack() sets the quantum pack flag.
693 % The format of the SetQuantumPack method is:
695 % void SetQuantumPack(QuantumInfo *quantum_info,
696 % const MagickBooleanType pack)
698 % A description of each parameter follows:
700 % o quantum_info: the quantum info.
702 % o pack: the pack flag.
705 MagickExport void SetQuantumPack(QuantumInfo *quantum_info,
706 const MagickBooleanType pack)
708 assert(quantum_info != (QuantumInfo *) NULL);
709 assert(quantum_info->signature == MagickSignature);
710 quantum_info->pack=pack;
715 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
719 % S e t Q u a n t u m P a d %
723 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
725 % SetQuantumPad() sets the quantum pad.
727 % The format of the SetQuantumPad method is:
729 % MagickBooleanType SetQuantumPad(const Image *image,
730 % QuantumInfo *quantum_info,const unsigned long pad)
732 % A description of each parameter follows:
734 % o image: the image.
736 % o quantum_info: the quantum info.
738 % o pad: the quantum pad.
741 MagickExport MagickBooleanType SetQuantumPad(const Image *image,
742 QuantumInfo *quantum_info,const unsigned long pad)
744 assert(image != (Image *) NULL);
745 assert(image->signature == MagickSignature);
746 if (image->debug != MagickFalse)
747 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
748 assert(quantum_info != (QuantumInfo *) NULL);
749 assert(quantum_info->signature == MagickSignature);
750 quantum_info->pad=pad;
751 return(SetQuantumDepth(image,quantum_info,quantum_info->depth));
755 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
759 % S e t Q u a n t u m M i n I s W h i t e %
763 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
765 % SetQuantumMinIsWhite() sets the quantum min-is-white flag.
767 % The format of the SetQuantumMinIsWhite method is:
769 % void SetQuantumMinIsWhite(QuantumInfo *quantum_info,
770 % const MagickBooleanType min_is_white)
772 % A description of each parameter follows:
774 % o quantum_info: the quantum info.
776 % o min_is_white: the min-is-white flag.
779 MagickExport void SetQuantumMinIsWhite(QuantumInfo *quantum_info,
780 const MagickBooleanType min_is_white)
782 assert(quantum_info != (QuantumInfo *) NULL);
783 assert(quantum_info->signature == MagickSignature);
784 quantum_info->min_is_white=min_is_white;
788 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
792 % S e t Q u a n t u m Q u a n t u m %
796 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
798 % SetQuantumQuantum() sets the quantum quantum.
800 % The format of the SetQuantumQuantum method is:
802 % void SetQuantumQuantum(QuantumInfo *quantum_info,
803 % const unsigned long quantum)
805 % A description of each parameter follows:
807 % o quantum_info: the quantum info.
809 % o quantum: the quantum quantum.
812 MagickExport void SetQuantumQuantum(QuantumInfo *quantum_info,
813 const unsigned long quantum)
815 assert(quantum_info != (QuantumInfo *) NULL);
816 assert(quantum_info->signature == MagickSignature);
817 quantum_info->quantum=quantum;
821 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
825 % S e t Q u a n t u m S c a l e %
829 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
831 % SetQuantumScale() sets the quantum scale.
833 % The format of the SetQuantumScale method is:
835 % void SetQuantumScale(QuantumInfo *quantum_info,const double scale)
837 % A description of each parameter follows:
839 % o quantum_info: the quantum info.
841 % o scale: the quantum scale.
844 MagickExport void SetQuantumScale(QuantumInfo *quantum_info,const double scale)
846 assert(quantum_info != (QuantumInfo *) NULL);
847 assert(quantum_info->signature == MagickSignature);
848 quantum_info->scale=scale;