OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimMaskFilter.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 // Modified by: Elan Sharghi (1/20/2009)
10 // Description: Class definition for ossimMaskFilter.
11 //
12 //*************************************************************************
13 // $Id: ossimMaskFilter.cpp 20409 2011-12-22 16:57:05Z dburken $
14 
19 
20 #include <ossim/base/ossimNotify.h>
23 
24 static const char * MASK_FILTER_MASK_TYPE_KW = "mask_type";
25 
26 RTTI_DEF1(ossimMaskFilter, "ossimMaskFilter", ossimImageSource);
27 
29  :
30  ossimImageSource(owner, 1, 1, true, false),
31  theMaskType(OSSIM_MASK_TYPE_SELECT),
32  theTile(0)
33 {
34 }
35 
37 {
38 }
39 
40 //*************************************************************************************************
42 {
43  theMaskSource = maskSource;
44 }
45 
47  ossim_uint32 resLevel)
48 {
50  if (!imageSource || !theMaskSource.valid())
51  {
53  return theTile;
54  }
55 
56  ossimRefPtr<ossimImageData> imageSourceData;
57  ossimRefPtr<ossimImageData> maskSourceData;
58 
59  imageSourceData = imageSource->getTile(rect, resLevel);
60  if(!isSourceEnabled())
61  return imageSourceData;
62 
63  if (!theTile.valid())
64  allocate();
65 
66  maskSourceData = theMaskSource->getTile(rect, resLevel);
67  if(!imageSourceData.valid() || !theTile.valid())
68  {
70  }
71 
72  theTile->setOrigin(rect.ul());
73  if(theTile->getImageRectangle() != rect)
74  {
77  }
78  if(!imageSourceData.valid())
79  {
80  return theTile;
81  }
82  if(!maskSourceData.valid())
83  {
84  return imageSourceData;
85  }
86 
87  if(imageSourceData->getDataObjectStatus() != OSSIM_NULL)
88  {
89  return executeMaskFilter(imageSourceData, maskSourceData);
90  }
91 
92  return theTile;
93 }
94 
96  const ossimConnectableObject* object)const
97 {
98  return (PTR_CAST(ossimImageSource, object)!= 0);
99 }
100 
102 {
103  if(getInput(0))
104  {
105  // Force an allocate on the next getTile.
106  theTile = 0;
107  }
108 }
109 
111 {
112  if(getInput())
113  {
115  theTile->initialize();
116  }
117 }
118 
120  ossimRefPtr<ossimImageData> imageSourceData,
121  ossimRefPtr<ossimImageData> maskSourceData)
122 {
123  if(!theTile)
124  {
125  theTile = (ossimImageData*)imageSourceData->dup();
126  if(!theTile->getBuf())
127  {
128  theTile->initialize();
129  }
130  }
131  else
132  {
133  ossim_uint32 tw = theTile->getWidth();
135  ossim_uint32 dw = imageSourceData->getWidth();
136  ossim_uint32 dh = imageSourceData->getHeight();
137 
138  theTile->setWidthHeight(imageSourceData->getWidth(),
139  imageSourceData->getHeight());
140  theTile->setOrigin(imageSourceData->getOrigin());
141  if((tw*th) != (dw*dh))
142  {
143  theTile->initialize();
144  }
145  theTile->setDataObjectStatus(imageSourceData->getDataObjectStatus());
146  }
147  theTile->loadTile(imageSourceData.get());
148  theTile->setDataObjectStatus(imageSourceData->getDataObjectStatus());
149  switch(theMaskType)
150  {
153  {
154  return executeMaskFilterSelect(theTile, maskSourceData);
155  }
157  {
158  return executeMaskFilterInvertSelect(theTile, maskSourceData);
159  }
161  {
162  return executeMaskFilterWeighted(theTile, maskSourceData);
163  }
166  {
167  return executeMaskFilterBinary(theTile, maskSourceData);
168  }
169  }
170 
171  return imageSourceData;
172 }
173 
175  ossimRefPtr<ossimImageData> imageSourceData,
176  ossimRefPtr<ossimImageData> maskSourceData)
177 {
178  if(maskSourceData->getScalarType() != OSSIM_UCHAR)
179  {
180  ossimNotify(ossimNotifyLevel_WARN) << "ossimMaskFilter::executeMaskFilterSelect WARNING: Only uchar masks are supported" << endl;
181  return imageSourceData;
182  }
183 
184  switch(imageSourceData->getScalarType())
185  {
186  case OSSIM_UCHAR:
187  {
189  (ossim_uint8)0,
190  imageSourceData,
191  maskSourceData);
192  break;
193  }
194  case OSSIM_USHORT11:
195  case OSSIM_USHORT12:
196  case OSSIM_USHORT13:
197  case OSSIM_USHORT14:
198  case OSSIM_USHORT15:
199  case OSSIM_USHORT16:
200  {
202  (ossim_uint8)0,
203  imageSourceData,
204  maskSourceData);
205  break;
206  }
207  case OSSIM_SSHORT16:
208  {
210  (ossim_uint8)0,
211  imageSourceData,
212  maskSourceData);
213  break;
214  }
215  case OSSIM_FLOAT:
217  {
219  (ossim_uint8)0,
220  imageSourceData,
221  maskSourceData);
222  break;
223  }
224  case OSSIM_DOUBLE:
226  {
227  executeMaskFilterSelection((double)0,
228  (ossim_uint8)0,
229  imageSourceData,
230  maskSourceData);
231  break;
232  }
233  default:
234  {
235  ossimNotify(ossimNotifyLevel_WARN) << "ossimMaskFilter::executeMaskFilterSelect WARNING: Unknown scalar type" << endl;
236  break;
237  }
238  }
239 
240  return theTile;
241 }
242 
244  ossimRefPtr<ossimImageData> maskSourceData)
245 {
246  if(maskSourceData->getScalarType() != OSSIM_UCHAR)
247  {
248  ossimNotify(ossimNotifyLevel_WARN) << "ossimMaskFilter::executeMaskFilterSelect WARNING: Only uchar masks are supported" << endl;
249  return imageSourceData;
250  }
251 
252  switch(imageSourceData->getScalarType())
253  {
254  case OSSIM_UCHAR:
255  {
257  (ossim_uint8)0,
258  imageSourceData,
259  maskSourceData);
260  break;
261  }
262  case OSSIM_USHORT11:
263  case OSSIM_USHORT12:
264  case OSSIM_USHORT13:
265  case OSSIM_USHORT14:
266  case OSSIM_USHORT15:
267  case OSSIM_USHORT16:
268  {
270  (ossim_uint8)0,
271  imageSourceData,
272  maskSourceData);
273  break;
274  }
275  case OSSIM_SSHORT16:
276  {
278  (ossim_uint8)0,
279  imageSourceData,
280  maskSourceData);
281  break;
282  }
283  case OSSIM_FLOAT:
285  {
287  (ossim_uint8)0,
288  imageSourceData,
289  maskSourceData);
290  break;
291  }
292  case OSSIM_DOUBLE:
294  {
296  (ossim_uint8)0,
297  imageSourceData,
298  maskSourceData);
299  break;
300  }
301  default:
302  {
303  ossimNotify(ossimNotifyLevel_WARN) << "ossimMaskFilter::executeMaskFilterSelect WARNING: Unknown scalar type" << endl;
304  break;
305  }
306  }
307 
308  return theTile;
309 }
310 
312  ossimRefPtr<ossimImageData> maskSourceData)
313 {
314  if(maskSourceData->getScalarType() != OSSIM_UCHAR)
315  {
316  ossimNotify(ossimNotifyLevel_WARN) << "ossimMaskFilter::executeMaskFilterSelect WARNING: Only uchar masks are supported" << endl;
317  return imageSourceData;
318  }
319 
320  switch(imageSourceData->getScalarType())
321  {
322  case OSSIM_UCHAR:
323  {
325  (ossim_uint8)0,
326  imageSourceData,
327  maskSourceData);
328  break;
329  }
330  case OSSIM_USHORT11:
331  case OSSIM_USHORT12:
332  case OSSIM_USHORT13:
333  case OSSIM_USHORT14:
334  case OSSIM_USHORT15:
335  case OSSIM_USHORT16:
336  {
338  (ossim_uint8)0,
339  imageSourceData,
340  maskSourceData);
341  break;
342  }
343  case OSSIM_SSHORT16:
344  {
346  (ossim_uint8)0,
347  imageSourceData,
348  maskSourceData);
349  break;
350  }
351  case OSSIM_FLOAT:
353  {
354  executeMaskFilterWeighted((float)0,
355  (ossim_uint8)0,
356  imageSourceData,
357  maskSourceData);
358  break;
359  }
360  case OSSIM_DOUBLE:
362  {
363  executeMaskFilterWeighted((double)0,
364  (ossim_uint8)0,
365  imageSourceData,
366  maskSourceData);
367  break;
368  }
369  default:
370  {
371  ossimNotify(ossimNotifyLevel_WARN) << "ossimMaskFilter::executeMaskFilterSelect WARNING: Unknown scalar type" << endl;
372  break;
373  }
374  }
375 
376  return theTile;
377 }
378 
380  ossimRefPtr<ossimImageData> imageSourceData, ossimRefPtr<ossimImageData> maskSourceData)
381 {
382  if(maskSourceData->getScalarType() != OSSIM_UCHAR)
383  {
384  ossimNotify(ossimNotifyLevel_WARN) << "ossimMaskFilter::executeMaskFilterBinary WARNING: Only uchar masks are supported" << endl;
385  return imageSourceData;
386  }
387 
388  switch(imageSourceData->getScalarType())
389  {
390  case OSSIM_UCHAR:
391  {
393  (ossim_uint8)0,
394  imageSourceData,
395  maskSourceData);
396  break;
397  }
398  case OSSIM_USHORT11:
399  case OSSIM_USHORT12:
400  case OSSIM_USHORT13:
401  case OSSIM_USHORT14:
402  case OSSIM_USHORT15:
403  case OSSIM_USHORT16:
404  {
406  (ossim_uint8)0,
407  imageSourceData,
408  maskSourceData);
409  break;
410  }
411  case OSSIM_SSHORT16:
412  {
414  (ossim_uint8)0,
415  imageSourceData,
416  maskSourceData);
417  break;
418  }
419  case OSSIM_FLOAT:
421  {
423  (ossim_uint8)0,
424  imageSourceData,
425  maskSourceData);
426  break;
427  }
428  case OSSIM_DOUBLE:
430  {
432  (ossim_uint8)0,
433  imageSourceData,
434  maskSourceData);
435  break;
436  }
437  default:
438  {
439  ossimNotify(ossimNotifyLevel_WARN) << "ossimMaskFilter::executeMaskFilterBinary WARNING: Unknown scalar type" << endl;
440  break;
441  }
442  }
443 
444  return theTile;
445 }
446 
447 template <class inputT, class maskT>
449  inputT /* dummyInput */,
450  maskT /* dummyMask */,
451  ossimRefPtr<ossimImageData> imageSourceData,
452  ossimRefPtr<ossimImageData> maskSourceData)
453 {
454  ossimDataObjectStatus maskDataStatus = maskSourceData->getDataObjectStatus();
455  ossimDataObjectStatus inputDataStatus = imageSourceData->getDataObjectStatus();
456 
457  // First just check if mask is full, which means pass the image source along untouched:
458  if (maskDataStatus == OSSIM_FULL)
459  {
460  theTile = imageSourceData;
461  return theTile;
462  }
463 
464  // Then check for a total mask (all mask values are 0) and return empty tile if so:
465  if( (maskDataStatus == OSSIM_NULL) || (maskDataStatus == OSSIM_EMPTY))
466  {
467  theTile->makeBlank();
468  return theTile;
469  }
470 
471  // Finally check for blank source tile and return it if so:
472  if( (inputDataStatus == OSSIM_NULL) || (inputDataStatus == OSSIM_EMPTY))
473  {
474  theTile->makeBlank();
475  return theTile;
476  }
477 
478  ossim_uint32 maskBands = maskSourceData->getNumberOfBands();
479  ossim_uint32 inputBands = imageSourceData->getNumberOfBands();
480  if(maskBands&&inputBands)
481  {
482  ossim_uint32 maxOffset = theTile->getWidth()*theTile->getHeight();
483  for(ossim_uint32 band = 0; band < inputBands; ++band)
484  {
485  maskT* bufMask = static_cast<maskT*> ( maskSourceData->getBuf() );
486  inputT* bufIn = static_cast<inputT*>( imageSourceData->getBuf(band) );
487  inputT* bufOut = static_cast<inputT*>( theTile->getBuf(band) );
488  inputT nullPix = static_cast<inputT> ( theTile->getNullPix(band) );
489  inputT minPix = static_cast<inputT> ( theTile->getMinPix(band) );
490  ossim_uint32 offset = 0;
491  for(offset = 0; offset < maxOffset; ++offset)
492  {
493  if(*bufMask)
494  {
496  {
497  *bufOut = *bufIn;
498  }
499  else
500  {
501  //---
502  // OSSIM_MASK_TYPE_SELECT_CLAMP_MIN
503  // Use input pixel clamping any nulls to min.
504  //---
505  *bufOut = *bufIn != nullPix ? *bufIn : minPix;
506  }
507  }
508  else
509  {
510  *bufOut = nullPix;
511  }
512  ++bufOut;
513  ++bufIn;
514  ++bufMask;
515  }
516  }
517  theTile->validate();
518  }
519 
520  return theTile;
521 }
522 
523 template <class inputT, class maskT>
525  inputT /* dummyInput */,
526  maskT /* dummyMask */,
527  ossimRefPtr<ossimImageData> imageSourceData,
528  ossimRefPtr<ossimImageData> maskSourceData)
529 {
530  ossimDataObjectStatus maskDataStatus = maskSourceData->getDataObjectStatus();
531  ossimDataObjectStatus inputDataStatus = imageSourceData->getDataObjectStatus();
532 
533  // First just check if mask is empty, which means pass the image source along untouched:
534  if( (maskDataStatus == OSSIM_NULL) || (maskDataStatus == OSSIM_EMPTY))
535  {
536  theTile = imageSourceData;
537  return theTile;
538  }
539 
540  // Then check for a total mask (all mask values are 1) and return empty tile if so:
541  if (maskDataStatus == OSSIM_FULL)
542  {
543  theTile->makeBlank();
544  return theTile;
545  }
546 
547  // Finally check for blank source tile and return it if so:
548  if( (inputDataStatus == OSSIM_NULL) || (inputDataStatus == OSSIM_EMPTY))
549  {
550  theTile->makeBlank();
551  return theTile;
552  }
553 
554  ossim_uint32 maskBands = maskSourceData->getNumberOfBands();
555  ossim_uint32 inputBands = imageSourceData->getNumberOfBands();
556  if(maskBands&&inputBands)
557  {
558  ossim_uint32 maxOffset = theTile->getWidth()*theTile->getHeight();
559  for(ossim_uint32 band = 0; band < inputBands; ++band)
560  {
561  maskT* bufMask = (maskT*)maskSourceData->getBuf();
562  inputT* bufIn = (inputT*)imageSourceData->getBuf(band);
563  inputT* bufOut = (inputT*)theTile->getBuf(band);
564  inputT np = (inputT)theTile->getNullPix(band);
565  ossim_uint32 offset = 0;
566  for(offset = 0; offset < maxOffset; ++offset)
567  {
568  if(!*bufMask)
569  {
570  *bufOut = *bufIn;
571  }
572  else
573  {
574  *bufOut = np;
575  }
576  ++bufOut;
577  ++bufIn;
578  ++bufMask;
579  }
580  }
581  theTile->validate();
582  }
583 
584  return theTile;
585 }
586 
587 template <class inputT, class maskT>
589  inputT /* dummyInput */,
590  maskT /* dummyMask */,
591  ossimRefPtr<ossimImageData> imageSourceData,
592  ossimRefPtr<ossimImageData> maskSourceData)
593 {
594  ossimDataObjectStatus maskDataStatus = maskSourceData->getDataObjectStatus();
595  ossimDataObjectStatus inputDataStatus = imageSourceData->getDataObjectStatus();
596 
597  if( (maskDataStatus == OSSIM_NULL)||
598  (maskDataStatus == OSSIM_EMPTY))
599  {
600  theTile->makeBlank();
601  return theTile;
602  }
603  if( (inputDataStatus == OSSIM_NULL)||
604  (inputDataStatus == OSSIM_EMPTY))
605  {
606  return theTile;
607  }
608 
609  ossim_uint32 maskBands = maskSourceData->getNumberOfBands();
610  ossim_uint32 inputBands = imageSourceData->getNumberOfBands();
611  if(maskBands&&inputBands)
612  {
613  ossim_uint32 maxOffset = theTile->getWidth()*theTile->getHeight();
614  for(ossim_uint32 band = 0; band < inputBands; ++band)
615  {
616  maskT* bufMask = (maskT*)maskSourceData->getBuf();
617  inputT* bufIn = (inputT*)imageSourceData->getBuf(band);
618  inputT* bufOut = (inputT*)theTile->getBuf(band);
619  inputT np = (inputT)theTile->getNullPix(band);
620  inputT minp = (inputT)theTile->getMinPix(band);
621  ossim_uint32 offset = 0;
622 
623  if(inputDataStatus == OSSIM_PARTIAL)
624  {
625  for(offset = 0; offset < maxOffset; ++offset)
626  {
627  if(*bufIn != np)
628  {
629  *bufOut = (inputT)((*bufIn)*((double)(*bufMask)/255.0));
630  if((*bufOut != np)&&
631  (*bufOut < minp))
632  {
633  *bufOut = minp;
634  }
635  }
636  else
637  {
638  *bufOut = np;
639  }
640  ++bufOut;
641  ++bufIn;
642  ++bufMask;
643  }
644  }
645  else
646  {
647  for(offset = 0; offset < maxOffset; ++offset)
648  {
649  *bufOut = (inputT)((*bufIn)*((double)(*bufMask)/255.0));
650  if((*bufOut != np)&&
651  (*bufOut < minp))
652  {
653  *bufOut = minp;
654  }
655  ++bufOut;
656  ++bufIn;
657  ++bufMask;
658  }
659  }
660  }
661  theTile->validate();
662  }
663 
664  return theTile;
665 }
666 
667 template <class inputT, class maskT>
669  inputT /* dummyInput */,
670  maskT /* dummyMask */ ,
671  ossimRefPtr<ossimImageData> imageSourceData,
672  ossimRefPtr<ossimImageData> maskSourceData)
673 {
674  ossim_uint32 maskBands = maskSourceData->getNumberOfBands();
675  ossim_uint32 inputBands = imageSourceData->getNumberOfBands();
676  if(maskBands&&inputBands)
677  {
678  ossim_uint32 maxOffset = theTile->getWidth()*theTile->getHeight();
679  for(ossim_uint32 band = 0; band < inputBands; ++band)
680  {
681  maskT* bufMask = (maskT*)maskSourceData->getBuf();
682  inputT* bufOut = (inputT*)theTile->getBuf(band);
683  const inputT NP = (inputT)theTile->getNullPix(band);
684  const inputT MP = (inputT)theTile->getMaxPix(band);
685  ossim_uint32 offset = 0;
686  for(offset = 0; offset < maxOffset; ++offset)
687  {
689  {
690  if(*bufMask) // if mask == 1
691  *bufOut = MP; // set to max pix
692  else // if mask == 0
693  *bufOut = NP; // set to null pix
694  }
695  else
696  {
697  if(*bufMask) // if mask == 1
698  *bufOut = NP; // set to null pix
699  else // if mask == 0
700  *bufOut = MP; // set to max pix
701  }
702  ++bufOut;
703  ++bufMask;
704  }
705  }
706  theTile->validate();
707  }
708 
709  return theTile;
710 }
711 
713 {
714  theMaskType = type;
715 }
716 
718 {
719  if(type != "")
720  {
721  ossimString maskType = type;
722  maskType.downcase();
723 
724  if(maskType == "select")
725  {
727  }
728  else if(maskType == "invert")
729  {
731  }
732  else if(maskType == "weighted")
733  {
735  }
736  else if(maskType == "binary")
737  {
739  }
740  else if(maskType == "binary_inverse")
741  {
743  }
744  else if(maskType == "select_clamp_min")
745  {
747  }
748  }
749 }
750 
752 {
753  return theMaskType;
754 }
755 
757 {
758  ossimString maskType;
759 
760  switch(theMaskType)
761  {
763  {
764  maskType = "select";
765  break;
766  }
768  {
769  maskType = "invert";
770  break;
771  }
773  {
774  maskType = "weighted";
775  break;
776  }
778  {
779  maskType = "binary";
780  break;
781  }
783  {
784  maskType = "binary_inverse";
785  break;
786  }
788  {
789  maskType = "select_clamp_min";
790  break;
791  }
792  }
793 
794  return maskType;
795 }
796 
798  const char* prefix)
799 {
800  bool result = ossimImageSource::loadState(kwl, prefix);
801 
803  theOutputListIsFixedFlag = false;
805 
806  const char* lookup = kwl.find(prefix, MASK_FILTER_MASK_TYPE_KW);
807  if (lookup)
808  {
809  setMaskType(ossimString(lookup));
810  }
811 
812  return result;
813 }
814 
816  const char* prefix)const
817 {
818  kwl.add(prefix,
819  MASK_FILTER_MASK_TYPE_KW,
820  getMaskTypeString().c_str(),
821  true);
822 
823  return ossimImageSource::saveState(kwl, prefix);
824 }
825 
827 {
828  if( property.valid() )
829  {
830  if(property->getName() == MASK_FILTER_MASK_TYPE_KW)
831  {
832  setMaskType(property->valueToString());
833  }
834  else
835  {
837  }
838  }
839 }
840 
842  const ossimString& name)const
843 {
844  ossimRefPtr<ossimProperty> result = 0;
845 
846  if(name == MASK_FILTER_MASK_TYPE_KW)
847  {
848  std::vector<ossimString> constraintList;
849  constraintList.push_back(ossimString("select"));
850  constraintList.push_back(ossimString("invert"));
851  constraintList.push_back(ossimString("weighted"));
852 
853  result = new ossimStringProperty(MASK_FILTER_MASK_TYPE_KW,
855  false,
856  constraintList);
857  }
858  else
859  {
860  result = ossimImageSource::getProperty(name);
861  }
862  return result;
863 }
864 
865 void ossimMaskFilter::getPropertyNames(std::vector<ossimString>& propertyNames)const
866 {
867  ossimImageSource::getPropertyNames(propertyNames);
868  propertyNames.push_back(MASK_FILTER_MASK_TYPE_KW);
869 }
870 
872 {
874  if (img_source)
875  return img_source->getNumberOfInputBands();
876  return 0;
877 }
878 
16 bit unsigned integer (15 bits used)
virtual void setNumberOfInputs(ossim_int32 numberOfInputs)
Will set the number of inputs.
virtual void valueToString(ossimString &valueResult) const =0
ossimRefPtr< ossimImageData > executeMaskFilterInvertSelection(inputT dummyInput, maskT dummyMask, ossimRefPtr< ossimImageData > imageSourceData, ossimRefPtr< ossimImageData > maskSourceData)
virtual ossim_uint32 getWidth() const
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
virtual const ossim_float64 * getMaxPix() const
Standard select if mask is true then keep with min.
virtual ossim_uint32 getNumberOfBands() const
virtual void setImageRectangle(const ossimIrect &rect)
virtual void setWidthHeight(ossim_uint32 w, ossim_uint32 h)
Represents serializable keyword/value map.
bool valid() const
Definition: ossimRefPtr.h:75
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
const char * find(const char *key) const
virtual void initialize()
ossimRefPtr< ossimImageData > executeMaskFilterBinary(ossimRefPtr< ossimImageData > imageSourceData, ossimRefPtr< ossimImageData > maskSourceData)
Will execute the binary algorithm.
ossimRefPtr< ossimImageData > theTile
Member used to store the result of the applied algorithm type.
RTTI_DEF1(ossimMaskFilter, "ossimMaskFilter", ossimImageSource)
virtual bool canConnectMyInputTo(ossim_int32 index, const ossimConnectableObject *object) const
required to be overriden by derived classes
const ossimIpt & ul() const
Definition: ossimIrect.h:274
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
16 bit unsigned integer (14 bits used)
16 bit unsigned integer (13 bits used)
unsigned short ossim_uint16
virtual ~ossimMaskFilter()
Will delete its owned tile.
virtual void initialize()
Initialize the data buffer.
ossimRefPtr< ossimImageData > executeMaskFilterInvertSelect(ossimRefPtr< ossimImageData > imageSourceData, ossimRefPtr< ossimImageData > maskSourceData)
will execute the invert selection algorithm.
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &rect, ossim_uint32 resLevel=0)
Main entry point for the algorithm.
virtual ossimObject * dup() const
standard select if mask is true then keep
ossimConnectableObject * getInput(ossim_uint32 index=0)
returns the object at the specified index.
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual void loadTile(const void *src, const ossimIrect &src_rect, ossimInterleaveType il_type)
virtual void setProperty(ossimRefPtr< ossimProperty > property)
virtual void setProperty(ossimRefPtr< ossimProperty > property)
Interface to set the mask type.
static ossimImageDataFactory * instance()
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) 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.
ossimFileSelectionMaskType theMaskType
Member variable that holds the algorithm type to run on the calls to getTile.
virtual ossimDataObjectStatus validate() const
signed short ossim_sint16
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
Adds "mask_type" to list.
virtual ossimString getMaskTypeString() const
Returns the current mask algorithm used as a string.
virtual ossim_uint32 getNumberOfInputBands() const
ossimRefPtr< ossimImageSource > theMaskSource
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
32 bit normalized floating point
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
virtual ossimIrect getImageRectangle() const
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
ossimRefPtr< ossimImageData > executeMaskFilterSelect(ossimRefPtr< ossimImageData > imageSourceData, ossimRefPtr< ossimImageData > maskSourceData)
will execute the section algorithm.
virtual void setOrigin(const ossimIpt &origin)
virtual const ossim_float64 * getMinPix() const
virtual ossimScalarType getScalarType() const
virtual void makeBlank()
Initializes data to null pixel values.
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
virtual void setMaskType(ossimFileSelectionMaskType type)
Sets the mask type.
virtual ossimFileSelectionMaskType getMaskType() const
Returns the current mask algorithm used.
ossimRefPtr< ossimImageData > executeMaskFilterWeighted(ossimRefPtr< ossimImageData > imageSourceData, ossimRefPtr< ossimImageData > maskSourceData)
will execute the weighted algorithm.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
virtual const void * getBuf() const
ossimMaskFilter(ossimObject *owner=NULL)
Default Constructor.
bool theInputListIsFixedFlag
Indicates whether the theInputObjectList is fixed.
virtual void setDataObjectStatus(ossimDataObjectStatus status) const
Full list found in ossimConstants.h.
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
ossimDataObjectStatus
Definitions for data object status.
bool theOutputListIsFixedFlag
Indicates whether the theOutputObjectList is fixed.
ossimFileSelectionMaskType
Enumeration used to identify what the selection type for this mask is to be used: ...
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
ossimRefPtr< ossimImageData > executeMaskFilterSelection(inputT dummyInput, maskT dummyMask, ossimRefPtr< ossimImageData > imageSourceData, ossimRefPtr< ossimImageData > maskSourceData)
virtual ossim_uint32 getNumberOfInputBands() const =0
32 bit floating point
16 bit unsigned iteger
64 bit floating point
16 bit signed integer
virtual const ossimIpt & getOrigin() const
unsigned char ossim_uint8
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
8 bit unsigned iteger
const ossimString & getName() const
int ossim_int32
virtual ossimRefPtr< ossimImageData > getTile(const ossimIpt &origin, ossim_uint32 resLevel=0)
void setMaskSource(ossimImageSource *maskSource)
This set method is necessary when this object is being added to an ossimImageChain because ossimImage...
16 bit unsigned integer (12 bits used)
ossimRefPtr< ossimImageData > executeMaskFilterBinarySelection(inputT dummyInput, maskT dummyMask, ossimRefPtr< ossimImageData > imageSourceData, ossimRefPtr< ossimImageData > maskSourceData)
virtual ossimRefPtr< ossimImageData > executeMaskFilter(ossimRefPtr< ossimImageData > imageSourceData, ossimRefPtr< ossimImageData > maskSourceData)