OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ossimTwoColorView Class Reference

This is a 2 color view of the input. More...

#include <ossimTwoColorView.h>

Inheritance diagram for ossimTwoColorView:
ossimImageCombiner ossimImageSource ossimConnectableObjectListener ossimSource ossimListener ossimConnectableObject ossimErrorStatusInterface ossimObject ossimListenerManager ossimPropertyInterface ossimReferenced

Public Types

enum  ossimTwoColorMultiViewOutputSource { UNKNOWN = 0, MIN = 1, OLD = 2, NEW = 3 }
 Enumerations for mapping inputs to red, green and blue output channels. More...
 
- Public Types inherited from ossimConnectableObject
enum  ossimConnectableObjectDirectionType { CONNECTABLE_DIRECTION_NONE = 0, CONNECTABLE_DIRECTION_INPUT = 1, CONNECTABLE_DIRECTION_OUTPUT = 2 }
 
typedef std::vector< ossimRefPtr< ossimConnectableObject > > ConnectableObjectList
 

Public Member Functions

 ossimTwoColorView ()
 
virtual ossim_uint32 getNumberOfOutputBands () const
 Returns the number of bands in a tile returned from this TileSource. More...
 
virtual ossimRefPtr< ossimImageDatagetTile (const ossimIrect &rect, ossim_uint32 resLevel=0)
 
ossimScalarType getOutputScalarType () const
 This will be used to query the output pixel type of the tile source. More...
 
double getNullPixelValue (ossim_uint32 band) const
 Each band has a null pixel associated with it. More...
 
double getMinPixelValue (ossim_uint32 band) const
 Returns the min pixel of the band. More...
 
double getMaxPixelValue (ossim_uint32 band) const
 Returns the max pixel of the band. More...
 
void setBandIndexMapping (ossim_uint32 oldInputBandIndex, ossim_uint32 newInputBandIndex, ossimTwoColorMultiViewOutputSource redOutputSource, ossimTwoColorMultiViewOutputSource grnOutputSource, ossimTwoColorMultiViewOutputSource bluOutputSource)
 Sets which bands to use from inputs, and which inputs to use for output red, green and blue channels. More...
 
virtual void initialize ()
 
- Public Member Functions inherited from ossimImageCombiner
 ossimImageCombiner ()
 
 ossimImageCombiner (ossimObject *owner, int numberOfInputs, int numberOfOutputs, bool inputListIsFixedFlag, bool outputListIsFixedFlag)
 
 ossimImageCombiner (ossimConnectableObject::ConnectableObjectList &inputSources)
 
virtual ossimIrect getBoundingRect (ossim_uint32 resLevel=0) const
 This will return the bounding rect of the source. More...
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=NULL)
 Method to the load (recreate) the state of an object from a keyword list. More...
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=NULL) const
 Method to save the state of an object to a keyword list. More...
 
virtual void updateRects ()
 This will go through and precompute the bounding rects of each input image. More...
 
virtual ossim_uint32 getNumberOfInputBands () const
 Returns the number of bands available from the input. More...
 
virtual ossim_uint32 getTileWidth () const
 Returns the default processing tile width. More...
 
virtual ossim_uint32 getTileHeight () const
 Returns the default processing tile height. More...
 
virtual ossim_uint32 getNumberOfOverlappingImages (const ossimIrect &rect, ossim_uint32 resLevel=0) const
 Used to retrieve the number of overlapping images withint the given rect. More...
 
virtual void getOverlappingImages (std::vector< ossim_uint32 > &result, const ossimIrect &rect, ossim_uint32 resLevel=0) const
 Used to populate the result with the index of the overlapping images. More...
 
virtual ossimRefPtr< ossimImageDatagetNextTile (ossim_uint32 &returnedIdx, const ossim_uint32 startIdx, const ossimIrect &tileRect, ossim_uint32 resLevel=0)
 
virtual ossimRefPtr< ossimImageDatagetNextTile (ossim_uint32 &returnedIdx, const ossimIrect &tileRect, ossim_uint32 resLevel=0)
 
virtual bool getNextTile (ossim_uint32 &returnedIdx, const ossim_uint32 startIdx, ossimImageData *tile, ossim_uint32 resLevel=0)
 
virtual ossimRefPtr< ossimImageDatagetNextNormTile (ossim_uint32 &returnedIdx, const ossim_uint32 index, const ossimIrect &tileRect, ossim_uint32 resLevel=0)
 
virtual ossimRefPtr< ossimImageDatagetNextNormTile (ossim_uint32 &returnedIdx, const ossimIrect &tileRect, ossim_uint32 resLevel=0)
 
virtual bool canConnectMyInputTo (ossim_int32 inputIndex, const ossimConnectableObject *object) const
 required to be overriden by derived classes More...
 
virtual void connectInputEvent (ossimConnectionEvent &event)
 
virtual void disconnectInputEvent (ossimConnectionEvent &event)
 
virtual void propertyEvent (ossimPropertyEvent &event)
 
virtual void refreshEvent (ossimRefreshEvent &event)
 
virtual bool hasDifferentInputs () const
 
