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/thread-private.h"
67 #include "magick/utility.h"
72 #define QuantumSignature 0xab
78 DestroyQuantumPixels(QuantumInfo *);
81 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
85 % A c q u i r e Q u a n t u m I n f o %
89 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
91 % AcquireQuantumInfo() allocates the QuantumInfo structure.
93 % The format of the AcquireQuantumInfo method is:
95 % QuantumInfo *AcquireQuantumInfo(const ImageInfo *image_info,Image *image)
97 % A description of each parameter follows:
99 % o image_info: the image info.
101 % o image: the image.
105 static inline unsigned long MagickMax(const unsigned long x,
106 const unsigned long y)
113 MagickExport QuantumInfo *AcquireQuantumInfo(const ImageInfo *image_info,
122 quantum_info=(QuantumInfo *) AcquireMagickMemory(sizeof(*quantum_info));
123 if (quantum_info == (QuantumInfo *) NULL)
124 ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
125 quantum_info->signature=MagickSignature;
126 GetQuantumInfo(image_info,quantum_info);
127 if (image == (const Image *) NULL)
128 return(quantum_info);
129 status=SetQuantumDepth(image,quantum_info,image->depth);
130 if (status == MagickFalse)
131 quantum_info=DestroyQuantumInfo(quantum_info);
132 return(quantum_info);
136 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
140 + A c q u i r e Q u a n t u m P i x e l s %
144 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
146 % AcquireQuantumPixels() allocates the unsigned char structure.
148 % The format of the AcquireQuantumPixels method is:
150 % MagickBooleanType AcquireQuantumPixels(QuantumInfo *quantum_info,
151 % const size_t extent)
153 % A description of each parameter follows:
155 % o quantum_info: the quantum info.
157 % o extent: the quantum info.
160 static MagickBooleanType AcquireQuantumPixels(QuantumInfo *quantum_info,
166 assert(quantum_info != (QuantumInfo *) NULL);
167 assert(quantum_info->signature == MagickSignature);
168 quantum_info->number_threads=GetOpenMPMaximumThreads();
169 quantum_info->pixels=(unsigned char **) AcquireQuantumMemory(
170 quantum_info->number_threads,sizeof(*quantum_info->pixels));
171 if (quantum_info->pixels == (unsigned char **) NULL)
173 quantum_info->extent=extent;
174 (void) ResetMagickMemory(quantum_info->pixels,0,
175 sizeof(*quantum_info->pixels));
176 for (i=0; i < (long) quantum_info->number_threads; i++)
178 quantum_info->pixels[i]=(unsigned char *) AcquireQuantumMemory(extent+1,
179 sizeof(**quantum_info->pixels));
180 if (quantum_info->pixels[i] == (unsigned char *) NULL)
182 (void) ResetMagickMemory(quantum_info->pixels[i],0,(extent+1)*
183 sizeof(**quantum_info->pixels));
184 quantum_info->pixels[i][extent]=QuantumSignature;
190 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
194 % D e s t r o y Q u a n t u m I n f o %
198 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
200 % DestroyQuantumInfo() deallocates memory associated with the QuantumInfo
203 % The format of the DestroyQuantumInfo method is:
205 % QuantumInfo *DestroyQuantumInfo(QuantumInfo *quantum_info)
207 % A description of each parameter follows:
209 % o quantum_info: the quantum info.
212 MagickExport QuantumInfo *DestroyQuantumInfo(QuantumInfo *quantum_info)
214 assert(quantum_info != (QuantumInfo *) NULL);
215 assert(quantum_info->signature == MagickSignature);
216 if (quantum_info->pixels != (unsigned char **) NULL)
217 DestroyQuantumPixels(quantum_info);
218 if (quantum_info->semaphore != (SemaphoreInfo *) NULL)
219 DestroySemaphoreInfo(&quantum_info->semaphore);
220 quantum_info->signature=(~MagickSignature);
221 quantum_info=(QuantumInfo *) RelinquishMagickMemory(quantum_info);
222 return(quantum_info);
226 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
230 + D e s t r o y Q u a n t u m P i x e l s %
234 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
236 % DestroyQuantumPixels() destroys the quantum pixels.
238 % The format of the DestroyQuantumPixels() method is:
240 % void DestroyQuantumPixels(QuantumInfo *quantum_info)
242 % A description of each parameter follows:
244 % o quantum_info: the quantum info.
247 static void DestroyQuantumPixels(QuantumInfo *quantum_info)
252 assert(quantum_info != (QuantumInfo *) NULL);
253 assert(quantum_info->signature == MagickSignature);
254 assert(quantum_info->pixels != (unsigned char **) NULL);
255 for (i=0; i < (long) quantum_info->number_threads; i++)
257 assert(quantum_info->pixels[i][quantum_info->extent] == QuantumSignature);
258 quantum_info->pixels[i]=(unsigned char *) RelinquishMagickMemory(
259 quantum_info->pixels[i]);
261 quantum_info->pixels=(unsigned char **) RelinquishMagickMemory(
262 quantum_info->pixels);
266 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
270 % G e t Q u a n t u m E x t e n t %
274 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
276 % GetQuantumExtent() returns the quantum pixel buffer extent.
278 % The format of the GetQuantumExtent method is:
280 % size_t GetQuantumExtent(Image *image,const QuantumInfo *quantum_info,
281 % const QuantumType quantum_type)
283 % A description of each parameter follows:
285 % o image: the image.
287 % o quantum_info: the quantum info.
289 % o quantum_type: Declare which pixel components to transfer (red, green,
290 % blue, opacity, RGB, or RGBA).
293 MagickExport size_t GetQuantumExtent(const Image *image,
294 const QuantumInfo *quantum_info,const QuantumType quantum_type)
299 assert(quantum_info != (QuantumInfo *) NULL);
300 assert(quantum_info->signature == MagickSignature);
302 switch (quantum_type)
304 case GrayAlphaQuantum: packet_size=2; break;
305 case IndexAlphaQuantum: packet_size=2; break;
306 case RGBQuantum: packet_size=3; break;
307 case RGBAQuantum: packet_size=4; break;
308 case RGBOQuantum: packet_size=4; break;
309 case CMYKQuantum: packet_size=4; break;
310 case CMYKAQuantum: packet_size=5; break;
313 if (quantum_info->pack == MagickFalse)
314 return((size_t) (packet_size*image->columns*((image->depth+7)/8)));
315 return((size_t) ((packet_size*image->columns*image->depth+7)/8));
319 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
323 % G e t Q u a n t u m I n f o %
327 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
329 % GetQuantumInfo() initializes the QuantumInfo structure to default values.
331 % The format of the GetQuantumInfo method is:
333 % GetQuantumInfo(const ImageInfo *image_info,QuantumInfo *quantum_info)
335 % A description of each parameter follows:
337 % o image_info: the image info.
339 % o quantum_info: the quantum info.
342 MagickExport void GetQuantumInfo(const ImageInfo *image_info,
343 QuantumInfo *quantum_info)
348 assert(quantum_info != (QuantumInfo *) NULL);
349 (void) ResetMagickMemory(quantum_info,0,sizeof(*quantum_info));
350 quantum_info->quantum=8;
351 quantum_info->maximum=1.0;
352 quantum_info->scale=QuantumRange;
353 quantum_info->pack=MagickTrue;
354 quantum_info->semaphore=AllocateSemaphoreInfo();
355 quantum_info->signature=MagickSignature;
356 if (image_info == (const ImageInfo *) NULL)
358 option=GetImageOption(image_info,"quantum:format");
359 if (option != (char *) NULL)
360 quantum_info->format=(QuantumFormatType) ParseMagickOption(
361 MagickQuantumFormatOptions,MagickFalse,option);
362 option=GetImageOption(image_info,"quantum:minimum");
363 if (option != (char *) NULL)
364 quantum_info->minimum=atof(option);
365 option=GetImageOption(image_info,"quantum:maximum");
366 if (option != (char *) NULL)
367 quantum_info->maximum=atof(option);
368 if ((quantum_info->minimum == 0.0) && (quantum_info->maximum == 0.0))
369 quantum_info->scale=0.0;
371 if (quantum_info->minimum == quantum_info->maximum)
373 quantum_info->scale=(MagickRealType) QuantumRange/quantum_info->minimum;
374 quantum_info->minimum=0.0;
377 quantum_info->scale=(MagickRealType) QuantumRange/(quantum_info->maximum-
378 quantum_info->minimum);
379 option=GetImageOption(image_info,"quantum:scale");
380 if (option != (char *) NULL)
381 quantum_info->scale=atof(option);
382 option=GetImageOption(image_info,"quantum:polarity");
383 if (option != (char *) NULL)
384 quantum_info->min_is_white=LocaleCompare(option,"min-is-white") == 0 ?
385 MagickTrue : MagickFalse;
389 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
393 % G e t Q u a n t u m P i x e l s %
397 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
399 % GetQuantumPixels() returns the quantum pixels.
401 % The format of the GetQuantumPixels method is:
403 % unsigned char *QuantumPixels GetQuantumPixels(
404 % const QuantumInfo *quantum_info)
406 % A description of each parameter follows:
408 % o image: the image.
411 MagickExport unsigned char *GetQuantumPixels(const QuantumInfo *quantum_info)
416 assert(quantum_info != (QuantumInfo *) NULL);
417 assert(quantum_info->signature == MagickSignature);
418 id=GetOpenMPThreadId();
419 return(quantum_info->pixels[id]);
423 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
427 % G e t Q u a n t u m T y p e %
431 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
433 % GetQuantumType() returns the quantum type of the image.
435 % The format of the GetQuantumType method is:
437 % QuantumType GetQuantumType(Image *image,ExceptionInfo *exception)
439 % A description of each parameter follows:
441 % o image: the image.
444 MagickExport QuantumType GetQuantumType(Image *image,ExceptionInfo *exception)
449 assert(image != (Image *) NULL);
450 assert(image->signature == MagickSignature);
451 if (image->debug != MagickFalse)
452 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
453 quantum_type=RGBQuantum;
454 if (image->matte != MagickFalse)
455 quantum_type=RGBAQuantum;
456 if (image->colorspace == CMYKColorspace)
458 quantum_type=CMYKQuantum;
459 if (image->matte != MagickFalse)
460 quantum_type=CMYKAQuantum;
462 if (IsGrayImage(image,exception) != MagickFalse)
464 quantum_type=GrayQuantum;
465 if (image->matte != MagickFalse)
466 quantum_type=GrayAlphaQuantum;
469 if (image->storage_class == PseudoClass)
471 quantum_type=IndexQuantum;
472 if (image->matte != MagickFalse)
473 quantum_type=IndexAlphaQuantum;
475 return(quantum_type);
479 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
483 % S e t Q u a n t u m F o r m a t %
487 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
489 % SetQuantumAlphaType() sets the quantum format.
491 % The format of the SetQuantumAlphaType method is:
493 % void SetQuantumAlphaType(QuantumInfo *quantum_info,
494 % const QuantumAlphaType type)
496 % A description of each parameter follows:
498 % o quantum_info: the quantum info.
500 % o type: the alpha type (e.g. associate).
503 MagickExport void SetQuantumAlphaType(QuantumInfo *quantum_info,
504 const QuantumAlphaType type)
506 assert(quantum_info != (QuantumInfo *) NULL);
507 assert(quantum_info->signature == MagickSignature);
508 quantum_info->alpha_type=type;
512 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
516 % S e t Q u a n t u m D e p t h %
520 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
522 % SetQuantumDepth() sets the quantum depth.
524 % The format of the SetQuantumDepth method is:
526 % MagickBooleanType SetQuantumDepth(const Image *image,
527 % QuantumInfo *quantum_info,const unsigned long depth)
529 % A description of each parameter follows:
531 % o image: the image.
533 % o quantum_info: the quantum info.
535 % o depth: the quantum depth.
538 MagickExport MagickBooleanType SetQuantumDepth(const Image *image,
539 QuantumInfo *quantum_info,const unsigned long depth)
545 Allocate the quantum pixel buffer.
547 assert(image != (Image *) NULL);
548 assert(image->signature == MagickSignature);
549 if (image->debug != MagickFalse)
550 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
551 assert(quantum_info != (QuantumInfo *) NULL);
552 assert(quantum_info->signature == MagickSignature);
553 quantum_info->depth=depth;
554 if (quantum_info->format == FloatingPointQuantumFormat)
556 if (quantum_info->depth > 32)
557 quantum_info->depth=64;
559 quantum_info->depth=32;
561 if (quantum_info->pixels != (unsigned char **) NULL)
562 DestroyQuantumPixels(quantum_info);
563 status=AcquireQuantumPixels(quantum_info,(quantum_info->pad+5)*image->columns*
564 ((quantum_info->depth+7)/8));
569 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
573 % S e t Q u a n t u m F o r m a t %
577 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
579 % SetQuantumFormat() sets the quantum format.
581 % The format of the SetQuantumFormat method is:
583 % MagickBooleanType SetQuantumFormat(const Image *image,
584 % QuantumInfo *quantum_info,const QuantumFormatType format)
586 % A description of each parameter follows:
588 % o image: the image.
590 % o quantum_info: the quantum info.
592 % o format: the quantum format.
595 MagickExport MagickBooleanType SetQuantumFormat(const Image *image,
596 QuantumInfo *quantum_info,const QuantumFormatType format)
598 assert(image != (Image *) NULL);
599 assert(image->signature == MagickSignature);
600 if (image->debug != MagickFalse)
601 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
602 assert(quantum_info != (QuantumInfo *) NULL);
603 assert(quantum_info->signature == MagickSignature);
604 quantum_info->format=format;
605 return(SetQuantumDepth(image,quantum_info,quantum_info->depth));
609 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
613 % S e t Q u a n t u m I m a g e T y p e %
617 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
619 % SetQuantumImageType() sets the image type based on the quantum type.
621 % The format of the SetQuantumImageType method is:
623 % void ImageType SetQuantumImageType(Image *image,
624 % const QuantumType quantum_type)
626 % A description of each parameter follows:
628 % o image: the image.
630 % o quantum_type: Declare which pixel components to transfer (red, green,
631 % blue, opacity, RGB, or RGBA).
634 MagickExport void SetQuantumImageType(Image *image,
635 const QuantumType quantum_type)
637 assert(image != (Image *) NULL);
638 assert(image->signature == MagickSignature);
639 if (image->debug != MagickFalse)
640 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
641 switch (quantum_type)
644 case IndexAlphaQuantum:
646 image->type=PaletteType;
650 case GrayAlphaQuantum:
652 image->type=GrayscaleType;
653 if (image->depth == 1)
654 image->type=BilevelType;
664 image->type=ColorSeparationType;
669 image->type=TrueColorType;
676 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
680 % S e t Q u a n t u m P a c k %
684 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
686 % SetQuantumPack() sets the quantum pack flag.
688 % The format of the SetQuantumPack method is:
690 % void SetQuantumPack(QuantumInfo *quantum_info,
691 % const MagickBooleanType pack)
693 % A description of each parameter follows:
695 % o quantum_info: the quantum info.
697 % o pack: the pack flag.
700 MagickExport void SetQuantumPack(QuantumInfo *quantum_info,
701 const MagickBooleanType pack)
703 assert(quantum_info != (QuantumInfo *) NULL);
704 assert(quantum_info->signature == MagickSignature);
705 quantum_info->pack=pack;
710 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
714 % S e t Q u a n t u m P a d %
718 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
720 % SetQuantumPad() sets the quantum pad.
722 % The format of the SetQuantumPad method is:
724 % MagickBooleanType SetQuantumPad(const Image *image,
725 % QuantumInfo *quantum_info,const unsigned long pad)
727 % A description of each parameter follows:
729 % o image: the image.
731 % o quantum_info: the quantum info.
733 % o pad: the quantum pad.
736 MagickExport MagickBooleanType SetQuantumPad(const Image *image,
737 QuantumInfo *quantum_info,const unsigned long pad)
739 assert(image != (Image *) NULL);
740 assert(image->signature == MagickSignature);
741 if (image->debug != MagickFalse)
742 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
743 assert(quantum_info != (QuantumInfo *) NULL);
744 assert(quantum_info->signature == MagickSignature);
745 quantum_info->pad=pad;
746 return(SetQuantumDepth(image,quantum_info,quantum_info->depth));
750 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
754 % S e t Q u a n t u m M i n I s W h i t e %
758 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
760 % SetQuantumMinIsWhite() sets the quantum min-is-white flag.
762 % The format of the SetQuantumMinIsWhite method is:
764 % void SetQuantumMinIsWhite(QuantumInfo *quantum_info,
765 % const MagickBooleanType min_is_white)
767 % A description of each parameter follows:
769 % o quantum_info: the quantum info.
771 % o min_is_white: the min-is-white flag.
774 MagickExport void SetQuantumMinIsWhite(QuantumInfo *quantum_info,
775 const MagickBooleanType min_is_white)
777 assert(quantum_info != (QuantumInfo *) NULL);
778 assert(quantum_info->signature == MagickSignature);
779 quantum_info->min_is_white=min_is_white;
783 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
787 % S e t Q u a n t u m Q u a n t u m %
791 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
793 % SetQuantumQuantum() sets the quantum quantum.
795 % The format of the SetQuantumQuantum method is:
797 % void SetQuantumQuantum(QuantumInfo *quantum_info,
798 % const unsigned long quantum)
800 % A description of each parameter follows:
802 % o quantum_info: the quantum info.
804 % o quantum: the quantum quantum.
807 MagickExport void SetQuantumQuantum(QuantumInfo *quantum_info,
808 const unsigned long quantum)
810 assert(quantum_info != (QuantumInfo *) NULL);
811 assert(quantum_info->signature == MagickSignature);
812 quantum_info->quantum=quantum;
816 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
820 % S e t Q u a n t u m S c a l e %
824 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
826 % SetQuantumScale() sets the quantum scale.
828 % The format of the SetQuantumScale method is:
830 % void SetQuantumScale(QuantumInfo *quantum_info,const double scale)
832 % A description of each parameter follows:
834 % o quantum_info: the quantum info.
836 % o scale: the quantum scale.
839 MagickExport void SetQuantumScale(QuantumInfo *quantum_info,const double scale)
841 assert(quantum_info != (QuantumInfo *) NULL);
842 assert(quantum_info->signature == MagickSignature);
843 quantum_info->scale=scale;