diff --git a/include/sp2/graphics/image/convert.h b/include/sp2/graphics/image/convert.h index 0144180..6f09f50 100644 --- a/include/sp2/graphics/image/convert.h +++ b/include/sp2/graphics/image/convert.h @@ -7,7 +7,7 @@ namespace sp::image { namespace detail { - template struct PixelConvertInfo; + template struct PixelConvertInfo; template<> struct PixelConvertInfo { static inline uint8_t conv(uint32_t in) { return ((in & 0xFF) + ((in >> 8) & 0xFF) + ((in >> 16) & 0xFF)) / 3; } }; template<> struct PixelConvertInfo { static inline uint32_t conv(uint8_t in) { return 0xFF000000 | in | (in << 8) | (in << 16); } }; } @@ -17,7 +17,7 @@ template ImageBase convert(const ImageBase auto src = input.getPtr(); auto dst = output.getPtr(); for(int n=0; n::conv(*src++); + *dst++ = detail::PixelConvertInfo::conv(*src++); return output; }