|
Krita Source Code Documentation
|
#include <kis_opengl_image_textures.h>
Inheritance diagram for KisOpenGLImageTextures:Signals | |
| void | sigShowFloatingMessage (const QString &message, int timeout, bool priority) |
Static Public Member Functions | |
| static KisOpenGLImageTexturesSP | createImageTextures (KisImageWSP image, const KoColorProfile *monitorProfile, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags) |
Static Public Attributes | |
| static const int | BACKGROUND_TEXTURE_CHECK_SIZE = 32 |
| static const int | BACKGROUND_TEXTURE_SIZE = BACKGROUND_TEXTURE_CHECK_SIZE * 2 |
Protected Member Functions | |
| void | destroyImageTextureTiles () |
| void | initBufferStorage (bool useBuffer) |
| KisOpenGLImageTextures (KisImageWSP image, const KoColorProfile *monitorProfile, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags) | |
| void | recreateImageTextureTiles () |
Protected Member Functions inherited from KisShared | |
| KisShared () | |
| ~KisShared () | |
Private Member Functions | |
| void | getTextureSize (KisGLTexturesInfo *texturesInfo) |
| KisOpenGLUpdateInfoSP | updateCacheImpl (const QRect &rect, KisImageSP srcImage, bool convertColorSpace) |
| void | updateTextureFormat () |
Private Attributes | |
| KisOpenGLBufferCircularStorage | m_bufferStorage |
| boost::optional< GLuint > | m_checkerTexture |
| KoColorConversionTransformation::ConversionFlags | m_conversionFlags |
| QOpenGLFunctions * | m_glFuncs {nullptr} |
| KisImageWSP | m_image |
| bool | m_initialized {false} |
| bool | m_internalColorManagementActive {true} |
| const KoColorProfile * | m_monitorProfile {nullptr} |
| int | m_numCols {0} |
| KoColorConversionTransformation::Intent | m_renderingIntent |
| QRect | m_storedImageBounds |
| KisGLTexturesInfo | m_texturesInfo |
| QVector< KisTextureTile * > | m_textureTiles |
| QOpenGLBuffer | m_tileTexCoordBuffer |
| QOpenGLBuffer | m_tileVertexBuffer |
| KisOpenGLUpdateInfoBuilder | m_updateInfoBuilder |
| bool | m_useOcio {false} |
A set of OpenGL textures that contains the projection of a KisImage.
Definition at line 36 of file kis_opengl_image_textures.h.
| KisOpenGLImageTextures::KisOpenGLImageTextures | ( | ) |
Default constructor.
Definition at line 71 of file kis_opengl_image_textures.cpp.
References KisConfig::allowLCMSOptimization(), KoColorConversionTransformation::BlackpointCompensation, KoColorConversionTransformation::HighQuality, m_conversionFlags, m_renderingIntent, m_useOcio, KisConfig::monitorRenderIntent(), KoColorConversionTransformation::NoOptimization, KisConfig::useBlackPointCompensation(), and KisConfig::useOcio().
|
virtual |
Destructor.
Definition at line 129 of file kis_opengl_image_textures.cpp.
References destroyImageTextureTiles(), m_checkerTexture, and m_glFuncs.
|
protected |
Definition at line 89 of file kis_opengl_image_textures.cpp.
| GLuint KisOpenGLImageTextures::checkerTexture | ( | ) |
Definition at line 393 of file kis_opengl_image_textures.cpp.
References dbgUI, m_checkerTexture, and m_glFuncs.
|
static |
Obtain a KisOpenGLImageTextures object for the given image.
| image | The image |
| monitorProfile | The profile of the display device |
| renderingIntent | The rendering intent |
| conversionFlags | The color conversion flags |
Definition at line 158 of file kis_opengl_image_textures.cpp.
References image(), KisOpenGLImageTextures(), and monitorProfile().
|
protected |
Definition at line 261 of file kis_opengl_image_textures.cpp.
References m_storedImageBounds, m_textureTiles, m_tileTexCoordBuffer, and m_tileVertexBuffer.
| void KisOpenGLImageTextures::generateCheckerTexture | ( | const QImage & | checkImage | ) |
Generate a background texture from the given QImage. This is used for the checker pattern on which the image is rendered.
Definition at line 338 of file kis_opengl_image_textures.cpp.
References BACKGROUND_TEXTURE_SIZE, KisFixedPaintDevice::bounds(), checkerTexture(), KoColorSpace::colorDepthId(), KoColorSpaceRegistry::colorSpace(), KisFixedPaintDevice::convertFromQImage(), KisFixedPaintDevice::convertTo(), KisFixedPaintDevice::data(), dbgUI, KisOpenGLUpdateInfoBuilder::destinationColorSpace(), KisGLTexturesInfo::format, KoID::id(), KoColorSpaceRegistry::instance(), KisGLTexturesInfo::internalFormat, KIS_ASSERT, m_initialized, m_monitorProfile, m_texturesInfo, m_updateInfoBuilder, KoColorProfile::name, KoColorSpace::profile(), KoColorSpaceRegistry::rgb8(), RGBAColorModelID, and KisGLTexturesInfo::type.
|
inline |
Definition at line 133 of file kis_opengl_image_textures.h.
References KIS_ASSERT_RECOVER_RETURN_VALUE.
|
private |
Definition at line 506 of file kis_opengl_image_textures.cpp.
References KisGLTexturesInfo::border, dbgUI, KisGLTexturesInfo::effectiveHeight, KisGLTexturesInfo::effectiveWidth, KisGLTexturesInfo::height, m_glFuncs, m_updateInfoBuilder, KisConfig::openGLTextureSize(), KisOpenGLUpdateInfoBuilder::setEffectiveTextureSize(), KisOpenGLUpdateInfoBuilder::setTextureBorder(), KisConfig::textureOverlapBorder(), and KisGLTexturesInfo::width.
|
inline |
Definition at line 124 of file kis_opengl_image_textures.h.
References KIS_ASSERT_RECOVER_RETURN_VALUE.
| KisImageSP KisOpenGLImageTextures::image | ( | ) | const |
Definition at line 137 of file kis_opengl_image_textures.cpp.
References m_image.
|
protected |
Definition at line 142 of file kis_opengl_image_textures.cpp.
References KisOpenGLBufferCircularStorage::allocate(), KisOpenGLUpdateInfoBuilder::destinationColorSpace(), KisGLTexturesInfo::height, m_bufferStorage, m_texturesInfo, m_updateInfoBuilder, KoColorSpace::pixelSize(), KisOpenGLBufferCircularStorage::reset(), and KisGLTexturesInfo::width.
| void KisOpenGLImageTextures::initGL | ( | QOpenGLFunctions * | f | ) |
Complete initialization can only happen once an OpenGL context has been created.
| f | Pointer to OpenGL functions. They must already be initialized. |
Definition at line 106 of file kis_opengl_image_textures.cpp.
References KisImage::bounds(), errUI, KisTextureTileInfoPoolRegistry::getPool(), getTextureSize(), KisGLTexturesInfo::height, m_checkerTexture, m_glFuncs, m_image, m_texturesInfo, m_updateInfoBuilder, recalculateCache(), recreateImageTextureTiles(), KisOpenGLUpdateInfoBuilder::setTextureInfoPool(), updateCache(), and KisGLTexturesInfo::width.
| bool KisOpenGLImageTextures::internalColorManagementActive | ( | ) | const |
Definition at line 534 of file kis_opengl_image_textures.cpp.
References m_internalColorManagementActive.
| const KoColorProfile * KisOpenGLImageTextures::monitorProfile | ( | ) |
Definition at line 447 of file kis_opengl_image_textures.cpp.
References m_monitorProfile.
| void KisOpenGLImageTextures::recalculateCache | ( | KisUpdateInfoSP | info, |
| bool | blockMipmapRegeneration ) |
Definition at line 291 of file kis_opengl_image_textures.cpp.
References KisOpenGLBufferCircularStorage::allocateMoreBuffers(), KisSharedPtr< T >::data(), dbgUI, getTextureTileCR(), KisOpenGLBufferCircularStorage::isValid(), KIS_ASSERT_RECOVER_RETURN, m_bufferStorage, m_initialized, KisOpenGLBufferCircularStorage::size(), KisOpenGLUpdateInfo::tileList, and KisTextureTile::update().
|
protected |
Definition at line 166 of file kis_opengl_image_textures.cpp.
References KisImage::bounds(), KisOpenGLUpdateInfoBuilder::calculateEffectiveTileRect(), KisOpenGLBufferCreationGuard::data(), dbgUI, KisOpenGLUpdateInfoBuilder::destinationColorSpace(), destroyImageTextureTiles(), KisImage::height(), KisGLTexturesInfo::height, initBufferStorage(), KisOpenGLBufferCircularStorage::isValid(), m_bufferStorage, m_image, m_initialized, m_numCols, m_storedImageBounds, m_texturesInfo, m_textureTiles, m_tileTexCoordBuffer, m_tileVertexBuffer, m_updateInfoBuilder, KisConfig::numMipmapLevels(), KisConfig::openGLFilteringMode(), KoColorSpace::pixelSize(), KisPaintingTweaks::rectToTexCoords(), KisPaintingTweaks::rectToVertices(), KisOpenGL::shouldUseTextureBuffers(), KisTextureTile::tileRectInImagePixels(), KisTextureTile::tileRectInTexturePixels(), updateTextureFormat(), KisConfig::useOpenGLTextureBuffer(), KisImage::width(), KisGLTexturesInfo::width, xToCol(), and yToRow().
| void KisOpenGLImageTextures::setChannelFlags | ( | const QBitArray & | channelFlags | ) |
Definition at line 471 of file kis_opengl_image_textures.cpp.
References KoColorSpace::channels, KoChannelInfo::COLOR, KisPaintDevice::colorSpace(), m_image, m_updateInfoBuilder, m_useOcio, KisImage::projection(), and KisOpenGLUpdateInfoBuilder::setChannelFlags().
| bool KisOpenGLImageTextures::setImageColorSpace | ( | const KoColorSpace * | cs | ) |
Update the textures when the color space of the image changes.
Definition at line 462 of file kis_opengl_image_textures.cpp.
References recreateImageTextureTiles().
| bool KisOpenGLImageTextures::setInternalColorManagementActive | ( | bool | value | ) |
Definition at line 539 of file kis_opengl_image_textures.cpp.
References m_internalColorManagementActive, recreateImageTextureTiles(), and value().
| void KisOpenGLImageTextures::setMonitorProfile | ( | const KoColorProfile * | monitorProfile, |
| KoColorConversionTransformation::Intent | renderingIntent, | ||
| KoColorConversionTransformation::ConversionFlags | conversionFlags ) |
Set the color profile of the display device.
| monitorProfile | The color profile of the display device |
| renderingIntent | The rendering intent |
| conversionFlags | The color conversion flags |
Definition at line 452 of file kis_opengl_image_textures.cpp.
References m_conversionFlags, m_monitorProfile, m_renderingIntent, monitorProfile(), and recreateImageTextureTiles().
| void KisOpenGLImageTextures::setProofingConfig | ( | KisProofingConfigurationSP | proofingConfig | ) |
Definition at line 501 of file kis_opengl_image_textures.cpp.
References m_updateInfoBuilder, and KisOpenGLUpdateInfoBuilder::setProofingConfig().
|
signal |
| void KisOpenGLImageTextures::slotImageSizeChanged | ( | qint32 | w, |
| qint32 | h ) |
Definition at line 437 of file kis_opengl_image_textures.cpp.
References recreateImageTextureTiles().
|
inline |
Definition at line 112 of file kis_opengl_image_textures.h.
| void KisOpenGLImageTextures::testingForceInitialized | ( | ) |
Definition at line 421 of file kis_opengl_image_textures.cpp.
References KoColorSpaceRegistry::instance(), KoColorConversionTransformation::internalConversionFlags(), KoColorConversionTransformation::internalRenderingIntent(), ConversionOptions::m_conversionFlags, ConversionOptions::m_destinationColorSpace, m_initialized, ConversionOptions::m_needsConversion, ConversionOptions::m_renderingIntent, m_updateInfoBuilder, KoColorSpaceRegistry::rgb8(), KisOpenGLUpdateInfoBuilder::setConversionOptions(), KisOpenGLUpdateInfoBuilder::setEffectiveTextureSize(), KisOpenGLUpdateInfoBuilder::setTextureBorder(), KisOpenGLUpdateInfoBuilder::setTextureInfoPool(), and toQShared().
|
inline |
Definition at line 150 of file kis_opengl_image_textures.h.
|
inline |
Definition at line 146 of file kis_opengl_image_textures.h.
|
inline |
Definition at line 142 of file kis_opengl_image_textures.h.
| KisOpenGLUpdateInfoSP KisOpenGLImageTextures::updateCache | ( | const QRect & | rect, |
| KisImageSP | srcImage ) |
Definition at line 274 of file kis_opengl_image_textures.cpp.
References updateCacheImpl().
|
private |
Definition at line 285 of file kis_opengl_image_textures.cpp.
References KisOpenGLUpdateInfoBuilder::buildUpdateInfo(), m_initialized, and m_updateInfoBuilder.
| KisOpenGLUpdateInfoSP KisOpenGLImageTextures::updateCacheNoConversion | ( | const QRect & | rect | ) |
Definition at line 279 of file kis_opengl_image_textures.cpp.
References m_image, and updateCacheImpl().
| void KisOpenGLImageTextures::updateConfig | ( | bool | useBuffer, |
| int | NumMipmapLevels ) |
Definition at line 408 of file kis_opengl_image_textures.cpp.
References initBufferStorage(), m_bufferStorage, m_textureTiles, KisTextureTile::setBufferStorage(), KisTextureTile::setNumMipmapLevels(), and KisOpenGL::shouldUseTextureBuffers().
| KisOpenGLUpdateInfoBuilder & KisOpenGLImageTextures::updateInfoBuilder | ( | ) |
Definition at line 442 of file kis_opengl_image_textures.cpp.
References m_updateInfoBuilder.
|
private |
TODO: add an optimization so that the tile->convertTo() method would not be called when not needed (DK)
Definition at line 635 of file kis_opengl_image_textures.cpp.
References KoColorSpace::colorDepthId(), KoColorSpace::colorModelId(), KisImage::colorSpace(), KoColorSpaceRegistry::colorSpace(), dbgUI, Float16BitsColorDepthID, Float32BitsColorDepthID, KisGLTexturesInfo::format, GL_BGRA, GL_BGRA8_EXT, GL_BGRA_EXT, GL_RGBA16_EXT, KisOpenGL::hasOpenGL3(), KisOpenGL::hasOpenGLES(), KoID::id(), KoColorSpaceRegistry::instance(), KisOpenGLModeProber::instance(), Integer16BitsColorDepthID, Integer8BitsColorDepthID, KisConfig::INTERNAL, KisGLTexturesInfo::internalFormat, KIS_ASSERT_X, m_conversionFlags, m_image, m_internalColorManagementActive, m_monitorProfile, m_renderingIntent, m_texturesInfo, m_updateInfoBuilder, KisConfig::ocioColorManagementMode(), ppVar, KoColorSpace::profile(), RGBAColorModelID, KisOpenGLUpdateInfoBuilder::setConversionOptions(), KisConfig::setOcioColorManagementMode(), sigShowFloatingMessage(), KisGLTexturesInfo::type, KisOpenGLModeProber::useHDRMode(), and warnUI.
|
inline |
Definition at line 116 of file kis_opengl_image_textures.h.
|
inline |
Definition at line 120 of file kis_opengl_image_textures.h.
|
static |
The background checkers texture.
Definition at line 97 of file kis_opengl_image_textures.h.
|
static |
Definition at line 98 of file kis_opengl_image_textures.h.
|
private |
Definition at line 208 of file kis_opengl_image_textures.h.
|
private |
Definition at line 202 of file kis_opengl_image_textures.h.
|
private |
Definition at line 192 of file kis_opengl_image_textures.h.
|
private |
Definition at line 213 of file kis_opengl_image_textures.h.
|
private |
Definition at line 188 of file kis_opengl_image_textures.h.
|
private |
Definition at line 216 of file kis_opengl_image_textures.h.
|
private |
Shows whether the internal color management should be enabled or not. Please note that if you disable color management, but your image color space will not be supported (non-RGB), then it will be enabled anyway. And this variable will hold the real state of affairs!
Definition at line 200 of file kis_opengl_image_textures.h.
|
private |
Definition at line 190 of file kis_opengl_image_textures.h.
|
private |
Definition at line 205 of file kis_opengl_image_textures.h.
|
private |
Definition at line 191 of file kis_opengl_image_textures.h.
|
private |
Definition at line 189 of file kis_opengl_image_textures.h.
|
private |
Definition at line 204 of file kis_opengl_image_textures.h.
|
private |
Definition at line 209 of file kis_opengl_image_textures.h.
|
private |
Definition at line 211 of file kis_opengl_image_textures.h.
|
private |
Definition at line 210 of file kis_opengl_image_textures.h.
|
private |
Definition at line 218 of file kis_opengl_image_textures.h.
|
private |
Definition at line 215 of file kis_opengl_image_textures.h.