Krita Source Code Documentation
Loading...
Searching...
No Matches
KoColorModelStandardIdsUtils.h File Reference
#include <KoColorModelStandardIds.h>
#include <KoConfig.h>

Go to the source code of this file.

Functions

template<template< typename T > class Functor, typename... Args, typename Result = decltype(std::declval<Functor<quint8>>()(std::declval<Args>()...))>
Result channelTypeForColorDepthId (const KoID &depthId, Args... args)
 
template<typename channel_type >
KoID colorDepthIdForChannelType ()
 
template<>
KoID colorDepthIdForChannelType< double > ()
 
template<>
KoID colorDepthIdForChannelType< float > ()
 
template<>
KoID colorDepthIdForChannelType< quint16 > ()
 
template<>
KoID colorDepthIdForChannelType< quint8 > ()
 

Function Documentation

◆ channelTypeForColorDepthId()

template<template< typename T > class Functor, typename... Args, typename Result = decltype(std::declval<Functor<quint8>>()(std::declval<Args>()...))>
Result channelTypeForColorDepthId ( const KoID & depthId,
Args... args )

Definition at line 46 of file KoColorModelStandardIdsUtils.h.

47{
48 if (depthId == Integer8BitsColorDepthID) {
49 return Functor<quint8>()(args...);
50 } else if (depthId == Integer16BitsColorDepthID) {
51 return Functor<quint16>()(args...);
52#ifdef HAVE_OPENEXR
53 } else if (depthId == Float16BitsColorDepthID) {
54 return Functor<half>()(args...);
55#endif
56 } else if (depthId == Float32BitsColorDepthID) {
57 return Functor<float>()(args...);
58 }
59
60 throw std::runtime_error("Invalid bit depth!");
61}
const KoID Float32BitsColorDepthID("F32", ki18n("32-bit float/channel"))
const KoID Float16BitsColorDepthID("F16", ki18n("16-bit float/channel"))
const KoID Integer8BitsColorDepthID("U8", ki18n("8-bit integer/channel"))
const KoID Integer16BitsColorDepthID("U16", ki18n("16-bit integer/channel"))

References Float16BitsColorDepthID, Float32BitsColorDepthID, Integer16BitsColorDepthID, and Integer8BitsColorDepthID.

◆ colorDepthIdForChannelType()

template<typename channel_type >
KoID colorDepthIdForChannelType ( )

◆ colorDepthIdForChannelType< double >()

template<>
KoID colorDepthIdForChannelType< double > ( )
inline

Definition at line 39 of file KoColorModelStandardIdsUtils.h.

39 {
41}
const KoID Float64BitsColorDepthID("F64", ki18n("64-bit float/channel"))

References Float64BitsColorDepthID.

◆ colorDepthIdForChannelType< float >()

template<>
KoID colorDepthIdForChannelType< float > ( )
inline

Definition at line 35 of file KoColorModelStandardIdsUtils.h.

35 {
37}

References Float32BitsColorDepthID.

◆ colorDepthIdForChannelType< quint16 >()

template<>
KoID colorDepthIdForChannelType< quint16 > ( )
inline

Definition at line 25 of file KoColorModelStandardIdsUtils.h.

25 {
27}

References Integer16BitsColorDepthID.

◆ colorDepthIdForChannelType< quint8 >()

template<>
KoID colorDepthIdForChannelType< quint8 > ( )
inline

Definition at line 21 of file KoColorModelStandardIdsUtils.h.

21 {
23}

References Integer8BitsColorDepthID.