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 *) 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 < (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++)
259 Did we overrun our quantum buffer?
261 assert(quantum_info->pixels[i][quantum_info->extent] == QuantumSignature);
262 quantum_info->pixels[i]=(unsigned char *) RelinquishMagickMemory(
263 quantum_info->pixels[i]);
265 quantum_info->pixels=(unsigned char **) RelinquishMagickMemory(
266 quantum_info->pixels);
270 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
274 % G e t Q u a n t u m E x t e n t %
278 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
280 % GetQuantumExtent() returns the quantum pixel buffer extent.
282 % The format of the GetQuantumExtent method is:
284 % size_t GetQuantumExtent(Image *image,const QuantumInfo *quantum_info,
285 % const QuantumType quantum_type)
287 % A description of each parameter follows:
289 % o image: the image.
291 % o quantum_info: the quantum info.
293 % o quantum_type: Declare which pixel components to transfer (red, green,
294 % blue, opacity, RGB, or RGBA).
297 MagickExport size_t GetQuantumExtent(const Image *image,
298 const QuantumInfo *quantum_info,const QuantumType quantum_type)
303 assert(quantum_info != (QuantumInfo *) NULL);
304 assert(quantum_info->signature == MagickSignature);
306 switch (quantum_type)
308 case GrayAlphaQuantum: packet_size=2; break;
309 case IndexAlphaQuantum: packet_size=2; break;
310 case RGBQuantum: packet_size=3; break;
311 case RGBAQuantum: packet_size=4; break;
312 case BGRAQuantum: packet_size=4; break;
313 case RGBOQuantum: packet_size=4; break;
314 case CMYKQuantum: packet_size=4; break;
315 case CMYKAQuantum: packet_size=5; break;
318 if (quantum_info->pack == MagickFalse)
319 return((size_t) (packet_size*image->columns*((quantum_info->depth+7)/8)));
320 return((size_t) ((packet_size*image->columns*quantum_info->depth+7)/8));
324 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
328 % G e t Q u a n t u m I n f o %
332 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
334 % GetQuantumInfo() initializes the QuantumInfo structure to default values.
336 % The format of the GetQuantumInfo method is:
338 % GetQuantumInfo(const ImageInfo *image_info,QuantumInfo *quantum_info)
340 % A description of each parameter follows:
342 % o image_info: the image info.
344 % o quantum_info: the quantum info.
347 MagickExport void GetQuantumInfo(const ImageInfo *image_info,
348 QuantumInfo *quantum_info)
353 assert(quantum_info != (QuantumInfo *) NULL);
354 (void) ResetMagickMemory(quantum_info,0,sizeof(*quantum_info));
355 quantum_info->quantum=8;
356 quantum_info->maximum=1.0;
357 quantum_info->scale=QuantumRange;
358 quantum_info->pack=MagickTrue;
359 quantum_info->semaphore=AllocateSemaphoreInfo();
360 quantum_info->signature=MagickSignature;
361 if (image_info == (const ImageInfo *) NULL)
363 option=GetImageOption(image_info,"quantum:format");
364 if (option != (char *) NULL)
365 quantum_info->format=(QuantumFormatType) ParseMagickOption(
366 MagickQuantumFormatOptions,MagickFalse,option);
367 option=GetImageOption(image_info,"quantum:minimum");
368 if (option != (char *) NULL)
369 quantum_info->minimum=StringToDouble(option);
370 option=GetImageOption(image_info,"quantum:maximum");
371 if (option != (char *) NULL)
372 quantum_info->maximum=StringToDouble(option);
373 if ((quantum_info->minimum == 0.0) && (quantum_info->maximum == 0.0))
374 quantum_info->scale=0.0;
376 if (quantum_info->minimum == quantum_info->maximum)
378 quantum_info->scale=(MagickRealType) QuantumRange/quantum_info->minimum;
379 quantum_info->minimum=0.0;
382 quantum_info->scale=(MagickRealType) QuantumRange/(quantum_info->maximum-
383 quantum_info->minimum);
384 option=GetImageOption(image_info,"quantum:scale");
385 if (option != (char *) NULL)
386 quantum_info->scale=StringToDouble(option);
387 option=GetImageOption(image_info,"quantum:polarity");
388 if (option != (char *) NULL)
389 quantum_info->min_is_white=LocaleCompare(option,"min-is-white") == 0 ?
390 MagickTrue : MagickFalse;
394 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
398 % G e t Q u a n t u m P i x e l s %
402 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
404 % GetQuantumPixels() returns the quantum pixels.
406 % The format of the GetQuantumPixels method is:
408 % unsigned char *QuantumPixels GetQuantumPixels(
409 % const QuantumInfo *quantum_info)
411 % A description of each parameter follows:
413 % o image: the image.
416 MagickExport unsigned char *GetQuantumPixels(const QuantumInfo *quantum_info)
421 assert(quantum_info != (QuantumInfo *) NULL);
422 assert(quantum_info->signature == MagickSignature);
423 id=GetOpenMPThreadId();
424 return(quantum_info->pixels[id]);
428 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
432 % G e t Q u a n t u m T y p e %
436 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
438 % GetQuantumType() returns the quantum type of the image.
440 % The format of the GetQuantumType method is:
442 % QuantumType GetQuantumType(Image *image,ExceptionInfo *exception)
444 % A description of each parameter follows:
446 % o image: the image.
449 MagickExport QuantumType GetQuantumType(Image *image,ExceptionInfo *exception)
454 assert(image != (Image *) NULL);
455 assert(image->signature == MagickSignature);
456 if (image->debug != MagickFalse)
457 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
458 quantum_type=RGBQuantum;
459 if (image->matte != MagickFalse)
460 quantum_type=RGBAQuantum;
461 if (image->colorspace == CMYKColorspace)
463 quantum_type=CMYKQuantum;
464 if (image->matte != MagickFalse)
465 quantum_type=CMYKAQuantum;
467 if (IsGrayImage(image,exception) != MagickFalse)
469 quantum_type=GrayQuantum;
470 if (image->matte != MagickFalse)
471 quantum_type=GrayAlphaQuantum;
474 if (image->storage_class == PseudoClass)
476 quantum_type=IndexQuantum;
477 if (image->matte != MagickFalse)
478 quantum_type=IndexAlphaQuantum;
480 return(quantum_type);
484 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
488 % S e t Q u a n t u m F o r m a t %
492 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
494 % SetQuantumAlphaType() sets the quantum format.
496 % The format of the SetQuantumAlphaType method is:
498 % void SetQuantumAlphaType(QuantumInfo *quantum_info,
499 % const QuantumAlphaType type)
501 % A description of each parameter follows:
503 % o quantum_info: the quantum info.
505 % o type: the alpha type (e.g. associate).
508 MagickExport void SetQuantumAlphaType(QuantumInfo *quantum_info,
509 const QuantumAlphaType type)
511 assert(quantum_info != (QuantumInfo *) NULL);
512 assert(quantum_info->signature == MagickSignature);
513 quantum_info->alpha_type=type;
517 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
521 % S e t Q u a n t u m D e p t h %
525 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
527 % SetQuantumDepth() sets the quantum depth.
529 % The format of the SetQuantumDepth method is:
531 % MagickBooleanType SetQuantumDepth(const Image *image,
532 % QuantumInfo *quantum_info,const size_t depth)
534 % A description of each parameter follows:
536 % o image: the image.
538 % o quantum_info: the quantum info.
540 % o depth: the quantum depth.
543 MagickExport MagickBooleanType SetQuantumDepth(const Image *image,
544 QuantumInfo *quantum_info,const size_t depth)
550 Allocate the quantum pixel buffer.
552 assert(image != (Image *) NULL);
553 assert(image->signature == MagickSignature);
554 if (image->debug != MagickFalse)
555 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
556 assert(quantum_info != (QuantumInfo *) NULL);
557 assert(quantum_info->signature == MagickSignature);
558 quantum_info->depth=depth;
559 if (quantum_info->format == FloatingPointQuantumFormat)
561 if (quantum_info->depth > 32)
562 quantum_info->depth=64;
564 if (quantum_info->depth > 16)
565 quantum_info->depth=32;
567 quantum_info->depth=16;
569 if (quantum_info->pixels != (unsigned char **) NULL)
570 DestroyQuantumPixels(quantum_info);
571 status=AcquireQuantumPixels(quantum_info,(6+quantum_info->pad)*image->columns*
572 ((quantum_info->depth+7)/8)); /* allow for CMYKA + RLE byte + pad */
577 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
581 % S e t Q u a n t u m F o r m a t %
585 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
587 % SetQuantumFormat() sets the quantum format.
589 % The format of the SetQuantumFormat method is:
591 % MagickBooleanType SetQuantumFormat(const Image *image,
592 % QuantumInfo *quantum_info,const QuantumFormatType format)
594 % A description of each parameter follows:
596 % o image: the image.
598 % o quantum_info: the quantum info.
600 % o format: the quantum format.
603 MagickExport MagickBooleanType SetQuantumFormat(const Image *image,
604 QuantumInfo *quantum_info,const QuantumFormatType format)
606 assert(image != (Image *) NULL);
607 assert(image->signature == MagickSignature);
608 if (image->debug != MagickFalse)
609 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
610 assert(quantum_info != (QuantumInfo *) NULL);
611 assert(quantum_info->signature == MagickSignature);
612 quantum_info->format=format;
613 return(SetQuantumDepth(image,quantum_info,quantum_info->depth));
617 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
621 % S e t Q u a n t u m I m a g e T y p e %
625 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
627 % SetQuantumImageType() sets the image type based on the quantum type.
629 % The format of the SetQuantumImageType method is:
631 % void ImageType SetQuantumImageType(Image *image,
632 % const QuantumType quantum_type)
634 % A description of each parameter follows:
636 % o image: the image.
638 % o quantum_type: Declare which pixel components to transfer (red, green,
639 % blue, opacity, RGB, or RGBA).
642 MagickExport void SetQuantumImageType(Image *image,
643 const QuantumType quantum_type)
645 assert(image != (Image *) NULL);
646 assert(image->signature == MagickSignature);
647 if (image->debug != MagickFalse)
648 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
649 switch (quantum_type)
652 case IndexAlphaQuantum:
654 image->type=PaletteType;
658 case GrayAlphaQuantum:
660 image->type=GrayscaleType;
661 if (image->depth == 1)
662 image->type=BilevelType;
672 image->type=ColorSeparationType;
677 image->type=TrueColorType;
684 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
688 % S e t Q u a n t u m P a c k %
692 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
694 % SetQuantumPack() sets the quantum pack flag.
696 % The format of the SetQuantumPack method is:
698 % void SetQuantumPack(QuantumInfo *quantum_info,
699 % const MagickBooleanType pack)
701 % A description of each parameter follows:
703 % o quantum_info: the quantum info.
705 % o pack: the pack flag.
708 MagickExport void SetQuantumPack(QuantumInfo *quantum_info,
709 const MagickBooleanType pack)
711 assert(quantum_info != (QuantumInfo *) NULL);
712 assert(quantum_info->signature == MagickSignature);
713 quantum_info->pack=pack;
718 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
722 % S e t Q u a n t u m P a d %
726 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
728 % SetQuantumPad() sets the quantum pad.
730 % The format of the SetQuantumPad method is:
732 % MagickBooleanType SetQuantumPad(const Image *image,
733 % QuantumInfo *quantum_info,const size_t pad)
735 % A description of each parameter follows:
737 % o image: the image.
739 % o quantum_info: the quantum info.
741 % o pad: the quantum pad.
744 MagickExport MagickBooleanType SetQuantumPad(const Image *image,
745 QuantumInfo *quantum_info,const size_t pad)
747 assert(image != (Image *) NULL);
748 assert(image->signature == MagickSignature);
749 if (image->debug != MagickFalse)
750 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
751 assert(quantum_info != (QuantumInfo *) NULL);
752 assert(quantum_info->signature == MagickSignature);
753 quantum_info->pad=pad;
754 return(SetQuantumDepth(image,quantum_info,quantum_info->depth));
758 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
762 % S e t Q u a n t u m M i n I s W h i t e %
766 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
768 % SetQuantumMinIsWhite() sets the quantum min-is-white flag.
770 % The format of the SetQuantumMinIsWhite method is:
772 % void SetQuantumMinIsWhite(QuantumInfo *quantum_info,
773 % const MagickBooleanType min_is_white)
775 % A description of each parameter follows:
777 % o quantum_info: the quantum info.
779 % o min_is_white: the min-is-white flag.
782 MagickExport void SetQuantumMinIsWhite(QuantumInfo *quantum_info,
783 const MagickBooleanType min_is_white)
785 assert(quantum_info != (QuantumInfo *) NULL);
786 assert(quantum_info->signature == MagickSignature);
787 quantum_info->min_is_white=min_is_white;
791 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
795 % S e t Q u a n t u m Q u a n t u m %
799 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
801 % SetQuantumQuantum() sets the quantum quantum.
803 % The format of the SetQuantumQuantum method is:
805 % void SetQuantumQuantum(QuantumInfo *quantum_info,
806 % const size_t quantum)
808 % A description of each parameter follows:
810 % o quantum_info: the quantum info.
812 % o quantum: the quantum quantum.
815 MagickExport void SetQuantumQuantum(QuantumInfo *quantum_info,
816 const size_t quantum)
818 assert(quantum_info != (QuantumInfo *) NULL);
819 assert(quantum_info->signature == MagickSignature);
820 quantum_info->quantum=quantum;
824 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
828 % S e t Q u a n t u m S c a l e %
832 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
834 % SetQuantumScale() sets the quantum scale.
836 % The format of the SetQuantumScale method is:
838 % void SetQuantumScale(QuantumInfo *quantum_info,const double scale)
840 % A description of each parameter follows:
842 % o quantum_info: the quantum info.
844 % o scale: the quantum scale.
847 MagickExport void SetQuantumScale(QuantumInfo *quantum_info,const double scale)
849 assert(quantum_info != (QuantumInfo *) NULL);
850 assert(quantum_info->signature == MagickSignature);
851 quantum_info->scale=scale;