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)
256 assert(quantum_info != (QuantumInfo *) NULL);
257 assert(quantum_info->signature == MagickSignature);
258 assert(quantum_info->pixels != (unsigned char **) NULL);
259 extent=(ssize_t) quantum_info->extent;
260 for (i=0; i < (ssize_t) quantum_info->number_threads; i++)
261 if (quantum_info->pixels[i] != (unsigned char *) NULL)
264 Did we overrun our quantum buffer?
266 assert(quantum_info->pixels[i][extent] == QuantumSignature);
267 quantum_info->pixels[i]=(unsigned char *) RelinquishMagickMemory(
268 quantum_info->pixels[i]);
270 quantum_info->pixels=(unsigned char **) RelinquishMagickMemory(
271 quantum_info->pixels);
275 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
279 % G e t Q u a n t u m E x t e n t %
283 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
285 % GetQuantumExtent() returns the quantum pixel buffer extent.
287 % The format of the GetQuantumExtent method is:
289 % size_t GetQuantumExtent(Image *image,const QuantumInfo *quantum_info,
290 % const QuantumType quantum_type)
292 % A description of each parameter follows:
294 % o image: the image.
296 % o quantum_info: the quantum info.
298 % o quantum_type: Declare which pixel components to transfer (red, green,
299 % blue, opacity, RGB, or RGBA).
302 MagickExport size_t GetQuantumExtent(const Image *image,
303 const QuantumInfo *quantum_info,const QuantumType quantum_type)
308 assert(quantum_info != (QuantumInfo *) NULL);
309 assert(quantum_info->signature == MagickSignature);
311 switch (quantum_type)
313 case GrayAlphaQuantum: packet_size=2; break;
314 case IndexAlphaQuantum: packet_size=2; break;
315 case RGBQuantum: packet_size=3; break;
316 case BGRQuantum: packet_size=3; break;
317 case RGBAQuantum: packet_size=4; break;
318 case RGBOQuantum: packet_size=4; break;
319 case BGRAQuantum: packet_size=4; break;
320 case CMYKQuantum: packet_size=4; break;
321 case CMYKAQuantum: packet_size=5; break;
324 if (quantum_info->pack == MagickFalse)
325 return((size_t) (packet_size*image->columns*((quantum_info->depth+7)/8)));
326 return((size_t) ((packet_size*image->columns*quantum_info->depth+7)/8));
330 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
334 % G e t Q u a n t u m I n f o %
338 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
340 % GetQuantumInfo() initializes the QuantumInfo structure to default values.
342 % The format of the GetQuantumInfo method is:
344 % GetQuantumInfo(const ImageInfo *image_info,QuantumInfo *quantum_info)
346 % A description of each parameter follows:
348 % o image_info: the image info.
350 % o quantum_info: the quantum info.
353 MagickExport void GetQuantumInfo(const ImageInfo *image_info,
354 QuantumInfo *quantum_info)
359 assert(quantum_info != (QuantumInfo *) NULL);
360 (void) ResetMagickMemory(quantum_info,0,sizeof(*quantum_info));
361 quantum_info->quantum=8;
362 quantum_info->maximum=1.0;
363 quantum_info->scale=QuantumRange;
364 quantum_info->pack=MagickTrue;
365 quantum_info->semaphore=AllocateSemaphoreInfo();
366 quantum_info->signature=MagickSignature;
367 if (image_info == (const ImageInfo *) NULL)
369 option=GetImageOption(image_info,"quantum:format");
370 if (option != (char *) NULL)
371 quantum_info->format=(QuantumFormatType) ParseCommandOption(
372 MagickQuantumFormatOptions,MagickFalse,option);
373 option=GetImageOption(image_info,"quantum:minimum");
374 if (option != (char *) NULL)
375 quantum_info->minimum=StringToDouble(option,(char **) NULL);
376 option=GetImageOption(image_info,"quantum:maximum");
377 if (option != (char *) NULL)
378 quantum_info->maximum=StringToDouble(option,(char **) NULL);
379 if ((quantum_info->minimum == 0.0) && (quantum_info->maximum == 0.0))
380 quantum_info->scale=0.0;
382 if (quantum_info->minimum == quantum_info->maximum)
384 quantum_info->scale=(MagickRealType) QuantumRange/quantum_info->minimum;
385 quantum_info->minimum=0.0;
388 quantum_info->scale=(MagickRealType) QuantumRange/(quantum_info->maximum-
389 quantum_info->minimum);
390 option=GetImageOption(image_info,"quantum:scale");
391 if (option != (char *) NULL)
392 quantum_info->scale=StringToDouble(option,(char **) NULL);
393 option=GetImageOption(image_info,"quantum:polarity");
394 if (option != (char *) NULL)
395 quantum_info->min_is_white=LocaleCompare(option,"min-is-white") == 0 ?
396 MagickTrue : MagickFalse;
400 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
404 % G e t Q u a n t u m P i x e l s %
408 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
410 % GetQuantumPixels() returns the quantum pixels.
412 % The format of the GetQuantumPixels method is:
414 % unsigned char *QuantumPixels GetQuantumPixels(
415 % const QuantumInfo *quantum_info)
417 % A description of each parameter follows:
419 % o image: the image.
422 MagickExport unsigned char *GetQuantumPixels(const QuantumInfo *quantum_info)
425 id = GetOpenMPThreadId();
427 assert(quantum_info != (QuantumInfo *) NULL);
428 assert(quantum_info->signature == MagickSignature);
429 return(quantum_info->pixels[id]);
433 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
437 % G e t Q u a n t u m T y p e %
441 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
443 % GetQuantumType() returns the quantum type of the image.
445 % The format of the GetQuantumType method is:
447 % QuantumType GetQuantumType(Image *image,ExceptionInfo *exception)
449 % A description of each parameter follows:
451 % o image: the image.
454 MagickExport QuantumType GetQuantumType(Image *image,ExceptionInfo *exception)
459 assert(image != (Image *) NULL);
460 assert(image->signature == MagickSignature);
461 if (image->debug != MagickFalse)
462 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
463 quantum_type=RGBQuantum;
464 if (image->matte != MagickFalse)
465 quantum_type=RGBAQuantum;
466 if (image->colorspace == CMYKColorspace)
468 quantum_type=CMYKQuantum;
469 if (image->matte != MagickFalse)
470 quantum_type=CMYKAQuantum;
472 if (IsGrayImage(image,exception) != MagickFalse)
474 quantum_type=GrayQuantum;
475 if (image->matte != MagickFalse)
476 quantum_type=GrayAlphaQuantum;
479 if (image->storage_class == PseudoClass)
481 quantum_type=IndexQuantum;
482 if (image->matte != MagickFalse)
483 quantum_type=IndexAlphaQuantum;
485 return(quantum_type);
489 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
493 % S e t Q u a n t u m F o r m a t %
497 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
499 % SetQuantumAlphaType() sets the quantum format.
501 % The format of the SetQuantumAlphaType method is:
503 % void SetQuantumAlphaType(QuantumInfo *quantum_info,
504 % const QuantumAlphaType type)
506 % A description of each parameter follows:
508 % o quantum_info: the quantum info.
510 % o type: the alpha type (e.g. associate).
513 MagickExport void SetQuantumAlphaType(QuantumInfo *quantum_info,
514 const QuantumAlphaType type)
516 assert(quantum_info != (QuantumInfo *) NULL);
517 assert(quantum_info->signature == MagickSignature);
518 quantum_info->alpha_type=type;
522 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
526 % S e t Q u a n t u m D e p t h %
530 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
532 % SetQuantumDepth() sets the quantum depth.
534 % The format of the SetQuantumDepth method is:
536 % MagickBooleanType SetQuantumDepth(const Image *image,
537 % QuantumInfo *quantum_info,const size_t depth)
539 % A description of each parameter follows:
541 % o image: the image.
543 % o quantum_info: the quantum info.
545 % o depth: the quantum depth.
548 MagickExport MagickBooleanType SetQuantumDepth(const Image *image,
549 QuantumInfo *quantum_info,const size_t depth)
555 Allocate the quantum pixel buffer.
557 assert(image != (Image *) NULL);
558 assert(image->signature == MagickSignature);
559 if (image->debug != MagickFalse)
560 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
561 assert(quantum_info != (QuantumInfo *) NULL);
562 assert(quantum_info->signature == MagickSignature);
563 quantum_info->depth=depth;
564 if (quantum_info->format == FloatingPointQuantumFormat)
566 if (quantum_info->depth > 32)
567 quantum_info->depth=64;
569 if (quantum_info->depth > 16)
570 quantum_info->depth=32;
572 quantum_info->depth=16;
574 if (quantum_info->pixels != (unsigned char **) NULL)
575 DestroyQuantumPixels(quantum_info);
576 status=AcquireQuantumPixels(quantum_info,(6+quantum_info->pad)*image->columns*
577 ((quantum_info->depth+7)/8)); /* allow for CMYKA + RLE byte + pad */
582 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
586 % S e t Q u a n t u m F o r m a t %
590 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
592 % SetQuantumFormat() sets the quantum format.
594 % The format of the SetQuantumFormat method is:
596 % MagickBooleanType SetQuantumFormat(const Image *image,
597 % QuantumInfo *quantum_info,const QuantumFormatType format)
599 % A description of each parameter follows:
601 % o image: the image.
603 % o quantum_info: the quantum info.
605 % o format: the quantum format.
608 MagickExport MagickBooleanType SetQuantumFormat(const Image *image,
609 QuantumInfo *quantum_info,const QuantumFormatType format)
611 assert(image != (Image *) NULL);
612 assert(image->signature == MagickSignature);
613 if (image->debug != MagickFalse)
614 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
615 assert(quantum_info != (QuantumInfo *) NULL);
616 assert(quantum_info->signature == MagickSignature);
617 quantum_info->format=format;
618 return(SetQuantumDepth(image,quantum_info,quantum_info->depth));
622 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
626 % S e t Q u a n t u m I m a g e T y p e %
630 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
632 % SetQuantumImageType() sets the image type based on the quantum type.
634 % The format of the SetQuantumImageType method is:
636 % void ImageType SetQuantumImageType(Image *image,
637 % const QuantumType quantum_type)
639 % A description of each parameter follows:
641 % o image: the image.
643 % o quantum_type: Declare which pixel components to transfer (red, green,
644 % blue, opacity, RGB, or RGBA).
647 MagickExport void SetQuantumImageType(Image *image,
648 const QuantumType quantum_type)
650 assert(image != (Image *) NULL);
651 assert(image->signature == MagickSignature);
652 if (image->debug != MagickFalse)
653 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
654 switch (quantum_type)
657 case IndexAlphaQuantum:
659 image->type=PaletteType;
663 case GrayAlphaQuantum:
665 image->type=GrayscaleType;
666 if (image->depth == 1)
667 image->type=BilevelType;
677 image->type=ColorSeparationType;
682 image->type=TrueColorType;
689 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
693 % S e t Q u a n t u m P a c k %
697 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
699 % SetQuantumPack() sets the quantum pack flag.
701 % The format of the SetQuantumPack method is:
703 % void SetQuantumPack(QuantumInfo *quantum_info,
704 % const MagickBooleanType pack)
706 % A description of each parameter follows:
708 % o quantum_info: the quantum info.
710 % o pack: the pack flag.
713 MagickExport void SetQuantumPack(QuantumInfo *quantum_info,
714 const MagickBooleanType pack)
716 assert(quantum_info != (QuantumInfo *) NULL);
717 assert(quantum_info->signature == MagickSignature);
718 quantum_info->pack=pack;
723 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
727 % S e t Q u a n t u m P a d %
731 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
733 % SetQuantumPad() sets the quantum pad.
735 % The format of the SetQuantumPad method is:
737 % MagickBooleanType SetQuantumPad(const Image *image,
738 % QuantumInfo *quantum_info,const size_t pad)
740 % A description of each parameter follows:
742 % o image: the image.
744 % o quantum_info: the quantum info.
746 % o pad: the quantum pad.
749 MagickExport MagickBooleanType SetQuantumPad(const Image *image,
750 QuantumInfo *quantum_info,const size_t pad)
752 assert(image != (Image *) NULL);
753 assert(image->signature == MagickSignature);
754 if (image->debug != MagickFalse)
755 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
756 assert(quantum_info != (QuantumInfo *) NULL);
757 assert(quantum_info->signature == MagickSignature);
758 quantum_info->pad=pad;
759 return(SetQuantumDepth(image,quantum_info,quantum_info->depth));
763 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
767 % S e t Q u a n t u m M i n I s W h i t e %
771 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
773 % SetQuantumMinIsWhite() sets the quantum min-is-white flag.
775 % The format of the SetQuantumMinIsWhite method is:
777 % void SetQuantumMinIsWhite(QuantumInfo *quantum_info,
778 % const MagickBooleanType min_is_white)
780 % A description of each parameter follows:
782 % o quantum_info: the quantum info.
784 % o min_is_white: the min-is-white flag.
787 MagickExport void SetQuantumMinIsWhite(QuantumInfo *quantum_info,
788 const MagickBooleanType min_is_white)
790 assert(quantum_info != (QuantumInfo *) NULL);
791 assert(quantum_info->signature == MagickSignature);
792 quantum_info->min_is_white=min_is_white;
796 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
800 % S e t Q u a n t u m Q u a n t u m %
804 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
806 % SetQuantumQuantum() sets the quantum quantum.
808 % The format of the SetQuantumQuantum method is:
810 % void SetQuantumQuantum(QuantumInfo *quantum_info,
811 % const size_t quantum)
813 % A description of each parameter follows:
815 % o quantum_info: the quantum info.
817 % o quantum: the quantum quantum.
820 MagickExport void SetQuantumQuantum(QuantumInfo *quantum_info,
821 const size_t quantum)
823 assert(quantum_info != (QuantumInfo *) NULL);
824 assert(quantum_info->signature == MagickSignature);
825 quantum_info->quantum=quantum;
829 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
833 % S e t Q u a n t u m S c a l e %
837 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
839 % SetQuantumScale() sets the quantum scale.
841 % The format of the SetQuantumScale method is:
843 % void SetQuantumScale(QuantumInfo *quantum_info,const double scale)
845 % A description of each parameter follows:
847 % o quantum_info: the quantum info.
849 % o scale: the quantum scale.
852 MagickExport void SetQuantumScale(QuantumInfo *quantum_info,const double scale)
854 assert(quantum_info != (QuantumInfo *) NULL);
855 assert(quantum_info->signature == MagickSignature);
856 quantum_info->scale=scale;