27 #include "../../../common/STLUtils.h" 28 #include "../../../dataaccess/dataset/DataSet.h" 29 #include "../../../dataaccess/utils/Utils.h" 30 #include "../../../geometry.h" 31 #include "../../../maptools/DataSetLayer.h" 32 #include "../../../maptools/RasterTransform.h" 33 #include "../../../maptools/RasterTransformConfigurer.h" 34 #include "../../../qt/widgets/canvas/Canvas.h" 35 #include "../../../qt/widgets/canvas/MapDisplay.h" 36 #include "../../../raster/Raster.h" 37 #include "../../../raster/RasterSummary.h" 38 #include "../../../raster/RasterSummaryManager.h" 39 #include "../../../raster/Utils.h" 40 #include "../../../se/Utils.h" 41 #include "../../../se.h" 45 #include <QMouseEvent> 62 if(e->button() != Qt::LeftButton)
66 #if QT_VERSION >= 0x050000 84 const std::vector<te::se::Symbolizer*>& symbolizers = rule->
getSymbolizers();
85 assert(!symbolizers.empty());
92 std::unique_ptr<te::da::DataSet>
ds =
m_layer->getData();
109 const std::complex<double>* cmin = rsMin->at(0).m_minVal;
110 const std::complex<double>* cmax = rsMax->at(0).m_maxVal;
121 te::gm::Coord2D coord = inputRst->getGrid()->geoToGrid(qpoint.x(), qpoint.y());
126 if((x >=0 && x < (
int)inputRst->getNumberOfColumns()) && (y >=0 && y < (
int)inputRst->getNumberOfRows()))
128 QString information(
"<h2>Read Pixel</h2><ul>");
130 information +=
"<h3>Location</h3>";
132 QString column,
line, xCoord, yCoord;
135 xCoord.setNum(qpoint.x());
136 yCoord.setNum(qpoint.y());
138 information +=
"<li><b>" + QString(
"Line ") +
":</b> " + line +
"</li>";
139 information +=
"<li><b>" + QString(
"Column ") +
":</b> " + column +
"</li>";
140 information +=
"<li><b>" + QString(
"Coord X ") +
":</b> " + xCoord +
"</li>";
141 information +=
"<li><b>" + QString(
"Coord Y ") +
":</b> " + yCoord +
"</li>";
143 information +=
"<h3>Original Values</h3>";
145 for(
size_t t = 0; t < inputRst->getNumberOfBands(); ++t )
148 inputRst->getValue(x, y, val, t);
154 information +=
"<li><b>" + QString(
"Value for band ") + band +
":</b> " + value +
"</li>";
160 information +=
"<h3>Transformed Values</h3>";
162 QString red, green, blue, alpha;
163 red.setNum(color.
getRed());
168 QString rBand, gBand, bBand;
173 information +=
"<li><b>" + QString(
"Red Channel: </b>") + rBand +
"<b> - Value:</b> " + red +
"</li>";
174 information +=
"<li><b>" + QString(
"Green Channel: </b>") + gBand +
"<b> - Value:</b> " + green +
"</li>";
175 information +=
"<li><b>" + QString(
"Blue Channel: </b>") + bBand +
"<b> - Value:</b> " + blue +
"</li>";
176 information +=
"<li><b>" + QString(
"Alpha Channel value") +
":</b> " + alpha +
"</li>";
179 information +=
"<h3>Symbolizer</h3>";
185 type =
"RGB Composition";
189 type =
"Gray Composition";
193 type =
"Unknown Composition";
196 information +=
"<li><b>" + QString(
"Color Composition ") +
":</b> " + type +
"</li>";
201 information +=
"<li><b>" + QString(
"Opacity Value ") +
":</b> " + opacity +
"</li>";
207 information +=
"<li><b>" + QString(
"Gain Value ") +
":</b> " + gain +
"</li>";
213 information +=
"<li><b>" + QString(
"Offset Value ") +
":</b> " + offset +
"</li>";
216 if(rs->getChannelSelection()->getRedChannel() &&
217 rs->getChannelSelection()->getRedChannel()->getContrastEnhancement())
220 c.setNum(rs->getChannelSelection()->getRedChannel()->getContrastEnhancement()->getGammaValue());
222 information +=
"<li><b>" + QString(
"Red Contrast") +
":</b> " + c +
"</li>";
225 if(rs->getChannelSelection()->getGreenChannel() &&
226 rs->getChannelSelection()->getGreenChannel()->getContrastEnhancement())
229 c.setNum(rs->getChannelSelection()->getGreenChannel()->getContrastEnhancement()->getGammaValue());
231 information +=
"<li><b>" + QString(
"Green Contraste") +
":</b> " + c +
"</li>";
234 if(rs->getChannelSelection()->getBlueChannel() &&
235 rs->getChannelSelection()->getBlueChannel()->getContrastEnhancement())
238 c.setNum(rs->getChannelSelection()->getBlueChannel()->getContrastEnhancement()->getGammaValue());
240 information +=
"<li><b>" + QString(
"Blue Contraste") +
":</b> " + c +
"</li>";
243 if(rs->getChannelSelection()->getGrayChannel() &&
244 rs->getChannelSelection()->getGrayChannel()->getContrastEnhancement())
247 c.setNum(rs->getChannelSelection()->getGrayChannel()->getContrastEnhancement()->getGammaValue());
249 information +=
"<li><b>" + QString(
"Gray Contraste") +
":</b> " + c +
"</li>";
252 information +=
"</ul>";
int getRed() const
It returns the red component color value (a value from 0 to 255).
The CoverageStyle defines the styling that is to be applied to a subset of Coverage data...
int getBlue() const
It returns the blue component color value (a value from 0 to 255).
int getGreen() const
It returns the green component color value (a value from 0 to 255).
An utility struct for representing 2D coordinates.
static te::dt::Date ds(2010, 01, 01)
Rule * getRule(std::size_t i) const
static RasterSummaryManager & getInstance()
It returns a reference to the singleton instance.
An abstract class for raster data strucutures.
virtual te::se::Style * getStyle() const
It returns the Style associated to the layer.
TERASTEREXPORT int Round(double val)
Round a double value to a integer value.
int getAlpha() const
It returns the alpha component color value (a value from 0 to 255).
boost::ptr_vector< BandSummary > RasterSummary
RasterSummary is just a typedef of a boost::ptr_vector.
The RasterSymbolizer describes how to render raster/matrix-coverage data (e.g., satellite photos...
const std::vector< Symbolizer * > & getSymbolizers() const
A Rule is used to attach property/scale conditions to and group the individual symbols used for rende...
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
A layer with reference to a dataset.
TEDATAACCESSEXPORT std::size_t GetFirstPropertyPos(const te::da::DataSet *dataset, int datatype)
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
TESEEXPORT std::string GetString(const te::se::ParameterValue *param)
It gets the parameter value as a string.