summaryrefslogtreecommitdiffstats
path: root/krita/ui/kis_opengl_image_context.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-26 00:29:37 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-26 00:29:37 +0000
commit2785103a6bd4de55bd26d79e34d0fdd4b329a73a (patch)
treec2738b1095bfdb263da27bc1391403d829522a14 /krita/ui/kis_opengl_image_context.h
parentf008adb5a77e094eaf6abf3fc0f36958e66896a5 (diff)
downloadkoffice-2785103a6bd4de55bd26d79e34d0fdd4b329a73a.tar.gz
koffice-2785103a6bd4de55bd26d79e34d0fdd4b329a73a.zip
Remove krita* in preparation for name switch from Krita to Chalk
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238361 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'krita/ui/kis_opengl_image_context.h')
-rw-r--r--krita/ui/kis_opengl_image_context.h157
1 files changed, 0 insertions, 157 deletions
diff --git a/krita/ui/kis_opengl_image_context.h b/krita/ui/kis_opengl_image_context.h
deleted file mode 100644
index 03833cd2..00000000
--- a/krita/ui/kis_opengl_image_context.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Copyright (c) 2005 Adrian Page <adrian@pagenet.plus.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-#ifndef KIS_OPENGL_IMAGE_CONTEXT_H_
-#define KIS_OPENGL_IMAGE_CONTEXT_H_
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_GL
-
-#include <map>
-
-#include <tqgl.h>
-#include <tqobject.h>
-#include <tqvaluevector.h>
-
-#include <koffice_export.h>
-
-#include "kis_types.h"
-
-class TQRegion;
-
-class KisOpenGLImageContext;
-typedef KSharedPtr<KisOpenGLImageContext> KisOpenGLImageContextSP;
-class KisColorSpace;
-
-class KRITACORE_EXPORT KisOpenGLImageContext : public TQObject , public KShared {
-
- Q_OBJECT
- TQ_OBJECT
-
-public:
- static KisOpenGLImageContextSP getImageContext(KisImageSP image, KisProfile *monitorProfile);
-
- KisOpenGLImageContext();
- virtual ~KisOpenGLImageContext();
-
-public:
- // In order to use the image textures, the caller must pass
- // the sharedContextWidget() as the shareWidget argument to the
- // TQGLWidget constructor.
- TQGLWidget *sharedContextWidget() const;
-
- void setMonitorProfile(KisProfile *profile);
- void setHDRExposure(float exposure);
-
- GLuint backgroundTexture() const;
-
- static const int BACKGROUND_TEXTURE_WIDTH = 32;
- static const int BACKGROUND_TEXTURE_HEIGHT = 32;
-
- // Get the image texture tile containing the point (pixelX, pixelY).
- GLuint imageTextureTile(int pixelX, int pixelY) const;
-
- int imageTextureTileWidth() const;
- int imageTextureTileHeight() const;
-
- /**
- * Select selection visualisation rendering.
- *
- * @param enable Set to true to enable selection visualisation rendering.
- */
- void setSelectionDisplayEnabled(bool enable);
-
- /**
- * Update the image textures for the given image rectangle.
- *
- * @param imageRect The rectangle to update in image coordinates.
- */
- void update(const TQRect& imageRect);
-
-signals:
- /**
- * Clients using the KisOpenGLImageContext should connect to the
- * following signals rather than to the KisImage's own equivalent
- * signals. This ensures that the image textures are always up to date
- * when used.
- */
-
- /**
- * Emitted whenever an action has caused the image to be recomposited.
- *
- * @param rc The rect that has been recomposited.
- */
- void sigImageUpdated(TQRect rc);
-
- /**
- * Emitted whenever the image size changes.
- *
- * @param width New image width
- * @param height New image height
- */
- void sigSizeChanged(TQ_INT32 width, TQ_INT32 height);
-
-protected:
- KisOpenGLImageContext(KisImageSP image, KisProfile *monitorProfile);
-
- void generateBackgroundTexture();
- void createImageTextureTiles();
- void destroyImageTextureTiles();
- int imageTextureTileIndex(int x, int y) const;
- void updateImageTextureTiles(const TQRect& rect);
-
- static KisColorSpace* textureColorSpaceForImageColorSpace(KisColorSpace *imageColorSpace);
- static bool imageCanShareImageContext(KisImageSP image);
-
-protected slots:
- void slotImageUpdated(TQRect r);
- void slotImageSizeChanged(TQ_INT32 w, TQ_INT32 h);
-
-private:
- KisImageSP m_image;
- KisProfile *m_monitorProfile;
- float m_exposure;
- bool m_displaySelection;
-
- GLuint m_backgroundTexture;
-
- static const int PREFERRED_IMAGE_TEXTURE_WIDTH = 256;
- static const int PREFERRED_IMAGE_TEXTURE_HEIGHT = 256;
-
- TQValueVector<GLuint> m_imageTextureTiles;
- int m_imageTextureTileWidth;
- int m_imageTextureTileHeight;
- int m_numImageTextureTileColumns;
-
- // We create a single OpenGL context and share it between all views
- // in the process. Aptqparently with some OpenGL implementations, only
- // one context will be hardware accelerated.
- static TQGLWidget *SharedContextWidget;
- static int SharedContextWidgetRefCount;
-
- typedef std::map<KisImageSP, KisOpenGLImageContext*> ImageContextMap;
-
- static ImageContextMap imageContextMap;
-};
-
-#endif // HAVE_GL
-
-#endif // KIS_OPENGL_IMAGE_CONTEXT_H_
-