MagickCore  7.0.8
Convert, Edit, Or Compose Bitmap Images
quantum-private.h
Go to the documentation of this file.
1 /*
2  Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
3  dedicated to making software imaging solutions freely available.
4 
5  You may not use this file except in compliance with the License. You may
6  obtain a copy of the License at
7 
8  https://imagemagick.org/script/license.php
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 
16  MagickCore quantum inline methods.
17 */
18 #ifndef MAGICKCORE_QUANTUM_PRIVATE_H
19 #define MAGICKCORE_QUANTUM_PRIVATE_H
20 
21 #include "MagickCore/memory_.h"
22 #include "MagickCore/cache.h"
25 
26 #if defined(__cplusplus) || defined(c_plusplus)
27 extern "C" {
28 #endif
29 
30 typedef struct _QuantumState
31 {
32  double
34 
35  unsigned int
37 
38  size_t
40 
41  const unsigned int
42  *mask;
43 } QuantumState;
44 
46 {
47  size_t
49  quantum;
50 
53 
54  double
56  maximum,
57  scale;
58 
59  size_t
60  pad;
61 
64  pack;
65 
68 
69  size_t
71 
73  **pixels;
74 
75  size_t
77 
80 
83 
86 
87  size_t
89 };
90 
91 extern MagickPrivate void
93 
94 static inline MagickSizeType GetQuantumRange(const size_t depth)
95 {
97  one;
98 
99  size_t
100  max_depth;
101 
102  if (depth == 0)
103  return(0);
104  one=1;
105  max_depth=8*sizeof(MagickSizeType);
106  return((MagickSizeType) ((one << (MagickMin(depth,max_depth)-1))+
107  ((one << (MagickMin(depth,max_depth)-1))-1)));
108 }
109 
110 static inline float HalfToSinglePrecision(const unsigned short half)
111 {
112 #define ExponentBias (127-15)
113 #define ExponentMask 0x7c00
114 #define ExponentShift 23
115 #define SignBitShift 31
116 #define SignificandShift 13
117 #define SignificandMask 0x00000400
118 
119  typedef union _SinglePrecision
120  {
121  unsigned int
122  fixed_point;
123 
124  float
125  single_precision;
126  } SinglePrecision;
127 
128  register unsigned int
129  exponent,
130  significand,
131  sign_bit;
132 
133  SinglePrecision
134  map;
135 
136  unsigned int
137  value;
138 
139  /*
140  The IEEE 754 standard specifies half precision as having:
141 
142  Sign bit: 1 bit
143  Exponent width: 5 bits
144  Significand precision: 11 (10 explicitly stored)
145  */
146  sign_bit=(unsigned int) ((half >> 15) & 0x00000001);
147  exponent=(unsigned int) ((half >> 10) & 0x0000001f);
148  significand=(unsigned int) (half & 0x000003ff);
149  if (exponent == 0)
150  {
151  if (significand == 0)
152  value=sign_bit << SignBitShift;
153  else
154  {
155  while ((significand & SignificandMask) == 0)
156  {
157  significand<<=1;
158  exponent--;
159  }
160  exponent++;
161  significand&=(~SignificandMask);
162  exponent+=ExponentBias;
163  value=(sign_bit << SignBitShift) | (exponent << ExponentShift) |
164  (significand << SignificandShift);
165  }
166  }
167  else
168  if (exponent == SignBitShift)
169  {
170  value=(sign_bit << SignBitShift) | 0x7f800000;
171  if (significand != 0)
172  value|=(significand << SignificandShift);
173  }
174  else
175  {
176  exponent+=ExponentBias;
177  significand<<=SignificandShift;
178  value=(sign_bit << SignBitShift) | (exponent << ExponentShift) |
179  significand;
180  }
181  map.fixed_point=value;
182  return(map.single_precision);
183 }
184 
185 static inline unsigned char *PopCharPixel(const unsigned char pixel,
186  unsigned char *pixels)
187 {
188  *pixels++=pixel;
189  return(pixels);
190 }
191 
192 static inline unsigned char *PopLongPixel(const EndianType endian,
193  const unsigned int pixel,unsigned char *pixels)
194 {
195  register unsigned int
196  quantum;
197 
198  quantum=(unsigned int) pixel;
199  if (endian == LSBEndian)
200  {
201  *pixels++=(unsigned char) (quantum);
202  *pixels++=(unsigned char) (quantum >> 8);
203  *pixels++=(unsigned char) (quantum >> 16);
204  *pixels++=(unsigned char) (quantum >> 24);
205  return(pixels);
206  }
207  *pixels++=(unsigned char) (quantum >> 24);
208  *pixels++=(unsigned char) (quantum >> 16);
209  *pixels++=(unsigned char) (quantum >> 8);
210  *pixels++=(unsigned char) (quantum);
211  return(pixels);
212 }
213 
214 static inline unsigned char *PopShortPixel(const EndianType endian,
215  const unsigned short pixel,unsigned char *pixels)
216 {
217  register unsigned int
218  quantum;
219 
220  quantum=pixel;
221  if (endian == LSBEndian)
222  {
223  *pixels++=(unsigned char) (quantum);
224  *pixels++=(unsigned char) (quantum >> 8);
225  return(pixels);
226  }
227  *pixels++=(unsigned char) (quantum >> 8);
228  *pixels++=(unsigned char) (quantum);
229  return(pixels);
230 }
231 
232 static inline const unsigned char *PushCharPixel(const unsigned char *pixels,
233  unsigned char *pixel)
234 {
235  *pixel=(*pixels++);
236  return(pixels);
237 }
238 
239 static inline const unsigned char *PushLongPixel(const EndianType endian,
240  const unsigned char *pixels,unsigned int *pixel)
241 {
242  register unsigned int
243  quantum;
244 
245  if (endian == LSBEndian)
246  {
247  quantum=((unsigned int) *pixels++);
248  quantum|=((unsigned int) *pixels++ << 8);
249  quantum|=((unsigned int) *pixels++ << 16);
250  quantum|=((unsigned int) *pixels++ << 24);
251  *pixel=quantum;
252  return(pixels);
253  }
254  quantum=((unsigned int) *pixels++ << 24);
255  quantum|=((unsigned int) *pixels++ << 16);
256  quantum|=((unsigned int) *pixels++ << 8);
257  quantum|=((unsigned int) *pixels++);
258  *pixel=quantum;
259  return(pixels);
260 }
261 
262 static inline const unsigned char *PushShortPixel(const EndianType endian,
263  const unsigned char *pixels,unsigned short *pixel)
264 {
265  register unsigned int
266  quantum;
267 
268  if (endian == LSBEndian)
269  {
270  quantum=(unsigned int) *pixels++;
271  quantum|=(unsigned int) (*pixels++ << 8);
272  *pixel=(unsigned short) (quantum & 0xffff);
273  return(pixels);
274  }
275  quantum=(unsigned int) (*pixels++ << 8);
276  quantum|=(unsigned int) *pixels++;
277  *pixel=(unsigned short) (quantum & 0xffff);
278  return(pixels);
279 }
280 
281 static inline const unsigned char *PushFloatPixel(const EndianType endian,
282  const unsigned char *pixels,MagickFloatType *pixel)
283 {
284  union
285  {
286  unsigned int
287  unsigned_value;
288 
290  float_value;
291  } quantum;
292 
293  if (endian == LSBEndian)
294  {
295  quantum.unsigned_value=((unsigned int) *pixels++);
296  quantum.unsigned_value|=((unsigned int) *pixels++ << 8);
297  quantum.unsigned_value|=((unsigned int) *pixels++ << 16);
298  quantum.unsigned_value|=((unsigned int) *pixels++ << 24);
299  *pixel=quantum.float_value;
300  return(pixels);
301  }
302  quantum.unsigned_value=((unsigned int) *pixels++ << 24);
303  quantum.unsigned_value|=((unsigned int) *pixels++ << 16);
304  quantum.unsigned_value|=((unsigned int) *pixels++ << 8);
305  quantum.unsigned_value|=((unsigned int) *pixels++);
306  *pixel=quantum.float_value;
307  return(pixels);
308 }
309 
310 static inline Quantum ScaleAnyToQuantum(const QuantumAny quantum,
311  const QuantumAny range)
312 {
313  if (quantum > range)
314  return(QuantumRange);
315 #if !defined(MAGICKCORE_HDRI_SUPPORT)
316  return((Quantum) (((double) QuantumRange*quantum)*
317  PerceptibleReciprocal((double) range)+0.5));
318 #else
319  return((Quantum) (((double) QuantumRange*quantum)*
320  PerceptibleReciprocal((double) range)));
321 #endif
322 }
323 
324 static inline QuantumAny ScaleQuantumToAny(const Quantum quantum,
325  const QuantumAny range)
326 {
327  if (quantum < 0)
328  return((QuantumAny) 0);
329  return((QuantumAny) (((double) range*quantum)/QuantumRange+0.5));
330 }
331 
332 #if (MAGICKCORE_QUANTUM_DEPTH == 8)
333 static inline Quantum ScaleCharToQuantum(const unsigned char value)
334 {
335  return((Quantum) value);
336 }
337 
338 static inline Quantum ScaleLongToQuantum(const unsigned int value)
339 {
340 #if !defined(MAGICKCORE_HDRI_SUPPORT)
341  return((Quantum) ((value)/16843009UL));
342 #else
343  return((Quantum) (value/16843009.0));
344 #endif
345 }
346 
347 static inline Quantum ScaleLongLongToQuantum(const MagickSizeType value)
348 {
349 #if !defined(MAGICKCORE_HDRI_SUPPORT)
350  return((Quantum) (value/MagickULLConstant(72340172838076673)));
351 #else
352  return((Quantum) (value/72340172838076673.0));
353 #endif
354 }
355 
356 static inline Quantum ScaleMapToQuantum(const MagickRealType value)
357 {
358  if (value <= 0.0)
359  return((Quantum) 0);
360  if (value >= MaxMap)
361  return(QuantumRange);
362 #if !defined(MAGICKCORE_HDRI_SUPPORT)
363  return((Quantum) (value+0.5));
364 #else
365  return((Quantum) value);
366 #endif
367 }
368 
369 static inline unsigned int ScaleQuantumToLong(const Quantum quantum)
370 {
371 #if !defined(MAGICKCORE_HDRI_SUPPORT)
372  return((unsigned int) (16843009UL*quantum));
373 #else
374  if (quantum <= 0.0)
375  return(0UL);
376  if ((16843009.0*quantum) >= 4294967295.0)
377  return(4294967295UL);
378  return((unsigned int) (16843009.0*quantum+0.5));
379 #endif
380 }
381 
382 static inline MagickSizeType ScaleQuantumToLongLong(const Quantum quantum)
383 {
384 #if !defined(MAGICKCORE_HDRI_SUPPORT)
385  return((MagickSizeType) (MagickULLConstant(72340172838076673)*quantum));
386 #else
387  if (quantum <= 0.0)
388  return(0UL);
389  if ((72340172838076673.0*quantum) >= 18446744073709551615.0)
390  return(MagickULLConstant(18446744073709551615));
391  return((MagickSizeType) (72340172838076673*quantum+0.5));
392 #endif
393 }
394 
395 static inline unsigned int ScaleQuantumToMap(const Quantum quantum)
396 {
397  if (quantum >= (Quantum) MaxMap)
398  return((unsigned int) MaxMap);
399 #if !defined(MAGICKCORE_HDRI_SUPPORT)
400  return((unsigned int) quantum);
401 #else
402  if (quantum < 0.0)
403  return(0UL);
404  return((unsigned int) (quantum+0.5));
405 #endif
406 }
407 
408 static inline unsigned short ScaleQuantumToShort(const Quantum quantum)
409 {
410 #if !defined(MAGICKCORE_HDRI_SUPPORT)
411  return((unsigned short) (257UL*quantum));
412 #else
413  if (quantum <= 0.0)
414  return(0);
415  if ((257.0*quantum) >= 65535.0)
416  return(65535);
417  return((unsigned short) (257.0*quantum+0.5));
418 #endif
419 }
420 
421 static inline Quantum ScaleShortToQuantum(const unsigned short value)
422 {
423 #if !defined(MAGICKCORE_HDRI_SUPPORT)
424  return((Quantum) ((value+128U)/257U));
425 #else
426  return((Quantum) (value/257.0));
427 #endif
428 }
429 #elif (MAGICKCORE_QUANTUM_DEPTH == 16)
430 static inline Quantum ScaleCharToQuantum(const unsigned char value)
431 {
432 #if !defined(MAGICKCORE_HDRI_SUPPORT)
433  return((Quantum) (257U*value));
434 #else
435  return((Quantum) (257.0*value));
436 #endif
437 }
438 
439 static inline Quantum ScaleLongToQuantum(const unsigned int value)
440 {
441 #if !defined(MAGICKCORE_HDRI_SUPPORT)
442  return((Quantum) ((value)/MagickULLConstant(65537)));
443 #else
444  return((Quantum) (value/65537.0));
445 #endif
446 }
447 
448 static inline Quantum ScaleLongLongToQuantum(const MagickSizeType value)
449 {
450 #if !defined(MAGICKCORE_HDRI_SUPPORT)
451  return((Quantum) ((value)/MagickULLConstant(281479271743489)));
452 #else
453  return((Quantum) (value/281479271743489.0));
454 #endif
455 }
456 
457 static inline Quantum ScaleMapToQuantum(const MagickRealType value)
458 {
459  if (value <= 0.0)
460  return((Quantum) 0);
461  if (value >= MaxMap)
462  return(QuantumRange);
463 #if !defined(MAGICKCORE_HDRI_SUPPORT)
464  return((Quantum) (value+0.5));
465 #else
466  return((Quantum) value);
467 #endif
468 }
469 
470 static inline unsigned int ScaleQuantumToLong(const Quantum quantum)
471 {
472 #if !defined(MAGICKCORE_HDRI_SUPPORT)
473  return((unsigned int) (65537UL*quantum));
474 #else
475  if (quantum <= 0.0)
476  return(0UL);
477  if ((65537.0*quantum) >= 4294967295.0)
478  return(4294967295U);
479  return((unsigned int) (65537.0*quantum+0.5));
480 #endif
481 }
482 
483 static inline MagickSizeType ScaleQuantumToLongLong(const Quantum quantum)
484 {
485 #if !defined(MAGICKCORE_HDRI_SUPPORT)
486  return((MagickSizeType) (MagickULLConstant(281479271743489)*quantum));
487 #else
488  if (quantum <= 0.0)
489  return(0UL);
490  if ((281479271743489.0*quantum) >= 18446744073709551615.0)
491  return(MagickULLConstant(18446744073709551615));
492  return((MagickSizeType) (281479271743489.0*quantum+0.5));
493 #endif
494 }
495 
496 static inline unsigned int ScaleQuantumToMap(const Quantum quantum)
497 {
498  if (quantum >= (Quantum) MaxMap)
499  return((unsigned int) MaxMap);
500 #if !defined(MAGICKCORE_HDRI_SUPPORT)
501  return((unsigned int) quantum);
502 #else
503  if (quantum < 0.0)
504  return(0UL);
505  return((unsigned int) (quantum+0.5));
506 #endif
507 }
508 
509 static inline unsigned short ScaleQuantumToShort(const Quantum quantum)
510 {
511 #if !defined(MAGICKCORE_HDRI_SUPPORT)
512  return((unsigned short) quantum);
513 #else
514  if (quantum <= 0.0)
515  return(0);
516  if (quantum >= 65535.0)
517  return(65535);
518  return((unsigned short) (quantum+0.5));
519 #endif
520 }
521 
522 static inline Quantum ScaleShortToQuantum(const unsigned short value)
523 {
524  return((Quantum) value);
525 }
526 #elif (MAGICKCORE_QUANTUM_DEPTH == 32)
527 static inline Quantum ScaleCharToQuantum(const unsigned char value)
528 {
529 #if !defined(MAGICKCORE_HDRI_SUPPORT)
530  return((Quantum) (16843009UL*value));
531 #else
532  return((Quantum) (16843009.0*value));
533 #endif
534 }
535 
536 static inline Quantum ScaleLongToQuantum(const unsigned int value)
537 {
538  return((Quantum) value);
539 }
540 
541 static inline Quantum ScaleLongLongToQuantum(const MagickSizeType value)
542 {
543 #if !defined(MAGICKCORE_HDRI_SUPPORT)
544  return((Quantum) ((value)/MagickULLConstant(4294967297)));
545 #else
546  return((Quantum) (value/4294967297.0));
547 #endif
548 }
549 
550 static inline Quantum ScaleMapToQuantum(const MagickRealType value)
551 {
552  if (value <= 0.0)
553  return((Quantum) 0);
554  if (value >= (Quantum) MaxMap)
555  return(QuantumRange);
556 #if !defined(MAGICKCORE_HDRI_SUPPORT)
557  return((Quantum) (65537.0*value+0.5));
558 #else
559  return((Quantum) (65537.0*value));
560 #endif
561 }
562 
563 static inline unsigned int ScaleQuantumToLong(const Quantum quantum)
564 {
565 #if !defined(MAGICKCORE_HDRI_SUPPORT)
566  return((unsigned int) quantum);
567 #else
568  if (quantum <= 0.0)
569  return(0);
570  if ((quantum) >= 4294967295.0)
571  return(4294967295);
572  return((unsigned int) (quantum+0.5));
573 #endif
574 }
575 
576 static inline MagickSizeType ScaleQuantumToLongLong(const Quantum quantum)
577 {
578 #if !defined(MAGICKCORE_HDRI_SUPPORT)
579  return((MagickSizeType) (MagickULLConstant(4294967297)*quantum));
580 #else
581  if (quantum <= 0.0)
582  return(0UL);
583  if ((4294967297.0*quantum) >= 18446744073709551615.0)
584  return(MagickULLConstant(18446744073709551615));
585  return((MagickSizeType) (4294967297.0*quantum+0.5));
586 #endif
587 }
588 
589 static inline unsigned int ScaleQuantumToMap(const Quantum quantum)
590 {
591  if (quantum < 0.0)
592  return(0UL);
593  if ((quantum/65537) >= (Quantum) MaxMap)
594  return((unsigned int) MaxMap);
595 #if !defined(MAGICKCORE_HDRI_SUPPORT)
596  return((unsigned int) ((quantum+MagickULLConstant(32768))/
597  MagickULLConstant(65537)));
598 #else
599  return((unsigned int) (quantum/65537.0+0.5));
600 #endif
601 }
602 
603 static inline unsigned short ScaleQuantumToShort(const Quantum quantum)
604 {
605 #if !defined(MAGICKCORE_HDRI_SUPPORT)
606  return((unsigned short) ((quantum+MagickULLConstant(32768))/
607  MagickULLConstant(65537)));
608 #else
609  if (quantum <= 0.0)
610  return(0);
611  if ((quantum/65537.0) >= 65535.0)
612  return(65535);
613  return((unsigned short) (quantum/65537.0+0.5));
614 #endif
615 }
616 
617 static inline Quantum ScaleShortToQuantum(const unsigned short value)
618 {
619 #if !defined(MAGICKCORE_HDRI_SUPPORT)
620  return((Quantum) (65537UL*value));
621 #else
622  return((Quantum) (65537.0*value));
623 #endif
624 }
625 #elif (MAGICKCORE_QUANTUM_DEPTH == 64)
626 static inline Quantum ScaleCharToQuantum(const unsigned char value)
627 {
628  return((Quantum) (72340172838076673.0*value));
629 }
630 
631 static inline Quantum ScaleLongToQuantum(const unsigned int value)
632 {
633  return((Quantum) (4294967297.0*value));
634 }
635 
636 static inline Quantum ScaleLongLongToQuantum(const MagickSizeType value)
637 {
638  return((Quantum) (value));
639 }
640 
641 static inline Quantum ScaleMapToQuantum(const MagickRealType value)
642 {
643  if (value <= 0.0)
644  return((Quantum) 0);
645  if (value >= MaxMap)
646  return(QuantumRange);
647  return((Quantum) (281479271743489.0*value));
648 }
649 
650 static inline unsigned int ScaleQuantumToLong(const Quantum quantum)
651 {
652  return((unsigned int) (quantum/4294967297.0+0.5));
653 }
654 
655 static inline MagickSizeType ScaleQuantumToLongLong(const Quantum quantum)
656 {
657 #if !defined(MAGICKCORE_HDRI_SUPPORT)
658  return((MagickSizeType) quantum);
659 #else
660  if (quantum <= 0.0)
661  return(0);
662  if (quantum >= 18446744073709551615.0)
663  return(MagickULLConstant(18446744073709551615));
664  return((MagickSizeType) (quantum+0.5));
665 #endif
666 }
667 
668 static inline unsigned int ScaleQuantumToMap(const Quantum quantum)
669 {
670  if (quantum <= 0.0)
671  return(0UL);
672  if ((quantum/281479271743489.0) >= MaxMap)
673  return((unsigned int) MaxMap);
674  return((unsigned int) (quantum/281479271743489.0+0.5));
675 }
676 
677 static inline unsigned short ScaleQuantumToShort(const Quantum quantum)
678 {
679  if (quantum <= 0.0)
680  return(0);
681  if ((quantum/281479271743489.0) >= 65535.0)
682  return(65535);
683  return((unsigned short) (quantum/281479271743489.0+0.5));
684 }
685 
686 static inline Quantum ScaleShortToQuantum(const unsigned short value)
687 {
688  return((Quantum) (281479271743489.0*value));
689 }
690 #endif
691 
692 static inline unsigned short SinglePrecisionToHalf(const float value)
693 {
694  typedef union _SinglePrecision
695  {
696  unsigned int
697  fixed_point;
698 
699  float
700  single_precision;
701  } SinglePrecision;
702 
703  register int
704  exponent;
705 
706  register unsigned int
707  significand,
708  sign_bit;
709 
710  SinglePrecision
711  map;
712 
713  unsigned short
714  half;
715 
716  /*
717  The IEEE 754 standard specifies half precision as having:
718 
719  Sign bit: 1 bit
720  Exponent width: 5 bits
721  Significand precision: 11 (10 explicitly stored)
722  */
723  map.single_precision=value;
724  sign_bit=(map.fixed_point >> 16) & 0x00008000;
725  exponent=(int) ((map.fixed_point >> ExponentShift) & 0x000000ff)-ExponentBias;
726  significand=map.fixed_point & 0x007fffff;
727  if (exponent <= 0)
728  {
729  int
730  shift;
731 
732  if (exponent < -10)
733  return((unsigned short) sign_bit);
734  significand=significand | 0x00800000;
735  shift=(int) (14-exponent);
736  significand=(unsigned int) ((significand+((1 << (shift-1))-1)+
737  ((significand >> shift) & 0x01)) >> shift);
738  return((unsigned short) (sign_bit | significand));
739  }
740  else
741  if (exponent == (0xff-ExponentBias))
742  {
743  if (significand == 0)
744  return((unsigned short) (sign_bit | ExponentMask));
745  else
746  {
747  significand>>=SignificandShift;
748  half=(unsigned short) (sign_bit | significand |
749  (significand == 0) | ExponentMask);
750  return(half);
751  }
752  }
753  significand=significand+((significand >> SignificandShift) & 0x01)+0x00000fff;
754  if ((significand & 0x00800000) != 0)
755  {
756  significand=0;
757  exponent++;
758  }
759  if (exponent > 30)
760  {
761  float
762  alpha;
763 
764  register int
765  i;
766 
767  /*
768  Float overflow.
769  */
770  alpha=1.0e10;
771  for (i=0; i < 10; i++)
772  alpha*=alpha;
773  return((unsigned short) (sign_bit | ExponentMask));
774  }
775  half=(unsigned short) (sign_bit | (exponent << 10) |
776  (significand >> SignificandShift));
777  return(half);
778 }
779 
780 #if defined(__cplusplus) || defined(c_plusplus)
781 }
782 #endif
783 
784 #endif
MagickDoubleType MagickRealType
Definition: magick-type.h:120
QuantumFormatType
Definition: quantum.h:42
QuantumFormatType format
Definition: quantum-private.h:52
static MagickSizeType GetQuantumRange(const size_t depth)
Definition: quantum-private.h:94
MemoryInfo ** pixels
Definition: quantum-private.h:73
#define ExponentMask
QuantumAlphaType alpha_type
Definition: quantum-private.h:67
size_t signature
Definition: quantum-private.h:88
#define MagickULLConstant(c)
Definition: magick-type.h:36
Definition: quantum.h:31
MagickPrivate void ResetQuantumState(QuantumInfo *)
Definition: quantum.c:579
#define SignBitShift
#define SignificandMask
QuantumState state
Definition: quantum-private.h:82
size_t depth
Definition: quantum-private.h:48
float MagickFloatType
Definition: magick-type.h:40
double minimum
Definition: quantum-private.h:55
Definition: memory.c:131
EndianType
Definition: quantum.h:28
size_t quantum
Definition: quantum-private.h:48
EndianType endian
Definition: quantum-private.h:79
static const unsigned char * PushShortPixel(const EndianType endian, const unsigned char *pixels, unsigned short *pixel)
Definition: quantum-private.h:262
MagickBooleanType pack
Definition: quantum-private.h:63
static const unsigned char * PushCharPixel(const unsigned char *pixels, unsigned char *pixel)
Definition: quantum-private.h:232
MagickBooleanType
Definition: magick-type.h:158
static double PerceptibleReciprocal(const double x)
Definition: pixel-accessor.h:224
static Quantum ScaleAnyToQuantum(const QuantumAny quantum, const QuantumAny range)
Definition: quantum-private.h:310
static unsigned char * PopLongPixel(const EndianType endian, const unsigned int pixel, unsigned char *pixels)
Definition: quantum-private.h:192
unsigned int pixel
Definition: quantum-private.h:36
size_t MagickSizeType
Definition: magick-type.h:130
static const unsigned char * PushLongPixel(const EndianType endian, const unsigned char *pixels, unsigned int *pixel)
Definition: quantum-private.h:239
SemaphoreInfo * semaphore
Definition: quantum-private.h:85
#define SignificandShift
#define ExponentShift
#define MaxMap
Definition: magick-type.h:75
Definition: quantum-private.h:45
size_t pad
Definition: quantum-private.h:60
static float HalfToSinglePrecision(const unsigned short half)
Definition: quantum-private.h:110
size_t number_threads
Definition: quantum-private.h:70
double scale
Definition: quantum-private.h:55
const unsigned int * mask
Definition: quantum-private.h:42
unsigned short Quantum
Definition: magick-type.h:82
#define ExponentBias
size_t bits
Definition: quantum-private.h:39
size_t extent
Definition: quantum-private.h:76
static unsigned char * PopCharPixel(const unsigned char pixel, unsigned char *pixels)
Definition: quantum-private.h:185
static unsigned char * PopShortPixel(const EndianType endian, const unsigned short pixel, unsigned char *pixels)
Definition: quantum-private.h:214
#define MagickMin(x, y)
Definition: image-private.h:27
double inverse_scale
Definition: quantum-private.h:33
static unsigned short SinglePrecisionToHalf(const float value)
Definition: quantum-private.h:692
#define MagickPrivate
Definition: method-attribute.h:81
struct _QuantumState QuantumState
double maximum
Definition: quantum-private.h:55
static QuantumAny ScaleQuantumToAny(const Quantum quantum, const QuantumAny range)
Definition: quantum-private.h:324
MagickBooleanType min_is_white
Definition: quantum-private.h:63
Definition: quantum-private.h:30
MagickSizeType QuantumAny
Definition: magick-type.h:144
QuantumAlphaType
Definition: quantum.h:35
Definition: semaphore.c:59
#define QuantumRange
Definition: magick-type.h:83
static const unsigned char * PushFloatPixel(const EndianType endian, const unsigned char *pixels, MagickFloatType *pixel)
Definition: quantum-private.h:281