bool KisOpenGLImageTextures::imageCanUseHDRExposureProgram(KisImageSP image) { #ifdef HAVE_GLEW if (!image->colorSpace()->hasHighDynamicRange()) { return false; } KisConfig cfg; if (!cfg.useOpenGLShaders()) { return false; } if (HDRExposureProgram == 0) { return false; } if (!HDRExposureProgram->isValid()) { return false; } if (!haveHDRTextureFormat(image->colorSpace())) { return false; } return true; #else Q_UNUSED(image); return false; #endif }
void KisOpenGLImageTextures::createHDRExposureProgramIfCan() { KisConfig cfg; if (!cfg.useOpenGLShaders()) return; #ifdef HAVE_GLEW if (HDRExposureProgram == 0 && KisOpenGL::hasShadingLanguage()) { dbgUI << "Creating shared HDR exposure program"; HDRExposureProgram = new KisOpenGLHDRExposureProgram(); Q_CHECK_PTR(HDRExposureProgram); } #endif }