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*((image->depth+7)/8)));
317 return((size_t) ((packet_size*image->columns*image->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 quantum_info->depth=32;
563 if (quantum_info->format == CompactFloatingPointQuantumFormat)
564 quantum_info->depth=16;
565 if (quantum_info->pixels != (unsigned char **) NULL)
566 DestroyQuantumPixels(quantum_info);
567 status=AcquireQuantumPixels(quantum_info,(quantum_info->pad+5)*image->columns*
568 ((quantum_info->depth+7)/8));
573 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
577 % S e t Q u a n t u m F o r m a t %
581 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
583 % SetQuantumFormat() sets the quantum format.
585 % The format of the SetQuantumFormat method is:
587 % MagickBooleanType SetQuantumFormat(const Image *image,
588 % QuantumInfo *quantum_info,const QuantumFormatType format)
590 % A description of each parameter follows:
592 % o image: the image.
594 % o quantum_info: the quantum info.
596 % o format: the quantum format.
599 MagickExport MagickBooleanType SetQuantumFormat(const Image *image,
600 QuantumInfo *quantum_info,const QuantumFormatType format)
602 assert(image != (Image *) NULL);
603 assert(image->signature == MagickSignature);
604 if (image->debug != MagickFalse)
605 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
606 assert(quantum_info != (QuantumInfo *) NULL);
607 assert(quantum_info->signature == MagickSignature);
608 quantum_info->format=format;
609 return(SetQuantumDepth(image,quantum_info,quantum_info->depth));
613 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
617 % S e t Q u a n t u m I m a g e T y p e %
621 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
623 % SetQuantumImageType() sets the image type based on the quantum type.
625 % The format of the SetQuantumImageType method is:
627 % void ImageType SetQuantumImageType(Image *image,
628 % const QuantumType quantum_type)
630 % A description of each parameter follows:
632 % o image: the image.
634 % o quantum_type: Declare which pixel components to transfer (red, green,
635 % blue, opacity, RGB, or RGBA).
638 MagickExport void SetQuantumImageType(Image *image,
639 const QuantumType quantum_type)
641 assert(image != (Image *) NULL);
642 assert(image->signature == MagickSignature);
643 if (image->debug != MagickFalse)
644 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
645 switch (quantum_type)
648 case IndexAlphaQuantum:
650 image->type=PaletteType;
654 case GrayAlphaQuantum:
656 image->type=GrayscaleType;
657 if (image->depth == 1)
658 image->type=BilevelType;
668 image->type=ColorSeparationType;
673 image->type=TrueColorType;
680 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
684 % S e t Q u a n t u m P a c k %
688 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
690 % SetQuantumPack() sets the quantum pack flag.
692 % The format of the SetQuantumPack method is:
694 % void SetQuantumPack(QuantumInfo *quantum_info,
695 % const MagickBooleanType pack)
697 % A description of each parameter follows:
699 % o quantum_info: the quantum info.
701 % o pack: the pack flag.
704 MagickExport void SetQuantumPack(QuantumInfo *quantum_info,
705 const MagickBooleanType pack)
707 assert(quantum_info != (QuantumInfo *) NULL);
708 assert(quantum_info->signature == MagickSignature);
709 quantum_info->pack=pack;
714 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
718 % S e t Q u a n t u m P a d %
722 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
724 % SetQuantumPad() sets the quantum pad.
726 % The format of the SetQuantumPad method is:
728 % MagickBooleanType SetQuantumPad(const Image *image,
729 % QuantumInfo *quantum_info,const unsigned long pad)
731 % A description of each parameter follows:
733 % o image: the image.
735 % o quantum_info: the quantum info.
737 % o pad: the quantum pad.
740 MagickExport MagickBooleanType SetQuantumPad(const Image *image,
741 QuantumInfo *quantum_info,const unsigned long pad)
743 assert(image != (Image *) NULL);
744 assert(image->signature == MagickSignature);
745 if (image->debug != MagickFalse)
746 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
747 assert(quantum_info != (QuantumInfo *) NULL);
748 assert(quantum_info->signature == MagickSignature);
749 quantum_info->pad=pad;
750 return(SetQuantumDepth(image,quantum_info,quantum_info->depth));
754 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
758 % S e t Q u a n t u m M i n I s W h i t e %
762 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
764 % SetQuantumMinIsWhite() sets the quantum min-is-white flag.
766 % The format of the SetQuantumMinIsWhite method is:
768 % void SetQuantumMinIsWhite(QuantumInfo *quantum_info,
769 % const MagickBooleanType min_is_white)
771 % A description of each parameter follows:
773 % o quantum_info: the quantum info.
775 % o min_is_white: the min-is-white flag.
778 MagickExport void SetQuantumMinIsWhite(QuantumInfo *quantum_info,
779 const MagickBooleanType min_is_white)
781 assert(quantum_info != (QuantumInfo *) NULL);
782 assert(quantum_info->signature == MagickSignature);
783 quantum_info->min_is_white=min_is_white;
787 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
791 % S e t Q u a n t u m Q u a n t u m %
795 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
797 % SetQuantumQuantum() sets the quantum quantum.
799 % The format of the SetQuantumQuantum method is:
801 % void SetQuantumQuantum(QuantumInfo *quantum_info,
802 % const unsigned long quantum)
804 % A description of each parameter follows:
806 % o quantum_info: the quantum info.
808 % o quantum: the quantum quantum.
811 MagickExport void SetQuantumQuantum(QuantumInfo *quantum_info,
812 const unsigned long quantum)
814 assert(quantum_info != (QuantumInfo *) NULL);
815 assert(quantum_info->signature == MagickSignature);
816 quantum_info->quantum=quantum;
820 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
824 % S e t Q u a n t u m S c a l e %
828 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
830 % SetQuantumScale() sets the quantum scale.
832 % The format of the SetQuantumScale method is:
834 % void SetQuantumScale(QuantumInfo *quantum_info,const double scale)
836 % A description of each parameter follows:
838 % o quantum_info: the quantum info.
840 % o scale: the quantum scale.
843 MagickExport void SetQuantumScale(QuantumInfo *quantum_info,const double scale)
845 assert(quantum_info != (QuantumInfo *) NULL);
846 assert(quantum_info->signature == MagickSignature);
847 quantum_info->scale=scale;