diff --git a/panda/src/pnmimage/convert_srgb.I b/panda/src/pnmimage/convert_srgb.I index 57d8d42170..f49cc38203 100644 --- a/panda/src/pnmimage/convert_srgb.I +++ b/panda/src/pnmimage/convert_srgb.I @@ -153,3 +153,17 @@ encode_sRGB_uchar(const LColorf &color, xel &into, xelval &into_alpha) { into_alpha = (xelval) (color[3] * 255.f + 0.5f); #endif } + + +/** + * Double-precision versions of the above. + */ +INLINE void +encode_sRGB_uchar(const LColord &color, xel &into) { + return encode_sRGB_uchar(LCAST(float, color), into); +} + +INLINE void +encode_sRGB_uchar(const LColord &color, xel &into, xelval &into_alpha) { + return encode_sRGB_uchar(LCAST(float, color), into, into_alpha); +} diff --git a/panda/src/pnmimage/convert_srgb.h b/panda/src/pnmimage/convert_srgb.h index dada8918b3..86bc8b07bf 100644 --- a/panda/src/pnmimage/convert_srgb.h +++ b/panda/src/pnmimage/convert_srgb.h @@ -46,6 +46,11 @@ EXPCL_PANDA_PNMIMAGE INLINE void encode_sRGB_uchar(const LColorf &from, EXPCL_PANDA_PNMIMAGE INLINE void encode_sRGB_uchar(const LColorf &from, xel &into, xelval &into_alpha); +EXPCL_PANDA_PNMIMAGE INLINE void encode_sRGB_uchar(const LColord &from, + xel &into); +EXPCL_PANDA_PNMIMAGE INLINE void encode_sRGB_uchar(const LColord &from, + xel &into, xelval &into_alpha); + // Use these functions if you know that SSE2 support is available. Otherwise, // they will crash! #if defined(__SSE2__) || defined(__i386__) || defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64)