OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimHsiRemapper.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 // Copyright (C) 2002 ImageLinks Inc.
3 //
4 // License: LGPL
5 //
6 // See LICENSE.txt file in the top level directory for more details.
7 //
8 // Author: David Burken
9 //
10 // Description:
11 //
12 // Remapper to adjust hue, saturation and intensity.
13 //
14 //*************************************************************************
15 // $Id: ossimHsiRemapper.cpp 19714 2011-06-03 17:23:45Z gpotts $
16 
17 #include <cstdlib>
19 #include <ossim/base/ossimTrace.h>
25 
27 
28 static ossimTrace traceDebug("ossimHsiRemapper:debug");
29 
30 //***
31 // State keywords:
32 //***
33 static const char MASTER_HUE_OFFSET_KW[] = "hsi_master_hue_offset";
34 static const char MASTER_SATURATION_OFFSET_KW[] = "hsi_master_saturation_offset";
35 static const char MASTER_INTENSITY_OFFSET_KW[] = "hsi_master_intensity_offset";
36 static const char MASTER_INTENSITY_LOW_CLIP_KW[] = "hsi_master_intensity_low_clip";
37 static const char MASTER_INTENSITY_HIGH_CLIP_KW[] = "hsi_master_intensity_high_clip";
38 
39 static const char RED_HUE_OFFSET_KW[] = "hsi_red_hue_offset";
40 static const char RED_HUE_LOW_RANGE_KW[] = "hsi_red_hue_low_range";
41 static const char RED_HUE_HIGH_RANGE_KW[] = "hsi_red_hue_high_range";
42 static const char RED_HUE_BLEND_RANGE_KW[] = "hsi_red_hue_blend_range";
43 static const char RED_SATURATION_OFFSET_KW[] = "hsi_red_saturation_offset";
44 static const char RED_INTENSITY_OFFSET_KW[] = "hsi_red_intensity_offset";
45 
46 static const char YELLOW_HUE_OFFSET_KW[] = "hsi_yellow_hue_offset";
47 static const char YELLOW_HUE_LOW_RANGE_KW[] = "hsi_yellow_hue_low_range";
48 static const char YELLOW_HUE_HIGH_RANGE_KW[] = "hsi_yellow_hue_high_range";
49 static const char YELLOW_HUE_BLEND_RANGE_KW[] = "hsi_yellow_hue_blend_range";
50 static const char YELLOW_SATURATION_OFFSET_KW[] = "hsi_yellow_saturation_offset";
51 static const char YELLOW_INTENSITY_OFFSET_KW[] = "hsi_yellow_intensity_offset";
52 
53 static const char GREEN_HUE_OFFSET_KW[] = "hsi_green_hue_offset";
54 static const char GREEN_HUE_LOW_RANGE_KW[] = "hsi_green_hue_low_range";
55 static const char GREEN_HUE_HIGH_RANGE_KW[] = "hsi_green_hue_high_range";
56 static const char GREEN_HUE_BLEND_RANGE_KW[] = "hsi_green_hue_blend_range";
57 static const char GREEN_SATURATION_OFFSET_KW[] = "hsi_green_saturation_offset";
58 static const char GREEN_INTENSITY_OFFSET_KW[] = "hsi_green_intensity_offset";
59 
60 static const char CYAN_HUE_OFFSET_KW[] = "hsi_cyan_hue_offset";
61 static const char CYAN_HUE_LOW_RANGE_KW[] = "hsi_cyan_hue_low_range";
62 static const char CYAN_HUE_HIGH_RANGE_KW[] = "hsi_cyan_hue_high_range";
63 static const char CYAN_HUE_BLEND_RANGE_KW[] = "hsi_cyan_hue_blend_range";
64 static const char CYAN_SATURATION_OFFSET_KW[] = "hsi_cyan_saturation_offset";
65 static const char CYAN_INTENSITY_OFFSET_KW[] = "hsi_cyan_intensity_offset";
66 
67 static const char BLUE_HUE_OFFSET_KW[] = "hsi_blue_hue_offset";
68 static const char BLUE_HUE_LOW_RANGE_KW[] = "hsi_blue_hue_low_range";
69 static const char BLUE_HUE_HIGH_RANGE_KW[] = "hsi_blue_hue_high_range";
70 static const char BLUE_HUE_BLEND_RANGE_KW[] = "hsi_blue_hue_blend_range";
71 static const char BLUE_SATURATION_OFFSET_KW[] = "hsi_blue_saturation_offset";
72 static const char BLUE_INTENSITY_OFFSET_KW[] = "hsi_blue_intensity_offset";
73 
74 static const char MAGENTA_HUE_OFFSET_KW[] = "hsi_magenta_hue_offset";
75 static const char MAGENTA_HUE_LOW_RANGE_KW[] = "hsi_magenta_hue_low_range";
76 static const char MAGENTA_HUE_HIGH_RANGE_KW[] = "hsi_magenta_hue_high_range";
77 static const char MAGENTA_HUE_BLEND_RANGE_KW[] = "hsi_magenta_hue_blend_range";
78 static const char MAGENTA_SATURATION_OFFSET_KW[] = "hsi_magenta_saturation_offset";
79 static const char MAGENTA_INTENSITY_OFFSET_KW[] = "hsi_magenta_intensity_offset";
80 
81 static const char WHITE_OBJECT_CLIP_KW[] = "hsi_white_object_clip";
82 
83 static const double DEFAULT_BLEND = 15.0;
84 static const double MAX_BLEND = 30.0;
85 
87  :
88  ossimImageSourceFilter (), // base class
89 
90  theTile (NULL),
91  theBuffer (NULL),
92  theNormalizedMinPix (0.0),
93 
94  theMasterHueOffset (0.0),
95  theMasterSaturationOffset (0.0),
96  theMasterIntensityOffset (0.0),
97  theMasterIntensityLowClip (0.0),
98  theMasterIntensityHighClip (1.0),
99 
100  theRedHueOffset (0.0),
101  theRedHueLowRange (-30.0),
102  theRedHueHighRange (30.0),
103  theRedHueBlendRange (DEFAULT_BLEND),
104  theRedSaturationOffset (0.0),
105  theRedIntensityOffset (0.0),
106 
107  theYellowHueOffset (0.0),
108  theYellowHueLowRange (30.0),
109  theYellowHueHighRange (90.0),
110  theYellowHueBlendRange (DEFAULT_BLEND),
111  theYellowSaturationOffset (0.0),
112  theYellowIntensityOffset (0.0),
113 
114  theGreenHueOffset (0.0),
115  theGreenHueLowRange (90.0),
116  theGreenHueHighRange (150.0),
117  theGreenHueBlendRange (DEFAULT_BLEND),
118  theGreenSaturationOffset (0.0),
119  theGreenIntensityOffset (0.0),
120 
121  theCyanHueOffset (0.0),
122  theCyanHueLowRange (150.0),
123  theCyanHueHighRange (210.0),
124  theCyanHueBlendRange (DEFAULT_BLEND),
125  theCyanSaturationOffset (0.0),
126  theCyanIntensityOffset (0.0),
127 
128  theBlueHueOffset (0.0),
129  theBlueHueLowRange (210.0),
130  theBlueHueHighRange (270.0),
131  theBlueHueBlendRange (DEFAULT_BLEND),
132  theBlueSaturationOffset (0.0),
133  theBlueIntensityOffset (0.0),
134 
135  theMagentaHueOffset (0.0),
136  theMagentaHueLowRange (270.0),
137  theMagentaHueHighRange (330.0),
138  theMagentaHueBlendRange (DEFAULT_BLEND),
139  theMagentaSaturationOffset (0.0),
140  theMagentaIntensityOffset (0.0),
141 
142  theWhiteObjectClip (1.0)
143 {
144  //***
145  // Set the base class "theEnableFlag" to off since no adjustments have been
146  // made yet.
147  //***
148  //disableSource();
149  theValidFlag = false;
150  // Construction not complete.
151 }
152 
154 {
155  theTile = NULL;
156  if (theBuffer)
157  {
158  delete [] theBuffer;
159  theBuffer = NULL;
160  }
161 }
162 
164  const ossimIrect& tile_rect,
165  ossim_uint32 resLevel)
166 {
167  if(!theInputConnection)
168  {
170  }
171 
172  // Fetch tile from pointer from the input source.
174  tile_rect, resLevel);
175 
176  // Check for remap bypass or a null tile return from input:
177  if (!isSourceEnabled() || !inputTile||!theValidFlag)
178  {
179  return inputTile;
180  }
181 
182  // Check for first time through or size change.
183  if ( !theTile.valid() ||
184  tile_rect.height() != theTile->getHeight() ||
185  tile_rect.width() != theTile->getWidth() )
186  {
187  allocate(tile_rect);
188  }
189 
190  //---
191  // Set the image rectangle of the tile.
192  // Note that this will resize the tiles buffers if
193  theTile->setImageRectangle(tile_rect);
194 
195  // Get its status.
196  ossimDataObjectStatus tile_status = inputTile->getDataObjectStatus();
197  if ( (tile_status == OSSIM_NULL) || (tile_status == OSSIM_EMPTY) )
198  {
199  theTile->makeBlank();
200  return theTile;
201  }
202 
203  double* rgbBuf[3];
204  const ossim_uint32 PPT = theTile->getSizePerBand(); // Pixels Per Tile
205 
206  rgbBuf[0] = theBuffer;
207  rgbBuf[1] = &(theBuffer[PPT]);
208  rgbBuf[2] = &(rgbBuf[1][PPT]);
209 
210  switch(inputTile->getNumberOfBands())
211  {
212  case 1:
213  case 2:
214  {
215  // Copy the first band only.
216  inputTile->copyTileBandToNormalizedBuffer(0, rgbBuf[0]);
217  memcpy(rgbBuf[1], rgbBuf[0], PPT*sizeof(double));
218  memcpy(rgbBuf[2], rgbBuf[0], PPT*sizeof(double));
219  break;
220  }
221  case 3:
222  {
224  break;
225  }
226  default:
227  {
228  inputTile->copyTileBandToNormalizedBuffer(0, rgbBuf[0]);
229  inputTile->copyTileBandToNormalizedBuffer(1, rgbBuf[1]);
230  inputTile->copyTileBandToNormalizedBuffer(2, rgbBuf[2]);
231  break;
232  }
233  }
234 
235  ossimNormRgbVector rgb;
236  ossimHsiVector hsi;
237  double r = 0.0;
238  double g = 0.0;
239  double b = 0.0;
240  double h = 0.0;
241  double s = 0.0;
242  double i = 0.0;
243  ossim_uint32 idx;
244  // Convert the rgb value to hsi and adjust values.
245  for (idx=0; idx<PPT; ++idx)
246  {
247  r = rgbBuf[0][idx];
248  g = rgbBuf[1][idx];
249  b = rgbBuf[2][idx];
250 
251  rgb = ossimNormRgbVector(r,g,b);
252  hsi = rgb;
253 
254  h = hsi.getH();
255  s = hsi.getS();
256  i = hsi.getI();
257 
258  if(i > FLT_EPSILON)
259  {
260  double h_offset = theMasterHueOffset;
261  double s_offset = theMasterSaturationOffset;
262  double i_offset = theMasterIntensityOffset;
263 
264  //***
265  // Note: For the purpose of checking to see if in the red range,
266  // make the hue negative if it's >= 315.0 and < 360.0.
267  // The red low and high ranges are stored in the same manner.
268  //***
269  double red_hue = h;
270  if (red_hue >= 315.0 && red_hue < 360.0) red_hue = red_hue - 360.0;
271 
272  if ( red_hue >= theRedHueLowRange && red_hue <= theRedHueHighRange)
273  {
274  // Adjust the reds.
275 
276  double bf = 1.0; // blend factor
277  if ( red_hue < (theRedHueLowRange + theRedHueBlendRange) )
278  {
279  bf = (red_hue - theRedHueLowRange) / theRedHueBlendRange;
280  }
281  else if ( red_hue > (theRedHueHighRange - theRedHueBlendRange) )
282  {
283  bf = (theRedHueHighRange - red_hue) / theRedHueBlendRange;
284  }
285 
286  h_offset += (theRedHueOffset * bf);
287  s_offset += (theRedSaturationOffset * bf);
288  i_offset += (theRedIntensityOffset * bf);
289  }
290 
292  {
293  // Adjust the yellows.
294 
295  double bf = 1.0; // blend factor
297  {
299  }
301  {
303  }
304 
305  h_offset += (theYellowHueOffset * bf);
306  s_offset += (theYellowSaturationOffset * bf);
307  i_offset += (theYellowIntensityOffset * bf);
308  }
309 
310  if (h >= theGreenHueLowRange && h <= theGreenHueHighRange)
311  {
312  // Adjust the greens.
313 
314  double bf = 1.0; // blend factor
316  {
318  }
319  else if ( h > (theGreenHueHighRange - theGreenHueBlendRange) )
320  {
322  }
323 
324  h_offset += (theGreenHueOffset * bf);
325  s_offset += (theGreenSaturationOffset * bf);
326  i_offset += (theGreenIntensityOffset * bf);
327  }
328 
329  if (h >= theCyanHueLowRange && h <= theCyanHueHighRange)
330  {
331  // Adjust the cyans.
332 
333  double bf = 1.0; // blend factor
335  {
337  }
338  else if ( h > (theCyanHueHighRange - theCyanHueBlendRange) )
339  {
341  }
342 
343  h_offset += (theCyanHueOffset * bf);
344  s_offset += (theCyanSaturationOffset * bf);
345  i_offset += (theCyanIntensityOffset * bf);
346  }
347 
348  if (h >= theBlueHueLowRange && h <= theBlueHueHighRange)
349  {
350  // Adjust the blues.
351 
352  double bf = 1.0; // blend factor
354  {
356  }
357  else if ( h > (theBlueHueHighRange - theBlueHueBlendRange) )
358  {
360  }
361 
362  h_offset += (theBlueHueOffset * bf);
363  s_offset += (theBlueSaturationOffset * bf);
364  i_offset += (theBlueIntensityOffset * bf);
365  }
366 
368  {
369  // Adjust the magentas.
370 
371  double bf = 1.0; // blend factor
373  {
375  }
377  {
379  }
380 
381  h_offset += (theMagentaHueOffset * bf);
382  s_offset += (theMagentaSaturationOffset * bf);
383  i_offset += (theMagentaIntensityOffset * bf);
384  }
385 
386  // Apply the hue offset.
387  h += h_offset;
388 
389  // Make sure the hue is between 0 and 360...
390  if (h < 0.0) h += 360.0;
391  else if (h >= 360) h -= 360.0;
392 
393  // Apply the saturation offset clamping/clipping to 0.0/1.0.
394  s += s_offset;
395  s = (s > 0.0 ? (s < 1.0 ? s : 1.0) : 0.0);
396 
397  // Apply the intensity offset clamping/clipping to 0.0/1.0.
398  i += i_offset;
399  i = (i > 0.0 ? (i < 1.0 ? i : 1.0) : 0.0);
400 
401  // Stretch the intensity channel.
402 // i = (i - theMasterIntensityLowClip) *
403 // ( 1.0 / (theMasterIntensityHighClip -
404 // theMasterIntensityLowClip) );
407 
408  hsi.setH(h);
409  hsi.setS(s);
410  hsi.setI(i);
411 
412  rgb = hsi;
413 
414  r = rgb.getR();
415  g = rgb.getG();
416  b = rgb.getB();
417  if ( (theWhiteObjectClip < 1.0) &&
418  (r > theWhiteObjectClip) &&
419  (g > theWhiteObjectClip) &&
420  (b > theWhiteObjectClip) )
421  {
422  r = theWhiteObjectClip;
423  g = theWhiteObjectClip;
424  b = theWhiteObjectClip;
425  }
426  // Do min/max range check and assign back to buffer.
427  rgbBuf[0][idx] = r > theNormalizedMinPix ? (r < 1.0 ? r : 1.0) :
429  rgbBuf[1][idx] = g > theNormalizedMinPix ? (g < 1.0 ? g : 1.0) :
431  rgbBuf[2][idx] = b > theNormalizedMinPix ? (b < 1.0 ? b : 1.0) :
433  } // End of "if(i > FLT_EPSILON)"
434  else
435  {
436  rgbBuf[0][idx] = 0.0;
437  rgbBuf[1][idx] = 0.0;
438  rgbBuf[2][idx] = 0.0;
439  }
440 
441  } // End of loop through pixels in a tile.
442  // Copy the buffer to the output tile.
444 
445  // Update the tile status.
446  theTile->validate();
447 
448  return theTile;
449 }
450 
452 {
454  if (theTile.valid())
455  {
456  theTile = NULL;
457  if(theBuffer)
458  {
459  delete []theBuffer;
460  theBuffer = NULL;
461  }
462  }
463 }
464 
466 {
467  if(!property.valid()) return;
468  ossimString name = property->getName();
469  if(name == MASTER_HUE_OFFSET_KW)
470  {
471  setMasterHueOffset(property->valueToString().toDouble());
472  }
473  else if(name == MASTER_SATURATION_OFFSET_KW)
474  {
475  setMasterSaturationOffset(property->valueToString().toDouble());
476  }
477  else if(name == MASTER_INTENSITY_OFFSET_KW)
478  {
479  setMasterIntensityOffset(property->valueToString().toDouble());
480  }
481  else if(name == MASTER_INTENSITY_LOW_CLIP_KW)
482  {
483  setMasterIntensityLowClip(property->valueToString().toDouble());
484  }
485  else if(name == MASTER_INTENSITY_HIGH_CLIP_KW)
486  {
487  setMasterIntensityHighClip(property->valueToString().toDouble());
488  }
489  else if(name == RED_HUE_OFFSET_KW)
490  {
491  setRedHueOffset(property->valueToString().toDouble());
492  }
493  else if(name == RED_HUE_LOW_RANGE_KW)
494  {
495  setRedHueLowRange(property->valueToString().toDouble());
496  }
497  else if(name == RED_HUE_HIGH_RANGE_KW)
498  {
499  setRedHueHighRange(property->valueToString().toDouble());
500  }
501  else if(name == RED_HUE_BLEND_RANGE_KW)
502  {
503  setRedHueBlendRange(property->valueToString().toDouble());
504  }
505  else if(name == RED_SATURATION_OFFSET_KW)
506  {
507  setRedSaturationOffset(property->valueToString().toDouble());
508  }
509  else if(name == RED_INTENSITY_OFFSET_KW)
510  {
511  setRedIntensityOffset(property->valueToString().toDouble());
512  }
513  else if(name == YELLOW_HUE_OFFSET_KW)
514  {
515  setYellowHueOffset(property->valueToString().toDouble());
516  }
517  else if(name == YELLOW_HUE_LOW_RANGE_KW)
518  {
519  setYellowHueLowRange(property->valueToString().toDouble());
520  }
521  else if(name == YELLOW_HUE_HIGH_RANGE_KW)
522  {
523  setYellowHueHighRange(property->valueToString().toDouble());
524  }
525  else if(name == YELLOW_HUE_BLEND_RANGE_KW)
526  {
527  setYellowHueBlendRange(property->valueToString().toDouble());
528  }
529  else if(name == YELLOW_SATURATION_OFFSET_KW)
530  {
531  setYellowSaturationOffset(property->valueToString().toDouble());
532  }
533  else if(name == YELLOW_INTENSITY_OFFSET_KW)
534  {
535  setYellowIntensityOffset(property->valueToString().toDouble());
536  }
537  else if(name == GREEN_HUE_OFFSET_KW)
538  {
539  setGreenHueOffset(property->valueToString().toDouble());
540  }
541  else if(name == GREEN_HUE_LOW_RANGE_KW)
542  {
543  setGreenHueLowRange(property->valueToString().toDouble());
544  }
545  else if(name == GREEN_HUE_HIGH_RANGE_KW)
546  {
547  setGreenHueHighRange(property->valueToString().toDouble());
548  }
549  else if(name == GREEN_HUE_BLEND_RANGE_KW)
550  {
551  setGreenHueBlendRange(property->valueToString().toDouble());
552  }
553  else if(name == GREEN_SATURATION_OFFSET_KW)
554  {
555  setGreenSaturationOffset(property->valueToString().toDouble());
556  }
557  else if(name == GREEN_INTENSITY_OFFSET_KW)
558  {
559  setGreenIntensityOffset(property->valueToString().toDouble());
560  }
561  else if(name == CYAN_HUE_OFFSET_KW)
562  {
563  setCyanHueOffset(property->valueToString().toDouble());
564  }
565  else if(name == CYAN_HUE_LOW_RANGE_KW)
566  {
567  setCyanHueLowRange(property->valueToString().toDouble());
568  }
569  else if(name == CYAN_HUE_HIGH_RANGE_KW)
570  {
571  setCyanHueHighRange(property->valueToString().toDouble());
572  }
573  else if(name == CYAN_HUE_BLEND_RANGE_KW)
574  {
575  setCyanHueBlendRange(property->valueToString().toDouble());
576  }
577  else if(name == CYAN_SATURATION_OFFSET_KW)
578  {
579  setCyanSaturationOffset(property->valueToString().toDouble());
580  }
581  else if(name == CYAN_INTENSITY_OFFSET_KW)
582  {
583  setCyanIntensityOffset(property->valueToString().toDouble());
584  }
585  else if(name == BLUE_HUE_OFFSET_KW)
586  {
587  setBlueHueOffset(property->valueToString().toDouble());
588  }
589  else if(name == BLUE_HUE_LOW_RANGE_KW)
590  {
591  setBlueHueLowRange(property->valueToString().toDouble());
592  }
593  else if(name == BLUE_HUE_HIGH_RANGE_KW)
594  {
595  setBlueHueHighRange(property->valueToString().toDouble());
596  }
597  else if(name == BLUE_HUE_BLEND_RANGE_KW)
598  {
599  setBlueHueBlendRange(property->valueToString().toDouble());
600  }
601  else if(name == BLUE_SATURATION_OFFSET_KW)
602  {
603  setBlueSaturationOffset(property->valueToString().toDouble());
604  }
605  else if(name == BLUE_INTENSITY_OFFSET_KW)
606  {
607  setBlueIntensityOffset(property->valueToString().toDouble());
608  }
609  else if(name == MAGENTA_HUE_OFFSET_KW)
610  {
611  setMagentaHueOffset(property->valueToString().toDouble());
612  }
613  else if(name == MAGENTA_HUE_LOW_RANGE_KW)
614  {
615  setMagentaHueLowRange(property->valueToString().toDouble());
616  }
617  else if(name == MAGENTA_HUE_HIGH_RANGE_KW)
618  {
619  setMagentaHueHighRange(property->valueToString().toDouble());
620  }
621  else if(name == MAGENTA_HUE_BLEND_RANGE_KW)
622  {
623  setMagentaHueBlendRange(property->valueToString().toDouble());
624  }
625  else if(name == MAGENTA_SATURATION_OFFSET_KW)
626  {
627  setMagentaSaturationOffset(property->valueToString().toDouble());
628  }
629  else if(name == MAGENTA_INTENSITY_OFFSET_KW)
630  {
631  setMagentaIntensityOffset(property->valueToString().toDouble());
632  }
633  else if(name == WHITE_OBJECT_CLIP_KW)
634  {
635  setWhiteObjectClip(property->valueToString().toDouble());
636  }
637  else
638  {
640  }
641 }
642 
644 {
646  if(name == MASTER_HUE_OFFSET_KW)
647  {
648  result = new ossimNumericProperty(name, ossimString::toString(theMasterHueOffset), -180, 180);
649  result->setCacheRefreshBit();
650  }
651  else if(name == MASTER_SATURATION_OFFSET_KW)
652  {
654  result->setCacheRefreshBit();
655  }
656  else if(name == MASTER_INTENSITY_OFFSET_KW)
657  {
659  result->setCacheRefreshBit();
660  }
661  else if(name == MASTER_INTENSITY_LOW_CLIP_KW)
662  {
664  result->setCacheRefreshBit();
665  }
666  else if(name == MASTER_INTENSITY_HIGH_CLIP_KW)
667  {
669  result->setCacheRefreshBit();
670  }
671  else if(name == RED_HUE_OFFSET_KW)
672  {
673  result = new ossimNumericProperty(name, ossimString::toString(theRedHueOffset), -180, 180);
674  result->setCacheRefreshBit();
675  }
676  else if(name == RED_HUE_LOW_RANGE_KW)
677  {
678  result = new ossimNumericProperty(name, ossimString::toString(theRedHueLowRange), -30, 30);
679  result->setCacheRefreshBit();
680  }
681  else if(name == RED_HUE_HIGH_RANGE_KW)
682  {
683  result = new ossimNumericProperty(name, ossimString::toString(theRedHueHighRange), -30, 30);
684  result->setCacheRefreshBit();
685  }
686  else if(name == RED_HUE_BLEND_RANGE_KW)
687  {
689  result->setCacheRefreshBit();
690  }
691  else if(name == RED_SATURATION_OFFSET_KW)
692  {
694  result->setCacheRefreshBit();
695  }
696  else if(name == RED_INTENSITY_OFFSET_KW)
697  {
699  result->setCacheRefreshBit();
700  }
701  else if(name == YELLOW_HUE_OFFSET_KW)
702  {
703  result = new ossimNumericProperty(name, ossimString::toString(theYellowHueOffset), -180, 180);
704  result->setCacheRefreshBit();
705  }
706  else if(name == YELLOW_HUE_LOW_RANGE_KW)
707  {
709  result->setCacheRefreshBit();
710  }
711  else if(name == YELLOW_HUE_HIGH_RANGE_KW)
712  {
714  result->setCacheRefreshBit();
715  }
716  else if(name == YELLOW_HUE_BLEND_RANGE_KW)
717  {
719  result->setCacheRefreshBit();
720  }
721  else if(name == YELLOW_SATURATION_OFFSET_KW)
722  {
724  result->setCacheRefreshBit();
725  }
726  else if(name == YELLOW_INTENSITY_OFFSET_KW)
727  {
729  result->setCacheRefreshBit();
730  }
731  else if(name == GREEN_HUE_OFFSET_KW)
732  {
733  result = new ossimNumericProperty(name, ossimString::toString(theGreenHueOffset), -180, 180);
734  result->setCacheRefreshBit();
735  }
736  else if(name == GREEN_HUE_LOW_RANGE_KW)
737  {
738  result = new ossimNumericProperty(name, ossimString::toString(theGreenHueLowRange), 90, 150);
739  result->setCacheRefreshBit();
740  }
741  else if(name == GREEN_HUE_HIGH_RANGE_KW)
742  {
744  result->setCacheRefreshBit();
745  }
746  else if(name == GREEN_HUE_BLEND_RANGE_KW)
747  {
749  result->setCacheRefreshBit();
750  }
751  else if(name == GREEN_SATURATION_OFFSET_KW)
752  {
754  result->setCacheRefreshBit();
755  }
756  else if(name == GREEN_INTENSITY_OFFSET_KW)
757  {
759  result->setCacheRefreshBit();
760  }
761  else if(name == CYAN_HUE_OFFSET_KW)
762  {
763  result = new ossimNumericProperty(name, ossimString::toString(theCyanHueOffset), -180, 180);
764  result->setCacheRefreshBit();
765  }
766  else if(name == CYAN_HUE_LOW_RANGE_KW)
767  {
768  result = new ossimNumericProperty(name, ossimString::toString(theCyanHueLowRange), 150, 210);
769  result->setCacheRefreshBit();
770  }
771  else if(name == CYAN_HUE_HIGH_RANGE_KW)
772  {
773  result = new ossimNumericProperty(name, ossimString::toString(theCyanHueHighRange), 150, 210);
774  result->setCacheRefreshBit();
775  }
776  else if(name == CYAN_HUE_BLEND_RANGE_KW)
777  {
779  result->setCacheRefreshBit();
780  }
781  else if(name == CYAN_SATURATION_OFFSET_KW)
782  {
784  result->setCacheRefreshBit();
785  }
786  else if(name == CYAN_INTENSITY_OFFSET_KW)
787  {
789  result->setCacheRefreshBit();
790  }
791  else if(name == BLUE_HUE_OFFSET_KW)
792  {
793  result = new ossimNumericProperty(name, ossimString::toString(theBlueHueOffset), -180, 180);
794  result->setCacheRefreshBit();
795  }
796  else if(name == BLUE_HUE_LOW_RANGE_KW)
797  {
798  result = new ossimNumericProperty(name, ossimString::toString(theBlueHueLowRange), 210, 270);
799  result->setCacheRefreshBit();
800  }
801  else if(name == BLUE_HUE_HIGH_RANGE_KW)
802  {
803  result = new ossimNumericProperty(name, ossimString::toString(theBlueHueHighRange), 210, 270);
804  result->setCacheRefreshBit();
805  }
806  else if(name == BLUE_HUE_BLEND_RANGE_KW)
807  {
809  result->setCacheRefreshBit();
810  }
811  else if(name == BLUE_SATURATION_OFFSET_KW)
812  {
814  result->setCacheRefreshBit();
815  }
816  else if(name == BLUE_INTENSITY_OFFSET_KW)
817  {
819  result->setCacheRefreshBit();
820  }
821  else if(name == MAGENTA_HUE_OFFSET_KW)
822  {
823  result = new ossimNumericProperty(name, ossimString::toString(theMagentaHueOffset), -180, 180);
824  result->setCacheRefreshBit();
825  }
826  else if(name == MAGENTA_HUE_LOW_RANGE_KW)
827  {
829  result->setCacheRefreshBit();
830  }
831  else if(name == MAGENTA_HUE_HIGH_RANGE_KW)
832  {
834  result->setCacheRefreshBit();
835  }
836  else if(name == MAGENTA_HUE_BLEND_RANGE_KW)
837  {
839  result->setCacheRefreshBit();
840  }
841  else if(name == MAGENTA_SATURATION_OFFSET_KW)
842  {
844  result->setCacheRefreshBit();
845  }
846  else if(name == MAGENTA_INTENSITY_OFFSET_KW)
847  {
849  result->setCacheRefreshBit();
850  }
851  else if(name == WHITE_OBJECT_CLIP_KW)
852  {
853  result = new ossimNumericProperty(name, ossimString::toString(theWhiteObjectClip), 0.8, 1.0);
854  result->setCacheRefreshBit();
855  }
856  else
857  {
859  }
860 
861  return result;
862 }
863 
864 void ossimHsiRemapper::getPropertyNames(std::vector<ossimString>& propertyNames)const
865 {
867  propertyNames.push_back(MASTER_HUE_OFFSET_KW);
868  propertyNames.push_back(MASTER_SATURATION_OFFSET_KW);
869  propertyNames.push_back(MASTER_INTENSITY_OFFSET_KW);
870  propertyNames.push_back(MASTER_INTENSITY_LOW_CLIP_KW);
871  propertyNames.push_back(MASTER_INTENSITY_HIGH_CLIP_KW);
872  propertyNames.push_back(RED_HUE_OFFSET_KW);
873  propertyNames.push_back(RED_HUE_LOW_RANGE_KW);
874  propertyNames.push_back(RED_HUE_HIGH_RANGE_KW);
875  propertyNames.push_back(RED_HUE_BLEND_RANGE_KW);
876  propertyNames.push_back(RED_SATURATION_OFFSET_KW);
877  propertyNames.push_back(RED_INTENSITY_OFFSET_KW);
878  propertyNames.push_back(YELLOW_HUE_OFFSET_KW);
879  propertyNames.push_back(YELLOW_HUE_LOW_RANGE_KW);
880  propertyNames.push_back(YELLOW_HUE_HIGH_RANGE_KW);
881  propertyNames.push_back(YELLOW_HUE_BLEND_RANGE_KW);
882  propertyNames.push_back(YELLOW_SATURATION_OFFSET_KW);
883  propertyNames.push_back(YELLOW_INTENSITY_OFFSET_KW);
884  propertyNames.push_back(GREEN_HUE_OFFSET_KW);
885  propertyNames.push_back(GREEN_HUE_LOW_RANGE_KW);
886  propertyNames.push_back(GREEN_HUE_HIGH_RANGE_KW);
887  propertyNames.push_back(GREEN_HUE_BLEND_RANGE_KW);
888  propertyNames.push_back(GREEN_SATURATION_OFFSET_KW);
889  propertyNames.push_back(GREEN_INTENSITY_OFFSET_KW);
890  propertyNames.push_back(CYAN_HUE_OFFSET_KW);
891  propertyNames.push_back(CYAN_HUE_LOW_RANGE_KW);
892  propertyNames.push_back(CYAN_HUE_HIGH_RANGE_KW);
893  propertyNames.push_back(CYAN_HUE_BLEND_RANGE_KW);
894  propertyNames.push_back(CYAN_SATURATION_OFFSET_KW);
895  propertyNames.push_back(CYAN_INTENSITY_OFFSET_KW);
896  propertyNames.push_back(BLUE_HUE_OFFSET_KW);
897  propertyNames.push_back(BLUE_HUE_LOW_RANGE_KW);
898  propertyNames.push_back(BLUE_HUE_HIGH_RANGE_KW);
899  propertyNames.push_back(BLUE_HUE_BLEND_RANGE_KW);
900  propertyNames.push_back(BLUE_SATURATION_OFFSET_KW);
901  propertyNames.push_back(BLUE_INTENSITY_OFFSET_KW);
902  propertyNames.push_back(MAGENTA_HUE_OFFSET_KW);
903  propertyNames.push_back(MAGENTA_HUE_LOW_RANGE_KW);
904  propertyNames.push_back(MAGENTA_HUE_HIGH_RANGE_KW);
905  propertyNames.push_back(MAGENTA_HUE_BLEND_RANGE_KW);
906  propertyNames.push_back(MAGENTA_SATURATION_OFFSET_KW);
907  propertyNames.push_back(MAGENTA_INTENSITY_OFFSET_KW);
908  propertyNames.push_back(WHITE_OBJECT_CLIP_KW);
909 }
910 
911 
913 {
914 
916  {
918  theTile->initialize();
919 
920  ossim_uint32 width = rect.width();
921  ossim_uint32 height = rect.height();
922  if(theBuffer)
923  {
924  delete [] theBuffer;
925  theBuffer = 0;
926  }
927  ossim_uint32 size = width * height * 3; // Buffer always 3 bands.
928  theBuffer = new double[size];
929  memset(theBuffer, '\0', sizeof(double) * size);
930 
931  // Get the minimum normalized pixel value.
933  }
934 }
935 
937  const char* prefix)
938 {
939  static const char MODULE[] = "ossimHsiRemapper::loadState()";
940 
941  if (traceDebug())
942  {
944  << MODULE << " entering..." << endl;
945  }
946 
947  // Make a prefix.
948  ossimString tmpPrefix;
949  if (prefix) tmpPrefix += prefix;
950 
951  const char* lookupReturn;
952 
953  lookupReturn = kwl.find(tmpPrefix.c_str(), MASTER_HUE_OFFSET_KW);
954  if(lookupReturn)
955  {
956  setMasterHueOffset(atof(lookupReturn));
957  }
958 
959  lookupReturn = kwl.find(tmpPrefix.c_str(), MASTER_SATURATION_OFFSET_KW);
960  if(lookupReturn)
961  {
962  setMasterSaturationOffset(atof(lookupReturn));
963  }
964 
965  lookupReturn = kwl.find(tmpPrefix.c_str(), MASTER_INTENSITY_OFFSET_KW);
966  if(lookupReturn)
967  {
968  setMasterIntensityOffset(atof(lookupReturn));
969  }
970 
971  lookupReturn = kwl.find(tmpPrefix.c_str(), MASTER_INTENSITY_LOW_CLIP_KW);
972  if(lookupReturn)
973  {
974  setMasterIntensityLowClip(atof(lookupReturn));
975  }
976 
977  lookupReturn = kwl.find(tmpPrefix.c_str(), MASTER_INTENSITY_HIGH_CLIP_KW);
978  if(lookupReturn)
979  {
980  setMasterIntensityHighClip(atof(lookupReturn));
981  }
982 
983  lookupReturn = kwl.find(tmpPrefix.c_str(), RED_HUE_OFFSET_KW);
984  if(lookupReturn)
985  {
986  setRedHueOffset(atof(lookupReturn));
987  }
988 
989  lookupReturn = kwl.find(tmpPrefix.c_str(), RED_HUE_LOW_RANGE_KW);
990  if(lookupReturn)
991  {
992  setRedHueLowRange(atof(lookupReturn));
993  }
994 
995  lookupReturn = kwl.find(tmpPrefix.c_str(), RED_HUE_HIGH_RANGE_KW);
996  if(lookupReturn)
997  {
998  setRedHueHighRange(atof(lookupReturn));
999  }
1000 
1001  lookupReturn = kwl.find(tmpPrefix.c_str(), RED_HUE_BLEND_RANGE_KW);
1002  if(lookupReturn)
1003  {
1004  setRedHueBlendRange(atof(lookupReturn));
1005  }
1006 
1007  lookupReturn = kwl.find(tmpPrefix.c_str(), RED_SATURATION_OFFSET_KW);
1008  if(lookupReturn)
1009  {
1010  setRedSaturationOffset(atof(lookupReturn));
1011  }
1012 
1013  lookupReturn = kwl.find(tmpPrefix.c_str(), RED_INTENSITY_OFFSET_KW);
1014  if(lookupReturn)
1015  {
1016  setRedIntensityOffset(atof(lookupReturn));
1017  }
1018 
1019  lookupReturn = kwl.find(tmpPrefix.c_str(), YELLOW_HUE_OFFSET_KW);
1020  if(lookupReturn)
1021  {
1022  setYellowHueOffset(atof(lookupReturn));
1023  }
1024 
1025  lookupReturn = kwl.find(tmpPrefix.c_str(), YELLOW_HUE_LOW_RANGE_KW);
1026  if(lookupReturn)
1027  {
1028  setYellowHueLowRange(atof(lookupReturn));
1029  }
1030 
1031  lookupReturn = kwl.find(tmpPrefix.c_str(), YELLOW_HUE_HIGH_RANGE_KW);
1032  if(lookupReturn)
1033  {
1034  setYellowHueHighRange(atof(lookupReturn));
1035  }
1036 
1037  lookupReturn = kwl.find(tmpPrefix.c_str(), YELLOW_HUE_BLEND_RANGE_KW);
1038  if(lookupReturn)
1039  {
1040  setYellowHueBlendRange(atof(lookupReturn));
1041  }
1042 
1043  lookupReturn = kwl.find(tmpPrefix.c_str(), YELLOW_SATURATION_OFFSET_KW);
1044  if(lookupReturn)
1045  {
1046  setYellowSaturationOffset(atof(lookupReturn));
1047  }
1048 
1049  lookupReturn = kwl.find(tmpPrefix.c_str(), YELLOW_INTENSITY_OFFSET_KW);
1050  if(lookupReturn)
1051  {
1052  setYellowIntensityOffset(atof(lookupReturn));
1053  }
1054 
1055  lookupReturn = kwl.find(tmpPrefix.c_str(), GREEN_HUE_OFFSET_KW);
1056  if(lookupReturn)
1057  {
1058  setGreenHueOffset(atof(lookupReturn));
1059  }
1060 
1061  lookupReturn = kwl.find(tmpPrefix.c_str(), GREEN_HUE_LOW_RANGE_KW);
1062  if(lookupReturn)
1063  {
1064  setGreenHueLowRange(atof(lookupReturn));
1065  }
1066 
1067  lookupReturn = kwl.find(tmpPrefix.c_str(), GREEN_HUE_HIGH_RANGE_KW);
1068  if(lookupReturn)
1069  {
1070  setGreenHueHighRange(atof(lookupReturn));
1071  }
1072 
1073  lookupReturn = kwl.find(tmpPrefix.c_str(), GREEN_HUE_BLEND_RANGE_KW);
1074  if(lookupReturn)
1075  {
1076  setGreenHueBlendRange(atof(lookupReturn));
1077  }
1078 
1079  lookupReturn = kwl.find(tmpPrefix.c_str(), GREEN_SATURATION_OFFSET_KW);
1080  if(lookupReturn)
1081  {
1082  setGreenSaturationOffset(atof(lookupReturn));
1083  }
1084 
1085  lookupReturn = kwl.find(tmpPrefix.c_str(), GREEN_INTENSITY_OFFSET_KW);
1086  if(lookupReturn)
1087  {
1088  setGreenIntensityOffset(atof(lookupReturn));
1089  }
1090 
1091  lookupReturn = kwl.find(tmpPrefix.c_str(), CYAN_HUE_OFFSET_KW);
1092  if(lookupReturn)
1093  {
1094  setCyanHueOffset(atof(lookupReturn));
1095  }
1096 
1097  lookupReturn = kwl.find(tmpPrefix.c_str(), CYAN_HUE_LOW_RANGE_KW);
1098  if(lookupReturn)
1099  {
1100  setCyanHueLowRange(atof(lookupReturn));
1101  }
1102 
1103  lookupReturn = kwl.find(tmpPrefix.c_str(), CYAN_HUE_HIGH_RANGE_KW);
1104  if(lookupReturn)
1105  {
1106  setCyanHueHighRange(atof(lookupReturn));
1107  }
1108 
1109  lookupReturn = kwl.find(tmpPrefix.c_str(), CYAN_HUE_BLEND_RANGE_KW);
1110  if(lookupReturn)
1111  {
1112  setCyanHueBlendRange(atof(lookupReturn));
1113  }
1114 
1115  lookupReturn = kwl.find(tmpPrefix.c_str(), CYAN_SATURATION_OFFSET_KW);
1116  if(lookupReturn)
1117  {
1118  setCyanSaturationOffset(atof(lookupReturn));
1119  }
1120 
1121  lookupReturn = kwl.find(tmpPrefix.c_str(), CYAN_INTENSITY_OFFSET_KW);
1122  if(lookupReturn)
1123  {
1124  setCyanIntensityOffset(atof(lookupReturn));
1125  }
1126 
1127  lookupReturn = kwl.find(tmpPrefix.c_str(), BLUE_HUE_OFFSET_KW);
1128  if(lookupReturn)
1129  {
1130  setBlueHueOffset(atof(lookupReturn));
1131  }
1132 
1133  lookupReturn = kwl.find(tmpPrefix.c_str(), BLUE_HUE_LOW_RANGE_KW);
1134  if(lookupReturn)
1135  {
1136  setBlueHueLowRange(atof(lookupReturn));
1137  }
1138 
1139  lookupReturn = kwl.find(tmpPrefix.c_str(), BLUE_HUE_HIGH_RANGE_KW);
1140  if(lookupReturn)
1141  {
1142  setBlueHueHighRange(atof(lookupReturn));
1143  }
1144 
1145  lookupReturn = kwl.find(tmpPrefix.c_str(), BLUE_HUE_BLEND_RANGE_KW);
1146  if(lookupReturn)
1147  {
1148  setBlueHueBlendRange(atof(lookupReturn));
1149  }
1150 
1151  lookupReturn = kwl.find(tmpPrefix.c_str(), BLUE_SATURATION_OFFSET_KW);
1152  if(lookupReturn)
1153  {
1154  setBlueSaturationOffset(atof(lookupReturn));
1155  }
1156 
1157  lookupReturn = kwl.find(tmpPrefix.c_str(), BLUE_INTENSITY_OFFSET_KW);
1158  if(lookupReturn)
1159  {
1160  setBlueIntensityOffset(atof(lookupReturn));
1161  }
1162 
1163  lookupReturn = kwl.find(tmpPrefix.c_str(), MAGENTA_HUE_OFFSET_KW);
1164  if(lookupReturn)
1165  {
1166  setMagentaHueOffset(atof(lookupReturn));
1167  }
1168 
1169  lookupReturn = kwl.find(tmpPrefix.c_str(), MAGENTA_HUE_LOW_RANGE_KW);
1170  if(lookupReturn)
1171  {
1172  setMagentaHueLowRange(atof(lookupReturn));
1173  }
1174 
1175  lookupReturn = kwl.find(tmpPrefix.c_str(), MAGENTA_HUE_HIGH_RANGE_KW);
1176  if(lookupReturn)
1177  {
1178  setMagentaHueHighRange(atof(lookupReturn));
1179  }
1180 
1181  lookupReturn = kwl.find(tmpPrefix.c_str(), MAGENTA_HUE_BLEND_RANGE_KW);
1182  if(lookupReturn)
1183  {
1184  setMagentaHueBlendRange(atof(lookupReturn));
1185  }
1186 
1187  lookupReturn = kwl.find(tmpPrefix.c_str(), MAGENTA_SATURATION_OFFSET_KW);
1188  if(lookupReturn)
1189  {
1190  setMagentaSaturationOffset(atof(lookupReturn));
1191  }
1192 
1193  lookupReturn = kwl.find(tmpPrefix.c_str(), MAGENTA_INTENSITY_OFFSET_KW);
1194  if(lookupReturn)
1195  {
1196  setMagentaIntensityOffset(atof(lookupReturn));
1197  }
1198 
1199  lookupReturn = kwl.find(tmpPrefix.c_str(), WHITE_OBJECT_CLIP_KW);
1200  if(lookupReturn)
1201  {
1202  setWhiteObjectClip(atof(lookupReturn));
1203  }
1204 
1205  //***
1206  // Initialize the base class. Do this last so that the enable/disable
1207  // doesn't get overridden by the "set*" methods.
1208  //***
1209  ossimImageSourceFilter::loadState(kwl, tmpPrefix.c_str());
1210 
1211  if (traceDebug())
1212  {
1214  << ""
1215  << *this
1216  << "\nreturning..."
1217  << endl;
1218  }
1219 
1220  return true;
1221 }
1222 
1224  const char* prefix) const
1225 {
1226  static const char MODULE[] = "ossimHsiRemapper::saveStateTo()";
1227 
1228  if (traceDebug())
1229  {
1231  << MODULE << "entering..." << endl;
1232  }
1233 
1234  // Call the base class getStateFrom.
1235  ossimImageSourceFilter::saveState(kwl, prefix);
1236 
1237  kwl.add(prefix, MASTER_HUE_OFFSET_KW, theMasterHueOffset);
1238 
1239  kwl.add(prefix, MASTER_SATURATION_OFFSET_KW, theMasterSaturationOffset);
1240 
1241  kwl.add(prefix, MASTER_INTENSITY_OFFSET_KW, theMasterIntensityOffset);
1242 
1243  kwl.add(prefix, MASTER_INTENSITY_LOW_CLIP_KW, theMasterIntensityLowClip);
1244 
1245  kwl.add(prefix, MASTER_INTENSITY_HIGH_CLIP_KW, theMasterIntensityHighClip);
1246 
1247  kwl.add(prefix, RED_HUE_OFFSET_KW, theRedHueOffset);
1248 
1249  kwl.add(prefix, RED_HUE_LOW_RANGE_KW, theRedHueLowRange);
1250 
1251  kwl.add(prefix, RED_HUE_HIGH_RANGE_KW, theRedHueHighRange);
1252 
1253  kwl.add(prefix, RED_HUE_BLEND_RANGE_KW, theRedHueBlendRange);
1254 
1255  kwl.add(prefix, RED_SATURATION_OFFSET_KW, theRedSaturationOffset);
1256 
1257  kwl.add(prefix, RED_INTENSITY_OFFSET_KW, theRedIntensityOffset);
1258 
1259  kwl.add(prefix, YELLOW_HUE_OFFSET_KW, theYellowHueOffset);
1260 
1261  kwl.add(prefix, YELLOW_HUE_LOW_RANGE_KW, theYellowHueLowRange);
1262 
1263  kwl.add(prefix, YELLOW_HUE_HIGH_RANGE_KW, theYellowHueHighRange);
1264 
1265  kwl.add(prefix, YELLOW_HUE_BLEND_RANGE_KW, theYellowHueBlendRange);
1266 
1267  kwl.add(prefix, YELLOW_SATURATION_OFFSET_KW, theYellowSaturationOffset);
1268 
1269  kwl.add(prefix, YELLOW_INTENSITY_OFFSET_KW, theYellowIntensityOffset);
1270 
1271  kwl.add(prefix, GREEN_HUE_OFFSET_KW, theGreenHueOffset);
1272 
1273  kwl.add(prefix, GREEN_HUE_LOW_RANGE_KW, theGreenHueLowRange);
1274 
1275  kwl.add(prefix, GREEN_HUE_HIGH_RANGE_KW, theGreenHueHighRange);
1276 
1277  kwl.add(prefix, GREEN_HUE_BLEND_RANGE_KW, theGreenHueBlendRange);
1278 
1279  kwl.add(prefix, GREEN_SATURATION_OFFSET_KW, theGreenSaturationOffset);
1280 
1281  kwl.add(prefix, GREEN_INTENSITY_OFFSET_KW, theGreenIntensityOffset);
1282 
1283  kwl.add(prefix, CYAN_HUE_OFFSET_KW, theCyanHueOffset);
1284 
1285  kwl.add(prefix, CYAN_HUE_LOW_RANGE_KW, theCyanHueLowRange);
1286 
1287  kwl.add(prefix, CYAN_HUE_HIGH_RANGE_KW, theCyanHueHighRange);
1288 
1289  kwl.add(prefix, CYAN_HUE_BLEND_RANGE_KW, theCyanHueBlendRange);
1290 
1291  kwl.add(prefix, CYAN_SATURATION_OFFSET_KW, theCyanSaturationOffset);
1292 
1293  kwl.add(prefix, CYAN_INTENSITY_OFFSET_KW, theCyanIntensityOffset);
1294 
1295  kwl.add(prefix, BLUE_HUE_OFFSET_KW, theBlueHueOffset);
1296 
1297  kwl.add(prefix, BLUE_HUE_LOW_RANGE_KW, theBlueHueLowRange);
1298 
1299  kwl.add(prefix, BLUE_HUE_HIGH_RANGE_KW, theBlueHueHighRange);
1300 
1301  kwl.add(prefix, BLUE_HUE_BLEND_RANGE_KW, theBlueHueBlendRange);
1302 
1303  kwl.add(prefix, BLUE_SATURATION_OFFSET_KW, theBlueSaturationOffset);
1304 
1305  kwl.add(prefix, BLUE_INTENSITY_OFFSET_KW, theBlueIntensityOffset);
1306 
1307  kwl.add(prefix, MAGENTA_HUE_OFFSET_KW, theMagentaHueOffset);
1308 
1309  kwl.add(prefix, MAGENTA_HUE_LOW_RANGE_KW, theMagentaHueLowRange);
1310 
1311  kwl.add(prefix, MAGENTA_HUE_HIGH_RANGE_KW, theMagentaHueHighRange);
1312 
1313  kwl.add(prefix, MAGENTA_HUE_BLEND_RANGE_KW, theMagentaHueBlendRange);
1314 
1315  kwl.add(prefix, MAGENTA_SATURATION_OFFSET_KW, theMagentaSaturationOffset);
1316 
1317  kwl.add(prefix, MAGENTA_INTENSITY_OFFSET_KW, theMagentaIntensityOffset);
1318 
1319  kwl.add(prefix, WHITE_OBJECT_CLIP_KW, theWhiteObjectClip);
1320 
1321  if (traceDebug())
1322  {
1323  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << "returning..." << endl;
1324  }
1325 
1326  return true;
1327 }
1328 
1329 void ossimHsiRemapper::resetGroup(int color_group)
1330 {
1331  switch (color_group)
1332  {
1333  case RED:
1334  resetRed();
1335  break;
1336  case YELLOW:
1337  resetYellow();
1338  break;
1339  case GREEN:
1340  resetGreen();
1341  break;
1342  case CYAN:
1343  resetCyan();
1344  break;
1345  case BLUE:
1346  resetBlue();
1347  break;
1348  case MAGENTA:
1349  resetMagenta();
1350  break;
1351  case ALL:
1352  resetMaster();
1353  break;
1354  default:
1356  << "ossimHsiRemapper::setSaturationOffset NOTICE: Range error!"
1357  << endl;
1358  break;
1359  }
1360  verifyEnabled();
1361 }
1362 
1364 {
1365  theMasterHueOffset = 0.0;
1370 
1371  theRedHueOffset = 0.0;
1372  theRedHueLowRange = -30.0;
1373  theRedHueHighRange = 30.0;
1374  theRedHueBlendRange = DEFAULT_BLEND;
1375  theRedSaturationOffset = 0.0;
1376  theRedIntensityOffset = 0.0;
1377 
1378  theYellowHueOffset = 0.0;
1379  theYellowHueLowRange = 30.0;
1380  theYellowHueHighRange = 90.0;
1381  theYellowHueBlendRange = DEFAULT_BLEND;
1384 
1385  theGreenHueOffset = 0.0;
1386  theGreenHueLowRange = 90.0;
1387  theGreenHueHighRange = 150.0;
1388  theGreenHueBlendRange = DEFAULT_BLEND;
1391 
1392  theCyanHueOffset = 0.0;
1393  theCyanHueLowRange = 150.0;
1394  theCyanHueHighRange = 210.0;
1395  theCyanHueBlendRange = DEFAULT_BLEND;
1397  theCyanIntensityOffset = 0.0;
1398 
1399  theBlueHueOffset = 0.0;
1400  theBlueHueLowRange = 210.0;
1401  theBlueHueHighRange = 270.0;
1402  theBlueHueBlendRange = DEFAULT_BLEND;
1404  theBlueIntensityOffset = 0.0;
1405 
1406  theMagentaHueOffset = 0.0;
1407  theMagentaHueLowRange = 270.0;
1408  theMagentaHueHighRange = 330.0;
1409  theMagentaHueBlendRange = DEFAULT_BLEND;
1412 
1413  theWhiteObjectClip = 1.0;
1414  theValidFlag = false;
1415  //disableSource();
1416 }
1417 
1419 {
1420  theMasterHueOffset = 0.0;
1425 
1426  verifyEnabled();
1427 }
1428 
1430 {
1431  theRedHueOffset = 0.0;
1432  theRedHueLowRange = -30.0;
1433  theRedHueHighRange = 30.0;
1434  theRedHueBlendRange = DEFAULT_BLEND;
1435  theRedSaturationOffset = 0.0;
1436  theRedIntensityOffset = 0.0;
1437 
1438  verifyEnabled();
1439 }
1440 
1442 {
1443  theYellowHueOffset = 0.0;
1444  theYellowHueLowRange = 30.0;
1445  theYellowHueHighRange = 90.0;
1446  theYellowHueBlendRange = DEFAULT_BLEND;
1449 
1450  verifyEnabled();
1451 }
1452 
1454 {
1455  theGreenHueOffset = 0.0;
1456  theGreenHueLowRange = 90.0;
1457  theGreenHueHighRange = 150.0;
1458  theGreenHueBlendRange = DEFAULT_BLEND;
1461 
1462  verifyEnabled();
1463 }
1464 
1466 {
1467  theCyanHueOffset = 0.0;
1468  theCyanHueLowRange = 150.0;
1469  theCyanHueHighRange = 210.0;
1470  theCyanHueBlendRange = DEFAULT_BLEND;
1472  theCyanIntensityOffset = 0.0;
1473 
1474  verifyEnabled();
1475 }
1476 
1478 {
1479  theBlueHueOffset = 0.0;
1480  theBlueHueLowRange = 210.0;
1481  theBlueHueHighRange = 270.0;
1482  theBlueHueBlendRange = DEFAULT_BLEND;
1484  theBlueIntensityOffset = 0.0;
1485 
1486  verifyEnabled();
1487 }
1488 
1490 {
1491  theMagentaHueOffset = 0.0;
1492  theMagentaHueLowRange = 270.0;
1493  theMagentaHueHighRange = 330.0;
1494  theMagentaHueBlendRange = DEFAULT_BLEND;
1497 
1498  verifyEnabled();
1499 }
1500 
1502 {
1503  // Start off disabled...
1504  //disableSource();
1505  theValidFlag = false;
1506  if (!theInputConnection)
1507  {
1508  //***
1509  // Since this filter can be constructed with no input connection do not
1510  // output and error, simply return.
1511  //***
1512  return;
1513  }
1514 
1515  //***
1516  // Add all the offsets and the low clips.
1517  // If greater than zero enable getTile method.
1518  //***
1519  double d = theMasterHueOffset +
1523  theRedHueOffset +
1541 
1542  if ( d != 0.0 ||
1543  theMasterIntensityHighClip != 1.0 ||
1544  theWhiteObjectClip != 1.0 )
1545  {
1546  theValidFlag = true;
1547  // enableSource();
1548  }
1549 }
1550 
1552 {
1553  if (offset >= -180.0 && offset <= 180.0)
1554  {
1555  theMasterHueOffset = offset;
1556  verifyEnabled();
1557  }
1558  else
1559  {
1561  << "ossimHsiRemapper::setMasterHueOffset range error:"
1562  << "\nOffset of " << offset << " is out of range!"
1563  << "\nMust be equal to or greater than -180.0 and less than"
1564  << "\nor equal to 180.0"
1565  << endl;
1566  }
1567 }
1568 
1570 {
1571  if (offset >= -1.0 && offset <= 1.0)
1572  {
1573  theMasterSaturationOffset = offset;
1574  verifyEnabled();
1575  }
1576  else
1577  {
1579  << "ossimHsiRemapper::setMasterSaturationOffset range error:"
1580  << "\nOffset of " << offset << " is out of range!"
1581  << "\nMust be equal to or greater than -1.0 and less than"
1582  << "\nor equal to 1.0"
1583  << endl;
1584  }
1585 }
1586 
1588 {
1589  if (offset >= -1.0 && offset <= 1.0)
1590  {
1591  theMasterIntensityOffset = offset;
1592  verifyEnabled();
1593  }
1594  else
1595  {
1597  << "ossimHsiRemapper::setMasterIntensityOffset range error:"
1598  << "\nOffset of " << offset << " is out of range!"
1599  << "\nMust be equal to or greater than -1.0 and less than"
1600  << "\nor equal to 1.0"
1601  << endl;
1602  }
1603 }
1604 
1606 {
1607  if (clip >= 0.0 && clip < theMasterIntensityHighClip)
1608  {
1610  verifyEnabled();
1611  }
1612  else
1613  {
1615  << "ossimHsiRemapper::setMasterIntensityClip range error:"
1616  << "\nLow clip of " << clip << " is out of range!"
1617  << "\nMust be equal to or greater than 0.0 and less than"
1618  << "\nthe high clip of " << theMasterIntensityHighClip
1619  << endl;
1620  }
1621 }
1622 
1624 {
1625  if (clip <= 1.0 && clip > theMasterIntensityLowClip)
1626  {
1628  verifyEnabled();
1629  }
1630  else
1631  {
1633  << "ossimHsiRemapper::setMasterIntensityHighClip range error:"
1634  << "\nHigh clip of " << clip << " is out of range!"
1635  << "\nMust be greater than low clip of "
1636  << theMasterIntensityLowClip << " and less than 1.0"
1637  << endl;
1638  }
1639 }
1640 
1642 {
1643  if (offset >= -180.0 && offset <= 180.0)
1644  {
1645  theRedHueOffset = offset;
1646  verifyEnabled();
1647  }
1648  else
1649  {
1651  << "ossimHsiRemapper::setRedHueOffset range error:"
1652  << "\nOffset of " << offset << " is out of range!"
1653  << "\nMust be equal to or greater than -180.0 and less than"
1654  << "\nor equal to 180.0"
1655  << endl;
1656  }
1657 }
1658 
1660 {
1661  //***
1662  // Default red range: 330 - 30
1663  // Allow 315 to 15 as long as it's less than the high range.
1664  // Note: Store the range as a negative if it's between 315 and 360.
1665  //***
1666  double r = range;
1667  double h = theRedHueHighRange;
1668 
1669  if (r >= 315.0 && r < 360.0) r = r - 360.0;
1670  if (h >= 315.0 && h < 360.0) h = h - 360.0;
1671 
1672  if (r >= -45.0 && r <= 15.0 && r < h)
1673  {
1674  theRedHueLowRange = r;
1675  }
1676  else
1677  {
1679  << "ossimHsiRemapper::setRedHueLow range error:"
1680  << "\nRange of " << range << " is out of range!"
1681  << endl;
1682  }
1683 }
1684 
1686 {
1687  if (range == 360.0) range = 0.0;
1688 
1689  //***
1690  // Default red range: 330 - 30
1691  // Allow 345 to 45 as long as it's greater than the low range.
1692  // Note: Store the range as a negative if it's between 345 and 360.
1693  //***
1694 
1695  double r = range;
1696  double l = theRedHueLowRange;
1697 
1698  if (r >= 315.0 && r < 360.0) r = r - 360.0;
1699  if (l >= 315.0 && l < 360.0) l = l - 360.0;
1700 
1701  if (r >= -15.0 && r <= 45 && l < r)
1702  {
1703  theRedHueHighRange = r;
1704  }
1705  else
1706  {
1708  << "ossimHsiRemapper::setRedHueHigh range error:"
1709  << "\nRange of " << range << " is out of range!"
1710  << endl;
1711  }
1712 }
1713 
1715 {
1716  //***
1717  // Allowable range: 0.0 to 30.0 as long as it's not greater than the
1718  // half range. If so snap it to half range.
1719  //***
1720  if ( range >= 0.0 &&
1721  range <= MAX_BLEND )
1722  {
1723  double half_range = (theRedHueHighRange - theRedHueLowRange) / 2.0;
1724 
1725  if (range <= half_range)
1726  {
1727  theRedHueBlendRange = range;
1728  }
1729  else
1730  {
1731  // Put it in the middle of the range.
1733  << "ossimHsiRemapper::setRedHueBlendRange range error:"
1734  << "\nRange of " << range << " is greater than the full range"
1735  << "\ndivided by 2!"
1736  << endl;
1737 
1738  theRedHueBlendRange = half_range;
1739  }
1740  }
1741  else
1742  {
1744  << "ossimHsiRemapper::setRedHueBlendRange range error:"
1745  << "\nRange of " << range << " is out of range!"
1746  << endl;
1747  }
1748 }
1749 
1751 {
1752  if (offset >= -1.0 && offset <= 1.0)
1753  {
1754  theRedSaturationOffset = offset;
1755  verifyEnabled();
1756  }
1757  else
1758  {
1760  << "ossimHsiRemapper::setRedSaturationOffset range error:"
1761  << "\nOffset of " << offset << " is out of range!"
1762  << "\nMust be equal to or greater than -1.0 and less than"
1763  << "\nor equal to 1.0"
1764  << endl;
1765  }
1766 }
1767 
1769 {
1770  if (offset >= -1.0 && offset <= 1.0)
1771  {
1772  theRedIntensityOffset = offset;
1773  verifyEnabled();
1774  }
1775  else
1776  {
1778  << "ossimHsiRemapper::setRedIntensityOffset range error:"
1779  << "\nOffset of " << offset << " is out of range!"
1780  << "\nMust be equal to or greater than -1.0 and less than"
1781  << "\nor equal to 1.0"
1782  << endl;
1783  }
1784 }
1785 
1787 {
1788  if (offset >= -180.0 && offset <= 180.0)
1789  {
1790  theYellowHueOffset = offset;
1791  verifyEnabled();
1792  }
1793  else
1794  {
1796  << "ossimHsiRemapper::setYellowHueOffset range error:"
1797  << "\nOffset of " << offset << " is out of range!"
1798  << "\nMust be equal to or greater than -180.0 and less than"
1799  << "\nor equal to 180.0"
1800  << endl;
1801  }
1802 }
1803 
1805 {
1806  //***
1807  // Default yellow range: 30 - 90
1808  // Allow 15 to 75 as long as it's less than the high range.
1809  //***
1810  if ( range >= 15.0 &&
1811  range <= 75.0 &&
1812  range < theYellowHueHighRange )
1813  {
1814  theYellowHueLowRange = range;
1815  }
1816  else
1817  {
1819  << "ossimHsiRemapper::setYellowHueLowRange range error:"
1820  << "\nRange of " << range << " is out of range!"
1821  << endl;
1822  }
1823 }
1824 
1826 {
1827  //***
1828  // Default yellow range: 30 - 90
1829  // Allow 45 to 105 as long as it's greater than the low range.
1830  //***
1831  if ( range >= 45.0 &&
1832  range <= 105.0 &&
1833  range > theYellowHueLowRange )
1834  {
1835  theYellowHueHighRange = range;
1836  }
1837  else
1838  {
1840  << "ossimHsiRemapper::setYellowHueHighRange range error:"
1841  << "\nRange of " << range << " is out of range!"
1842  << endl;
1843  }
1844 }
1845 
1847 {
1848  //***
1849  // Allowable range: 0.0 to 30.0 as long as it's not greater than the
1850  // half range. If so snap it to half range.
1851  //***
1852  if ( range >= 0.0 &&
1853  range <= MAX_BLEND )
1854  {
1855  double half_range = (theYellowHueHighRange - theYellowHueLowRange) / 2.0;
1856 
1857  if (range <= half_range)
1858  {
1859  theYellowHueBlendRange = range;
1860  }
1861  else
1862  {
1863  // Put it in the middle of the range.
1865  << "ossimHsiRemapper::setYellowHueBlendRange range error:"
1866  << "\nRange of " << range << " is greater than the full range"
1867  << "\ndivided by 2!"
1868  << endl;
1869 
1870  theYellowHueBlendRange = half_range;
1871  }
1872  }
1873  else
1874  {
1876  << "ossimHsiRemapper::setYellowHueBlendRange range error:"
1877  << "\nRange of " << range << " is out of range!"
1878  << endl;
1879  }
1880 }
1881 
1883 {
1884  if (offset >= -1.0 && offset <= 1.0)
1885  {
1886  theYellowSaturationOffset = offset;
1887  verifyEnabled();
1888  }
1889  else
1890  {
1892  << "ossimHsiRemapper::setYellowSaturationOffset range error:"
1893  << "\nOffset of " << offset << " is out of range!"
1894  << "\nMust be equal to or greater than -1.0 and less than"
1895  << "\nor equal to 1.0"
1896  << endl;
1897  }
1898 }
1899 
1901 {
1902  if (offset >= -1.0 && offset <= 1.0)
1903  {
1904  theYellowIntensityOffset = offset;
1905  verifyEnabled();
1906  }
1907  else
1908  {
1910  << "ossimHsiRemapper::setYellowIntensityOffset range error:"
1911  << "\nOffset of " << offset << " is out of range!"
1912  << "\nMust be equal to or greater than -1.0 and less than"
1913  << "\nor equal to 1.0"
1914  << endl;
1915  }
1916 }
1917 
1919 {
1920  if (offset >= -180.0 && offset <= 180.0)
1921  {
1922  theGreenHueOffset = offset;
1923  verifyEnabled();
1924  }
1925  else
1926  {
1928  << "ossimHsiRemapper::setGreenHueOffset range error:"
1929  << "\nOffset of " << offset << " is out of range!"
1930  << "\nMust be equal to or greater than -180.0 and less than"
1931  << "\nor equal to 180.0"
1932  << endl;
1933  }
1934 }
1935 
1937 {
1938  //***
1939  // Default green range: 90 - 150
1940  // Allow 75 to 135 as long as it's less than the high range.
1941  //***
1942 
1943  if ( range >= 75.0 &&
1944  range <= 135.0 &&
1945  range < theGreenHueHighRange )
1946  {
1947  theGreenHueLowRange = range;
1948  }
1949  else
1950  {
1952  << "ossimHsiRemapper::setGreenHueLowRange range error:"
1953  << "\nRange of " << range << " is out of range!"
1954  << endl;
1955  }
1956 }
1957 
1959 {
1960  //***
1961  // Default green range: 90 - 150
1962  // Allow 105 to 165 as long as it's greater than the low range.
1963  //***
1964 
1965  if ( range >= 105.0 &&
1966  range <= 165.0 &&
1967  range > theGreenHueLowRange )
1968  {
1969  theGreenHueHighRange = range;
1970  }
1971  else
1972  {
1974  << "ossimHsiRemapper::setGreenHueHighRange range error:"
1975  << "\nRange of " << range << " is out of range!"
1976  << endl;
1977  }
1978 }
1979 
1981 {
1982  //***
1983  // Allowable range: 0.0 to 30.0 as long as it's not greater than the
1984  // half range. If so snap it to half range.
1985  //***
1986  if ( range >= 0.0 &&
1987  range <= MAX_BLEND )
1988  {
1989  double half_range = (theGreenHueHighRange - theGreenHueLowRange) / 2.0;
1990 
1991  if (range <= half_range)
1992  {
1993  theGreenHueBlendRange = range;
1994  }
1995  else
1996  {
1997  // Put it in the middle of the range.
1999  << "ossimHsiRemapper::setGreenHueBlendRange range error:"
2000  << "\nRange of " << range << " is greater than the full range"
2001  << "\ndivided by 2!"
2002  << endl;
2003 
2004  theGreenHueBlendRange = half_range;
2005  }
2006  }
2007  else
2008  {
2010  << "ossimHsiRemapper::setGreenHueBlendRange range error:"
2011  << "\nRange of " << range << " is out of range!"
2012  << endl;
2013  }
2014 }
2015 
2017 {
2018  if (offset >= -1.0 && offset <= 1.0)
2019  {
2020  theGreenSaturationOffset = offset;
2021  verifyEnabled();
2022  }
2023  else
2024  {
2026  << "ossimHsiRemapper::setGreenSaturationOffset range error:"
2027  << "\nOffset of " << offset << " is out of range!"
2028  << "\nMust be equal to or greater than -1.0 and less than"
2029  << "\nor equal to 1.0"
2030  << endl;
2031  }
2032 }
2033 
2035 {
2036  if (offset >= -1.0 && offset <= 1.0)
2037  {
2038  theGreenIntensityOffset = offset;
2039  verifyEnabled();
2040  }
2041  else
2042  {
2044  << "ossimHsiRemapper::setGreenIntensityOffset range error:"
2045  << "\nOffset of " << offset << " is out of range!"
2046  << "\nMust be equal to or greater than -1.0 and less than"
2047  << "\nor equal to 1.0"
2048  << endl;
2049  }
2050 }
2051 
2053 {
2054  if (offset >= -180.0 && offset <= 180.0)
2055  {
2056  theCyanHueOffset = offset;
2057  verifyEnabled();
2058  }
2059  else
2060  {
2062  << "ossimHsiRemapper::setCyanHueOffset range error:"
2063  << "\nOffset of " << offset << " is out of range!"
2064  << "\nMust be equal to or greater than -180.0 and less than"
2065  << "\nor equal to 180.0"
2066  << endl;
2067  }
2068 }
2069 
2071 {
2072  //***
2073  // Default cyan range: 150 - 210
2074  // Allow 135 to 195 as long as it's less than the high range.
2075  //***
2076 
2077  if ( range >= 135.0 &&
2078  range <= 195.0 &&
2079  range < theCyanHueHighRange )
2080  {
2081  theCyanHueLowRange = range;
2082  }
2083  else
2084  {
2086  << "ossimHsiRemapper::setCyanHueLowRange range error:"
2087  << "\nRange of " << range << " is out of range!"
2088  << endl;
2089  }
2090 }
2091 
2093 {
2094  //***
2095  // Default cyan range: 150 - 210
2096  // Allow 165 to 225 as long as it's greater than the low range.
2097  //***
2098 
2099  if ( range >= 165.0 &&
2100  range <= 225.0 &&
2101  range > theCyanHueLowRange )
2102  {
2103  theCyanHueHighRange = range;
2104  }
2105  else
2106  {
2108  << "ossimHsiRemapper::setCyanHueHighRange range error:"
2109  << "\nRange of " << range << " is out of range!"
2110  << endl;
2111  }
2112 }
2113 
2115 {
2116  //***
2117  // Allowable range: 0.0 to 30.0 as long as it's not greater than the
2118  // half range. If so snap it to half range.
2119  //***
2120  if ( range >= 0.0 &&
2121  range <= MAX_BLEND )
2122  {
2123  double half_range = (theCyanHueHighRange - theCyanHueLowRange) / 2.0;
2124 
2125  if (range <= half_range)
2126  {
2127  theCyanHueBlendRange = range;
2128  }
2129  else
2130  {
2131  // Put it in the middle of the range.
2133  << "ossimHsiRemapper::setCyanHueBlendRange range error:"
2134  << "\nRange of " << range << " is greater than the full range"
2135  << "\ndivided by 2!"
2136  << endl;
2137 
2138  theCyanHueBlendRange = half_range;
2139  }
2140  }
2141  else
2142  {
2144  << "ossimHsiRemapper::setCyanHueBlendRange range error:"
2145  << "\nRange of " << range << " is out of range!"
2146  << endl;
2147  }
2148 }
2149 
2151 {
2152  if (offset >= -1.0 && offset <= 1.0)
2153  {
2154  theCyanSaturationOffset = offset;
2155  verifyEnabled();
2156  }
2157  else
2158  {
2160  << "ossimHsiRemapper::setCyanSaturationOffset range error:"
2161  << "\nOffset of " << offset << " is out of range!"
2162  << "\nMust be equal to or greater than -1.0 and less than"
2163  << "\nor equal to 1.0"
2164  << endl;
2165  }
2166 }
2167 
2169 {
2170  if (offset >= -1.0 && offset <= 1.0)
2171  {
2172  theCyanIntensityOffset = offset;
2173  verifyEnabled();
2174  }
2175  else
2176  {
2178  << "ossimHsiRemapper::setCyanIntensityOffset range error:"
2179  << "\nOffset of " << offset << " is out of range!"
2180  << "\nMust be equal to or greater than -1.0 and less than"
2181  << "\nor equal to 1.0"
2182  << endl;
2183  }
2184 }
2185 
2187 {
2188  if (offset >= -180.0 && offset <= 180.0)
2189  {
2190  theBlueHueOffset = offset;
2191  verifyEnabled();
2192  }
2193  else
2194  {
2196  << "ossimHsiRemapper::setBlueHueOffset range error:"
2197  << "\nOffset of " << offset << " is out of range!"
2198  << "\nMust be equal to or greater than -180.0 and less than"
2199  << "\nor equal to 180.0"
2200  << endl;
2201  }
2202 }
2203 
2205 {
2206  //***
2207  // Default blue range: 210 - 270
2208  // Allow 195 to 255 as long as it's less than the high range.
2209  //***
2210  if ( range >= 195.0 &&
2211  range <= 255.0 &&
2212  range < theBlueHueHighRange )
2213  {
2214  theBlueHueLowRange = range;
2215  }
2216  else
2217  {
2219  << "ossimHsiRemapper::setBlueHueLowRange range error:"
2220  << "\nRange of " << range << " is out of range!"
2221  << endl;
2222  }
2223 }
2224 
2226 {
2227  //***
2228  // Default blue range: 210 - 270
2229  // Allow 225 to 285 as long as it's greater than the low range.
2230  //***
2231  if ( range >= 225.0 &&
2232  range <= 285.0 &&
2233  range > theBlueHueLowRange )
2234  {
2235  theBlueHueHighRange = range;
2236  }
2237  else
2238  {
2240  << "ossimHsiRemapper::setBlueHueHighRange range error:"
2241  << "\nRange of " << range << " is out of range!"
2242  << endl;
2243  }
2244 }
2245 
2247 {
2248  //***
2249  // Allowable range: 0.0 to 30.0 as long as it's not greater than the
2250  // half range. If so snap it to half range.
2251  //***
2252  if ( range >= 0.0 &&
2253  range <= MAX_BLEND )
2254  {
2255  double half_range = (theBlueHueHighRange - theBlueHueLowRange) / 2.0;
2256 
2257  if (range <= half_range)
2258  {
2259  theBlueHueBlendRange = range;
2260  }
2261  else
2262  {
2263  // Put it in the middle of the range.
2265  << "ossimHsiRemapper::setBlueHueBlendRange range error:"
2266  << "\nRange of " << range << " is greater than the full range"
2267  << "\ndivided by 2!"
2268  << endl;
2269 
2270  theBlueHueBlendRange = half_range;
2271  }
2272  }
2273  else
2274  {
2276  << "ossimHsiRemapper::setBlueHueBlendRange range error:"
2277  << "\nRange of " << range << " is out of range!"
2278  << endl;
2279  }
2280 }
2281 
2283 {
2284  if (offset >= -1.0 && offset <= 1.0)
2285  {
2286  theBlueSaturationOffset = offset;
2287  verifyEnabled();
2288  }
2289  else
2290  {
2292  << "ossimHsiRemapper::setBlueSaturationOffset range error:"
2293  << "\nOffset of " << offset << " is out of range!"
2294  << "\nMust be equal to or greater than -1.0 and less than"
2295  << "\nor equal to 1.0"
2296  << endl;
2297  }
2298 }
2299 
2301 {
2302  if (offset >= -1.0 && offset <= 1.0)
2303  {
2304  theBlueIntensityOffset = offset;
2305  verifyEnabled();
2306  }
2307  else
2308  {
2310  << "ossimHsiRemapper::setBlueIntensityOffset range error:"
2311  << "\nOffset of " << offset << " is out of range!"
2312  << "\nMust be equal to or greater than -1.0 and less than"
2313  << "\nor equal to 1.0"
2314  << endl;
2315  }
2316 }
2317 
2319 {
2320  if (offset >= -180.0 && offset <= 180.0)
2321  {
2322  theMagentaHueOffset = offset;
2323  verifyEnabled();
2324  }
2325  else
2326  {
2328  << "ossimHsiRemapper::setMagentaHueOffset range error:"
2329  << "\nOffset of " << offset << " is out of range!"
2330  << "\nMust be equal to or greater than -180.0 and less than"
2331  << "\nor equal to 180.0"
2332  << endl;
2333  }
2334 }
2335 
2337 {
2338  //***
2339  // Default magenta range: 270 - 330
2340  // Allow 255 to 315 as long as it's less than the high range.
2341  //***
2342  if ( range >= 255.0 &&
2343  range <= 315.0 &&
2344  range < theMagentaHueHighRange )
2345  {
2346  theMagentaHueLowRange = range;
2347  }
2348  else
2349  {
2351  << "ossimHsiRemapper::setMagentaHueLowRange range error:"
2352  << "\nRange of " << range << " is out of range!"
2353  << endl;
2354  }
2355 }
2356 
2358 {
2359  //***
2360  // Default magenta range: 270 - 330
2361  // Allow 285 to 345 as long as it's greater than the low range.
2362  //***
2363  if ( range >= 285.0 &&
2364  range <= 345.0 &&
2365  range > theMagentaHueLowRange )
2366  {
2367  theMagentaHueHighRange = range;
2368  }
2369  else
2370  {
2372  << "ossimHsiRemapper::setMagentaHueHighRange range error:"
2373  << "\nRange of " << range << " is out of range!"
2374  << endl;
2375  }
2376 }
2377 
2379 {
2380  //***
2381  // Allowable range: 0.0 to 30.0 as long as it's not greater than the
2382  // half range. If so snap it to half range.
2383  //***
2384  if ( range >= 0.0 &&
2385  range <= MAX_BLEND )
2386  {
2387  double half_range = (theMagentaHueHighRange-theMagentaHueLowRange)/2.0;
2388 
2389  if (range <= half_range)
2390  {
2391  theMagentaHueBlendRange = range;
2392  }
2393  else
2394  {
2395  // Put it in the middle of the range.
2397  << "ossimHsiRemapper::setMagentaHueBlendRange range error:"
2398  << "\nRange of " << range << " is greater than the full range"
2399  << "\ndivided by 2!"
2400  << endl;
2401 
2402  theMagentaHueBlendRange = half_range;
2403  }
2404  }
2405  else
2406  {
2408  << "ossimHsiRemapper::setMagentaHueBlendRange range error:"
2409  << "\nRange of " << range << " is out of range!"
2410  << endl;
2411  }
2412 }
2413 
2415 {
2416  if (offset >= -1.0 && offset <= 1.0)
2417  {
2418  theMagentaSaturationOffset = offset;
2419  verifyEnabled();
2420  }
2421  else
2422  {
2424  << "ossimHsiRemapper::setMagentaSaturationOffset range error:"
2425  << "\nOffset of " << offset << " is out of range!"
2426  << "\nMust be equal to or greater than -1.0 and less than"
2427  << "\nor equal to 1.0"
2428  << endl;
2429  }
2430 }
2431 
2433 {
2434  if (offset >= -1.0 && offset <= 1.0)
2435  {
2436  theMagentaIntensityOffset = offset;
2437  verifyEnabled();
2438  }
2439  else
2440  {
2442  << "ossimHsiRemapper::setMagentaIntensityOffset range error:"
2443  << "\nOffset of " << offset << " is out of range!"
2444  << "\nMust be equal to or greater than -1.0 and less than"
2445  << "\nor equal to 1.0"
2446  << endl;
2447  }
2448 }
2449 
2451 {
2452  static const char MODULE[] = "ossimHsiRemapper::calculateMinNormValue";
2453 
2454  if (traceDebug())
2455  {
2456  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " Entered..." << endl;
2457  }
2458 
2459  if (!theTile)
2460  {
2462  << MODULE << " ERROR:"
2463  << "\nClass not initialized!"
2464  << endl;
2465  return 0.0;
2466  }
2467 
2468  double min_pix = theTile->getMinPix(0);
2469  double max_pix = theTile->getMaxPix(0);
2470 
2471  for (ossim_uint32 band=1; band<theTile->getNumberOfBands(); ++band)
2472  {
2473  if (min_pix != theTile->getMinPix(band))
2474  {
2476  << MODULE << " Warning:"
2477  << "\nMixed minimum values for bands..."
2478  << endl;
2479  }
2480  if (max_pix != theTile->getMaxPix(band))
2481  {
2482  ossimNotify(ossimNotifyLevel_WARN) << " Warning:"
2483  << "\nMixed maximum values for bands..."
2484  << endl;
2485  }
2486  }
2487 
2488  if (min_pix < 0.0)
2489  {
2490  //
2491  // Assigning some arbituary number for float data.
2492  // This should really come from the normalizer (ossimImageData) of
2493  // the data.
2494  //
2496  }
2497 
2498  return (min_pix / max_pix);
2499 }
2500 
2502 {
2503  if (isSourceEnabled()&&theValidFlag) // Always rgb tile out...
2504  {
2505  return 3;
2506  }
2507 
2508  // Filter bypassed so getTile will return input tile.
2510 }
2511 
2512 
2514 {
2515  return theMasterHueOffset;
2516 }
2517 
2519 {
2521 }
2522 
2524 {
2525  return theMasterIntensityOffset;
2526 }
2527 
2529 {
2531 }
2532 
2534 {
2536 }
2537 
2539 {
2540  return theRedHueOffset;
2541 }
2542 
2544 {
2545  return theRedHueLowRange;
2546 }
2547 
2549 {
2550  return theRedHueHighRange;
2551 }
2552 
2554 {
2555  return theRedHueBlendRange;
2556 }
2557 
2559 {
2560  return theRedSaturationOffset;
2561 }
2562 
2564 {
2565  return theRedIntensityOffset;
2566 }
2567 
2569 {
2570  return theYellowHueOffset;
2571 }
2572 
2574 {
2575  return theYellowHueLowRange;
2576 }
2577 
2579 {
2580  return theYellowHueHighRange;
2581 }
2582 
2584 {
2585  return theYellowHueBlendRange;
2586 }
2587 
2589 {
2591 }
2592 
2594 {
2595  return theYellowIntensityOffset;
2596 }
2597 
2599 {
2600  return theGreenHueOffset;
2601 }
2602 
2604 {
2605  return theGreenHueLowRange;
2606 }
2607 
2609 {
2610  return theGreenHueHighRange;
2611 }
2612 
2614 {
2615  return theGreenHueBlendRange;
2616 }
2617 
2619 {
2620  return theGreenSaturationOffset;
2621 }
2622 
2624 {
2625  return theGreenIntensityOffset;
2626 }
2627 
2629 {
2630  return theCyanHueOffset;
2631 }
2632 
2634 {
2635  return theCyanHueLowRange;
2636 }
2637 
2639 {
2640  return theCyanHueHighRange;
2641 }
2642 
2644 {
2645  return theCyanHueBlendRange;
2646 }
2647 
2649 {
2650  return theCyanSaturationOffset;
2651 }
2652 
2654 {
2655  return theCyanIntensityOffset;
2656 }
2657 
2659 {
2660  return theBlueHueOffset;
2661 }
2662 
2664 {
2665  return theBlueHueLowRange;
2666 }
2667 
2669 {
2670  return theBlueHueHighRange;
2671 }
2672 
2674 {
2675  return theBlueHueBlendRange;
2676 }
2677 
2679 {
2680  return theBlueSaturationOffset;
2681 }
2682 
2684 {
2685  return theBlueIntensityOffset;
2686 }
2687 
2689 {
2690  return theMagentaHueOffset;
2691 }
2692 
2694 {
2695  return theMagentaHueLowRange;
2696 }
2697 
2699 {
2700  return theMagentaHueHighRange;
2701 }
2702 
2704 {
2705  return theMagentaHueBlendRange;
2706 }
2707 
2709 {
2711 }
2712 
2714 {
2716 }
2717 
2718 void ossimHsiRemapper::setHueOffset(int color_group, double offset)
2719 {
2720  switch (color_group)
2721  {
2722  case RED:
2723  setRedHueOffset(offset);
2724  break;
2725  case YELLOW:
2726  setYellowHueOffset(offset);
2727  break;
2728  case GREEN:
2729  setGreenHueOffset(offset);
2730  break;
2731  case CYAN:
2732  setCyanHueOffset(offset);
2733  break;
2734  case BLUE:
2735  setBlueHueOffset(offset);
2736  break;
2737  case MAGENTA:
2738  setMagentaHueOffset(offset);
2739  break;
2740  case ALL:
2741  setMasterHueOffset(offset);
2742  break;
2743  default:
2745  << "ossimHsiRemapper::setHueOffset NOTICE: Range error!" << endl;
2746  }
2747 }
2748 
2749 void ossimHsiRemapper::setHueLowRange(int color_group, double range)
2750 {
2751  switch (color_group)
2752  {
2753  case RED:
2754  setRedHueLowRange(range);
2755  break;
2756  case YELLOW:
2757  setYellowHueLowRange(range);
2758  break;
2759  case GREEN:
2760  setGreenHueLowRange(range);
2761  break;
2762  case CYAN:
2763  setCyanHueLowRange(range);
2764  break;
2765  case BLUE:
2766  setBlueHueLowRange(range);
2767  break;
2768  case MAGENTA:
2769  setMagentaHueLowRange(range);
2770  break;
2771  default:
2773  << "ossimHsiRemapper::setHueLowRange NOTICE: Range error!"
2774  << endl;
2775  }
2776 }
2777 
2778 void ossimHsiRemapper::setHueHighRange(int color_group, double range)
2779 {
2780  switch (color_group)
2781  {
2782  case RED:
2783  setRedHueHighRange(range);
2784  break;
2785  case YELLOW:
2786  setYellowHueHighRange(range);
2787  break;
2788  case GREEN:
2789  setGreenHueHighRange(range);
2790  break;
2791  case CYAN:
2792  setCyanHueHighRange(range);
2793  break;
2794  case BLUE:
2795  setBlueHueHighRange(range);
2796  break;
2797  case MAGENTA:
2798  setMagentaHueHighRange(range);
2799  break;
2800  default:
2802  << "ossimHsiRemapper::setHueHighRange NOTICE: Range error!"
2803  << endl;
2804  }
2805 }
2806 
2807 void ossimHsiRemapper::setHueBlendRange(int color_group, double range)
2808 {
2809  switch (color_group)
2810  {
2811  case RED:
2812  setRedHueBlendRange(range);
2813  break;
2814  case YELLOW:
2815  setYellowHueBlendRange(range);
2816  break;
2817  case GREEN:
2818  setGreenHueBlendRange(range);
2819  break;
2820  case CYAN:
2821  setCyanHueBlendRange(range);
2822  break;
2823  case BLUE:
2824  setBlueHueBlendRange(range);
2825  break;
2826  case MAGENTA:
2827  setMagentaHueBlendRange(range);
2828  break;
2829  default:
2831  << "ossimHsiRemapper::setHueBlendRange NOTICE: Range error!"
2832  << endl;
2833  }
2834 }
2835 
2836 void ossimHsiRemapper::setSaturationOffset(int color_group, double offset)
2837 {
2838  switch (color_group)
2839  {
2840  case RED:
2841  setRedSaturationOffset(offset);
2842  break;
2843  case YELLOW:
2844  setYellowSaturationOffset(offset);
2845  break;
2846  case GREEN:
2847  setGreenSaturationOffset(offset);
2848  break;
2849  case CYAN:
2850  setCyanSaturationOffset(offset);
2851  break;
2852  case BLUE:
2853  setBlueSaturationOffset(offset);
2854  break;
2855  case MAGENTA:
2857  break;
2858  case ALL:
2859  setMasterSaturationOffset(offset);
2860  break;
2861  default:
2863  << "ossimHsiRemapper::setSaturationOffset NOTICE: Range error!"
2864  << endl;
2865  break;
2866  }
2867 }
2868 
2869 void ossimHsiRemapper::setIntensityOffset(int color_group, double offset)
2870 {
2871  switch (color_group)
2872  {
2873  case RED:
2874  setRedIntensityOffset(offset);
2875  break;
2876  case YELLOW:
2877  setYellowIntensityOffset(offset);
2878  break;
2879  case GREEN:
2880  setGreenIntensityOffset(offset);
2881  break;
2882  case CYAN:
2883  setCyanIntensityOffset(offset);
2884  break;
2885  case BLUE:
2886  setBlueIntensityOffset(offset);
2887  break;
2888  case MAGENTA:
2889  setMagentaIntensityOffset(offset);
2890  break;
2891  case ALL:
2892  setMasterIntensityOffset(offset);
2893  break;
2894  default:
2896  << "ossimHsiRemapper::setIntensityOffset NOTICE: Range error!"
2897  << endl;
2898  break;
2899  }
2900 }
2901 
2902 double ossimHsiRemapper::getHueOffset(int color_group) const
2903 {
2904  switch (color_group)
2905  {
2906  case RED:
2907  return getRedHueOffset();
2908  break;
2909  case YELLOW:
2910  return getYellowHueOffset();
2911  break;
2912  case GREEN:
2913  return getGreenHueOffset();
2914  break;
2915  case CYAN:
2916  return getCyanHueOffset();
2917  break;
2918  case BLUE:
2919  return getBlueHueOffset();
2920  break;
2921  case MAGENTA:
2922  return getMagentaHueOffset();
2923  break;
2924  case ALL:
2925  return getMasterHueOffset();
2926  break;
2927  default:
2929  << "ossimHsiRemapper::getHueOffset NOTICE: Range error!"
2930  << endl;
2931  break;
2932  }
2933  return 0.0;
2934 }
2935 
2936 double ossimHsiRemapper::getHueLowRange(int color_group) const
2937 {
2938  switch (color_group)
2939  {
2940  case RED:
2941  return getRedHueLowRange();
2942  break;
2943  case YELLOW:
2944  return getYellowHueLowRange();
2945  break;
2946  case GREEN:
2947  return getGreenHueLowRange();
2948  break;
2949  case CYAN:
2950  return getCyanHueLowRange();
2951  break;
2952  case BLUE:
2953  return getBlueHueLowRange();
2954  break;
2955  case MAGENTA:
2956  return getMagentaHueLowRange();
2957  break;
2958  default:
2960  << "ossimHsiRemapper::getHueLowRange NOTICE: Range error!"
2961  << endl;
2962  break;
2963  }
2964  return 0.0;
2965 }
2966 
2967 double ossimHsiRemapper::getHueHighRange(int color_group) const
2968 {
2969  switch (color_group)
2970  {
2971  case RED:
2972  return getRedHueHighRange();
2973  break;
2974  case YELLOW:
2975  return getYellowHueHighRange();
2976  break;
2977  case GREEN:
2978  return getGreenHueHighRange();
2979  break;
2980  case CYAN:
2981  return getCyanHueHighRange();
2982  break;
2983  case BLUE:
2984  return getBlueHueHighRange();
2985  break;
2986  case MAGENTA:
2987  return getMagentaHueHighRange();
2988  break;
2989  default:
2991  << "ossimHsiRemapper::getHueHighRange NOTICE: Range error!"
2992  << endl;
2993  break;
2994  }
2995  return 0.0;
2996 }
2997 
2998 double ossimHsiRemapper::getHueBlendRange(int color_group) const
2999 {
3000  switch (color_group)
3001  {
3002  case RED:
3003  return getRedHueBlendRange();
3004  break;
3005  case YELLOW:
3006  return getYellowHueBlendRange();
3007  break;
3008  case GREEN:
3009  return getGreenHueBlendRange();
3010  break;
3011  case CYAN:
3012  return getCyanHueBlendRange();
3013  break;
3014  case BLUE:
3015  return getBlueHueBlendRange();
3016  break;
3017  case MAGENTA:
3018  return getMagentaHueBlendRange();
3019  break;
3020  default:
3022  << "ossimHsiRemapper::getHueBlendRange NOTICE: Range error!"
3023  << endl;
3024  break;
3025  }
3026  return 0.0;
3027 }
3028 
3029 double ossimHsiRemapper::getSaturationOffset(int color_group) const
3030 {
3031  switch (color_group)
3032  {
3033  case RED:
3034  return getRedSaturationOffset();
3035  break;
3036  case YELLOW:
3037  return getYellowSaturationOffset();
3038  break;
3039  case GREEN:
3040  return getGreenSaturationOffset();
3041  break;
3042  case CYAN:
3043  return getCyanSaturationOffset();
3044  break;
3045  case BLUE:
3046  return getBlueSaturationOffset();
3047  break;
3048  case MAGENTA:
3049  return getMagentaSaturationOffset();
3050  break;
3051  case ALL:
3052  return getMasterSaturationOffset();
3053  break;
3054  default:
3056  << "ossimHsiRemapper::getSaturationOffset NOTICE: Range error!"
3057  << endl;
3058  break;
3059  }
3060  return 0.0;
3061 }
3062 
3063 double ossimHsiRemapper::getIntensityOffset(int color_group) const
3064 {
3065  switch (color_group)
3066  {
3067  case RED:
3068  return getRedIntensityOffset();
3069  break;
3070  case YELLOW:
3071  return getYellowIntensityOffset();
3072  break;
3073  case GREEN:
3074  return getGreenIntensityOffset();
3075  break;
3076  case CYAN:
3077  return getCyanIntensityOffset();
3078  break;
3079  case BLUE:
3080  return getBlueIntensityOffset();
3081  break;
3082  case MAGENTA:
3083  return getMagentaIntensityOffset();
3084  break;
3085  case ALL:
3086  return getMasterIntensityOffset();
3087  break;
3088  default:
3090  << "ossimHsiRemapper::getIntensityOffset NOTICE: Range error!"
3091  << endl;
3092  break;
3093  }
3094  return 0.0;
3095 }
3096 
3098 {
3099  if ( (clip >= .8) && (clip <= 1.0) )
3100  {
3101  theWhiteObjectClip = clip;
3102  verifyEnabled();
3103  }
3104  else
3105  {
3107  << "HsiRemapper::setWhiteObjectClip range error:"
3108  << "\nClip of " << clip << " is out of range!"
3109  << "\nMust be between .8 and 1.0"
3110  << endl;
3111  }
3112 }
3113 
3115 {
3116  return theWhiteObjectClip;
3117 }
3118 
3120 {
3121  theWhiteObjectClip = 1.0;
3122  verifyEnabled();
3123 }
3124 
3126 {
3127  return ossimString("HSI Remapper, filter with controls for all HSI(Hue, Saturation, and Intensity) adjustments.");
3128 }
3129 
3131 {
3132  return ossimString("HSI Remapper");
3133 }
3134 
3136 {
3137  os << setiosflags(ios::fixed) << setprecision(2)
3138  << "\nossimHsiRemapper:"
3139  << "\ntheEnableFlag: " << theEnableFlag
3140 
3141  << "\ntheMasterHueOffset: " << theMasterHueOffset
3142  << "\ntheMasterSaturationOffset: " << theMasterSaturationOffset
3143  << "\ntheMasterIntensityOffset: " << theMasterIntensityOffset
3144  << "\ntheMasterIntensityLowClip: " << theMasterIntensityLowClip
3145  << "\ntheMasterIntensityHighClip: " << theMasterIntensityHighClip
3146 
3147  << "\ntheRedHueOffset: " << theRedHueOffset
3148  << "\ntheRedHueLowRange: " << theRedHueLowRange
3149  << "\ntheRedHueHighRange: " << theRedHueHighRange
3150  << "\ntheRedSaturationOffset: " << theRedSaturationOffset
3151  << "\ntheRedIntensityOffset: " << theRedIntensityOffset
3152 
3153  << "\ntheYellowHueOffset: " << theYellowHueOffset
3154  << "\ntheYellowHueLowRange: " << theYellowHueLowRange
3155  << "\ntheYellowHueHighRange: " << theYellowHueHighRange
3156  << "\ntheYellowSaturationOffset: " << theYellowSaturationOffset
3157  << "\ntheYellowIntensityOffset: " << theYellowIntensityOffset
3158 
3159  << "\ntheGreenHueOffset: " << theGreenHueOffset
3160  << "\ntheGreenHueLowRange: " << theGreenHueLowRange
3161  << "\ntheGreenHueHighRange: " << theGreenHueHighRange
3162  << "\ntheGreenSaturationOffset: " << theGreenSaturationOffset
3163  << "\ntheGreenIntensityOffset: " << theGreenIntensityOffset
3164 
3165  << "\ntheCyanHueOffset: " << theCyanHueOffset
3166  << "\ntheCyanHueLowRange: " << theCyanHueLowRange
3167  << "\ntheCyanHueHighRange: " << theCyanHueHighRange
3168  << "\ntheCyanSaturationOffset: " << theCyanSaturationOffset
3169  << "\ntheCyanIntensityOffset: " << theCyanIntensityOffset
3170 
3171  << "\ntheBlueHueOffset: " << theBlueHueOffset
3172  << "\ntheBlueHueLowRange: " << theBlueHueLowRange
3173  << "\ntheBlueHueHighRange: " << theBlueHueHighRange
3174  << "\ntheBlueSaturationOffset: " << theBlueSaturationOffset
3175  << "\ntheBlueIntensityOffset: " << theBlueIntensityOffset
3176 
3177  << "\ntheMagentaHueOffset: " << theMagentaHueOffset
3178  << "\ntheMagentaHueLowRange: " << theMagentaHueLowRange
3179  << "\ntheMagentaHueHighRange: " << theMagentaHueHighRange
3180  << "\ntheMagentaSaturationOffset: " << theMagentaSaturationOffset
3181  << "\ntheMagentaIntensityOffset: " << theMagentaIntensityOffset
3182 
3183  << "\ntheWhiteObjectClip: " << theWhiteObjectClip
3184  << endl;
3185 
3186  return os;
3187 }
3188 
3190 {
3191  return hr.print(os);
3192 }
void setMasterIntensityOffset(double offset)
void setYellowHueBlendRange(double range)
double getHueHighRange(int color_group) const
virtual void valueToString(ossimString &valueResult) const =0
virtual ossim_uint32 getWidth() const
double theMagentaIntensityOffset
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
double getHueOffset(int color_group) const
double getCyanSaturationOffset() const
virtual void setProperty(ossimRefPtr< ossimProperty > property)
virtual ossim_uint32 getNumberOfInputBands() const
void setMasterHueOffset(double offset)
virtual const ossim_float64 * getMaxPix() const
double getCyanHueBlendRange() const
virtual ossim_uint32 getNumberOfBands() const
ossim_float64 getS() const
void setGreenHueLowRange(double range)
double theMagentaSaturationOffset
virtual void setImageRectangle(const ossimIrect &rect)
ossim_float64 getH() const
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
double getYellowHueHighRange() const
Represents serializable keyword/value map.
bool theEnableFlag
Definition: ossimSource.h:62
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
double getMasterIntensityOffset() const
bool valid() const
Definition: ossimRefPtr.h:75
const char * find(const char *key) const
double getMagentaHueOffset() const
void setGreenSaturationOffset(double offset)
double theCyanSaturationOffset
virtual void copyTileBandToNormalizedBuffer(ossim_uint32 band, ossim_float64 *buf) const
Will copy this tiles specified band number to the normalized buffer.
void setMagentaHueHighRange(double range)
double getYellowHueLowRange() const
ossim_uint32 height() const
Definition: ossimIrect.h:487
void setHueOffset(int color_group, double offset)
double getMasterIntensityHighClip() const
double getRedHueOffset() const
double getHueBlendRange(int color_group) const
static ossimString toString(bool aValue)
Numeric to string methods.
double getCyanHueOffset() const
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &tile_rect, ossim_uint32 resLevel=0)
void setMagentaIntensityOffset(double offset)
void setCyanHueHighRange(double range)
double getBlueIntensityOffset() const
double getMagentaSaturationOffset() const
double getMasterSaturationOffset() const
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
double theBlueSaturationOffset
double getYellowHueBlendRange() const
double theMasterIntensityHighClip
void setYellowSaturationOffset(double offset)
void setMagentaHueBlendRange(double range)
double getWhiteObjectClip() const
void setGreenIntensityOffset(double offset)
void setHueBlendRange(int color_group, double range)
virtual void initialize()
Initialize the data buffer.
void setMagentaHueOffset(double offset)
double getBlueHueBlendRange() const
double getYellowSaturationOffset() const
void setWhiteObjectClip(double clip)
void resetGroup(int color_group)
double theMasterIntensityOffset
double getMasterIntensityLowClip() const
void setMagentaSaturationOffset(double offset)
double getMagentaIntensityOffset() const
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
void setSaturationOffset(int color_group, double offset)
double getGreenHueBlendRange() const
void setCyanHueLowRange(double range)
double getYellowIntensityOffset() const
void setI(ossim_float64 I)
ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
ossimRefPtr< ossimImageData > theTile
double getGreenHueHighRange() const
static ossimImageDataFactory * instance()
double getBlueHueLowRange() const
double getMagentaHueBlendRange() const
double getGreenIntensityOffset() const
void allocate(const ossimIrect &rect)
yy_size_t size
virtual ossimDataObjectStatus validate() const
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
double theYellowIntensityOffset
void setMagentaHueLowRange(double range)
void setMasterIntensityHighClip(double clip)
void setYellowHueOffset(double offset)
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
#define FLT_EPSILON
void setBlueHueHighRange(double range)
void setRedHueLowRange(double range)
virtual void setProperty(ossimRefPtr< ossimProperty > property)
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
ossimImageSource * theInputConnection
void setH(ossim_float64 H)
unsigned int ossim_uint32
ossim_float64 getI() const
double getHueLowRange(int color_group) const
void setRedHueHighRange(double range)
double getBlueSaturationOffset() const
void setBlueHueLowRange(double range)
void setRedHueOffset(double offset)
void setCyanIntensityOffset(double offset)
virtual ostream & print(ostream &os) const
Outputs theErrorStatus as an ossimErrorCode and an ossimString.
void setCyanSaturationOffset(double offset)
double getGreenSaturationOffset() const
void setGreenHueOffset(double offset)
virtual void copyTileToNormalizedBuffer(ossim_float64 *buf) const
Copies entire tile to buf passed in.
double getBlueHueOffset() const
double theMagentaHueBlendRange
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
void setGreenHueHighRange(double range)
double getYellowHueOffset() const
virtual void copyNormalizedBufferToTile(ossim_float64 *buf)
Copies buf passed in to tile.
void setYellowIntensityOffset(double offset)
void setIntensityOffset(int color_group, double offset)
double getGreenHueOffset() const
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const
ossim_uint32 width() const
Definition: ossimIrect.h:500
virtual void initialize()
void setGreenHueBlendRange(double range)
double getIntensityOffset(int color_group) const
double getRedHueBlendRange() const
ostream & operator<<(ostream &os, const ossimHsiRemapper &hr)
void setCyanHueOffset(double offset)
virtual const ossim_float64 * getMinPix() const
double theGreenSaturationOffset
void setBlueHueBlendRange(double range)
virtual void makeBlank()
Initializes data to null pixel values.
void setBlueHueOffset(double offset)
double theYellowSaturationOffset
#define OSSIM_DEFAULT_MIN_PIX_NORM_DOUBLE
double getMagentaHueLowRange() const
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
void setRedHueBlendRange(double range)
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
ossim_float64 getB() const
double getRedIntensityOffset() const
double getCyanIntensityOffset() const
void setRedSaturationOffset(double offset)
void setS(ossim_float64 S)
double getSaturationOffset(int color_group) const
void setMasterSaturationOffset(double offset)
double theMasterSaturationOffset
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
void setMasterIntensityLowClip(double clip)
double getBlueHueHighRange() const
void setRedIntensityOffset(double offset)
virtual ossimString getShortName() const
ossim_float64 getG() const
#define RTTI_DEF1(cls, name, b1)
Definition: ossimRtti.h:485
double getGreenHueLowRange() const
ossimDataObjectStatus
Definitions for data object status.
virtual ossimString getLongName() const
double getMagentaHueHighRange() const
double getMasterHueOffset() const
ossim_float64 getR() const
double getRedHueHighRange() const
double getRedSaturationOffset() const
double theMasterIntensityLowClip
void setYellowHueHighRange(double range)
double getCyanHueHighRange() const
void setCyanHueBlendRange(double range)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
void setBlueSaturationOffset(double offset)
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
void setCacheRefreshBit()
double getCyanHueLowRange() const
void setHueLowRange(int color_group, double range)
void setBlueIntensityOffset(double offset)
void setYellowHueLowRange(double range)
virtual ossimRefPtr< ossimImageData > getTile(const ossimIpt &origin, ossim_uint32 resLevel=0)
double getRedHueLowRange() const
double theGreenIntensityOffset
void setHueHighRange(int color_group, double range)