Lines Matching refs:quantum
98 static inline unsigned char ScaleQuantumToChar(const Quantum quantum) in ScaleQuantumToChar() argument
101 return((unsigned char) quantum); in ScaleQuantumToChar()
103 if (quantum <= 0.0) in ScaleQuantumToChar()
105 if (quantum >= 255.0) in ScaleQuantumToChar()
107 return((unsigned char) (quantum+0.5)); in ScaleQuantumToChar()
111 static inline unsigned char ScaleQuantumToChar(const Quantum quantum) in ScaleQuantumToChar() argument
114 return((unsigned char) (((quantum+128UL)-((quantum+128UL) >> 8)) >> 8)); in ScaleQuantumToChar()
116 if (quantum <= 0.0) in ScaleQuantumToChar()
118 if ((quantum/257.0) >= 255.0) in ScaleQuantumToChar()
120 return((unsigned char) (quantum/257.0+0.5)); in ScaleQuantumToChar()
124 static inline unsigned char ScaleQuantumToChar(const Quantum quantum) in ScaleQuantumToChar() argument
127 return((unsigned char) ((quantum+MagickULLConstant(8421504))/ in ScaleQuantumToChar()
130 if (quantum <= 0.0) in ScaleQuantumToChar()
132 if ((quantum/16843009.0) >= 255.0) in ScaleQuantumToChar()
134 return((unsigned char) (quantum/16843009.0+0.5)); in ScaleQuantumToChar()
138 static inline unsigned char ScaleQuantumToChar(const Quantum quantum) in ScaleQuantumToChar() argument
141 return((unsigned char) (quantum/72340172838076673.0+0.5)); in ScaleQuantumToChar()
143 if (quantum <= 0.0) in ScaleQuantumToChar()
145 if ((quantum/72340172838076673.0) >= 255.0) in ScaleQuantumToChar()
147 return((unsigned char) (quantum/72340172838076673.0+0.5)); in ScaleQuantumToChar()