Remove class predefinition for deleted tcHLImage
[tecorrec.git] / geo / tcChannel.h
blob0b7659957274b56b1d2e73fd2f12c1a0ba1335e9
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 _tcChannel_h_
21 #define _tcChannel_h_
23 /**
24 * @file tcChannel.h
25 * @brief A single abstract image channel.
28 #include "tcPixelData.h"
30 #include <QString>
32 #include <GL/gl.h>
34 /// A single abstract image channel.
35 class tcChannel
37 public:
40 * Constructors + destructor
43 /// Primary constructor.
44 tcChannel(const QString& name, const QString& description);
46 /// Destructor.
47 virtual ~tcChannel();
50 * Metadata
53 /// Get the channel name.
54 const QString& name() const;
56 /// Get the channel description;
57 const QString& description() const;
59 /// Set the channel name.
60 void setName(const QString& name);
62 /// Set the channel description.
63 void setDescription(const QString& description);
66 * Main image interface
69 /// Get GL texture ID of thumbnail of the channel.
70 virtual GLuint thumbnailTexture() = 0;
72 /// Get a reference to the pixel data of a portion of the image.
73 Reference<tcAbstractPixelData> portion(double* x1, double* y1, double* x2, double* y2);
75 /// Get GL texture ID of portion of the channel.
76 GLuint portionTexture(double* x1, double* y1, double* x2, double* y2);
78 protected:
81 * Interface for derived class to implement
84 /// Round coordinates to sensible values.
85 virtual void roundPortion(double* x1, double* y1, double* x2, double* y2) = 0;
87 /// Load a portion of pixel data from the channel source, wherever that may be.
88 virtual tcAbstractPixelData* loadPortion(double x1, double y1, double x2, double y2) = 0;
91 * Interface for derived classes
94 /** Invalidate this channel.
95 * For example if one of the inputs has changed.
97 void invalidate();
99 /** Revalidate the channel, indicating that the data has changed.
100 * For example after the content has been recalculated after an invalidation.
102 void revalidate();
104 private:
107 * Variables
110 /// Name of the channel.
111 QString m_name;
113 /// Description of the channel.
114 QString m_description;
116 /// Pixel data of a portion of the channel.
117 Reference<tcAbstractPixelData> m_portion;
119 /// Portion coordinates.
120 double m_portionPosition[2][2];
123 #endif