OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimScaleFilter.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 //*************************************************************************
11 // $Id: ossimScaleFilter.cpp 21631 2012-09-06 18:10:55Z dburken $
20 
22 
23 //**************************************************************************************************
26  m_BlankTile(NULL),
27  m_Tile(NULL),
28  m_MinifyFilter(NULL),
29  m_MagnifyFilter(NULL),
30  m_MinifyFilterType(ossimScaleFilter_NEAREST_NEIGHBOR),
31  m_MagnifyFilterType(ossimScaleFilter_NEAREST_NEIGHBOR),
32  m_ScaleFactor(1.0, 1.0),
33  m_InverseScaleFactor(1.0, 1.0),
34  m_TileSize(64, 64),
35  m_BlurFactor(1.0)
36 {
40 }
41 
42 //**************************************************************************************************
44  const ossimDpt& scaleFactor)
45  :ossimImageSourceFilter(inputSource),
46  m_BlankTile(NULL),
47  m_Tile(NULL),
48  m_MinifyFilter(NULL),
49  m_MagnifyFilter(NULL),
50  m_MinifyFilterType(ossimScaleFilter_NEAREST_NEIGHBOR),
51  m_MagnifyFilterType(ossimScaleFilter_NEAREST_NEIGHBOR),
52  m_ScaleFactor(scaleFactor),
53  m_TileSize(64, 64),
54  m_BlurFactor(1.0)
55 {
59 }
60 
61 //**************************************************************************************************
63 {
64  if(m_MinifyFilter)
65  {
66  delete m_MinifyFilter;
67  m_MinifyFilter = NULL;
68  }
69 
70  if(m_MagnifyFilter)
71  {
72  delete m_MagnifyFilter;
73  m_MagnifyFilter = NULL;
74  }
75 }
76 
77 //**************************************************************************************************
79  const ossimIrect& tileRect, ossim_uint32 resLevel)
80 {
81 
82  if((!isSourceEnabled())||
84  ((m_ScaleFactor.x == 1.0)&&
85  (m_ScaleFactor.y == 1.0)&&
86  (m_BlurFactor == 1.0)))
87  {
88  return ossimImageSourceFilter::getTile(tileRect, resLevel);
89  }
90  if(!m_Tile.valid())
91  {
92  allocate();
93  }
94 
95  if(!m_Tile)
96  {
97  return ossimImageSourceFilter::getTile(tileRect, resLevel);
98  }
99 
100  m_Tile->makeBlank();
101 
102 
103  ossimIrect imageRect = tileRect*m_InverseScaleFactor;
104 
105  m_Tile->setImageRectangle(tileRect);
106  m_BlankTile->setImageRectangle(tileRect);
107 
108 
109  double xSupport;
110  double ySupport;
111 
112  getSupport(xSupport, ySupport);
113 
114  ossimIpt deltaPt;
115  deltaPt.x = (ossim_int32)ceil(xSupport);
116  deltaPt.y = (ossim_int32)ceil(ySupport);
117 
118  imageRect = ossimIrect(imageRect.ul().x - (deltaPt.x),
119  imageRect.ul().y - (deltaPt.y),
120  imageRect.lr().x + (deltaPt.x),
121  imageRect.lr().y + (deltaPt.y));
122 
123 
124  runFilter(imageRect, tileRect);
125 
126  m_Tile->validate();
127 
128  return m_Tile;
129 }
130 
131 //**************************************************************************************************
133  const ossimIrect& viewRect)
134 {
135  switch(m_Tile->getScalarType())
136  {
137  case OSSIM_UINT8:
138  {
140  imageRect,
141  viewRect);
142  break;
143  }
144  case OSSIM_USHORT11:
145  case OSSIM_USHORT12:
146  case OSSIM_USHORT13:
147  case OSSIM_USHORT14:
148  case OSSIM_USHORT15:
149  case OSSIM_UINT16:
150  {
152  imageRect,
153  viewRect);
154  break;
155  }
156  case OSSIM_SINT16:
157  {
159  imageRect,
160  viewRect);
161  break;
162  }
163  case OSSIM_UINT32:
164  {
166  imageRect,
167  viewRect);
168  break;
169  }
170  case OSSIM_DOUBLE:
172  {
174  imageRect,
175  viewRect);
176  break;
177  }
178  case OSSIM_FLOAT:
180  {
182  imageRect,
183  viewRect);
184  break;
185  }
186  default:
187  break;
188  }
189 }
190 
191 //**************************************************************************************************
192 template <class T>
194  const ossimIrect& imageRect,
195  const ossimIrect& viewRect)
196 {
197  ossimRefPtr<ossimImageData> inputData =
198  theInputConnection->getTile(imageRect);
199 
200  if(!inputData.valid() ||
201  !inputData->getBuf() ||
202  (inputData->getDataObjectStatus() == OSSIM_EMPTY))
203  {
204  return;
205  }
206 
207  ossim_int32 h = imageRect.height();
208  ossimRefPtr<ossimImageData> tempData =
210  inputData->getScalarType(),
211  inputData->getNumberOfBands(),
212  viewRect.width(),
213  h);
214  tempData->setOrigin(ossimIpt(viewRect.ul().x,
215  imageRect.ul().y));
216 
217  tempData->initialize();
218 
219  if((m_ScaleFactor.x != 1.0)||
220  (m_BlurFactor != 1.0))
221  {
223  inputData,
224  tempData);
225  tempData->validate();
226  }
227  else
228  {
229  tempData->loadTile(inputData.get());
230  }
231 
232  if((m_ScaleFactor.y != 1.0)||
233  (m_BlurFactor != 1.0))
234  {
236  tempData,
237  m_Tile);
238  }
239  else
240  {
241  m_Tile->loadTile(tempData.get());
242  }
243 
244  m_Tile->validate();
245 }
246 
247 //**************************************************************************************************
249 {
251 
252  if(!result.hasNans())
253  {
254  result *= m_ScaleFactor;
255  }
256 
257  return result;
258 }
259 
260 //**************************************************************************************************
262 {
263  setFilterType(filterType, filterType);
264 }
265 
266 
267 //**************************************************************************************************
269  ossimScaleFilterType magnifyFilterType)
270 {
271  if(m_MinifyFilter)
272  {
273  delete m_MinifyFilter;
274  m_MinifyFilter = NULL;
275  }
276  if(m_MagnifyFilter)
277  {
278  delete m_MagnifyFilter;
279  m_MagnifyFilter = NULL;
280  }
281 
282  m_MinifyFilterType = minifyFilterType;
283  m_MagnifyFilterType = magnifyFilterType;
284 
287 }
288 
289 //**************************************************************************************************
291  ossimScaleFilterType& result)
292 {
293  switch(filterType)
294  {
296  {
297  return new ossimNearestNeighborFilter();
298  }
300  {
301  return new ossimBoxFilter();
302  }
304  {
305  return new ossimGaussianFilter();
306  }
308  {
309  return new ossimCubicFilter();
310  }
312  {
313  return new ossimHanningFilter();
314  }
316  {
317  return new ossimHammingFilter();
318  }
320  {
321  return new ossimLanczosFilter();
322  }
324  {
325  return new ossimCatromFilter();
326  }
328  {
329  return new ossimMitchellFilter();
330  }
332  {
333  return new ossimBlackmanFilter();
334  }
336  {
337  return new ossimBlackmanSincFilter();
338  }
340  {
341  return new ossimBlackmanBesselFilter();
342  }
344  {
345  return new ossimQuadraticFilter();
346  }
348  {
349  return new ossimTriangleFilter();
350  }
352  {
353  return new ossimHermiteFilter();
354  }
355 
356  }
357 
359  return new ossimNearestNeighborFilter();
360 }
361 
362 //**************************************************************************************************
364 {
365  m_ScaleFactor = scale;
366  if(fabs(m_ScaleFactor.x) <= FLT_EPSILON)
367  {
368  m_ScaleFactor.x = 1.0;
369  }
370  if(fabs(m_ScaleFactor.y) <= FLT_EPSILON)
371  {
372  m_ScaleFactor.y = 1.0;
373  }
374 
377 
378  // A change in the scale factor implies a change to the image geometry. If one has been created
379  // it needs to be modified:
380  updateGeometry();
381 }
382 
383 
384 //**************************************************************************************************
386  T /* dummy */,
387  const ossimRefPtr<ossimImageData>& input,
389 {
390  ossimIrect viewRect = output->getImageRectangle();
391  ossimIrect imageRect = input->getImageRectangle();
392  ossim_int32 vw = viewRect.width();
393  ossim_int32 vh = viewRect.height();
394  ossim_int32 iw = imageRect.width();
395  ossimIpt origin(viewRect.ul());
396  ossimIpt imageOrigin(imageRect.ul());
397  ossimIpt inputUl = m_InputRect.ul();
398  ossimIpt inputLr = m_InputRect.lr();
399 
400  double scale = 0.0;
401  double support = 0.0;
402  ossim_int32 x = 0;
403  ossim_int32 y = 0;
404  ossim_int32 start = 0;
405  ossim_int32 stop = 0;
406  ossim_int32 kernelIdx = 0;
407  const ossimFilter* filter = getHorizontalFilter();
408  ossim_float64 center = 0.0;
409  ossim_int32 bandIdx = 0;
410  ossim_int32 numberOfBands = m_Tile->getNumberOfBands();
411 
412  scale = m_BlurFactor*ossim::max(1.0/m_ScaleFactor.x, 1.0);
413 
414  support=scale*filter->getSupport();
415  if (support <= 0.5)
416  {
417  support = 0.5 + FLT_EPSILON;
418  scale = 1.0;
419  }
420  scale=1.0/scale;
421  for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
422  {
423  T* imageBuf = (T*)input->getBuf(bandIdx);
424  T* viewBuf = (T*)output->getBuf(bandIdx);
425  T np = (T)input->getNullPix(bandIdx);
426  T outNp = (T)output->getNullPix(bandIdx);
427  T outMinPix = (T)output->getMinPix(bandIdx);
428  T outMaxPix = (T)output->getMaxPix(bandIdx);
429 
430  for(x = 0; x < vw; ++x)
431  {
432  center=(origin.x + x+ .5)/m_ScaleFactor.x;
433  start=ossim::max((ossim_int32)ossim::round<int>(center-support), (ossim_int32)inputUl.x);
434  stop=ossim::min((ossim_int32)ossim::round<int>(center+support), (ossim_int32)inputLr.x);
435  ossim_int32 delta = stop-start;
436  if (delta <= 0)
437  {
438  break;
439  }
440  vector<double> kernel(delta);
441  double density=0.0;
442 
443  for(kernelIdx = 0; kernelIdx < delta; ++kernelIdx)
444  {
445  double t = scale*(start + kernelIdx -
446  center + .5);
447  kernel[kernelIdx] = filter->filter(t,
448  filter->getSupport());
449  density += kernel[kernelIdx];
450  }
451  if ((density != 0.0) && (density != 1.0))
452  {
453  /*
454  Normalize.
455  */
456  density=1.0/density;
457  for (kernelIdx=0; kernelIdx < delta; kernelIdx++)
458  kernel[kernelIdx]*=density;
459  }
460  ossim_int32 offset = start - imageOrigin.x;
461 
462  T* xptr = imageBuf + offset;
463  T* xCenterptr = imageBuf + offset;
464  T* outptr = viewBuf + x;
465 
466  for(y = 0; y < vh; ++y)
467  {
468  double result = 0.0;
469  density = 0.0;
470  if((*xCenterptr) == np)
471  {
472  *outptr = outNp;
473  }
474  else
475  {
476  for(kernelIdx = 0; kernelIdx < (int)kernel.size(); ++kernelIdx)
477  {
478  if((*xptr != np)&&
479  (kernel[kernelIdx] != 0.0))
480  {
481  result += ((double)(*(xptr+kernelIdx))*kernel[kernelIdx]);
482  density += kernel[kernelIdx];
483  }
484  }
485  if(density != 0.0)
486  {
487  result /= density;
488 
489  if(result < outMinPix) result = outMinPix;
490  if(result > outMaxPix) result = outMaxPix;
491 
492  *outptr = (T)result;
493  }
494  else
495  {
496  *outptr = outNp;
497  }
498  }
499  xCenterptr += iw;
500  xptr += iw;
501  outptr += vw;
502  }
503  }
504  }
505 }
506 
507 //**************************************************************************************************
509  T /* dummy */,
510  const ossimRefPtr<ossimImageData>& input,
512 {
513  ossimIrect viewRect = output->getImageRectangle();
514  ossimIrect imageRect = input->getImageRectangle();
515  ossim_int32 vw = viewRect.width();
516  ossim_int32 vh = viewRect.height();
517  ossim_int32 iw = imageRect.width();
518  ossimIpt origin(viewRect.ul());
519  ossimIpt imageOrigin(imageRect.ul());
520  ossimIpt inputUl = m_InputRect.ul();
521  ossimIpt inputLr = m_InputRect.lr();
522  double scale = 0.0;
523  double support = 0.0;
524  ossim_int32 x = 0;
525  ossim_int32 y = 0;
526  ossim_int32 start = 0;
527  ossim_int32 stop = 0;
528  ossim_int32 kernelIdx = 0;
529  const ossimFilter* filter = getVerticalFilter();
530  ossim_float64 center = 0.0;
531  ossim_int32 bandIdx = 0;
532  ossim_int32 numberOfBands = m_Tile->getNumberOfBands();
533 
534  scale = m_BlurFactor*ossim::max(1.0/m_ScaleFactor.y, 1.0);
535 
536  support=scale*filter->getSupport();
537  if (support <= 0.5)
538  {
539  support = .5 + FLT_EPSILON;
540  scale = 1.0;
541  }
542  scale=1.0/scale;
543 
544  for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
545  {
546  T* imageBuf = (T*)input->getBuf(bandIdx);
547  T* viewBuf = (T*)output->getBuf(bandIdx);
548  T np = (T)input->getNullPix(bandIdx);
549  T outNp = (T)output->getNullPix(bandIdx);
550  T outMinPix = (T)output->getMinPix(bandIdx);
551  T outMaxPix = (T)output->getMaxPix(bandIdx);
552 
553  for(y = 0; y < vh; ++y)
554  {
555  center=(double) ((y + origin.y+0.5)/m_ScaleFactor.y);
556  start=ossim::max((ossim_int32)ossim::round<int>(center-support), (ossim_int32)inputUl.y);
557  stop=ossim::min((ossim_int32)ossim::round<int>(center+support), (ossim_int32)inputLr.y);
558  ossim_int32 delta = stop-start;
559  if (delta <= 0)
560  {
561  break;
562  }
563  vector<double> kernel(delta);
564  double density = 0.0;
565  for(kernelIdx = 0; kernelIdx < delta; ++kernelIdx)
566  {
567  kernel[kernelIdx] = filter->filter(scale*(start + kernelIdx - center + .5),
568  filter->getSupport());
569  density += kernel[kernelIdx];
570  }
571  if ((density != 0.0) && (density != 1.0))
572  {
573  /*
574  Normalize.
575  */
576  density=1.0/density;
577  for (kernelIdx=0; kernelIdx < delta; kernelIdx++)
578  kernel[kernelIdx]*=density;
579  }
580 
581  ossim_int32 offset = ((start - imageOrigin.y)*iw);
582  ossim_int32 offsetCenter = ((((ossim_int32)center) - imageOrigin.y)*iw);
583 
584  for(x = 0; x < vw; ++x)
585  {
586  T* yptr = imageBuf + offset + x;
587  T* yCenterptr = imageBuf + offsetCenter + x;
588  double result = 0.0;
589  density = 0.0;
590 
591  if((*yCenterptr) == np)
592  {
593  *viewBuf = outNp;
594  }
595  else
596  {
597  for(kernelIdx = 0; kernelIdx < delta; ++kernelIdx)
598  {
599  if((*yptr != np)&&
600  (kernel[kernelIdx] != 0.0))
601  {
602  result += ((*yptr)*kernel[kernelIdx]);
603  density += kernel[kernelIdx];
604  }
605  yptr += iw;
606  }
607  if(density != 0.0)
608  {
609  result /= density;
610 
611  if(result < outMinPix) result = outMinPix;
612  if(result > outMaxPix) result = outMaxPix;
613 
614  *viewBuf = (T)result;
615  }
616  else
617  {
618  *viewBuf = outNp;
619  }
620  }
621  ++viewBuf;
622  }
623  }
624  }
625 }
626 
627 //**************************************************************************************************
629 {
631 
632  // Force an allocate next getTile.
633  m_Tile = NULL;
634  m_BlankTile = NULL;
636 }
637 
638 //**************************************************************************************************
640 {
641  m_Tile = NULL;
642  m_BlankTile = NULL;
644 
646  {
649 
650  m_Tile->initialize();
651 
653  }
654 }
655 
656 //**************************************************************************************************
657 // Returns a pointer reference to the active image geometry at this filter. The input source
658 // geometry is modified, so we need to maintain our own geometry object as a data member.
659 //**************************************************************************************************
661 {
662  // Have we already defined our own geometry? Return it if so:
664 
665  // Otherwise we'll need to establish a geometry based on the input connection:
667  {
668  // Fetch the map projection of the input image if it exists:
670 
671  // If trivial case of identity scale, just pass along the input connection's geometry:
672  if ((m_ScaleFactor.x == 1.0) && (m_ScaleFactor.y == 1.0))
673  return inputGeom;
674 
675  // Need to create a copy of the input geom and modify it as our own, then pass that:
676  if ( inputGeom.valid() )
677  {
678  m_ScaledGeometry = new ossimImageGeometry(*inputGeom);
679  updateGeometry();
680 
681  // Return the modified geometry:
682  return m_ScaledGeometry;
683  }
684  }
685 
686  // No geometry defined, return NULL pointer:
688 }
689 
690 //**************************************************************************************************
692  const ossimDpt& scaleFactor)const
693 {
694  ossimIpt origin(ossim::round<int>(input.ul().x*scaleFactor.x),
695  ossim::round<int>(input.ul().y*scaleFactor.y));
696  ossim_int32 w = ossim::round<int>(input.width()*scaleFactor.x);
697  ossim_int32 h = ossim::round<int>(input.height()*scaleFactor.y);
698 
699  if(w < 1) w = 1;
700  if(h < 1) h = 1;
701 
702  return ossimIrect(origin.x,
703  origin.y,
704  origin.x + (w-1),
705  origin.y + (h-1));
706 }
707 
708 //**************************************************************************************************
710 {
711  switch(type)
712  {
714  {
715  return "nearest_neighbor";
716  }
718  {
719  return "box";
720  }
722  {
723  return "gaussian";
724  }
726  {
727  return "cubic";
728  }
730  {
731  return "hanning";
732  }
734  {
735  return "hamming";
736  }
738  {
739  return "lanczos";
740  }
742  {
743  return "mitchell";
744  }
746  {
747  return "catrom";
748  }
750  {
751  return "blackman";
752  }
754  {
755  return "blackman_sinc";
756  }
758  {
759  return "blackman_bessel";
760  }
762  {
763  return "quadratic";
764  }
766  {
767  return "triangle";
768  }
770  {
771  return "hermite";
772  }
773  }
774 
775  return "nearest_neighbor";
776 }
777 
778 //**************************************************************************************************
780 {
781  ossimString typeUpper = type;
782  typeUpper = typeUpper.upcase();
783 
784  if(typeUpper.contains("BOX"))
785  {
786  return ossimScaleFilter_BOX;
787  }
788  else if(typeUpper.contains("NEAREST_NEIGHBOR"))
789  {
791  }
792  else if(typeUpper.contains("GAUSSIAN"))
793  {
795  }
796  else if(typeUpper.contains("HANNING"))
797  {
799  }
800  else if(typeUpper.contains("HAMMING"))
801  {
803  }
804  else if(typeUpper.contains("LANCZOS"))
805  {
807  }
808  else if(typeUpper.contains("MITCHELL"))
809  {
811  }
812  else if(typeUpper.contains("CATROM"))
813  {
815  }
816  else if(typeUpper.contains("CUBIC"))
817  {
818  return ossimScaleFilter_CUBIC;
819  }
820  else if(typeUpper.contains("BLACKMAN_BESSEL"))
821  {
823  }
824  else if(typeUpper.contains("BLACKMAN_SINC"))
825  {
827  }
828  else if(typeUpper.contains("BLACKMAN"))
829  {
831  }
832  else if(typeUpper.contains("QUADRATIC"))
833  {
835  }
836  else if(typeUpper.contains("TRIANGLE"))
837  {
839  }
840  else if(typeUpper.contains("HERMITE"))
841  {
843  }
844 
846 }
847 
848 //**************************************************************************************************
849 void ossimScaleFilter::getSupport(double& x, double& y)
850 {
851  const ossimFilter* horizontalFilter = getHorizontalFilter();
852  const ossimFilter* verticalFilter = getVerticalFilter();
853 
855  horizontalFilter->getSupport();
857  verticalFilter->getSupport();
858 }
859 
860 //**************************************************************************************************
862 {
863  if(m_ScaleFactor.x < 1)
864  {
865  return m_MinifyFilter;
866  }
867 
868  return m_MagnifyFilter;
869 }
870 
871 //**************************************************************************************************
873 {
874  if(m_ScaleFactor.y < 1)
875  {
876  return m_MinifyFilter;
877  }
878 
879  return m_MagnifyFilter;
880 }
881 
882 
883 
884 //**************************************************************************************************
885 bool ossimScaleFilter::saveState(ossimKeywordlist& kwl, const char* prefix)const
886 {
887  kwl.add(prefix,
890  true);
891  kwl.add(prefix,
894  true);
895  kwl.add(prefix,
896  "minify_type",
898  true);
899  kwl.add(prefix,
900  "magnify_type",
902  true);
903 
904  return ossimImageSourceFilter::saveState(kwl, prefix);
905 }
906 
907 //**************************************************************************************************
909  const char* prefix)
910 {
911  ossimString scalex = kwl.find(prefix,
913  ossimString scaley = kwl.find(prefix,
915  ossimString minify = kwl.find(prefix,
916  "minify_type");
917  ossimString magnify = kwl.find(prefix,
918  "magnify_type");
919 
920  m_ScaleFactor.x = scalex.toDouble();
921  m_ScaleFactor.y = scaley.toDouble();
922 
923  if(fabs(m_ScaleFactor.x) <= FLT_EPSILON)
924  {
925  m_ScaleFactor.x = 1.0;
926  }
927  if(fabs(m_ScaleFactor.y) <= FLT_EPSILON)
928  {
929  m_ScaleFactor.y = 1.0;
930  }
931 
934 
936  getFilterType(magnify));
937 
938  // A change in the scale factor implies a change to the image geometry. If one has been created
939  // it needs to be modified:
940  updateGeometry();
941 
942  return ossimImageSourceFilter::loadState(kwl, prefix);
943 }
944 
945 //**************************************************************************************************
948 //**************************************************************************************************
950 {
951  if (m_ScaledGeometry.valid())
952  {
953  // Modify the image geometry's projection with the scale factor before returning geom:
956  if(mapProj)
957  mapProj->applyScale(m_InverseScaleFactor, true);
958  }
959 }
16 bit unsigned integer (15 bits used)
ossim_uint32 x
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
This will return the bounding rect of the source.
void runFilter(const ossimIrect &imageRect, const ossimIrect &viewRect)
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
virtual const ossim_float64 * getMaxPix() const
static ossimString upcase(const ossimString &aString)
Definition: ossimString.cpp:34
T max(T a, T b)
Definition: ossimCommon.h:236
virtual ossim_uint32 getNumberOfBands() const
virtual double getSupport() const =0
virtual void setImageRectangle(const ossimIrect &rect)
ossimRefPtr< ossimImageData > m_Tile
16 bit unsigned integer
void updateGeometry()
If this object is maintaining an ossimImageGeometry, this method needs to be called after a scale cha...
Represents serializable keyword/value map.
void setScaleFactor(const ossimDpt &scale)
ossimString getFilterTypeAsString(ossimScaleFilterType type) const
ossim_uint32 y
bool valid() const
Definition: ossimRefPtr.h:75
const char * find(const char *key) const
float ossim_float32
void getSupport(double &x, double &y)
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
16 bit signed integer
ossimFilter * createNewFilter(ossimScaleFilterType filterType, ossimScaleFilterType &result)
const ossimIpt & ul() const
Definition: ossimIrect.h:274
virtual ossimDataObjectStatus getDataObjectStatus() const
16 bit unsigned integer (14 bits used)
16 bit unsigned integer (13 bits used)
unsigned short ossim_uint16
ossimIrect m_InputRect
32 bit unsigned integer
virtual void applyScale(const ossimDpt &scale, bool recenterTiePoint)
Applies scale to theDeltaLonPerPixel, theDeltaLatPerPixel and theMetersPerPixel data members (eg: the...
const ossimFilter * getHorizontalFilter() const
static const char * SCALE_Y_KW
virtual void initialize()
Initialize the data buffer.
ossimFilter * m_MinifyFilter
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
double ossim_float64
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual void loadTile(const void *src, const ossimIrect &src_rect, ossimInterleaveType il_type)
void runFilterTemplate(T dummy, const ossimIrect &imageRect, const ossimIrect &viewRect)
static ossimImageDataFactory * instance()
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
This will return the bounding rect of the source.
virtual ossimDataObjectStatus validate() const
signed short ossim_sint16
ossimFilter * m_MagnifyFilter
#define FLT_EPSILON
ossimImageSource * theInputConnection
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
32 bit normalized floating point
double toDouble() const
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
virtual ossimIrect getImageRectangle() const
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
ossim_float64 m_BlurFactor
virtual ~ossimScaleFilter()
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &tileRect, ossim_uint32 resLevel=0)
ossimRefPtr< ossimImageData > m_BlankTile
const ossimIpt & lr() const
Definition: ossimIrect.h:276
ossimIrect scaleRect(const ossimIrect input, const ossimDpt &scaleFactor) const
T min(T a, T b)
Definition: ossimCommon.h:203
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const
ossim_uint32 width() const
Definition: ossimIrect.h:500
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if not defined...
ossimDpt m_InverseScaleFactor
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
virtual double filter(double x, double support) const =0
RTTI_DEF1(ossimScaleFilter, "ossimScaleFilter", ossimImageSourceFilter)
virtual void setOrigin(const ossimIpt &origin)
virtual const ossim_float64 * getMinPix() const
ossimRefPtr< ossimImageGeometry > m_ScaledGeometry
The input image geometry, altered by the scale.
const ossimFilter * getVerticalFilter() const
void setFilterType(ossimScaleFilterType filterType)
virtual ossimScalarType getScalarType() const
virtual void makeBlank()
Initializes data to null pixel values.
64 bit normalized floating point
const ossimProjection * getProjection() const
Access methods for projection (may be NULL pointer).
16 bit unsigned integer (11 bits used)
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if not defined...
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
void runVerticalFilterTemplate(T dummy, const ossimRefPtr< ossimImageData > &input, ossimRefPtr< ossimImageData > &output)
ossim_int32 y
Definition: ossimIpt.h:142
virtual void initialize()
void makeNan()
Definition: ossimIrect.h:329
virtual const void * getBuf() const
double x
Definition: ossimDpt.h:164
bool hasNans() const
Definition: ossimIrect.h:337
ossim_int32 x
Definition: ossimIpt.h:141
ossimScaleFilterType getFilterType(const ossimString &type) const
8 bit unsigned integer
void runHorizontalFilterTemplate(T dummy, const ossimRefPtr< ossimImageData > &input, ossimRefPtr< ossimImageData > &output)
ossimScaleFilterType m_MinifyFilterType
ossimScaleFilterType m_MagnifyFilterType
32 bit floating point
64 bit floating point
unsigned char ossim_uint8
int ossim_int32
virtual ossimRefPtr< ossimImageData > getTile(const ossimIpt &origin, ossim_uint32 resLevel=0)
16 bit unsigned integer (12 bits used)