MagickCore  7.0.8
Convert, Edit, Or Compose Bitmap Images
quantum-private.h
Go to the documentation of this file.
1 /*
2  Copyright 1999-2018 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.
6  obtain a copy of the License at
7 
8  https://www.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  return((QuantumAny) (((double) range*quantum)/QuantumRange+0.5));
328 }
329 
330 #if (MAGICKCORE_QUANTUM_DEPTH == 8)
331 static inline Quantum ScaleCharToQuantum(const unsigned char value)
332 {
333  return((Quantum) value);
334 }
335 
336 static inline Quantum ScaleLongToQuantum(const unsigned int value)
337 {
338 #if !defined(MAGICKCORE_HDRI_SUPPORT)
339  return((Quantum) ((value+8421504UL)/16843009UL));
340 #else
341  return((Quantum) (value/16843009.0));
342 #endif
343 }
344 
345 static inline Quantum ScaleLongLongToQuantum(const MagickSizeType value)
346 {
347 #if !defined(MAGICKCORE_HDRI_SUPPORT)
348  return((Quantum) ((value+MagickULLConstant(551911719039))/
349  MagickULLConstant(1103823438079)));
350 #else
351  return((Quantum) (value/1103823438079.0));
352 #endif
353 }
354 
355 static inline Quantum ScaleMapToQuantum(const MagickRealType value)
356 {
357  if (value <= 0.0)
358  return((Quantum) 0);
359  if (value >= MaxMap)
360  return(QuantumRange);
361 #if !defined(MAGICKCORE_HDRI_SUPPORT)
362  return((Quantum) (value+0.5));
363 #else
364  return((Quantum) value);
365 #endif
366 }
367 
368 static inline unsigned int ScaleQuantumToLong(const Quantum quantum)
369 {
370 #if !defined(MAGICKCORE_HDRI_SUPPORT)
371  return((unsigned int) (16843009UL*quantum));
372 #else
373  if (quantum <= 0.0)
374  return(0UL);
375  if ((16843009.0*quantum) >= 4294967295.0)
376  return(4294967295UL);
377  return((unsigned int) (16843009.0*quantum+0.5));
378 #endif
379 }
380 
381 static inline MagickSizeType ScaleQuantumToLongLong(const Quantum quantum)
382 {
383 #if !defined(MAGICKCORE_HDRI_SUPPORT)
384  return((MagickSizeType) (MagickULLConstant(551911719039)*quantum));
385 #else
386  if (quantum <= 0.0)
387  return(0UL);
388  if ((551911719039.0*quantum) >= 18446744073709551615.0)
389  return(MagickULLConstant(18446744073709551615));
390  return((MagickSizeType) (1103823438079.0*quantum+0.5));
391 #endif
392 }
393 
394 static inline unsigned int ScaleQuantumToMap(const Quantum quantum)
395 {
396  if (quantum >= (Quantum) MaxMap)
397  return((unsigned int) MaxMap);
398 #if !defined(MAGICKCORE_HDRI_SUPPORT)
399  return((unsigned int) quantum);
400 #else
401  if (quantum < 0.0)
402  return(0UL);
403  return((unsigned int) (quantum+0.5));
404 #endif
405 }
406 
407 static inline unsigned short ScaleQuantumToShort(const Quantum quantum)
408 {
409 #if !defined(MAGICKCORE_HDRI_SUPPORT)
410  return((unsigned short) (257UL*quantum));
411 #else
412  if (quantum <= 0.0)
413  return(0);
414  if ((257.0*quantum) >= 65535.0)
415  return(65535);
416  return((unsigned short) (257.0*quantum+0.5));
417 #endif
418 }
419 
420 static inline Quantum ScaleShortToQuantum(const unsigned short value)
421 {
422 #if !defined(MAGICKCORE_HDRI_SUPPORT)
423  return((Quantum) ((value+128U)/257U));
424 #else
425  return((Quantum) (value/257.0));
426 #endif
427 }
428 #elif (MAGICKCORE_QUANTUM_DEPTH == 16)
429 static inline Quantum ScaleCharToQuantum(const unsigned char value)
430 {
431 #if !defined(MAGICKCORE_HDRI_SUPPORT)
432  return((Quantum) (257U*value));
433 #else
434  return((Quantum) (257.0*value));
435 #endif
436 }
437 
438 static inline Quantum ScaleLongToQuantum(const unsigned int value)
439 {
440 #if !defined(MAGICKCORE_HDRI_SUPPORT)
441  return((Quantum) ((value+MagickULLConstant(32768))/
442  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(8421376))/
452  MagickULLConstant(16842752)));
453 #else
454  return((Quantum) (value/16842752.0));
455 #endif
456 }
457 
458 static inline Quantum ScaleMapToQuantum(const MagickRealType value)
459 {
460  if (value <= 0.0)
461  return((Quantum) 0);
462  if (value >= MaxMap)
463  return(QuantumRange);
464 #if !defined(MAGICKCORE_HDRI_SUPPORT)
465  return((Quantum) (value+0.5));
466 #else
467  return((Quantum) value);
468 #endif
469 }
470 
471 static inline unsigned int ScaleQuantumToLong(const Quantum quantum)
472 {
473 #if !defined(MAGICKCORE_HDRI_SUPPORT)
474  return((unsigned int) (65537UL*quantum));
475 #else
476  if (quantum <= 0.0)
477  return(0UL);
478  if ((65537.0*quantum) >= 4294967295.0)
479  return(4294967295U);
480  return((unsigned int) (65537.0*quantum+0.5));
481 #endif
482 }
483 
484 static inline MagickSizeType ScaleQuantumToLongLong(const Quantum quantum)
485 {
486 #if !defined(MAGICKCORE_HDRI_SUPPORT)
487  return((MagickSizeType) (MagickULLConstant(16842752)*quantum));
488 #else
489  if (quantum <= 0.0)
490  return(0UL);
491  if ((65537.0*quantum) >= 18446744073709551615.0)
492  return(MagickULLConstant(18446744073709551615));
493  return((MagickSizeType) (16842752.0*quantum+0.5));
494 #endif
495 }
496 
497 static inline unsigned int ScaleQuantumToMap(const Quantum quantum)
498 {
499  if (quantum >= (Quantum) MaxMap)
500  return((unsigned int) MaxMap);
501 #if !defined(MAGICKCORE_HDRI_SUPPORT)
502  return((unsigned int) quantum);
503 #else
504  if (quantum < 0.0)
505  return(0UL);
506  return((unsigned int) (quantum+0.5));
507 #endif
508 }
509 
510 static inline unsigned short ScaleQuantumToShort(const Quantum quantum)
511 {
512 #if !defined(MAGICKCORE_HDRI_SUPPORT)
513  return((unsigned short) quantum);
514 #else
515  if (quantum <= 0.0)
516  return(0);
517  if (quantum >= 65535.0)
518  return(65535);
519  return((unsigned short) (quantum+0.5));
520 #endif
521 }
522 
523 static inline Quantum ScaleShortToQuantum(const unsigned short value)
524 {
525  return((Quantum) value);
526 }
527 #elif (MAGICKCORE_QUANTUM_DEPTH == 32)
528 static inline Quantum ScaleCharToQuantum(const unsigned char value)
529 {
530 #if !defined(MAGICKCORE_HDRI_SUPPORT)
531  return((Quantum) (16843009UL*value));
532 #else
533  return((Quantum) (16843009.0*value));
534 #endif
535 }
536 
537 static inline Quantum ScaleLongToQuantum(const unsigned int value)
538 {
539  return((Quantum) value);
540 }
541 
542 static inline Quantum ScaleLongLongToQuantum(const MagickSizeType value)
543 {
544  return((Quantum) value);
545 }
546 
547 static inline Quantum ScaleMapToQuantum(const MagickRealType value)
548 {
549  if (value <= 0.0)
550  return((Quantum) 0);
551  if (value >= (Quantum) MaxMap)
552  return(QuantumRange);
553 #if !defined(MAGICKCORE_HDRI_SUPPORT)
554  return((Quantum) (65537.0*value+0.5));
555 #else
556  return((Quantum) (65537.0*value));
557 #endif
558 }
559 
560 static inline unsigned int ScaleQuantumToLong(const Quantum quantum)
561 {
562 #if !defined(MAGICKCORE_HDRI_SUPPORT)
563  return((unsigned int) quantum);
564 #else
565  if (quantum <= 0.0)
566  return(0);
567  if ((quantum) >= 4294967295.0)
568  return(4294967295);
569  return((unsigned int) (quantum+0.5));
570 #endif
571 }
572 
573 static inline MagickSizeType ScaleQuantumToLongLong(const Quantum quantum)
574 {
575 #if !defined(MAGICKCORE_HDRI_SUPPORT)
576  return((MagickSizeType) quantum);
577 #else
578  return((MagickSizeType) (quantum+0.5));
579 #endif
580 }
581 
582 static inline unsigned int ScaleQuantumToMap(const Quantum quantum)
583 {
584  if (quantum < 0.0)
585  return(0UL);
586  if ((quantum/65537) >= (Quantum) MaxMap)
587  return((unsigned int) MaxMap);
588 #if !defined(MAGICKCORE_HDRI_SUPPORT)
589  return((unsigned int) ((quantum+MagickULLConstant(32768))/
590  MagickULLConstant(65537)));
591 #else
592  return((unsigned int) (quantum/65537.0+0.5));
593 #endif
594 }
595 
596 static inline unsigned short ScaleQuantumToShort(const Quantum quantum)
597 {
598 #if !defined(MAGICKCORE_HDRI_SUPPORT)
599  return((unsigned short) ((quantum+MagickULLConstant(32768))/
600  MagickULLConstant(65537)));
601 #else
602  if (quantum <= 0.0)
603  return(0);
604  if ((quantum/65537.0) >= 65535.0)
605  return(65535);
606  return((unsigned short) (quantum/65537.0+0.5));
607 #endif
608 }
609 
610 static inline Quantum ScaleShortToQuantum(const unsigned short value)
611 {
612 #if !defined(MAGICKCORE_HDRI_SUPPORT)
613  return((Quantum) (65537UL*value));
614 #else
615  return((Quantum) (65537.0*value));
616 #endif
617 }
618 #elif (MAGICKCORE_QUANTUM_DEPTH == 64)
619 static inline Quantum ScaleCharToQuantum(const unsigned char value)
620 {
621  return((Quantum) (72340172838076673.0*value));
622 }
623 
624 static inline Quantum ScaleLongToQuantum(const unsigned int value)
625 {
626  return((Quantum) (4294967297.0*value));
627 }
628 
629 static inline Quantum ScaleLongLongToQuantum(const MagickSizeType value)
630 {
631  return((Quantum) (18446744073709551615.0*value));
632 }
633 
634 static inline Quantum ScaleMapToQuantum(const MagickRealType value)
635 {
636  if (value <= 0.0)
637  return((Quantum) 0);
638  if (value >= MaxMap)
639  return(QuantumRange);
640  return((Quantum) (281479271743489.0*value));
641 }
642 
643 static inline unsigned int ScaleQuantumToLong(const Quantum quantum)
644 {
645  return((unsigned int) (quantum/4294967297.0+0.5));
646 }
647 
648 static inline MagickSizeType ScaleQuantumToLongLong(const Quantum quantum)
649 {
650  return((MagickSizeType) (quantum/18446744073709551615.0+0.5));
651 }
652 
653 static inline unsigned int ScaleQuantumToMap(const Quantum quantum)
654 {
655  if (quantum <= 0.0)
656  return(0UL);
657  if ((quantum/281479271743489.0) >= MaxMap)
658  return((unsigned int) MaxMap);
659  return((unsigned int) (quantum/281479271743489.0+0.5));
660 }
661 
662 static inline unsigned short ScaleQuantumToShort(const Quantum quantum)
663 {
664  if (quantum <= 0.0)
665  return(0);
666  if ((quantum/281479271743489.0) >= 65535.0)
667  return(65535);
668  return((unsigned short) (quantum/281479271743489.0+0.5));
669 }
670 
671 static inline Quantum ScaleShortToQuantum(const unsigned short value)
672 {
673  return((Quantum) (281479271743489.0*value));
674 }
675 #endif
676 
677 static inline unsigned short SinglePrecisionToHalf(const float value)
678 {
679  typedef union _SinglePrecision
680  {
681  unsigned int
682  fixed_point;
683 
684  float
685  single_precision;
686  } SinglePrecision;
687 
688  register int
689  exponent;
690 
691  register unsigned int
692  significand,
693  sign_bit;
694 
695  SinglePrecision
696  map;
697 
698  unsigned short
699  half;
700 
701  /*
702  The IEEE 754 standard specifies half precision as having:
703 
704  Sign bit: 1 bit
705  Exponent width: 5 bits
706  Significand precision: 11 (10 explicitly stored)
707  */
708  map.single_precision=value;
709  sign_bit=(map.fixed_point >> 16) & 0x00008000;
710  exponent=(int) ((map.fixed_point >> ExponentShift) & 0x000000ff)-ExponentBias;
711  significand=map.fixed_point & 0x007fffff;
712  if (exponent <= 0)
713  {
714  int
715  shift;
716 
717  if (exponent < -10)
718  return((unsigned short) sign_bit);
719  significand=significand | 0x00800000;
720  shift=(int) (14-exponent);
721  significand=(unsigned int) ((significand+((1 << (shift-1))-1)+
722  ((significand >> shift) & 0x01)) >> shift);
723  return((unsigned short) (sign_bit | significand));
724  }
725  else
726  if (exponent == (0xff-ExponentBias))
727  {
728  if (significand == 0)
729  return((unsigned short) (sign_bit | ExponentMask));
730  else
731  {
732  significand>>=SignificandShift;
733  half=(unsigned short) (sign_bit | significand |
734  (significand == 0) | ExponentMask);
735  return(half);
736  }
737  }
738  significand=significand+((significand >> SignificandShift) & 0x01)+0x00000fff;
739  if ((significand & 0x00800000) != 0)
740  {
741  significand=0;
742  exponent++;
743  }
744  if (exponent > 30)
745  {
746  float
747  alpha;
748 
749  register int
750  i;
751 
752  /*
753  Float overflow.
754  */
755  alpha=1.0e10;
756  for (i=0; i < 10; i++)
757  alpha*=alpha;
758  return((unsigned short) (sign_bit | ExponentMask));
759  }
760  half=(unsigned short) (sign_bit | (exponent << 10) |
761  (significand >> SignificandShift));
762  return(half);
763 }
764 
765 #if defined(__cplusplus) || defined(c_plusplus)
766 }
767 #endif
768 
769 #endif
MagickDoubleType MagickRealType
Definition: magick-type.h:118
QuantumFormatType
Definition: quantum.h:42
QuantumFormatType format
static MagickSizeType GetQuantumRange(const size_t depth)
MemoryInfo ** pixels
#define ExponentMask
QuantumAlphaType alpha_type
#define MagickULLConstant(c)
Definition: magick-type.h:36
MagickPrivate void ResetQuantumState(QuantumInfo *)
Definition: quantum.c:579
#define SignBitShift
#define SignificandMask
QuantumState state
float MagickFloatType
Definition: magick-type.h:40
EndianType
Definition: quantum.h:28
EndianType endian
static const unsigned char * PushShortPixel(const EndianType endian, const unsigned char *pixels, unsigned short *pixel)
MagickBooleanType pack
static const unsigned char * PushCharPixel(const unsigned char *pixels, unsigned char *pixel)
MagickBooleanType
Definition: magick-type.h:156
static double PerceptibleReciprocal(const double x)
static Quantum ScaleAnyToQuantum(const QuantumAny quantum, const QuantumAny range)
static unsigned char * PopLongPixel(const EndianType endian, const unsigned int pixel, unsigned char *pixels)
unsigned int pixel
size_t MagickSizeType
Definition: magick-type.h:128
static const unsigned char * PushLongPixel(const EndianType endian, const unsigned char *pixels, unsigned int *pixel)
SemaphoreInfo * semaphore
#define SignificandShift
#define ExponentShift
#define MaxMap
Definition: magick-type.h:75
static float HalfToSinglePrecision(const unsigned short half)
size_t number_threads
const unsigned int * mask
unsigned short Quantum
Definition: magick-type.h:82
#define ExponentBias
static unsigned char * PopCharPixel(const unsigned char pixel, unsigned char *pixels)
static unsigned char * PopShortPixel(const EndianType endian, const unsigned short pixel, unsigned char *pixels)
#define MagickMin(x, y)
Definition: image-private.h:27
double inverse_scale
static unsigned short SinglePrecisionToHalf(const float value)
#define MagickPrivate
struct _QuantumState QuantumState
static QuantumAny ScaleQuantumToAny(const Quantum quantum, const QuantumAny range)
MagickBooleanType min_is_white
MagickSizeType QuantumAny
Definition: magick-type.h:142
QuantumAlphaType
Definition: quantum.h:35
#define QuantumRange
Definition: magick-type.h:83
static const unsigned char * PushFloatPixel(const EndianType endian, const unsigned char *pixels, MagickFloatType *pixel)