OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimFilterResampler.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 // Copyright (C) 2000 ImageLinks Inc.
3 //
4 // License: LGPL
5 //
6 // See LICENSE.txt file in the top level directory for more details.
7 //
8 // Author: Garrett Potts
9 
10 // Contributor:
11 // David A. Horner (DAH) http://dave.thehorners.com
12 //
13 //*************************************************************************
14 // $Id: ossimFilterResampler.cpp 23586 2015-10-19 10:45:22Z gpotts $
15 
17 #include <ossim/base/ossimCommon.h>
22 #include <ossim/base/ossimDpt.h>
23 #include <ossim/base/ossimDrect.h>
26  :theMinifyFilter(new ossimNearestNeighborFilter()),
27  theMagnifyFilter(new ossimNearestNeighborFilter()),
28  theMinifyFilterType(ossimFilterResampler_NEAREST_NEIGHBOR),
29  theMagnifyFilterType(ossimFilterResampler_NEAREST_NEIGHBOR),
30  theScaleFactor(1.0, 1.0),
31  theInverseScaleFactor(1.0, 1.0),
32  theBlurFactor(1.0)
33 {
34  setScaleFactor(ossimDpt(1.0, 1.0));
35  loadState(ossimPreferences::instance()->preferencesKWL(),"resampler.");
36 
37 }
38 
40 {
41  if(theMinifyFilter)
42  {
43  delete theMinifyFilter;
44  theMinifyFilter = NULL;
45  }
47  {
48  delete theMagnifyFilter;
49  theMagnifyFilter = NULL;
50  }
51 }
52 
53 
56  const ossimDpt& ul,
57  const ossimDpt& ur,
58  const ossimDpt& deltaUl,
59  const ossimDpt& deltaUr,
60  const ossimDpt& length)
61 {
62  resample(input,
63  output,
64  output->getImageRectangle(),
65  ul,
66  ur,
67  deltaUl,
68  deltaUr,
69  length);
70 }
71 
74  const ossimIrect& outputSubRect,
75  const ossimDpt& ul,
76  const ossimDpt& ur,
77  const ossimDpt& deltaUl,
78  const ossimDpt& deltaUr,
79  const ossimDpt& length)
80 {
81  if(!input.valid() ||
82  !output.valid() ||
83  !input->getBuf() ||
84  !output->getBuf())
85  {
86  return;
87  }
88 
89  ossimScalarType scalarType = input->getScalarType();
90  switch(scalarType)
91  {
92  case OSSIM_UINT8:
93  {
94  resampleBilinearTile(ossim_uint8(0), // dummy template variable
95  input,
96  output,
97  outputSubRect,
98  ul,
99  ur,
100  deltaUl,
101  deltaUr,
102  length);
103  break;
104  }
105  case OSSIM_SINT8:
106  {
107  resampleBilinearTile(ossim_sint8(0), // dummy template variable
108  input,
109  output,
110  outputSubRect,
111  ul,
112  ur,
113  deltaUl,
114  deltaUr,
115  length);
116  break;
117  }
118  case OSSIM_UINT16:
119  case OSSIM_USHORT11:
120  case OSSIM_USHORT12:
121  case OSSIM_USHORT13:
122  case OSSIM_USHORT14:
123  case OSSIM_USHORT15:
124  {
125  resampleBilinearTile(ossim_uint16(0), // dummy template variable
126  input,
127  output,
128  outputSubRect,
129  ul,
130  ur,
131  deltaUl,
132  deltaUr,
133  length);
134  break;
135  }
136  case OSSIM_SINT16:
137  {
138  resampleBilinearTile(ossim_sint16(0), // dummy template variable
139  input,
140  output,
141  outputSubRect,
142  ul,
143  ur,
144  deltaUl,
145  deltaUr,
146  length);
147  break;
148  }
149  case OSSIM_UINT32:
150  {
151  resampleBilinearTile(ossim_uint32(0), // dummy template variable
152  input,
153  output,
154  outputSubRect,
155  ul,
156  ur,
157  deltaUl,
158  deltaUr,
159  length);
160  break;
161  }
162  case OSSIM_SINT32:
163  {
164  resampleBilinearTile(ossim_sint32(0), // dummy template variable
165  input,
166  output,
167  outputSubRect,
168  ul,
169  ur,
170  deltaUl,
171  deltaUr,
172  length);
173  break;
174  }
175  case OSSIM_FLOAT32:
177  {
178  resampleBilinearTile(ossim_float32(0.0), // dummy template variable
179  input,
180  output,
181  outputSubRect,
182  ul,
183  ur,
184  deltaUl,
185  deltaUr,
186  length);
187  break;
188  }
189  case OSSIM_FLOAT64:
191  {
192  resampleBilinearTile(ossim_float64(0.0), // dummy template variable
193  input,
194  output,
195  outputSubRect,
196  ul,
197  ur,
198  deltaUl,
199  deltaUr,
200  length);
201  break;
202  }
203  default:
204  {
206  << "ossimFilterResampler::resample error: unknown scalar type: "
207  << scalarType << endl;
208  }
209  }
210 }
211 
212 
214  ossimFilterResamplerType filterType,
215  ossimFilterResamplerType& result)
216 {
217  switch(filterType)
218  {
220  {
221  return new ossimNearestNeighborFilter();
222  }
224  {
225  return new ossimBoxFilter();
226  }
228  {
229  return new ossimGaussianFilter();
230  }
232  {
233  return new ossimCubicFilter();
234  }
236  {
237  return new ossimHanningFilter();
238  }
240  {
241  return new ossimHammingFilter();
242  }
244  {
245  return new ossimLanczosFilter();
246  }
248  {
249  return new ossimCatromFilter();
250  }
252  {
253  return new ossimMitchellFilter();
254  }
256  {
257  return new ossimBlackmanFilter();
258  }
260  {
261  return new ossimBlackmanSincFilter();
262  }
264  {
265  return new ossimBlackmanBesselFilter();
266  }
268  {
269  return new ossimQuadraticFilter();
270  }
272  {
273  return new ossimTriangleFilter();
274  }
276  {
277  return new ossimHermiteFilter();
278  }
280  {
281  return new ossimGaussianFilter();
282  }
284  {
285  return new ossimBSplineFilter();
286  }
288  {
289  return new ossimBSplineFilter();
290  }
291  }
292 
294  return new ossimNearestNeighborFilter();
295 }
296 
298 {
299  theScaleFactor = scale;
300  if(fabs(theScaleFactor.x) <= FLT_EPSILON)
301  {
302  theScaleFactor.x = 1.0;
303  }
304  if(fabs(theScaleFactor.y) <= FLT_EPSILON)
305  {
306  theScaleFactor.y = 1.0;
307  }
308 
311 }
312 
314  T /* dummy */,
315  const ossimRefPtr<ossimImageData>& input,
317  const ossimIrect& outputSubRect,
318  const ossimDpt& inputUl,
319  const ossimDpt& inputUr,
320  const ossimDpt& deltaUl,
321  const ossimDpt& deltaUr,
322  const ossimDpt& outLength)
323 {
324 #if 0 /* Please leave for debug. */
325  std::cout << "INPUT = \n" << *input << std::endl
326  << "OUTPUT = \n" << *output << std::endl
327  << "inputUL= " << inputUl << std::endl
328  << "inputUR= " << inputUr << std::endl
329  << "deltaUL= " << deltaUl << std::endl
330  << "deltaUr= " << deltaUr << std::endl
331  << "outlength= " << outLength << std::endl;
332 #endif
333 
334  ossim_uint32 band, centerOffset;
335  ossim_float64 tmpFlt64, stepSizeWidth;
336 
337  if(outLength.x>1) {
338  stepSizeWidth = 1.0/(outLength.x-1.0);
339  } else {
340  stepSizeWidth = 1.0;
341  }
342 
343  // INPUT INFORMATION
344  ossim_uint32 inWidth = input->getWidth();
345  ossim_uint32 inBandSize = input->getSizePerBand(); // fix for out-of-bounds check OLK 06/2005
346  ossim_uint32 BANDS = input->getNumberOfBands();
347  ossimIrect inputRect = input->getImageRectangle();
348 
349  // OUTPUT INFORMATION
350  const ossim_float64* NULL_PIX = output->getNullPix();
351  const ossim_float64* MIN_PIX = output->getMinPix();
352  const ossim_float64* MAX_PIX = output->getMaxPix();
353  ossimIrect outputRect = output->getImageRectangle();
354  ossim_uint32 resultRectH = outputSubRect.height();
355  ossim_uint32 resultRectW = outputSubRect.width();
356  ossim_uint32 outputRectW = outputRect.width();
357 
358  // calculate the offset into the data so we can refer to it at 0 index.
359  ossim_uint32 resultOffset=(outputSubRect.ul().y - outputRect.ul().y)*outputRectW +
360  (outputSubRect.ul().x - outputRect.ul().x);
361 
362  // make a local copy of the band pointers (at resultOffset)
363  ossim_float64 *densityvals=new ossim_float64[BANDS];
364  ossim_float64 *pixelvals=new ossim_float64[BANDS];
365  const T* *inputBuf = new const T*[BANDS];
366  T* *resultBuf = new T*[BANDS];
367  if(!pixelvals||!inputBuf||!resultBuf)
368  {
369  return;
370  }
371 
372  for(band = 0; band < BANDS; ++band)
373  {
374  inputBuf[band] = static_cast<const T*>(input->getBuf(band));
375  resultBuf[band] = static_cast<T*>(output->getBuf(band))+resultOffset;
376  }
377 
378  // FILTER INFORMAION
379  ossim_uint32 xkernel_width = theFilterTable.getWidth();;
380  ossim_uint32 ykernel_height = theFilterTable.getHeight();
381  double xkernel_half_width = theFilterTable.getXSupport();
382  double ykernel_half_height = theFilterTable.getYSupport();
383 
384  double initialx = inputUl.x-inputRect.ul().x;
385  double initialy = inputUl.y-inputRect.ul().y;
386  double terminalx = inputUr.x-inputRect.ul().x;
387  double terminaly = inputUr.y-inputRect.ul().y;
388  double pointx,pointy,deltaX,deltaY;
389  ossim_int32 starty,startx;
390 
391  if(xkernel_width==0 || ykernel_height==0)
392  {
393  // USING NEAREST NEIGHBOR
394  for(ossim_uint32 resultY = 0; resultY < resultRectH; ++resultY)
395  {
396 // deltaX = (terminalx-initialx) * stepSizeWidth;
397 // deltaY = (terminaly-initialy) * stepSizeHeight;
398  // this should be stepsize width for both since we are traversing horizontal
399  deltaX = (terminalx-initialx) * stepSizeWidth;
400  deltaY = (terminaly-initialy) * stepSizeWidth;
401  pointx = initialx;
402  pointy = initialy;
403  for(ossim_uint32 resultX = 0; resultX < resultRectW; ++resultX)
404  {
405  // just sample center in input space.
406  centerOffset = ossim::round<int>(pointy)*inWidth + ossim::round<int>(pointx);
407  for(band=0;band<BANDS;++band)
408  {
409  resultBuf[band][resultX] = inputBuf[band][centerOffset];
410  }
411  pointy += deltaY;
412  pointx += deltaX;
413  } // End of loop in x direction.
414 
415  // increment pointers to where we are now.
416  for(band=0;band<BANDS;++band)
417  {
418  resultBuf[band] += outputRectW;
419  }
420  initialx += deltaUl.x;
421  initialy += deltaUl.y;
422  terminalx += deltaUr.x;
423  terminaly += deltaUr.y;
424  } // End of loop in y direction.
425 
426  }
427  else
428  {
429  // USING A KERNEL
430  const double* kernel;
431  ossim_uint32 iy,ix,sourceIndex,nullCount;
432  for(ossim_uint32 resultY = 0; resultY < resultRectH; ++resultY)
433  {
434  deltaX = (terminalx-initialx) * stepSizeWidth;
435  deltaY = (terminaly-initialy) * stepSizeWidth;
436  pointx = initialx;
437  pointy = initialy;
438  for(ossim_uint32 resultX = 0; resultX < resultRectW; ++resultX)
439  {
440  starty = ossim::round<int>(pointy - ykernel_half_height + .5);
441  startx = ossim::round<int>(pointx - xkernel_half_width + .5);
442  centerOffset = ossim::round<int>(pointy)*inWidth + ossim::round<int>(pointx);
443  sourceIndex = starty*inWidth+startx;
444 
445  // look at center pixel, make sure they aren't all null.
446  nullCount=0;
447  if(centerOffset<inBandSize)
448  {
449  for (band=0;band<BANDS;++band)
450  {
451  if(inputBuf[band][centerOffset]==static_cast<T>(NULL_PIX[band]))
452  {
453  ++nullCount;
454  }
455  }
456  // the center of the kernel is outside the input space, just set null.
457  }
458  else
459  {
460  nullCount=BANDS;
461  }
462 
463  // make sure we have non-null data and we fit within the inputBuf.
464  if ( nullCount==BANDS || (sourceIndex>=inBandSize))
465  {
466  // we don't need to continue, just assign null!
467  for (band=0;band<BANDS;++band)
468  {
469  resultBuf[band][resultX] = static_cast<T>(NULL_PIX[band]);
470  }
471  }
472  else
473  {
474  kernel = theFilterTable.getClosestWeights(pointx,pointy);
475  if(kernel)
476  {
477  // reset the pixel/density sums for each band to zero.
478  memset(densityvals,'\0',sizeof(ossim_float64)*BANDS);
479  memset(pixelvals,'\0',sizeof(ossim_float64)*BANDS);
480 
481  // apply kernel to input space.
482  for (iy=0;((iy<ykernel_height)&&(sourceIndex<inBandSize));++iy)
483  {
484  for (ix = 0;((ix<xkernel_width)&&(sourceIndex<inBandSize));++ix)
485  {
486  tmpFlt64=*kernel; // pixel weight;
487  for(band=0;band<BANDS;++band)
488  {
489  if(inputBuf[band][sourceIndex]!=NULL_PIX[band])
490  {
491  densityvals[band] += tmpFlt64;
492  pixelvals[band] += (inputBuf[band][sourceIndex]*tmpFlt64);
493  }
494  }
495  ++sourceIndex;
496  ++kernel;
497  if(sourceIndex>=inBandSize)
498  {
499  break;
500  }
501  }
502  sourceIndex+=(inWidth-xkernel_width);
503  }
504 
505  // actually assign the value to the output
506  for (band = 0; band < BANDS; ++band)
507  {
508  if(densityvals[band]<=FLT_EPSILON)
509  {
510  //---
511  // Setting tempFlt64 to pixelvals[band] causing 0's where -32768
512  // should be when null check was skipped above.
513  // tmpFlt64 = pixelvals[band];
514  //---
515  tmpFlt64 = NULL_PIX[band];
516  }
517  else
518  {
519  // normalize
520  tmpFlt64 = pixelvals[band]/densityvals[band];
521  }
522 
523  // clamp
524  tmpFlt64 = (tmpFlt64>=MIN_PIX[band]?(tmpFlt64<MAX_PIX[band]?tmpFlt64:MAX_PIX[band]):MIN_PIX[band]);
525  // set resultant pixel value.
526  resultBuf[band][resultX] = static_cast<T>(tmpFlt64);
527  }
528 
529  // we didn't get a filter kernel, just set NULL in this disaster.
530  }
531  else
532  {
533  for (band=0;band<BANDS;++band)
534  {
535  resultBuf[band][resultX] = static_cast<T>(NULL_PIX[band]);
536  }
537  }
538  }
539  pointy += deltaY;
540  pointx += deltaX;
541  } // End of loop in x direction.
542 
543  // increment pointers to where we are now.
544  for(band=0;band<BANDS;++band)
545  {
546  resultBuf[band] += outputRectW;
547  }
548  initialx += deltaUl.x;
549  initialy += deltaUl.y;
550  terminalx += deltaUr.x;
551  terminaly += deltaUr.y;
552  } // End of loop in y direction.
553  } // USING A KERNEL END
554 
555  delete [] densityvals;
556  delete [] pixelvals;
557  delete [] resultBuf;
558  delete [] inputBuf;
559 }
560 
562 {
563  switch(type)
564  {
566  {
567  return "nearest neighbor";
568  }
570  {
571  return "box";
572  }
574  {
575  return "gaussian";
576  }
578  {
579  return "cubic";
580  }
582  {
583  return "hanning";
584  }
586  {
587  return "hamming";
588  }
590  {
591  return "lanczos";
592  }
594  {
595  return "mitchell";
596  }
598  {
599  return "catrom";
600  }
602  {
603  return "blackman";
604  }
606  {
607  return "sinc";
608  }
610  {
611  return "bessel";
612  }
614  {
615  return "quadratic";
616  }
618  {
619  return "bilinear";
620  }
622  {
623  return "hermite";
624  }
626  {
627  return "gaussian";
628  }
630  {
631  return "bspline";
632  }
634  {
635  return "magic";
636  }
637  }
638 
639  return "nearest neighbor";
640 }
641 
642 void ossimFilterResampler::getFilterTypes(std::vector<ossimString>& filterTypes)const
643 {
644  filterTypes.push_back("nearest neighbor");
645  filterTypes.push_back("bilinear");
646  filterTypes.push_back("cubic");
647 // filterTypes.push_back("bell");
648  filterTypes.push_back("bessel");
649  filterTypes.push_back("blackman");
650  filterTypes.push_back("box");
651  filterTypes.push_back("bspline");
652  filterTypes.push_back("catrom");
653  filterTypes.push_back("gaussian");
654  filterTypes.push_back("hanning");
655  filterTypes.push_back("hamming");
656  filterTypes.push_back("hermite");
657  filterTypes.push_back("lanczos");
658  filterTypes.push_back("mitchell");
659  filterTypes.push_back("quadratic");
660  filterTypes.push_back("sinc");
661  filterTypes.push_back("magic");
662 }
663 
664 
666 {
667  ossimString typeUpper = type;
668  typeUpper = typeUpper.upcase();
669 
670  if(typeUpper.contains("BOX"))
671  {
673  }
674  else if(typeUpper.contains("NEAREST"))
675  {
677  }
678  else if(typeUpper.contains("GAUSSIAN"))
679  {
681  }
682  else if(typeUpper.contains("HANNING"))
683  {
685  }
686  else if(typeUpper.contains("HAMMING"))
687  {
689  }
690  else if(typeUpper.contains("LANCZOS"))
691  {
693  }
694  else if(typeUpper.contains("MITCHELL"))
695  {
697  }
698  else if(typeUpper.contains("CATROM"))
699  {
701  }
702  else if(typeUpper.contains("CUBIC"))
703  {
705  }
706  else if(typeUpper.contains("BESSEL"))
707  {
709  }
710  else if(typeUpper.contains("SINC"))
711  {
713  }
714  else if(typeUpper.contains("BLACKMAN"))
715  {
717  }
718  else if(typeUpper.contains("QUADRATIC"))
719  {
721  }
722  else if(typeUpper.contains("TRIANGLE"))
723  {
725  }
726  else if(typeUpper.contains("BILINEAR"))
727  {
729  }
730  else if(typeUpper.contains("HERMITE"))
731  {
733  }
734 // else if(typeUpper.contains("BELL"))
735 // {
736 // return ossimFilterResampler_BELL;
737 // }
738  else if(typeUpper.contains("BSPLINE"))
739  {
741  }
742  else if(typeUpper.contains("MAGIC"))
743  {
745  }
746 
748 }
749 
750 void ossimFilterResampler::getKernelSupport(double& x, double& y)const
751 {
752  const ossimFilter* horizontalFilter = getHorizontalFilter();
753  const ossimFilter* verticalFilter = getVerticalFilter();
754 
755  if(!horizontalFilter)
756  {
757  x = 0.0;
758  }
759  else
760  {
761 // x = theBlurFactor*ossim::max(1.0/theScaleFactor.x, 1.0)*
762 // horizontalFilter->getSupport();
763  x = horizontalFilter->getSupport();
764  }
765 
766  if(!verticalFilter)
767  {
768  y = 0.0;
769  }
770  else
771  {
772 // y = theBlurFactor*ossim::max(1.0/theScaleFactor.y, 1.0)*
773 // verticalFilter->getSupport();
774  y = verticalFilter->getSupport();
775  }
776 }
777 
779 {
780  if(theScaleFactor.x < 1)
781  {
782  return theMinifyFilter;
783  }
784 
785  return theMagnifyFilter;
786 }
787 
789 {
790  if(theScaleFactor.y < 1)
791  {
792  return theMinifyFilter;
793  }
794 
795  return theMagnifyFilter;
796 }
797 
799 {
800  setFilterType(type, type);
801 }
802 
804 {
805  setFilterType(filterType, filterType);
806 }
808  const ossimString& magnifyType)
809 {
810  setFilterType(getFilterType(minifyType),
811  getFilterType(magnifyType));
812 }
813 
815 {
816  setMinifyFilterType(getFilterType(minifyType));
817 }
818 
820 {
821  setMagnifyFilterType(getFilterType(magnifyType));
822 }
823 
825 {
826  setFilterType(filterType,
828 }
829 
831 {
833 }
834 
836 {
838 }
839 
841 {
843 }
844 
846  ossimFilterResamplerType minifyFilterType,
847  ossimFilterResamplerType magnifyFilterType)
848 {
849  if(theMinifyFilter)
850  {
851  delete theMinifyFilter;
852  theMinifyFilter = NULL;
853  }
854  if(theMagnifyFilter)
855  {
856  delete theMagnifyFilter;
857  theMagnifyFilter = NULL;
858  }
859 
860  theMinifyFilterType = minifyFilterType;
861  theMagnifyFilterType = magnifyFilterType;
862 
865  computeTable();
866 }
867 
869 {
870  return theBlurFactor;
871 }
872 
874 {
875  theBlurFactor = blur;
876 }
877 
879  const char* prefix)const
880 {
881  kwl.add(prefix,
884  true);
885  kwl.add(prefix,
888  true);
889  kwl.add(prefix,
890  "minify_type",
892  true);
893  kwl.add(prefix,
894  "magnify_type",
896  true);
897 
898  return true;
899 }
900 
902  const char* prefix)
903 {
904  const char* lookup = 0;
905 
906  lookup = kwl.find(prefix, ossimKeywordNames::SCALE_X_KW);
907  if (lookup)
908  {
909  theScaleFactor.x = ossimString(lookup).toDouble();
910  }
911 
912  lookup = kwl.find(prefix, ossimKeywordNames::SCALE_Y_KW);
913  if (lookup)
914  {
915  theScaleFactor.y = ossimString(lookup).toDouble();
916  }
917 
918  lookup = kwl.find(prefix, "minify_type");
919  if (lookup)
920  {
921  setMinifyFilterType(lookup);
922  }
923 
924  lookup = kwl.find(prefix, "magnify_type");
925  if (lookup)
926  {
927  setMagnifyFilterType(lookup);
928  }
929 
930  if(fabs(theScaleFactor.x) <= FLT_EPSILON)
931  {
932  theScaleFactor.x = 1.0;
933  }
934  if(fabs(theScaleFactor.y) <= FLT_EPSILON)
935  {
936  theScaleFactor.y = 1.0;
937  }
938 
941 
942  return true;
943 }
944 
946 {
948 }
949 
16 bit unsigned integer (15 bits used)
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
8 bit signed integer
virtual ossim_uint32 getWidth() const
ossim_uint32 x
ossimString getMagnifyFilterTypeAsString() const
virtual const ossim_float64 * getMaxPix() const
virtual void getFilterTypes(std::vector< ossimString > &filterTypes) const
static ossimString upcase(const ossimString &aString)
Definition: ossimString.cpp:34
virtual ossim_uint32 getNumberOfBands() const
virtual double getSupport() const =0
64 bit floating point
16 bit unsigned integer
ossimString getMinifyFilterTypeAsString() const
Represents serializable keyword/value map.
ossim_uint32 y
bool valid() const
Definition: ossimRefPtr.h:75
ossim_uint32 getXSupport() const
const char * find(const char *key) const
float ossim_float32
double y
Definition: ossimDpt.h:165
ossim_uint32 height() const
Definition: ossimIrect.h:487
static const char * SCALE_X_KW
bool contains(char aChar) const
Definition: ossimString.h:58
ossim_float64 getBlurFactor() const
16 bit signed integer
void setScaleFactor(const ossimDpt &scale)
const ossimIpt & ul() const
Definition: ossimIrect.h:274
16 bit unsigned integer (14 bits used)
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
void setBlurFactor(ossim_float64 blur)
unsigned short ossim_uint16
32 bit unsigned integer
static const char * SCALE_Y_KW
void setFilterType(ossimFilterResamplerType filterType)
double ossim_float64
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
const double * getClosestWeights(const double &x, const double &y) const
Inlined below.
ossimFilterTable theFilterTable
const ossimFilter * getVerticalFilter() const
ossim_uint32 getWidth() const
signed short ossim_sint16
#define FLT_EPSILON
32 bit signed integer
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
ossimString getFilterTypeAsString(ossimFilterResamplerType type) const
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
32 bit normalized floating point
ossimFilterResamplerType theMagnifyFilterType
double toDouble() const
signed int ossim_sint32
virtual ossimIrect getImageRectangle() const
ossimFilter * createNewFilter(ossimFilterResamplerType filterType, ossimFilterResamplerType &result)
ossim_uint32 getHeight() const
ossim_uint32 width() const
Definition: ossimIrect.h:500
ossimFilterResamplerType getFilterType(const ossimString &type) const
static ossimPreferences * instance()
ossimScalarType
virtual const ossim_float64 * getMinPix() const
void setMinifyFilterType(const ossimString &minifyType)
void setMagnifyFilterType(const ossimString &magnifyType)
virtual void getKernelSupport(double &x, double &y) const
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
ossim_uint32 getYSupport() const
void buildTable(ossim_uint32 filterSteps, const ossimFilter &filter)
Builds a table with filter being used in both x and y direction.
const ossimFilter * getHorizontalFilter() const
ossim_int32 y
Definition: ossimIpt.h:142
virtual const void * getBuf() const
double x
Definition: ossimDpt.h:164
virtual void resample(const ossimRefPtr< ossimImageData > &input, ossimRefPtr< ossimImageData > &output, const ossimDpt &ul, const ossimDpt &ur, const ossimDpt &deltaUl, const ossimDpt &deltaUr, const ossimDpt &length)
ossim_int32 x
Definition: ossimIpt.h:141
8 bit unsigned integer
void resampleBilinearTile(T dummy, const ossimRefPtr< ossimImageData > &input, ossimRefPtr< ossimImageData > &output, const ossimIrect &outputSubRect, const ossimDpt &inputUl, const ossimDpt &inputUr, const ossimDpt &deltaUl, const ossimDpt &deltaUr, const ossimDpt &outLength)
unsigned char ossim_uint8
ossimFilterResamplerType theMinifyFilterType
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
int ossim_int32
16 bit unsigned integer (12 bits used)
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)