- Public Member Functions inherited from ossimImageSource
 ossimImageSource (ossimObject *owner=0)
 
 ossimImageSource (ossimObject *owner, ossim_uint32 inputListSize, ossim_uint32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimImageSource ()
 
virtual ossimRefPtr< ossimImageDatagetTile (const ossimIpt &origin, ossim_uint32 resLevel=0)
 
virtual bool getTile (ossimImageData *result, ossim_uint32 resLevel=0)
 Method to get a tile. More...
 
virtual ossimObjectgetObject ()
 For RTTI support. More...
 
virtual const ossimObjectgetObject () const
 For RTTI support. More...
 
virtual void getDecimationFactor (ossim_uint32 resLevel, ossimDpt &result) const
 Will return the decimation factor for the given resolution level. More...
 
virtual void getDecimationFactors (std::vector< ossimDpt > &decimations) const
 Will return an array of all decimations for each resolution level. More...
 
virtual ossim_uint32 getNumberOfDecimationLevels () const
 Will return the number of resolution levels. More...
 
virtual void getOutputBandList (std::vector< ossim_uint32 > &bandList) const
 Initializes bandList. More...
 
virtual void getBoundingRect (ossimIrect &rect, ossim_uint32 resLevel=0) const
 Gets the bounding rectangle of the source. More...
 
virtual void getValidImageVertices (std::vector< ossimIpt > &validVertices, ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER, ossim_uint32 resLevel=0) const
 ordering specifies how the vertices should be arranged. More...
 
virtual ossimRefPtr< ossimImageGeometrygetImageGeometry ()
 Returns the image geometry object associated with this tile source or NULL if not defined. More...
 
virtual void setImageGeometry (const ossimImageGeometry *geom)
 Default implementation sets geometry of the first input to the geometry specified. More...
 
virtual void saveImageGeometry () const
 Default method to call input's saveImageGeometry. More...
 
virtual void saveImageGeometry (const ossimFilename &geometry_file) const
 Default method to call input's saveImageGeometry. More...
 
virtual ossimRefPtr< ossimPropertygetProperty (const ossimString &name) const
 
virtual void setProperty (ossimRefPtr< ossimProperty > property)
 
virtual void getPropertyNames (std::vector< ossimString > &propertyNames) const
 
virtual bool isIndexedData () const
 
- Public Member Functions inherited from ossimSource
 ossimSource (ossimObject *owner=0)
 
 ossimSource (ossimObject *owner, ossim_uint32 inputListSize, ossim_uint32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimSource ()
 
virtual bool isSourceEnabled () const
 
virtual void enableSource ()
 
virtual void disableSource ()
 
virtual bool getEnableFlag () const
 
virtual void setEnableFlag (bool flag)
 
virtual bool isInitialized () const
 
virtual void setInitializedFlag (bool flag)
 
virtual std::ostream & print (std::ostream &out) const
 Outputs theErrorStatus as an ossimErrorCode and an ossimString. More...
 
- Public Member Functions inherited from ossimConnectableObject
 ossimConnectableObject (ossimObject *owner=0)
 Base constructor of this object. More...
 
 ossimConnectableObject (ossimObject *owner, ossim_int32 inputListSize, ossim_int32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimConnectableObject ()
 
void setId (const ossimId &id)
 All connectable objects will have id's. More...
 
const ossimIdgetId () const
 Will allow us to get this object's id. More...
 
const ossimObjectgetOwner () const
 Fetches the current owner, most likely a container but not limited to one. More...
 
virtual void changeOwner (ossimObject *owner)
 Permits changing the object's owner. More...
 
virtual void setDescription (const ossimString &description)
 
virtual ossimString getDescription () const
 
virtual bool isConnected (ossimConnectableObjectDirectionType direction=CONNECTABLE_DIRECTION_INPUT) const
 will check the direction specified to see if all slots are full. More...
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findConnectableObject(const ossimId &id))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findObjectOfType(RTTItypeid typeId, ossimConnectableObjectDirectionType directionType, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findObjectOfType(const ossimString &obj, ossimConnectableObjectDirectionType directionType, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findInputObjectOfType(const ossimString &className))
 
virtual ossim_int32 findInputIndex (const ossimConnectableObject *object)
 Return a valid index of the input list if the passed in object is found else return -1. More...
 
virtual ossim_int32 findInputIndex (const ossimId &id)
 Return a valid index of the input list if the passed id is found else return -1. More...
 
virtual ossim_int32 findOutputIndex (const ossimConnectableObject *object)
 Return a valid index of the output list if the passed in object is found else return -1. More...
 
virtual ossim_int32 findOutputIndex (const ossimId &id)
 Return a valid index of the output list if the passed in object is found else return -1. More...
 
virtual ossim_int32 getMyInputIndexToConnectTo (ossimConnectableObject *object) const
 Should return the first available index to connect to. More...
 
virtual ossim_int32 getMyOutputIndexToConnectTo (ossimConnectableObject *object) const
 Should return the first available index to connect to. More...
 
virtual bool canConnectMyOutputTo (ossim_int32 myOutputIndex, const ossimConnectableObject *object) const
 default implementation is to allow anyone to connect to us. More...
 
virtual void disconnect (ossimConnectableObject *object=0)
 Will disconnect the object passed in. More...
 
virtual void disconnect (const ossimId &id)
 Will disconnect the object passed in. More...
 
virtual ossimRefPtr< ossimConnectableObjectdisconnectMyInput (ossim_int32 inputIndex, bool disconnectOutputFlag=true, bool createEventFlag=true)
 Will disconnect the object at the given input index and generate a connection event. More...
 
virtual void disconnectMyInput (ossimConnectableObject *input, bool disconnectOutputFlag=true, bool createEventFlag=true)
 Finds the index of the passed in input and calls disconnectMyInput(inputIndex, disconnectOutputFlag, createEventFlag);. More...
 
virtual void disconnectMyInputs (ConnectableObjectList &inputList, bool disconnectOutputFlag=true, bool createEventFlag=true)
 
virtual ossimRefPtr< ossimConnectableObjectdisconnectMyOutput (ossim_int32 outputIndex, bool disconnectInputFlag=true, bool createEventFlag=true)
 Will disconnect the object at the given output index and generate a connection event. More...
 
virtual void disconnectMyOutput (ossimConnectableObject *output, bool disconnectInputFlag=true, bool createEventFlag=true)
 Will disconnect the output object. More...
 
virtual void disconnectMyOutputs (ConnectableObjectList &outputList, bool disconnectOutputFlag=true, bool createEventFlag=true)
 
virtual void disconnectAllInputs ()
 Will disconnect all of the input objects. More...
 
virtual void disconnectAllOutputs ()
 Will disconnect all of the output objects. More...
 
virtual ossim_int32 connectMyInputTo (ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
 Will try to connect this objects input to the passed in object. More...
 
virtual ossim_int32 connectMyInputTo (ossim_int32 inputIndex, ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
 Will connect the specified input to the passed in object. More...
 
virtual bool connectMyInputTo (ConnectableObjectList &inputList, bool makeOutputConnection=true, bool createEventFlag=true)
 
virtual ossim_int32 connectMyOutputTo (ossimConnectableObject *outputObject, bool makeInputConnection=true, bool createEventFlag=true)
 Will try to connect this objects output to the passed in object. More...
 
virtual bool connectMyOutputTo (ConnectableObjectList &outputList, bool makeInputConnection=true, bool createEventFlag=true)
 
virtual bool connectInputList (ConnectableObjectList &inputList)
 Will disconnect itself from all inputs and reset to the passed in input list. More...
 
virtual bool connectOutputList (ConnectableObjectList &outputList)
 Will disconnect itself from all outputs and reset to the passed in output list. More...
 
virtual ossim_uint32 getNumberOfInputs () const
 Returns the number of input objects. More...
 
virtual ossim_uint32 getNumberOfOutputs () const
 Return the number of output objects. More...
 
ossimConnectableObjectgetInput (ossim_uint32 index=0)
 returns the object at the specified index. More...
 
const ossimConnectableObjectgetInput (ossim_uint32 index=0) const
 returns the object at the specified index. More...
 
ossimConnectableObjectgetOutput (ossim_uint32 index=0)
 returns the object at the specified index. More...
 
const ossimConnectableObjectgetOutput (ossim_uint32 index=0) const
 returns the object at the specified index. More...
 
virtual void setNumberOfInputs (ossim_int32 numberOfInputs)
 Will set the number of inputs. More...
 
virtual bool getInputListIsFixedFlag () const
 
virtual bool getOutputListIsFixedFlag () const
 
virtual void setNumberOfOutputs (ossim_int32 numberOfInputs)
 Will set the number of outputs. More...
 
const ConnectableObjectListgetInputList () const
 
const ConnectableObjectListgetOutputList () const
 
ConnectableObjectListgetInputList ()
 
ConnectableObjectListgetOutputList ()
 
 OSSIM_DEPRECATE_METHOD (virtual void findAllObjectsOfType(ConnectableObjectList &result, const RTTItypeid &typeInfo, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual void findAllObjectsOfType(ConnectableObjectList &result, const ossimString &className, bool recurse=true))
 
virtual void propagateEventToOutputs (ossimEvent &event)
 
virtual void propagateEventToInputs (ossimEvent &event)
 
virtual void setProperty (const ossimString &name, const ossimString &value)
 
virtual ossim_uint32 saveStateOfAllInputs (ossimKeywordlist &kwl, bool saveThisStateFlag=true, ossim_uint32 objectIndex=1, const char *prefix=0) const
 Save the state of all inputs to a keyword list. More...
 
virtual bool fillContainer (ossimConnectableContainer &container)
 Inserts this object and all of its children and inputs into the container provided. More...
 
bool moveInputUp (const ossimId &id)
 Moves the input connection matching id up one in the connection list. More...
 
bool moveInputDown (const ossimId &id)
 Moves the input connection matching id down one in the connection list. More...
 
bool moveInputToTop (const ossimId &id)
 Moves the input connection matching id to the top of the connection list. More...
 
bool moveInputToBottom (const ossimId &id)
 Moves the input connection matching id to the bottom of the connection list. More...
 
virtual void accept (ossimVisitor &visitor)
 We will add a visitor interface for all connectable objects. More...
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimObjectdup () const
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getClassName () const
 
virtual RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 
- Public Member Functions inherited from ossimListenerManager
 ossimListenerManager ()
 
virtual ~ossimListenerManager ()
 
virtual void fireEvent (ossimEvent &event)
 
virtual bool addListener (ossimListener *listener)
 
virtual bool removeListener (ossimListener *listener)
 
virtual bool findListener (ossimListener *listener)
 
- Public Member Functions inherited from ossimPropertyInterface
 ossimPropertyInterface ()
 
virtual ~ossimPropertyInterface ()
 
virtual ossimString getPropertyValueAsString (const ossimString &name) const
 
void getPropertyList (std::vector< ossimRefPtr< ossimProperty > > &propertyList) const
 
void setProperties (std::vector< ossimRefPtr< ossimProperty > > &propertyList)
 
- Public Member Functions inherited from ossimErrorStatusInterface
 ossimErrorStatusInterface ()
 
virtual ~ossimErrorStatusInterface ()
 
virtual ossimErrorCode getErrorStatus () const
 
virtual ossimString getErrorStatusString () const
 
virtual void setErrorStatus (ossimErrorCode error_status) const
 
virtual void setErrorStatus () const
 
virtual void clearErrorStatus () const
 
bool hasError () const
 
- Public Member Functions inherited from ossimConnectableObjectListener
 ossimConnectableObjectListener ()
 
virtual ~ossimConnectableObjectListener ()
 
virtual void processEvent (ossimEvent &event)
 ProcessEvent. More...
 
virtual void objectDestructingEvent (ossimObjectDestructingEvent &)
 
virtual void connectionEvent (ossimConnectionEvent &)
 
virtual void disconnectOutputEvent (ossimConnectionEvent &)
 
virtual void connectOutputEvent (ossimConnectionEvent &)
 
virtual void addObjectEvent (ossimContainerEvent &)
 
virtual void removeObjectEvent (ossimContainerEvent &)
 
virtual void containerEvent (ossimContainerEvent &)
 
- Public Member Functions inherited from ossimListener
 ossimListener ()
 
virtual ~ossimListener ()
 
void enableListener ()
 
void disableListener ()
 
void setListenerEnableFlag (bool flag)
 
bool isListenerEnabled () const
 
bool getListenerEnableFlag () const
 

Protected Member Functions

void allocate ()
 
void runAlgorithm (ossimImageData *newData, ossimImageData *oldData)
 
void runNative8 (ossimImageData *newData, ossimImageData *oldData)
 
void runNorm (ossimImageData *newData, ossimImageData *oldData)
 
- Protected Member Functions inherited from ossimImageCombiner
virtual ~ossimImageCombiner ()
 
void precomputeBounds () const
 
- Protected Member Functions inherited from ossimImageSource
 ossimImageSource (const ossimImageSource &rhs)
 
const ossimImageSourceoperator= (const ossimImageSource &)
 
- Protected Member Functions inherited from ossimSource
 ossimSource (const ossimSource &rhs)
 
const ossimSourceoperator= (const ossimSource &rhs)
 
- Protected Member Functions inherited from ossimConnectableObject
ossimConnectableObjectfindObjectOfType (ConnectableObjectList *connectableList, ossimVisitor &visitor)
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 
- Protected Member Functions inherited from ossimListenerManager
 ossimListenerManager (const ossimListenerManager &rhs)
 

Protected Attributes

bool m_byPassFlag
 
bool m_nativeFlag
 
ossimRefPtr< ossimImageDatam_twoColorTile
 
ossimRefPtr< ossimImageSourcem_newInput
 
ossimRefPtr< ossimImageSourcem_oldInput
 
ossim_uint32 m_newInputBandIndex
 
ossim_uint32 m_oldInputBandIndex
 
ossimTwoColorMultiViewOutputSource m_redSource
 
ossimTwoColorMultiViewOutputSource m_grnSource
 
ossimTwoColorMultiViewOutputSource m_bluSource
 
- Protected Attributes inherited from ossimImageCombiner
ossim_uint32 theLargestNumberOfInputBands
 
ossim_uint32 theInputToPassThrough
 
bool theHasDifferentInputs
 
ossimRefPtr< ossimImageDatatheNormTile
 
std::vector< ossimIrecttheFullResBounds
 
bool theComputeFullResBoundsFlag
 
ossim_uint32 theCurrentIndex
 
- Protected Attributes inherited from ossimSource
bool theEnableFlag
 
bool theInitializedFlag
 
- Protected Attributes inherited from ossimConnectableObject
ossimId theId
 
ossimString theDescription
 
ossimObjecttheOwner
 
bool theInputListIsFixedFlag
 Indicates whether the theInputObjectList is fixed. More...
 
bool theOutputListIsFixedFlag
 Indicates whether the theOutputObjectList is fixed. More...
 
ConnectableObjectList theInputObjectList
 Holds a list of input objects. More...
 
ConnectableObjectList theOutputObjectList
 Holds a list of output objects. More...
 
- Protected Attributes inherited from ossimListenerManager
std::list< ossimListener * > theListenerList
 
bool theEnabledFlag
 
std::list< ossimListener * > theDelayedAdd
 
std::list< ossimListener * > theDelayedRemove
 
bool theFireEventFlag
 
- Protected Attributes inherited from ossimErrorStatusInterface
ossimErrorCode theErrorStatus
 
- Protected Attributes inherited from ossimListener
bool theListenerEnableFlag
 

Detailed Description

This is a 2 color view of the input.

It basically allows for a change detection and by default will take the first input and map it to the blue channel and takes the second input and maps to the red channel. The unused channel is mapped to a min pixel value.

Definition at line 18 of file ossimTwoColorView.h.

Member Enumeration Documentation

◆ ossimTwoColorMultiViewOutputSource

Enumerations for mapping inputs to red, green and blue output channels.

Enumerator
UNKNOWN 
MIN 
OLD 
NEW 

Definition at line 26 of file ossimTwoColorView.h.

Constructor & Destructor Documentation

◆ ossimTwoColorView()

ossimTwoColorView::ossimTwoColorView ( )

Definition at line 16 of file ossimTwoColorView.cpp.

17  :
18  ossimImageCombiner(0, 2, 0, true, false) ,
19  m_byPassFlag(true),
20  m_nativeFlag(false),
21  m_newInput(0),
22  m_oldInput(0),
28 {
29 }
ossimRefPtr< ossimImageSource > m_oldInput
ossimTwoColorMultiViewOutputSource m_grnSource
ossimTwoColorMultiViewOutputSource m_bluSource
ossim_uint32 m_oldInputBandIndex
ossim_uint32 m_newInputBandIndex
ossimTwoColorMultiViewOutputSource m_redSource
ossimRefPtr< ossimImageSource > m_newInput

Member Function Documentation

◆ allocate()

void ossimTwoColorView::allocate ( )
protected

Definition at line 359 of file ossimTwoColorView.cpp.

References ossimImageDataFactory::create(), ossimImageData::initialize(), ossimImageDataFactory::instance(), m_twoColorTile, and ossimRefPtr< T >::valid().

Referenced by getTile().

360 {
362  if(m_twoColorTile.valid())
363  {
365  }
366 }
bool valid() const
Definition: ossimRefPtr.h:75
virtual void initialize()
Initialize the data buffer.
static ossimImageDataFactory * instance()
ossimRefPtr< ossimImageData > m_twoColorTile
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const

◆ getMaxPixelValue()

double ossimTwoColorView::getMaxPixelValue ( ossim_uint32  band) const
virtual

Returns the max pixel of the band.

Reimplemented from ossimImageCombiner.

Definition at line 81 of file ossimTwoColorView.cpp.

References ossimImageCombiner::getMaxPixelValue(), ossimSource::isSourceEnabled(), and m_byPassFlag.

82 {
84  {
86  }
87  return 256;
88 }
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
virtual double getMaxPixelValue(ossim_uint32 band=0) const
Returns the max pixel of the band.

◆ getMinPixelValue()

double ossimTwoColorView::getMinPixelValue ( ossim_uint32  band) const
virtual

Returns the min pixel of the band.

Reimplemented from ossimImageCombiner.

Definition at line 72 of file ossimTwoColorView.cpp.

References ossimImageCombiner::getMinPixelValue(), ossimSource::isSourceEnabled(), and m_byPassFlag.

73 {
75  {
77  }
78  return 1;
79 }
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
virtual double getMinPixelValue(ossim_uint32 band=0) const
Returns the min pixel of the band.

◆ getNullPixelValue()

double ossimTwoColorView::getNullPixelValue ( ossim_uint32  band) const
virtual

Each band has a null pixel associated with it.

The null pixel represents an invalid value.

Reimplemented from ossimImageCombiner.

Definition at line 63 of file ossimTwoColorView.cpp.

References ossimImageCombiner::getNullPixelValue(), ossimSource::isSourceEnabled(), and m_byPassFlag.

64 {
66  {
68  }
69  return 0;
70 }
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
virtual double getNullPixelValue(ossim_uint32 band=0) const
Each band has a null pixel associated with it.

◆ getNumberOfOutputBands()

ossim_uint32 ossimTwoColorView::getNumberOfOutputBands ( ) const
virtual

Returns the number of bands in a tile returned from this TileSource.

Reimplemented from ossimImageSource.

Definition at line 31 of file ossimTwoColorView.cpp.

References ossimImageSource::getNumberOfOutputBands(), ossimSource::isSourceEnabled(), and m_byPassFlag.

32 {
34  {
36  }
37  return 3;
38 }
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.

◆ getOutputScalarType()

ossimScalarType ossimTwoColorView::getOutputScalarType ( ) const
virtual

This will be used to query the output pixel type of the tile source.

Please ignore the argument. It will soon be removed.

Reimplemented from ossimImageCombiner.

Definition at line 40 of file ossimTwoColorView.cpp.

References ossimImageCombiner::getOutputScalarType(), ossimSource::isSourceEnabled(), m_byPassFlag, and OSSIM_UINT8.

41 {
43  {
45  }
46  return OSSIM_UINT8;
47 }
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
virtual ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.
8 bit unsigned integer

◆ getTile()

ossimRefPtr< ossimImageData > ossimTwoColorView::getTile ( const ossimIrect rect,
ossim_uint32  resLevel = 0 
)
virtual
Returns
the requested region of interest

Reimplemented from ossimImageSource.

Definition at line 90 of file ossimTwoColorView.cpp.

References allocate(), ossimRefPtr< T >::get(), ossimImageCombiner::getNextTile(), ossimImageSource::getTile(), ossimSource::isSourceEnabled(), m_byPassFlag, m_newInput, m_oldInput, m_twoColorTile, ossimImageData::makeBlank(), runAlgorithm(), ossimImageData::setImageRectangle(), ossimRefPtr< T >::valid(), and ossimImageData::validate().

92 {
93  ossim_uint32 tileIdx = 0;
95  {
96  return getNextTile(tileIdx, 0, rect, resLevel);
97  }
98  if(!m_twoColorTile.valid())
99  {
100  allocate();
101  }
102  if(!m_twoColorTile.valid())
103  {
104  return m_twoColorTile;
105  }
108 
109  ossimRefPtr<ossimImageData> newData = m_newInput->getTile(rect, resLevel);
110  ossimRefPtr<ossimImageData> oldData = m_oldInput->getTile(rect, resLevel);
111 
112  runAlgorithm(newData.get(), oldData.get());
113 
115 
116  return m_twoColorTile;
117 }
ossimRefPtr< ossimImageSource > m_oldInput
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
virtual void setImageRectangle(const ossimIrect &rect)
void runAlgorithm(ossimImageData *newData, ossimImageData *oldData)
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossimRefPtr< ossimImageData > getNextTile(ossim_uint32 &returnedIdx, const ossim_uint32 startIdx, const ossimIrect &tileRect, ossim_uint32 resLevel=0)
virtual ossimDataObjectStatus validate() const
unsigned int ossim_uint32
ossimRefPtr< ossimImageData > m_twoColorTile
ossimRefPtr< ossimImageSource > m_newInput
virtual void makeBlank()
Initializes data to null pixel values.
virtual ossimRefPtr< ossimImageData > getTile(const ossimIpt &origin, ossim_uint32 resLevel=0)

◆ initialize()

void ossimTwoColorView::initialize ( )
virtual

Reimplemented from ossimImageCombiner.

Definition at line 369 of file ossimTwoColorView.cpp.

References ossimConnectableObject::getInput(), ossimConnectableObject::getNumberOfInputs(), ossimImageSource::getNumberOfOutputBands(), ossimImageSource::getOutputScalarType(), ossimImageCombiner::initialize(), m_byPassFlag, m_nativeFlag, m_newInput, m_newInputBandIndex, m_oldInput, m_oldInputBandIndex, m_twoColorTile, OSSIM_UINT8, and ossimRefPtr< T >::valid().

370 {
372  m_newInput = 0;
373  m_oldInput = 0;
374  m_twoColorTile = 0;
375  m_nativeFlag = false;
376  m_byPassFlag = false;
377 
378  if(getNumberOfInputs() < 2)
379  {
380  m_byPassFlag = true;
381  }
382  else
383  {
384  m_oldInput = dynamic_cast<ossimImageSource*>( getInput(0) );
385  m_newInput = dynamic_cast<ossimImageSource*>( getInput(1) );
386 
387  //---
388  // Range check band selection. This can be set from setBandIndexMapping method which
389  // does no error checking because inputs may not be set.
390  //----
391  if ( m_oldInput.valid() )
392  {
394  {
396  }
397  }
398 
399  if ( m_newInput.valid() )
400  {
402  {
404  }
405  }
406 
407  if(!m_newInput||!m_oldInput)
408  {
409  m_byPassFlag = true;
410  }
411  else
412  {
415  {
416  m_nativeFlag = true;
417  }
418  }
419  }
420 }
ossimRefPtr< ossimImageSource > m_oldInput
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 m_oldInputBandIndex
ossimConnectableObject * getInput(ossim_uint32 index=0)
returns the object at the specified index.
ossim_uint32 m_newInputBandIndex
ossimRefPtr< ossimImageData > m_twoColorTile
ossimRefPtr< ossimImageSource > m_newInput
virtual ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.
virtual ossim_uint32 getNumberOfInputs() const
Returns the number of input objects.
8 bit unsigned integer

◆ runAlgorithm()

void ossimTwoColorView::runAlgorithm ( ossimImageData newData,
ossimImageData oldData 
)
protected

Definition at line 118 of file ossimTwoColorView.cpp.

References m_nativeFlag, runNative8(), and runNorm().

Referenced by getTile().

119 {
120  if(m_nativeFlag)
121  {
122  runNative8(newData, oldData);
123  }
124  else
125  {
126  runNorm(newData, oldData);
127  }
128 }
void runNorm(ossimImageData *newData, ossimImageData *oldData)
void runNative8(ossimImageData *newData, ossimImageData *oldData)

◆ runNative8()

void ossimTwoColorView::runNative8 ( ossimImageData newData,
ossimImageData oldData 
)
protected

Definition at line 130 of file ossimTwoColorView.cpp.

References ossimImageData::getBuf(), ossimImageData::getNumberOfBands(), ossimImageData::getSizePerBand(), m_grnSource, m_newInputBandIndex, m_oldInputBandIndex, m_redSource, m_twoColorTile, n, NEW, OLD, and ossimRefPtr< T >::valid().

Referenced by runAlgorithm().

131 {
132  if ( newData && oldData && m_twoColorTile.valid() &&
133  ( m_twoColorTile->getNumberOfBands() == 3 ) )
134  {
135  // old, new, red, green, blue buffers...
136  ossim_uint8* o = static_cast<ossim_uint8*>( oldData->getBuf(m_oldInputBandIndex) );
137  ossim_uint8* n = static_cast<ossim_uint8*>( newData->getBuf(m_newInputBandIndex) );
138  ossim_uint8* r = static_cast<ossim_uint8*>( m_twoColorTile->getBuf(0) );
139  ossim_uint8* g = static_cast<ossim_uint8*>( m_twoColorTile->getBuf(1) );
140  ossim_uint8* b = static_cast<ossim_uint8*>( m_twoColorTile->getBuf(2) );
141 
142  if ( o && n && r && g && b )
143  {
144  // Assuming null pix of 0 for 8 bit.
145  const ossim_uint8 MP = 1;
146  const ossim_uint8 NP = 0;
147 
148  ossim_uint8 newPix = 0;
149  ossim_uint8 oldPix = 0;
150 
151  const ossim_uint32 MAX_IDX = m_twoColorTile->getSizePerBand();
152 
153  for(ossim_uint32 idx = 0; idx < MAX_IDX; ++idx)
154  {
155  if( ( *n == NP ) && ( *o == NP ) )
156  {
157  // Both inputs null, set all outputs null.
158  *r = NP;
159  *b = NP;
160  *g = NP;
161  }
162  else
163  {
164  // At least one input is not null.
165  newPix = (*n != NP) ? *n : MP;
166  oldPix = (*o != NP) ? *o : MP;
167 
168  // Set red, OLD is default so check first:
170  {
171  *r = oldPix;
172  }
173  else if ( m_redSource == ossimTwoColorView::NEW )
174  {
175  *r = newPix;
176  }
177  else
178  {
179  *r = MP;
180  }
181 
182  // Set green, NEW is default so check first:
184  {
185  *g = newPix;
186  }
187  else if ( m_grnSource == ossimTwoColorView::OLD )
188  {
189  *g = oldPix;
190  }
191  else
192  {
193  *g = MP;
194  }
195 
196  // Set blue, NEW is default so check first:
198  {
199  *b = newPix;
200  }
201  else if ( m_grnSource == ossimTwoColorView::OLD )
202  {
203  *b = oldPix;
204  }
205  else
206  {
207  *b = MP;
208  }
209  }
210 
211  // Next pixel:
212  ++n;
213  ++o;
214  ++r;
215  ++g;
216  ++b;
217  }
218  }
219  }
220 }
ossimTwoColorMultiViewOutputSource m_grnSource
virtual ossim_uint32 getNumberOfBands() const
bool valid() const
Definition: ossimRefPtr.h:75
ossim_uint32 m_oldInputBandIndex
ossim_uint32 m_newInputBandIndex
os2<< "> n<< " > nendobj n
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
ossimTwoColorMultiViewOutputSource m_redSource
unsigned int ossim_uint32
ossimRefPtr< ossimImageData > m_twoColorTile
virtual const void * getBuf() const
unsigned char ossim_uint8

◆ runNorm()

void ossimTwoColorView::runNorm ( ossimImageData newData,
ossimImageData oldData 
)
protected

Definition at line 222 of file ossimTwoColorView.cpp.

References ossimImageData::copyTileBandToNormalizedBuffer(), ossimImageData::getBuf(), ossimImageData::getNumberOfBands(), ossimImageData::getSizePerBand(), m_grnSource, m_newInputBandIndex, m_oldInputBandIndex, m_redSource, m_twoColorTile, n, NEW, OLD, and ossimRefPtr< T >::valid().

Referenced by runAlgorithm().

223 {
224  if ( newData && oldData && m_twoColorTile.valid() &&
225  ( m_twoColorTile->getNumberOfBands() == 3 ) )
226  {
227  const ossim_uint32 MAX_IDX = m_twoColorTile->getSizePerBand();
228 
229  // Buffers for normalized oldData and newData tiles.
230  std::vector<ossim_float32> oldDataBuffer(MAX_IDX);
231  std::vector<ossim_float32> newDataBuffer(MAX_IDX);
232 
233  // old and new input buffers.
234  ossim_float32* o = &oldDataBuffer.front();
235  ossim_float32* n = &newDataBuffer.front();
236 
237  // Normalize/copy to buffers.
240 
241  // Get the output buffers.
242  ossim_uint8* r = static_cast<ossim_uint8*>( m_twoColorTile->getBuf(0) );
243  ossim_uint8* g = static_cast<ossim_uint8*>( m_twoColorTile->getBuf(1) );
244  ossim_uint8* b = static_cast<ossim_uint8*>( m_twoColorTile->getBuf(2) );
245 
246  if ( o && n && r && g && b )
247  {
248  // Assuming null pix of 0 for 8 bit.
249  const ossim_uint8 MP = 1;
250  const ossim_uint8 NP = 0;
251 
252  ossim_uint8 newPix = 0;
253  ossim_uint8 oldPix = 0;
254  ossim_float32 tmpPix = 0.0;
255 
256  const ossim_uint32 MAX_IDX = m_twoColorTile->getSizePerBand();
257 
258  for(ossim_uint32 idx = 0; idx < MAX_IDX; ++idx)
259  {
260  if( ( *n == NP ) && ( *o == NP ) )
261  {
262  // Both inputs null, set all outputs null.
263  *r = NP;
264  *b = NP;
265  *g = NP;
266  }
267  else
268  {
269  // At least one input is not null.
270 
271  // Set the newPix:
272  if ( *n != NP )
273  {
274  // Un-normalize:
275  tmpPix = (*n) * 255.0;
276 
277  // Clamp to min/max.
278  tmpPix = (tmpPix <= 255.0) ? ( (tmpPix >= 1.0) ? tmpPix : 1.0) : 255.0;
279 
280  // Copy
281  newPix = static_cast<ossim_uint8>( tmpPix );
282  }
283  else
284  {
285  newPix = MP;
286  }
287 
288  // Set the oldPix:
289  if ( *o != NP )
290  {
291  // Un-normalize:
292  tmpPix = (*o) * 255.0;
293 
294  // Clamp to min/max.
295  tmpPix = (tmpPix <= 255.0) ? ( (tmpPix >= 1.0) ? tmpPix : 1.0) : 255.0;
296 
297  // Copy
298  oldPix = static_cast<ossim_uint8>( tmpPix );
299  }
300  else
301  {
302  oldPix = MP;
303  }
304 
305  // Set red, OLD is default so check first:
307  {
308  *r = oldPix;
309  }
310  else if ( m_redSource == ossimTwoColorView::NEW )
311  {
312  *r = newPix;
313  }
314  else
315  {
316  *r = MP;
317  }
318 
319  // Set green, NEW is default so check first:
321  {
322  *g = newPix;
323  }
324  else if ( m_grnSource == ossimTwoColorView::OLD )
325  {
326  *g = oldPix;
327  }
328  else
329  {
330  *g = MP;
331  }
332 
333  // Set blue, NEW is default so check first:
335  {
336  *b = newPix;
337  }
338  else if ( m_grnSource == ossimTwoColorView::OLD )
339  {
340  *b = oldPix;
341  }
342  else
343  {
344  *b = MP;
345  }
346  }
347 
348  // Next pixel:
349  ++n;
350  ++o;
351  ++r;
352  ++g;
353  ++b;
354  }
355  }
356  }
357 }
ossimTwoColorMultiViewOutputSource m_grnSource
virtual ossim_uint32 getNumberOfBands() const
bool valid() const
Definition: ossimRefPtr.h:75
float ossim_float32
virtual void copyTileBandToNormalizedBuffer(ossim_uint32 band, ossim_float64 *buf) const
Will copy this tiles specified band number to the normalized buffer.
ossim_uint32 m_oldInputBandIndex
ossim_uint32 m_newInputBandIndex
os2<< "> n<< " > nendobj n
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
ossimTwoColorMultiViewOutputSource m_redSource
unsigned int ossim_uint32
ossimRefPtr< ossimImageData > m_twoColorTile
virtual const void * getBuf() const
unsigned char ossim_uint8

◆ setBandIndexMapping()

void ossimTwoColorView::setBandIndexMapping ( ossim_uint32  oldInputBandIndex,
ossim_uint32  newInputBandIndex,
ossimTwoColorMultiViewOutputSource  redOutputSource,
ossimTwoColorMultiViewOutputSource  grnOutputSource,
ossimTwoColorMultiViewOutputSource  bluOutputSource 
)

Sets which bands to use from inputs, and which inputs to use for output red, green and blue channels.

This method does no error checking as the inputs may or may not be set prior to this call. ossimTwoColorView::initialize() will verify once inputs are established. So if an input band is out of range band 0 (first band) will be used.

Callers should ensure initialize is called after this.

Parameters
oldInputBandIndexZero based band index for old input. Default=0
newInputBandIndexZero based band index for new input. Default=0.
redOutputSourcedefault=OLD. Can be: ossimTwoColorMultiViewOutputSource::OLD ossimTwoColorMultiViewOutputSource::NEW ossimTwoColorMultiViewOutputSource::MIN
grnOutputSourcedefault=NEW. Can be: ossimTwoColorMultiViewOutputSource::OLD ossimTwoColorMultiViewOutputSource::NEW ossimTwoColorMultiViewOutputSource::MIN
bluOutputSourcedefault=NEW. Can be: ossimTwoColorMultiViewOutputSource::OLD ossimTwoColorMultiViewOutputSource::NEW ossimTwoColorMultiViewOutputSource::MIN

Definition at line 49 of file ossimTwoColorView.cpp.

References m_bluSource, m_grnSource, m_newInputBandIndex, m_oldInputBandIndex, and m_redSource.

55 {
56  m_oldInputBandIndex = oldInputBandIndex;
57  m_newInputBandIndex = newInputBandIndex;
58  m_redSource = redOutputSource;
59  m_grnSource = grnOutputSource;
60  m_bluSource = bluOutputSource;
61 }
ossimTwoColorMultiViewOutputSource m_grnSource
ossimTwoColorMultiViewOutputSource m_bluSource
ossim_uint32 m_oldInputBandIndex
ossim_uint32 m_newInputBandIndex
ossimTwoColorMultiViewOutputSource m_redSource

Member Data Documentation

◆ m_bluSource

ossimTwoColorMultiViewOutputSource ossimTwoColorView::m_bluSource
protected

Definition at line 101 of file ossimTwoColorView.h.

Referenced by setBandIndexMapping().

◆ m_byPassFlag

bool ossimTwoColorView::m_byPassFlag
protected

◆ m_grnSource

ossimTwoColorMultiViewOutputSource ossimTwoColorView::m_grnSource
protected

Definition at line 100 of file ossimTwoColorView.h.

Referenced by runNative8(), runNorm(), and setBandIndexMapping().

◆ m_nativeFlag

bool ossimTwoColorView::m_nativeFlag
protected

Definition at line 93 of file ossimTwoColorView.h.

Referenced by initialize(), and runAlgorithm().

◆ m_newInput

ossimRefPtr<ossimImageSource> ossimTwoColorView::m_newInput
protected

Definition at line 95 of file ossimTwoColorView.h.

Referenced by getTile(), and initialize().

◆ m_newInputBandIndex

ossim_uint32 ossimTwoColorView::m_newInputBandIndex
protected

Definition at line 97 of file ossimTwoColorView.h.

Referenced by initialize(), runNative8(), runNorm(), and setBandIndexMapping().

◆ m_oldInput

ossimRefPtr<ossimImageSource> ossimTwoColorView::m_oldInput
protected

Definition at line 96 of file ossimTwoColorView.h.

Referenced by getTile(), and initialize().

◆ m_oldInputBandIndex

ossim_uint32 ossimTwoColorView::m_oldInputBandIndex
protected

Definition at line 98 of file ossimTwoColorView.h.

Referenced by initialize(), runNative8(), runNorm(), and setBandIndexMapping().

◆ m_redSource

ossimTwoColorMultiViewOutputSource ossimTwoColorView::m_redSource
protected

Definition at line 99 of file ossimTwoColorView.h.

Referenced by runNative8(), runNorm(), and setBandIndexMapping().

◆ m_twoColorTile

ossimRefPtr<ossimImageData> ossimTwoColorView::m_twoColorTile
protected

Definition at line 94 of file ossimTwoColorView.h.

Referenced by allocate(), getTile(), initialize(), runNative8(), and runNorm().


The documentation for this class was generated from the following files: