1 /***************************************************************************
2 * This file is part of Tecorrec. *
3 * Copyright 2008 James Hogan <james@albanarts.com> *
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. *
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. *
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_
24 * @file tcChannelFile.h
25 * @brief An image channel from an image file.
28 #include "tcChannel.h"
30 #include "tcAffineTransform.h"
33 class OGRCoordinateTransformation
;
35 /// An image channel from an image file.
36 class tcChannelFile
: public tcChannel
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
);
48 virtual ~tcChannelFile();
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
65 virtual GLuint
thumbnailTexture();
70 * Interface for derived class to implement
74 virtual void roundPortion(double* x1
, double* y1
, double* x2
, double* y2
);
77 virtual tcAbstractPixelData
* loadPortion(double x1
, double y1
, double x2
, double y2
, bool changed
);
85 /// Width of the image file.
88 /// Height of the image file.
91 /// GDAL dataset object.
92 GDALDataset
* m_dataset
;
94 /// Thumbnail texture.
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
;