Updated todo list
[tecorrec.git] / geo / tcHLImage.h
blob8620aaa4e463ec76157af5c377d1f2aa81d85e35
1 /***************************************************************************
2 * This file is part of Tecorrec. *
3 * Copyright 2008 James Hogan <james@albanarts.com> *
4 * *
5 * Tecorrec is free software: you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation, either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * Tecorrec is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with Tecorrec. If not, write to the Free Software Foundation, *
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18 ***************************************************************************/
20 #ifndef _tcHLImage_h_
21 #define _tcHLImage_h_
23 /**
24 * @file tcHLImage.h
25 * @brief Hurrendously Large Images.
28 #include <QString>
29 #include <GL/gl.h>
31 class GDALDataset;
33 /** Hurrendously Large Images.
34 * This class is designed to help keep very large image files under control.
35 * This involves partial loading, mipmapping, and loading into GL textures.
36 * The assumption is that when processing we are only interested in the full
37 * resolution data (although probably only a small part of it).
39 class tcHLImage
41 public:
44 * Constructors + destructor
47 /// Primary constructor.
48 tcHLImage(const QString& filename);
50 /// Destructor.
51 virtual ~tcHLImage();
54 * General accessors
57 /// Get the width of the image.
58 int width() const;
60 /// Get the height of the image.
61 int height() const;
64 * Main interface
67 /// Get the thumbnail of the entire image.
68 GLuint thumbnailTexture();
70 /** Set up the current texture with a full resolution portion of the image.
71 * Writes back to the coordinates to ensure they are accurate.
72 * @returns false on failure - in which case perhaps the region is too big
73 * try using thumbnailTexture in that case instead
75 bool setupTexture(double* x1, double* y1, double* x2, double* y2);
77 /// Prefetch a portion of the image.
78 void prefetch(int x, int y, int w, int h);
80 private:
83 * Variables
86 /// Width of the image file.
87 int m_width;
89 /// Height of the image file.
90 int m_height;
92 /// GDAL dataset object.
93 GDALDataset* m_dataset;
95 /// Thumbnail texture.
96 GLuint m_thumbnail;
99 #endif