OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimFusionCombiner.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 // Copyright (C) 2000 ImageLinks Inc.
3 //
4 // License: See top level LICENSE.txt file.
5 //
6 // Author: Garrett Potts
7 //
8 // Description: implementation for base fusion
9 //
10 //*************************************************************************
11 // $Id: ossimFusionCombiner.cpp 13312 2008-07-27 01:26:52Z gpotts $
12 
15 RTTI_DEF1(ossimFusionCombiner, "ossimFusionCombiner", ossimImageCombiner);
16 
18  :ossimImageCombiner(NULL, 2, 0, true, false),
19  theTile(NULL),
20  theNormTile(NULL),
21  theNormIntensity(NULL),
22  theInputConnection(NULL),
23  theIntensityConnection(NULL)
24 {
25 }
26 
28  :ossimImageCombiner(owner, 2, 0, true, false),
29  theTile(NULL),
30  theNormTile(NULL),
31  theNormIntensity(NULL),
32  theInputConnection(NULL),
33  theIntensityConnection(NULL)
34 {}
35 
37 {
38  theInputConnection = NULL;
40 }
41 
43 {
44  ossimIrect result;
45  ossimIrect colorRect;
46  result.makeNan();
47 
49  {
50  result = theIntensityConnection->getBoundingRect(resLevel);
51  }
53  {
54  colorRect = theInputConnection->getBoundingRect(resLevel);
56  {
57  result = result.clipToRect(colorRect);
58  }
59  else
60  {
61  result = colorRect;
62  }
63  }
64 
65  return result;
66 }
67 
69  const ossimConnectableObject* object)const
70 {
71  return ((inputIndex<2)&&
72  (PTR_CAST(ossimImageSource, object)||!object));
73 }
74 
76 {
78  {
80  }
81 
83 }
84 
85 
87  const ossimIrect& rect,
88  ossim_uint32 resLevel)
89 {
91  {
93  theIntensityConnection->getTile(rect, resLevel);
94  if(data.valid() && data->getBuf())
95  {
96  if(!theNormIntensity.valid())
97  {
100  data->getNumberOfBands(),
101  rect.width(),
102  rect.height());
104  }
105 
107  data->getNumberOfBands());
108 
111  return theNormIntensity;
112  }
113  }
115 }
116 
118  const ossimIrect& rect,
119  ossim_uint32 resLevel)
120 {
122  {
124  resLevel);
125  if(data.valid() && data->getBuf())
126  {
127  // make sure the tile result is updated if changed.
128  //
129  if((data->getNumberOfBands() != theTile->getNumberOfBands())||
130  (data->getScalarType() != theTile->getScalarType()))
131  {
134  theTile->initialize();
135  }
136 
137  if(!theNormTile.valid())
138  {
139  theNormTile = new ossimImageData(this,
141  data->getNumberOfBands(),
142  rect.width(),
143  rect.height());
145  }
146  else if(theNormTile->getNumberOfBands() != data->getNumberOfBands())
147  {
148  theNormTile = new ossimImageData(this,
150  data->getNumberOfBands(),
151  rect.width(),
152  rect.height());
154 
155  }
156 
158  data->getNumberOfBands());
159 
162  return theNormTile;
163  }
164  }
166 }
167 
169 {
171 
174 
175  if(getInput(0)&&getInput(1))
176  {
178  getInput(0));
180  getInput(1));
181 
182  if(temp&&temp2)
183  {
184  if((temp->getNumberOfOutputBands()==1)&&
185  (temp2->getNumberOfOutputBands()!=1))
186  {
188  getInput(0));
190  getInput(1));
191  }
192  }
193  }
194 
196  {
199  theTile->initialize();
200  }
201 }
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
This will return the bounding rect of the source.
virtual ossim_uint32 getNumberOfBands() const
ossimRefPtr< ossimImageData > getNormTile(const ossimIrect &rect, ossim_uint32 resLevel)
ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.
This will be a base for all combiners.
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
bool valid() const
Definition: ossimRefPtr.h:75
ossim_uint32 height() const
Definition: ossimIrect.h:487
ossimRefPtr< ossimImageData > theTile
virtual ossimDataObjectStatus getDataObjectStatus() const
ossimImageSource * theInputConnection
ossimRefPtr< ossimImageData > theNormTile
ossimRefPtr< ossimImageData > theNormIntensity
virtual void initialize()
Initialize the data buffer.
ossimConnectableObject * getInput(ossim_uint32 index=0)
returns the object at the specified index.
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
This will return the bounding rect of the source.
static ossimImageDataFactory * instance()
virtual void setImageRectangleAndBands(const ossimIrect &rect, ossim_uint32 numberOfBands)
ossimImageSource * theIntensityConnection
unsigned int ossim_uint32
32 bit normalized floating point
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
virtual void copyTileToNormalizedBuffer(ossim_float64 *buf) const
Copies entire tile to buf passed in.
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const
ossim_uint32 width() const
Definition: ossimIrect.h:500
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
ossimScalarType
ossimRefPtr< ossimImageData > getNormIntensity(const ossimIrect &rect, ossim_uint32 resLevel)
virtual ossimScalarType getScalarType() const
virtual ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.
void makeNan()
Definition: ossimIrect.h:329
virtual const void * getBuf() const
RTTI_DEF1(ossimFusionCombiner, "ossimFusionCombiner", ossimImageCombiner)
virtual void setDataObjectStatus(ossimDataObjectStatus status) const
Full list found in ossimConstants.h.
virtual ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.
bool canConnectMyInputTo(ossim_int32 inputIndex, const ossimConnectableObject *object) const
required to be overriden by derived classes
int ossim_int32
virtual ossimRefPtr< ossimImageData > getTile(const ossimIpt &origin, ossim_uint32 resLevel=0)