diff --git a/libs/gfx/include/psemek/gfx/pixmap.hpp b/libs/gfx/include/psemek/gfx/pixmap.hpp index 788cb429..1a1e9b56 100644 --- a/libs/gfx/include/psemek/gfx/pixmap.hpp +++ b/libs/gfx/include/psemek/gfx/pixmap.hpp @@ -27,4 +27,18 @@ namespace psemek::gfx pixmap_rgba read_png(io::istream && is); pixmap_monochrome read_png_monochrome(io::istream && is); + template + auto to_srgb(util::array pm, float g = 1.f / 2.2f) + { + for (auto & c : pm) + c = to_srgb(c, g); + return pm; + } + + template + auto to_linear(util::array pm, float g = 1.f / 2.2f) + { + return to_srgb(std::move(pm), 1.f / g); + } + }