All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RasterTransform.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2001-2009 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib 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 Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file RasterTransform.h
22 
23  \brief A Raster Transform is a class that defines functions to transform a styled raster.
24 */
25 
26 // TerraLib
27 #include "RasterTransform.h"
28 
29 #include "../raster.h"
30 #include "../raster/RasterProperty.h"
31 #include "../se/RasterSymbolizer.h"
32 
33 // STL
34 #include <limits>
35 
37  m_rasterIn(input),
38  m_rasterOut(output),
39  m_transp(TE_OPAQUE),
40  m_gain(1.),
41  m_offset(0.),
42  m_rContrast(TE_SE_DEFAULT_GAMMA_VALUE),
43  m_gContrast(TE_SE_DEFAULT_GAMMA_VALUE),
44  m_bContrast(TE_SE_DEFAULT_GAMMA_VALUE),
45  m_mContrast(TE_SE_DEFAULT_GAMMA_VALUE),
46  m_monoBand(0),
47  m_monoBandOut(0),
48  m_transfFuncPtr(&RasterTransform::setExtractRGB),
49  m_RGBAFuncPtr(&RasterTransform::getExtractRGB)
50 {
51  m_rstMinValue = -std::numeric_limits<double>::max();
52  m_rstMaxValue = std::numeric_limits<double>::max();
53 }
54 
56 {
57  m_categorizeMap.clear();
58  m_interpolateMap.clear();
59  m_rgbMap.clear();
60 }
61 
62 void te::map::RasterTransform::setRGBMap(std::map<RGBChannels, short>& rgbMap)
63 {
64  m_rgbMap.clear();
65  m_rgbMap[RED_CHANNEL] = -1;
66  m_rgbMap[GREEN_CHANNEL] = -1;
67  m_rgbMap[BLUE_CHANNEL] = -1;
68 
69  std::map<RGBChannels,short>::iterator it = m_rgbMap.begin();
70  while (it != m_rgbMap.end())
71  {
72  if (it->first == RED_CHANNEL)
73  m_rgbMap[RED_CHANNEL] = it->second;
74 
75  else if (it->first == GREEN_CHANNEL)
76  m_rgbMap[GREEN_CHANNEL] = it->second;
77 
78  else if (it->first == BLUE_CHANNEL)
79  m_rgbMap[BLUE_CHANNEL] = it->second;
80 
81  ++it;
82  }
83 }
84 
85 void te::map::RasterTransform::setLinearTransfParameters(double vmin, double vmax, double rmin, double rmax)
86 {
87  m_rstMinValue = rmin;
88  m_rstMaxValue = rmax;
89 
90  if( vmax == vmin )
91  {
92  m_gain = 0.0;
93  m_offset = 0.0;
94  }
95  else
96  {
97  m_gain = (double)(rmax-rmin)/(vmax-vmin);
98  m_offset = -1*m_gain*vmin+rmin;
99  }
100 }
101 
103 {
104  if (m_transfFuncPtr == 0 || m_RGBAFuncPtr)
105  {
106  return NO_TRANSF;
107  }
108  else if (m_transfFuncPtr == &RasterTransform::setMono2ThreeBand &&
109  m_RGBAFuncPtr == &RasterTransform::getMono2ThreeBand)
110  {
111  return MONO2THREE_TRANSF;
112  }
113  else if (m_transfFuncPtr == &RasterTransform::setExtractRGB &&
114  m_RGBAFuncPtr == &RasterTransform::getExtractRGB)
115  {
116  return EXTRACT2RGB_TRANSF;
117  }
118  else if (m_transfFuncPtr == &RasterTransform::setRed2ThreeBand &&
119  m_RGBAFuncPtr == &RasterTransform::getRed2ThreeBand)
120  {
121  return RED2THREE_TRANSF;
122  }
123  else if (m_transfFuncPtr == &RasterTransform::setGreen2ThreeBand &&
124  m_RGBAFuncPtr == &RasterTransform::getGreen2ThreeBand)
125  {
126  return GREEN2THREE_TRANSF;
127  }
128  else if (m_transfFuncPtr == &RasterTransform::setBlue2ThreeBand &&
129  m_RGBAFuncPtr == &RasterTransform::getBlue2ThreeBand)
130  {
131  return BLUE2THREE_TRANSF;
132  }
133  else if (m_transfFuncPtr == &RasterTransform::setCategorize &&
134  m_RGBAFuncPtr == &RasterTransform::getCategorize)
135  {
136  return CATEGORIZE_TRANSF;
137  }
138  else if (m_transfFuncPtr == &RasterTransform::setInterpolate &&
139  m_RGBAFuncPtr == &RasterTransform::getInterpolate)
140  {
141  return INTERPOLATE_TRANSF;
142  }
143  else if (m_transfFuncPtr == &RasterTransform::setBand2Band)
144  {
145  return BAND2BAND_TRANSF;
146  }
147  else
148  {
149  return NO_TRANSF;
150  }
151 }
152 
154 {
155  if (func == MONO2THREE_TRANSF)
156  {
157  m_transfFuncPtr = &RasterTransform::setMono2ThreeBand;
158  m_RGBAFuncPtr = &RasterTransform::getMono2ThreeBand;
159  }
160  else if (func == EXTRACT2RGB_TRANSF)
161  {
162  m_transfFuncPtr = &RasterTransform::setExtractRGB;
163  m_RGBAFuncPtr = &RasterTransform::getExtractRGB;
164  }
165  else if (func == RED2THREE_TRANSF)
166  {
167  m_transfFuncPtr = &RasterTransform::setRed2ThreeBand;
168  m_RGBAFuncPtr = &RasterTransform::getRed2ThreeBand;
169  }
170  else if (func == GREEN2THREE_TRANSF)
171  {
172  m_transfFuncPtr = &RasterTransform::setGreen2ThreeBand;
173  m_RGBAFuncPtr = &RasterTransform::getGreen2ThreeBand;
174  }
175  else if (func == BLUE2THREE_TRANSF)
176  {
177  m_transfFuncPtr = &RasterTransform::setBlue2ThreeBand;
178  m_RGBAFuncPtr = &RasterTransform::getBlue2ThreeBand;
179  }
180  else if (func == CATEGORIZE_TRANSF)
181  {
182  m_transfFuncPtr = &RasterTransform::setCategorize;
183  m_RGBAFuncPtr = &RasterTransform::getCategorize;
184  }
185  else if (func == INTERPOLATE_TRANSF)
186  {
187  m_transfFuncPtr = &RasterTransform::setInterpolate;
188  m_RGBAFuncPtr = &RasterTransform::getInterpolate;
189  }
190  else if (func == BAND2BAND_TRANSF)
191  {
192  m_transfFuncPtr = &RasterTransform::setBand2Band;
193  m_RGBAFuncPtr = 0;
194  }
195  else if (func == EXTRACT2RGBA_TRANSF)
196  {
197  m_transfFuncPtr = &RasterTransform::setExtractRGBA;
198  m_RGBAFuncPtr = &RasterTransform::getExtractRGBA;
199  }
200  else
201  {
202  m_transfFuncPtr = 0;
203  m_RGBAFuncPtr = 0;
204  }
205 }
206 
207 void te::map::RasterTransform::setMono2ThreeBand(double icol, double ilin, double ocol, double olin)
208 {
209  double val;
210 
211  m_rasterIn->getValue((int)icol, (int)ilin, val, m_monoBand);
212 
213  if(checkNoValue(val, m_monoBand) == false)
214  {
215  val = (val * m_gain + m_offset) * m_mContrast;
216 
217  fixValue(val);
218 
219  std::vector<double> vecValues;
220  vecValues.resize(3, val);
221 
222  m_rasterOut->setValues((int)ocol, (int)olin, vecValues);
223  }
224 }
225 
227 {
228  double val;
229 
230  m_rasterIn->getValue((int)icol, (int)ilin, val, m_monoBand);
231 
232  if(checkNoValue(val, m_monoBand) == false)
233  {
234  val = (val * m_gain + m_offset) * m_mContrast;
235 
236  fixValue(val);
237 
238  te::color::RGBAColor c(static_cast<int>(val), static_cast<int>(val), static_cast<int>(val), static_cast<int>(m_transp));
239 
240  return c;
241  }
242 
243  return te::color::RGBAColor();
244 }
245 
246 void te::map::RasterTransform::setExtractRGB(double icol, double ilin, double ocol, double olin)
247 {
248  double valR, valG, valB;
249 
250  m_rasterIn->getValue((int)icol, (int)ilin, valR, m_rgbMap[RED_CHANNEL]);
251  m_rasterIn->getValue((int)icol, (int)ilin, valG, m_rgbMap[GREEN_CHANNEL]);
252  m_rasterIn->getValue((int)icol, (int)ilin, valB, m_rgbMap[BLUE_CHANNEL]);
253 
254  if(checkNoValue(valR, m_rgbMap[RED_CHANNEL]) == false ||
255  checkNoValue(valG, m_rgbMap[GREEN_CHANNEL]) == false ||
256  checkNoValue(valB, m_rgbMap[BLUE_CHANNEL]) == false)
257  {
258  std::vector<double> vecValues;
259 
260  valR = (valR * m_gain + m_offset) * m_rContrast;
261  fixValue(valR);
262  vecValues.push_back(valR);
263 
264  valG = (valG * m_gain + m_offset) * m_gContrast;
265  fixValue(valG);
266  vecValues.push_back(valG);
267 
268  valB = (valB * m_gain + m_offset) * m_bContrast;
269  fixValue(valB);
270  vecValues.push_back(valB);
271 
272  m_rasterOut->setValues((int)ocol, (int)olin, vecValues);
273  }
274 }
275 
277 {
278  double valR, valG, valB;
279 
280  m_rasterIn->getValue((int)icol, (int)ilin, valR, m_rgbMap[RED_CHANNEL]);
281  m_rasterIn->getValue((int)icol, (int)ilin, valG, m_rgbMap[GREEN_CHANNEL]);
282  m_rasterIn->getValue((int)icol, (int)ilin, valB, m_rgbMap[BLUE_CHANNEL]);
283 
284  if(checkNoValue(valR, m_rgbMap[RED_CHANNEL]) == false ||
285  checkNoValue(valG, m_rgbMap[GREEN_CHANNEL]) == false ||
286  checkNoValue(valB, m_rgbMap[BLUE_CHANNEL]) == false)
287  {
288  valR = (valR * m_gain + m_offset) * m_rContrast;
289  fixValue(valR);
290 
291  valG = (valG * m_gain + m_offset) * m_gContrast;
292  fixValue(valG);
293 
294  valB = (valB * m_gain + m_offset) * m_bContrast;
295  fixValue(valB);
296 
297  te::color::RGBAColor c(static_cast<int>(valR), static_cast<int>(valG), static_cast<int>(valB), static_cast<int>(m_transp));
298 
299  return c;
300  }
301 
302  return te::color::RGBAColor();
303 }
304 
305 void te::map::RasterTransform::setExtractRGBA(double icol, double ilin, double ocol, double olin)
306 {
307  double valR, valG, valB, valA;
308 
309  m_rasterIn->getValue((int)icol, (int)ilin, valR, m_rgbMap[RED_CHANNEL]);
310  m_rasterIn->getValue((int)icol, (int)ilin, valG, m_rgbMap[GREEN_CHANNEL]);
311  m_rasterIn->getValue((int)icol, (int)ilin, valB, m_rgbMap[BLUE_CHANNEL]);
312  m_rasterIn->getValue((int)icol, (int)ilin, valA, m_rgbMap[ALPHA_CHANNEL]);
313 
314  if(checkNoValue(valR, m_rgbMap[RED_CHANNEL]) == false ||
315  checkNoValue(valG, m_rgbMap[GREEN_CHANNEL]) == false ||
316  checkNoValue(valB, m_rgbMap[BLUE_CHANNEL]) == false ||
317  checkNoValue(valA, m_rgbMap[ALPHA_CHANNEL]) == false)
318  {
319  std::vector<double> vecValues;
320 
321  valR = (valR * m_gain + m_offset) * m_rContrast;
322  fixValue(valR);
323  vecValues.push_back(valR);
324 
325  valG = (valG * m_gain + m_offset) * m_gContrast;
326  fixValue(valG);
327  vecValues.push_back(valG);
328 
329  valB = (valB * m_gain + m_offset) * m_bContrast;
330  fixValue(valB);
331  vecValues.push_back(valB);
332 
333  fixValue(valA);
334  vecValues.push_back(valB);
335 
336  m_rasterOut->setValues((int)ocol, (int)olin, vecValues);
337  }
338 }
339 
341 {
342  double valR, valG, valB, valA;
343 
344  m_rasterIn->getValue((int)icol, (int)ilin, valR, m_rgbMap[RED_CHANNEL]);
345  m_rasterIn->getValue((int)icol, (int)ilin, valG, m_rgbMap[GREEN_CHANNEL]);
346  m_rasterIn->getValue((int)icol, (int)ilin, valB, m_rgbMap[BLUE_CHANNEL]);
347  m_rasterIn->getValue((int)icol, (int)ilin, valA, m_rgbMap[ALPHA_CHANNEL]);
348 
349  if(checkNoValue(valR, m_rgbMap[RED_CHANNEL]) == false ||
350  checkNoValue(valG, m_rgbMap[GREEN_CHANNEL]) == false ||
351  checkNoValue(valB, m_rgbMap[BLUE_CHANNEL]) == false ||
352  checkNoValue(valA, m_rgbMap[ALPHA_CHANNEL]) == false)
353  {
354  valR = (valR * m_gain + m_offset) * m_rContrast;
355  fixValue(valR);
356 
357  valG = (valG * m_gain + m_offset) * m_gContrast;
358  fixValue(valG);
359 
360  valB = (valB * m_gain + m_offset) * m_bContrast;
361  fixValue(valB);
362 
363  fixValue(valA);
364 
365  if(valA < m_transp)
366  return te::color::RGBAColor(static_cast<int>(valR), static_cast<int>(valG), static_cast<int>(valB), static_cast<int>(valA));
367  else
368  return te::color::RGBAColor(static_cast<int>(valR), static_cast<int>(valG), static_cast<int>(valB), static_cast<int>(m_transp));
369  }
370 
371  return te::color::RGBAColor();
372 }
373 
374 void te::map::RasterTransform::setRed2ThreeBand(double icol, double ilin, double ocol, double olin)
375 {
376  double val;
377 
378  m_rasterIn->getValue((int)icol, (int)ilin, val, m_rgbMap[RED_CHANNEL]);
379 
380  if(checkNoValue(val, m_rgbMap[RED_CHANNEL]) == false)
381  {
382  val = (val * m_gain + m_offset) * m_rContrast;
383 
384  fixValue(val);
385 
386  std::vector<double> vecValues;
387  vecValues.push_back(val);
388  vecValues.push_back(0.);
389  vecValues.push_back(0.);
390 
391  m_rasterOut->setValues((int)ocol, (int)olin, vecValues);
392  }
393 }
394 
396 {
397  double val;
398 
399  m_rasterIn->getValue((int)icol, (int)ilin, val, m_rgbMap[RED_CHANNEL]);
400 
401  if(checkNoValue(val, m_rgbMap[RED_CHANNEL]) == false)
402  {
403  val = (val * m_gain + m_offset) * m_rContrast;
404 
405  fixValue(val);
406 
407  te::color::RGBAColor c(static_cast<int>(val), static_cast<int>(0.), static_cast<int>(0.), static_cast<int>(m_transp));
408 
409  return c;
410 
411  }
412 
413  return te::color::RGBAColor();
414 }
415 
416 void te::map::RasterTransform::setGreen2ThreeBand(double icol, double ilin, double ocol, double olin)
417 {
418  double val;
419 
420  m_rasterIn->getValue((int)icol, (int)ilin, val, m_rgbMap[GREEN_CHANNEL]);
421 
422  if(checkNoValue(val, m_rgbMap[GREEN_CHANNEL]) == false)
423  {
424  val = (val * m_gain + m_offset) * m_gContrast;
425 
426  fixValue(val);
427 
428  std::vector<double> vecValues;
429  vecValues.push_back(0.);
430  vecValues.push_back(val);
431  vecValues.push_back(0.);
432 
433  m_rasterOut->setValues((int)ocol, (int)olin, vecValues);
434  }
435 }
436 
438 {
439  double val;
440 
441  m_rasterIn->getValue((int)icol, (int)ilin, val, m_rgbMap[GREEN_CHANNEL]);
442 
443  if(checkNoValue(val, m_rgbMap[GREEN_CHANNEL]) == false)
444  {
445  val = (val * m_gain + m_offset) * m_gContrast;
446 
447  fixValue(val);
448 
449  te::color::RGBAColor c(static_cast<int>(0.), static_cast<int>(val), static_cast<int>(0.), static_cast<int>(m_transp));
450 
451  return c;
452 
453  }
454 
455  return te::color::RGBAColor();
456 }
457 
458 void te::map::RasterTransform::setBlue2ThreeBand(double icol, double ilin, double ocol, double olin)
459 {
460  double val;
461 
462  m_rasterIn->getValue((int)icol, (int)ilin, val, m_rgbMap[BLUE_CHANNEL]);
463 
464  if(checkNoValue(val, m_rgbMap[BLUE_CHANNEL]) == false)
465  {
466  val = (val * m_gain + m_offset) * m_bContrast;
467 
468  fixValue(val);
469 
470  std::vector<double> vecValues;
471  vecValues.push_back(0.);
472  vecValues.push_back(0.);
473  vecValues.push_back(val);
474 
475  m_rasterOut->setValues((int)ocol, (int)olin, vecValues);
476  }
477 }
478 
480 {
481  double val;
482 
483  m_rasterIn->getValue((int)icol, (int)ilin, val, m_rgbMap[BLUE_CHANNEL]);
484 
485  if(checkNoValue(val, m_rgbMap[BLUE_CHANNEL]) == false)
486  {
487  val = (val * m_gain + m_offset) * m_bContrast;
488 
489  fixValue(val);
490 
491  te::color::RGBAColor c(static_cast<int>(0.), static_cast<int>(0.), static_cast<int>(val), static_cast<int>(m_transp));
492 
493  return c;
494 
495  }
496 
497  return te::color::RGBAColor();
498 }
499 
500 void te::map::RasterTransform::setCategorize(double icol, double ilin, double ocol, double olin)
501 {
502  double val;
503 
504  m_rasterIn->getValue((int)icol, (int)ilin, val, m_monoBand);
505 
506  te::color::RGBAColor c= getCategorizedColor(val);
507 
508  std::vector<double> vecValues;
509  vecValues.push_back(c.getRed());
510  vecValues.push_back(c.getGreen());
511  vecValues.push_back(c.getBlue());
512 
513  m_rasterOut->setValues((int)ocol, (int)olin, vecValues);
514 }
515 
517 {
518  double val;
519 
520  m_rasterIn->getValue((int)icol, (int)ilin, val, m_monoBand);
521 
522  return getCategorizedColor(val);
523 }
524 
525 void te::map::RasterTransform::setInterpolate(double icol, double ilin, double ocol, double olin)
526 {
527  double val;
528 
529  m_rasterIn->getValue((int)icol, (int)ilin, val, m_monoBand);
530 
531  te::color::RGBAColor c= getInterpolatedColor(val);
532 
533  std::vector<double> vecValues;
534  vecValues.push_back(c.getRed());
535  vecValues.push_back(c.getGreen());
536  vecValues.push_back(c.getBlue());
537 
538  m_rasterOut->setValues((int)ocol, (int)olin, vecValues);
539 }
540 
542 {
543  double val;
544 
545  m_rasterIn->getValue((int)icol, (int)ilin, val, m_monoBand);
546 
547  return getInterpolatedColor(val);
548 }
549 
550 void te::map::RasterTransform::setBand2Band(double icol, double ilin, double ocol, double olin)
551 {
552  double val;
553 
554  for(std::size_t t = 0; t < m_rasterIn->getNumberOfBands(); ++t)
555  {
556  m_rasterIn->getValue((int)icol, (int)ilin, val, t);
557 
558  if(checkNoValue(val, t) == false)
559  {
560  val = (val * m_gain + m_offset);
561 
562  fixValue(val);
563 
564  m_rasterOut->setValue((int)ocol, (int)olin, val, t);
565  }
566  }
567 }
568 
570 {
571  if (value < m_rstMinValue)
572  {
573  value = m_rstMinValue;
574  }
575  else if (value > m_rstMaxValue)
576  {
577  value = m_rstMaxValue;
578  }
579 }
580 
581 bool te::map::RasterTransform::checkNoValue(double& value, int band)
582 {
583  if(m_rasterIn->getBand(band)->getProperty()->m_noDataValue == value)
584  {
585  return true;
586  }
587 
588  return false;
589 }
590 
592 {
593  InterpolatedMap::iterator it = m_interpolateMap.begin();
594 
595  while(it != m_interpolateMap.end())
596  {
597  RasterThreshold rt = it->first;
598 
599  if(rt.first<= value && rt.second > value)
600  {
601  int distance = int(value - it->first.first);
602 
603  if(distance < 0)
604  {
605  distance = 0;
606  }
607  else if(distance >= (int)it->second.getColorBar().size())
608  {
609  distance = it->second.getColorBar().size() - 1;
610  }
611 
612  return it->second.getColorBar()[distance];
613  }
614 
615  ++it;
616  }
617 
618  return te::color::RGBAColor();
619 }
620 
622 {
623  CategorizedMap::iterator it = m_categorizeMap.begin();
624 
625  while(it != m_categorizeMap.end())
626  {
627  RasterThreshold rt = it->first;
628 
629  if(rt.first<= value && rt.second > value)
630  {
631  return it->second;
632  }
633 
634  ++it;
635  }
636 
637  return te::color::RGBAColor();
638 }
void setCategorize(double icol, double ilin, double ocol, double olin)
void setTransfFunction(RasterTransfFunctions func)
te::color::RGBAColor getInterpolatedColor(double value)
A Raster Transform is a class that defines functions to transform a styled raster.
void setRGBMap(std::map< RGBChannels, short > &rgbMap)
Sets the rgb map values.
int getRed() const
It returns the red component color value (a value from 0 to 255).
Definition: RGBAColor.h:295
double m_rstMinValue
Min value from input raster.
void setGreen2ThreeBand(double icol, double ilin, double ocol, double olin)
void setInterpolate(double icol, double ilin, double ocol, double olin)
void setBand2Band(double icol, double ilin, double ocol, double olin)
void setExtractRGBA(double icol, double ilin, double ocol, double olin)
void setMono2ThreeBand(double icol, double ilin, double ocol, double olin)
int getBlue() const
It returns the blue component color value (a value from 0 to 255).
Definition: RGBAColor.h:305
te::color::RGBAColor getMono2ThreeBand(double icol, double ilin)
int getGreen() const
It returns the green component color value (a value from 0 to 255).
Definition: RGBAColor.h:300
double m_rstMaxValue
Max value from input raster.
RasterTransfFunctions getTransfFunction()
void setLinearTransfParameters(double vmin, double vmax, double rmin, double rmax)
Set parameters of linear transformation.
void setRed2ThreeBand(double icol, double ilin, double ocol, double olin)
An abstract class for raster data strucutures.
Definition: Raster.h:71
te::color::RGBAColor getGreen2ThreeBand(double icol, double ilin)
#define TE_OPAQUE
For an RGBA color this is the value of the alpha-channel for totally opaque.
Definition: Config.h:39
RasterTransform(te::rst::Raster *input, te::rst::Raster *output)
Constructor.
te::color::RGBAColor getBlue2ThreeBand(double icol, double ilin)
void setBlue2ThreeBand(double icol, double ilin, double ocol, double olin)
te::color::RGBAColor getCategorizedColor(double value)
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
Definition: RGBAColor.h:57
#define TE_SE_DEFAULT_GAMMA_VALUE
It specifies the default gamma value.
Definition: Config.h:107
te::color::RGBAColor getInterpolate(double icol, double ilin)
A Raster Transform is a class that defines functions to transform a styled raster.
te::color::RGBAColor getExtractRGB(double icol, double ilin)
void setExtractRGB(double icol, double ilin, double ocol, double olin)
std::pair< double, double > RasterThreshold
te::color::RGBAColor getExtractRGBA(double icol, double ilin)
bool checkNoValue(double &value, int band)
Function used to check if value is or not a valid value.
te::color::RGBAColor getRed2ThreeBand(double icol, double ilin)
void fixValue(double &value)
te::color::RGBAColor getCategorize(double icol, double ilin)