Simple program to read arcinfo ascii files and convert into hgt elevation data (for...
[tecorrec.git] / geo / tcChannelFile.h
blobcf5357b5fce61a97894df2d0877e7eaeda2b61bd
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 _tcChannelFile_h_
21 #define _tcChannelFile_h_
23 /**
24 * @file tcChannelFile.h
25 * @brief An image channel from an image file.
28 #include "tcChannel.h"
29 #include "tcGeo.h"
30 #include "tcAffineTransform.h"
32 class GDALDataset;
33 class OGRCoordinateTransformation;
35 /// An image channel from an image file.
36 class tcChannelFile : public tcChannel
38 public:
41 * Constructors + destructor
44 /// Primary constructor.
45 tcChannelFile(const QString& filename, const QString& name, const QString& description, float radianceOffset = 0.0f, float radianceBias = 1.0f);
47 /// Destructor.
48 virtual ~tcChannelFile();
51 * Accessors
54 /// Load the transformation from projection to texture.
55 const tcAffineTransform2<double> geoToTex() const;
57 /// Load the transformation from projection to texture.
58 const tcAffineTransform2<double> texToGeo() const;
61 * Main image interface
64 // Reimplemented
65 virtual GLuint thumbnailTexture();
67 protected:
70 * Interface for derived class to implement
73 // Reimplemented
74 virtual void roundPortion(double* x1, double* y1, double* x2, double* y2);
76 // Reimplemented
77 virtual tcAbstractPixelData* loadPortion(double x1, double y1, double x2, double y2, bool changed);
79 private:
82 * Variables
85 /// Width of the image file.
86 int m_width;
88 /// Height of the image file.
89 int m_height;
91 /// GDAL dataset object.
92 GDALDataset* m_dataset;
94 /// Thumbnail texture.
95 GLuint m_thumbnail;
97 /// Transformation from projection to geographical coordinates.
98 OGRCoordinateTransformation* m_projToGeo;
100 /// Transformation from geographical coordinates to projection.
101 OGRCoordinateTransformation* m_geoToProj;
103 /// Transformation from projection to pixel, lines.
104 tcAffineTransform2<double> m_pixelsToProj;
106 /// Transformation from pixel, lines to projection.
107 tcAffineTransform2<double> m_projToPixels;
109 /// Transformation from texture to geo.
110 tcAffineTransform2<double> m_texToGeo;
112 /// Transformation from geo to texture.
113 tcAffineTransform2<double> m_geoToTex;
116 #endif