Lines Matching refs:quantum
49 quantum; member
196 quantum; in PopLongPixel() local
198 quantum=(unsigned int) pixel; in PopLongPixel()
201 *pixels++=(unsigned char) (quantum); in PopLongPixel()
202 *pixels++=(unsigned char) (quantum >> 8); in PopLongPixel()
203 *pixels++=(unsigned char) (quantum >> 16); in PopLongPixel()
204 *pixels++=(unsigned char) (quantum >> 24); in PopLongPixel()
207 *pixels++=(unsigned char) (quantum >> 24); in PopLongPixel()
208 *pixels++=(unsigned char) (quantum >> 16); in PopLongPixel()
209 *pixels++=(unsigned char) (quantum >> 8); in PopLongPixel()
210 *pixels++=(unsigned char) (quantum); in PopLongPixel()
218 quantum; in PopShortPixel() local
220 quantum=pixel; in PopShortPixel()
223 *pixels++=(unsigned char) (quantum); in PopShortPixel()
224 *pixels++=(unsigned char) (quantum >> 8); in PopShortPixel()
227 *pixels++=(unsigned char) (quantum >> 8); in PopShortPixel()
228 *pixels++=(unsigned char) (quantum); in PopShortPixel()
243 quantum; in PushLongPixel() local
247 quantum=((unsigned int) *pixels++); in PushLongPixel()
248 quantum|=((unsigned int) *pixels++ << 8); in PushLongPixel()
249 quantum|=((unsigned int) *pixels++ << 16); in PushLongPixel()
250 quantum|=((unsigned int) *pixels++ << 24); in PushLongPixel()
251 *pixel=quantum; in PushLongPixel()
254 quantum=((unsigned int) *pixels++ << 24); in PushLongPixel()
255 quantum|=((unsigned int) *pixels++ << 16); in PushLongPixel()
256 quantum|=((unsigned int) *pixels++ << 8); in PushLongPixel()
257 quantum|=((unsigned int) *pixels++); in PushLongPixel()
258 *pixel=quantum; in PushLongPixel()
266 quantum; in PushShortPixel() local
270 quantum=(unsigned int) *pixels++; in PushShortPixel()
271 quantum|=(unsigned int) (*pixels++ << 8); in PushShortPixel()
272 *pixel=(unsigned short) (quantum & 0xffff); in PushShortPixel()
275 quantum=(unsigned int) (*pixels++ << 8); in PushShortPixel()
276 quantum|=(unsigned int) *pixels++; in PushShortPixel()
277 *pixel=(unsigned short) (quantum & 0xffff); in PushShortPixel()
291 } quantum; in PushFloatPixel() local
295 quantum.unsigned_value=((unsigned int) *pixels++); in PushFloatPixel()
296 quantum.unsigned_value|=((unsigned int) *pixels++ << 8); in PushFloatPixel()
297 quantum.unsigned_value|=((unsigned int) *pixels++ << 16); in PushFloatPixel()
298 quantum.unsigned_value|=((unsigned int) *pixels++ << 24); in PushFloatPixel()
299 *pixel=quantum.float_value; in PushFloatPixel()
302 quantum.unsigned_value=((unsigned int) *pixels++ << 24); in PushFloatPixel()
303 quantum.unsigned_value|=((unsigned int) *pixels++ << 16); in PushFloatPixel()
304 quantum.unsigned_value|=((unsigned int) *pixels++ << 8); in PushFloatPixel()
305 quantum.unsigned_value|=((unsigned int) *pixels++); in PushFloatPixel()
306 *pixel=quantum.float_value; in PushFloatPixel()
310 static inline Quantum ScaleAnyToQuantum(const QuantumAny quantum, in ScaleAnyToQuantum() argument
313 if (quantum > range) in ScaleAnyToQuantum()
316 return((Quantum) (((double) QuantumRange*quantum)* in ScaleAnyToQuantum()
319 return((Quantum) (((double) QuantumRange*quantum)* in ScaleAnyToQuantum()
324 static inline QuantumAny ScaleQuantumToAny(const Quantum quantum, in ScaleQuantumToAny() argument
327 return((QuantumAny) (((double) range*quantum)/QuantumRange+0.5)); in ScaleQuantumToAny()
367 static inline unsigned int ScaleQuantumToLong(const Quantum quantum) in ScaleQuantumToLong() argument
370 return((unsigned int) (16843009UL*quantum)); in ScaleQuantumToLong()
372 if (quantum <= 0.0) in ScaleQuantumToLong()
374 if ((16843009.0*quantum) >= 4294967295.0) in ScaleQuantumToLong()
376 return((unsigned int) (16843009.0*quantum+0.5)); in ScaleQuantumToLong()
380 static inline MagickSizeType ScaleQuantumToLongLong(const Quantum quantum) in ScaleQuantumToLongLong() argument
383 return((MagickSizeType) (MagickULLConstant(72340172838076673)*quantum)); in ScaleQuantumToLongLong()
385 if (quantum <= 0.0) in ScaleQuantumToLongLong()
387 if ((72340172838076673.0*quantum) >= 18446744073709551615.0) in ScaleQuantumToLongLong()
389 return((MagickSizeType) (72340172838076673*quantum+0.5)); in ScaleQuantumToLongLong()
393 static inline unsigned int ScaleQuantumToMap(const Quantum quantum) in ScaleQuantumToMap() argument
395 if (quantum >= (Quantum) MaxMap) in ScaleQuantumToMap()
398 return((unsigned int) quantum); in ScaleQuantumToMap()
400 if (quantum < 0.0) in ScaleQuantumToMap()
402 return((unsigned int) (quantum+0.5)); in ScaleQuantumToMap()
406 static inline unsigned short ScaleQuantumToShort(const Quantum quantum) in ScaleQuantumToShort() argument
409 return((unsigned short) (257UL*quantum)); in ScaleQuantumToShort()
411 if (quantum <= 0.0) in ScaleQuantumToShort()
413 if ((257.0*quantum) >= 65535.0) in ScaleQuantumToShort()
415 return((unsigned short) (257.0*quantum+0.5)); in ScaleQuantumToShort()
468 static inline unsigned int ScaleQuantumToLong(const Quantum quantum) in ScaleQuantumToLong() argument
471 return((unsigned int) (65537UL*quantum)); in ScaleQuantumToLong()
473 if (quantum <= 0.0) in ScaleQuantumToLong()
475 if ((65537.0*quantum) >= 4294967295.0) in ScaleQuantumToLong()
477 return((unsigned int) (65537.0*quantum+0.5)); in ScaleQuantumToLong()
481 static inline MagickSizeType ScaleQuantumToLongLong(const Quantum quantum) in ScaleQuantumToLongLong() argument
484 return((MagickSizeType) (MagickULLConstant(281479271743489)*quantum)); in ScaleQuantumToLongLong()
486 if (quantum <= 0.0) in ScaleQuantumToLongLong()
488 if ((281479271743489.0*quantum) >= 18446744073709551615.0) in ScaleQuantumToLongLong()
490 return((MagickSizeType) (281479271743489.0*quantum+0.5)); in ScaleQuantumToLongLong()
494 static inline unsigned int ScaleQuantumToMap(const Quantum quantum) in ScaleQuantumToMap() argument
496 if (quantum >= (Quantum) MaxMap) in ScaleQuantumToMap()
499 return((unsigned int) quantum); in ScaleQuantumToMap()
501 if (quantum < 0.0) in ScaleQuantumToMap()
503 return((unsigned int) (quantum+0.5)); in ScaleQuantumToMap()
507 static inline unsigned short ScaleQuantumToShort(const Quantum quantum) in ScaleQuantumToShort() argument
510 return((unsigned short) quantum); in ScaleQuantumToShort()
512 if (quantum <= 0.0) in ScaleQuantumToShort()
514 if (quantum >= 65535.0) in ScaleQuantumToShort()
516 return((unsigned short) (quantum+0.5)); in ScaleQuantumToShort()
561 static inline unsigned int ScaleQuantumToLong(const Quantum quantum) in ScaleQuantumToLong() argument
564 return((unsigned int) quantum); in ScaleQuantumToLong()
566 if (quantum <= 0.0) in ScaleQuantumToLong()
568 if ((quantum) >= 4294967295.0) in ScaleQuantumToLong()
570 return((unsigned int) (quantum+0.5)); in ScaleQuantumToLong()
574 static inline MagickSizeType ScaleQuantumToLongLong(const Quantum quantum) in ScaleQuantumToLongLong() argument
577 return((MagickSizeType) (MagickULLConstant(4294967297)*quantum)); in ScaleQuantumToLongLong()
579 if (quantum <= 0.0) in ScaleQuantumToLongLong()
581 if ((4294967297.0*quantum) >= 18446744073709551615.0) in ScaleQuantumToLongLong()
583 return((MagickSizeType) (4294967297.0*quantum+0.5)); in ScaleQuantumToLongLong()
587 static inline unsigned int ScaleQuantumToMap(const Quantum quantum) in ScaleQuantumToMap() argument
589 if (quantum < 0.0) in ScaleQuantumToMap()
591 if ((quantum/65537) >= (Quantum) MaxMap) in ScaleQuantumToMap()
594 return((unsigned int) ((quantum+MagickULLConstant(32768))/ in ScaleQuantumToMap()
597 return((unsigned int) (quantum/65537.0+0.5)); in ScaleQuantumToMap()
601 static inline unsigned short ScaleQuantumToShort(const Quantum quantum) in ScaleQuantumToShort() argument
604 return((unsigned short) ((quantum+MagickULLConstant(32768))/ in ScaleQuantumToShort()
607 if (quantum <= 0.0) in ScaleQuantumToShort()
609 if ((quantum/65537.0) >= 65535.0) in ScaleQuantumToShort()
611 return((unsigned short) (quantum/65537.0+0.5)); in ScaleQuantumToShort()
648 static inline unsigned int ScaleQuantumToLong(const Quantum quantum) in ScaleQuantumToLong() argument
650 return((unsigned int) (quantum/4294967297.0+0.5)); in ScaleQuantumToLong()
653 static inline MagickSizeType ScaleQuantumToLongLong(const Quantum quantum) in ScaleQuantumToLongLong() argument
656 return((MagickSizeType) quantum); in ScaleQuantumToLongLong()
658 if (quantum <= 0.0) in ScaleQuantumToLongLong()
660 if (quantum >= 18446744073709551615) in ScaleQuantumToLongLong()
662 return((MagickSizeType) (quantum+0.5)); in ScaleQuantumToLongLong()
666 static inline unsigned int ScaleQuantumToMap(const Quantum quantum) in ScaleQuantumToMap() argument
668 if (quantum <= 0.0) in ScaleQuantumToMap()
670 if ((quantum/281479271743489.0) >= MaxMap) in ScaleQuantumToMap()
672 return((unsigned int) (quantum/281479271743489.0+0.5)); in ScaleQuantumToMap()
675 static inline unsigned short ScaleQuantumToShort(const Quantum quantum) in ScaleQuantumToShort() argument
677 if (quantum <= 0.0) in ScaleQuantumToShort()
679 if ((quantum/281479271743489.0) >= 65535.0) in ScaleQuantumToShort()
681 return((unsigned short) (quantum/281479271743489.0+0.5)); in ScaleQuantumToShort()