Add double-precision versions of encode_sRGB_uchar

This commit is contained in:
rdb 2017-12-19 23:44:15 +01:00
parent 061e0c4862
commit 096d54de00
2 changed files with 19 additions and 0 deletions

View File

@ -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);
}

View File

@ -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)