const ImageFormat* ImageFormat::getSRGBFormat(const ImageFormat* otherFormat) { switch (otherFormat->code) { case CODE_RGB8: return SRGB8(); case CODE_RGBA8: return SRGBA8(); case CODE_RGB_DXT1: return SRGB_DXT1(); case CODE_RGBA_DXT1: return SRGBA_DXT1(); case CODE_RGBA_DXT3: return SRGBA_DXT3(); case CODE_RGBA_DXT5: return SRGBA_DXT5(); default: return otherFormat; } }
TextureFormat const * TextureFormat::fromCode(Code code) { switch (code) { case Code::L8: return L8(); case Code::L16: return L16(); case Code::L16F: return L16F(); case Code::L32F: return L32F(); case Code::A8: return A8(); case Code::A16: return A16(); case Code::A16F: return A16F(); case Code::A32F: return A32F(); case Code::LA4: return LA4(); case Code::LA8: return LA8(); case Code::LA16: return LA16(); case Code::LA16F: return LA16F(); break; case Code::LA32F: return LA32F(); case Code::RGB5: return RGB5(); case Code::RGB5A1: return RGB5A1(); case Code::RGB8: return RGB8(); case Code::RGB10: return RGB10(); case Code::RGB10A2: return RGB10A2(); case Code::RGB16: return RGB16(); case Code::RGB32F: return RGB32F(); case Code::R11G11B10F: return R11G11B10F(); case Code::RGB9E5F: return RGB9E5F(); case Code::RGB8I: return RGB8I(); case Code::RGB8UI: return RGB8UI(); case Code::ARGB8: return NULL; case Code::BGR8: return BGR8(); case Code::BGRA8: return BGRA8(); case Code::BGR16: return BGR16(); case Code::BGRA16: return BGRA16(); case Code::BGR32F: return BGR32F(); case Code::BGRA32F: return BGRA32F(); case Code::R8: return R8(); case Code::RG8: return RG8(); case Code::RG8I: return RG8I(); case Code::RG8UI: return RG8UI(); case Code::RG16F: return RG16F(); case Code::RGBA8: return RGBA8(); case Code::RGBA16: return RGBA16(); case Code::RGBA16F: return RGBA16F(); case Code::RGBA32F: return RGBA32F(); case Code::RGBA32UI: return RGBA32UI(); case Code::BAYER_RGGB8: // TODO case Code::BAYER_GRBG8: // TODO case Code::BAYER_GBRG8: // TODO case Code::BAYER_BGGR8: // TODO case Code::BAYER_RGGB32F: // TODO case Code::BAYER_GRBG32F: // TODO case Code::BAYER_GBRG32F: // TODO case Code::BAYER_BGGR32F: // TODO case Code::HSV8: // TODO case Code::HSV32F: // TODO return NULL; break; case Code::RGB_DXT1: return RGB_DXT1(); break; case Code::RGBA_DXT1: return RGBA_DXT1(); break; case Code::RGBA_DXT3: return RGBA_DXT3(); break; case Code::RGBA_DXT5: return RGBA_DXT5(); break; case Code::SRGB8: return SRGB8(); break; case Code::SRGBA8: return SRGBA8(); break; case Code::SL8: return SL8(); break; case Code::SLA8: return SLA8(); break; case Code::SRGB_DXT1: return SRGB_DXT1(); break; case Code::SRGBA_DXT1: return SRGBA_DXT1(); break; case Code::SRGBA_DXT3: return SRGBA_DXT3(); break; case Code::SRGBA_DXT5: return SRGBA_DXT5(); break; case Code::DEPTH16: return DEPTH16(); break; case Code::DEPTH24: return DEPTH24(); break; case Code::DEPTH32: return DEPTH32(); break; case Code::DEPTH32F: return DEPTH32F(); break; case Code::STENCIL1: return STENCIL1(); break; case Code::STENCIL4: return STENCIL4(); break; case Code::STENCIL8: return STENCIL8(); break; case Code::STENCIL16: return STENCIL16(); break; case Code::DEPTH24_STENCIL8: return DEPTH24_STENCIL8(); break; case Code::YUV420_PLANAR: return YUV420_PLANAR(); break; case Code::YUV422: return YUV422(); break; case Code::YUV444: return YUV444(); break; default: return NULL; } }