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

#include <ossimColorProperty.h>

Inheritance diagram for ossimColorProperty:
ossimProperty ossimObject ossimReferenced

Public Member Functions

 ossimColorProperty (const ossimString &name=ossimString(""), const ossimRgbVector &value=ossimRgbVector(0, 0, 0))
 
 ossimColorProperty (const ossimColorProperty &rhs)
 
virtual ossimObjectdup () const
 
virtual const ossimPropertyassign (const ossimProperty &rhs)
 
virtual bool setValue (const ossimString &value)
 
virtual void valueToString (ossimString &valueResult) const
 
const ossimRgbVectorgetColor () const
 
void setColor (const ossimRgbVector &value)
 
ossim_uint8 getRed () const
 
ossim_uint8 getGreen () const
 
ossim_uint8 getBlue () const
 
void setRed (ossim_uint8 r)
 
void setGreen (ossim_uint8 r)
 
void setBlue (ossim_uint8 r)
 
- Public Member Functions inherited from ossimProperty
 ossimProperty (const ossimString &name=ossimString(""))
 
 ossimProperty (const ossimProperty &rhs)
 
const ossimPropertyoperator= (const ossimProperty &rhs)
 
const ossimStringgetName () const
 
void setName (const ossimString &name)
 
virtual ossimString valueToString () const
 
virtual const ossimContainerPropertyasContainer () const
 
virtual ossimContainerPropertyasContainer ()
 
bool isChangeTypeSet (int type) const
 
void clearChangeType ()
 
void setChangeType (int type, bool on=true)
 
void setFullRefreshBit ()
 
void setCacheRefreshBit ()
 
ossimPropertyChangeType getChangeType () const
 
bool isFullRefresh () const
 
bool isCacheRefresh () const
 
bool isChangeTypeSpecified () const
 
bool affectsOthers () const
 
virtual void setReadOnlyFlag (bool flag)
 
bool getReadOnlyFlag () const
 
bool isReadOnly () const
 
void setModifiedFlag (bool flag)
 
bool getModifiedFlag () const
 
bool isModified () const
 
void clearModifiedFlag ()
 
void setDescription (const ossimString &description)
 
virtual ossimString getDescription () const
 
virtual ossimRefPtr< ossimXmlNodetoXml () const
 
virtual void saveState (ossimKeywordlist &kwl, const ossimString &prefix="") const
 
virtual void accept (ossimVisitor &visitor)
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
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 saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
virtual std::ostream & print (std::ostream &out) const
 Generic print method. More...
 
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
 

Protected Member Functions

virtual ~ossimColorProperty ()
 
- Protected Member Functions inherited from ossimProperty
virtual ~ossimProperty ()
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 

Protected Attributes

ossimRgbVector theValue
 
- Protected Attributes inherited from ossimProperty
ossimString theName
 
ossimString theDescription
 
bool theReadOnlyFlag
 
ossimPropertyChangeType theChangeType
 
bool theModifiedFlag
 

Additional Inherited Members

- Public Types inherited from ossimProperty
enum  ossimPropertyChangeType {
  ossimPropertyChangeType_NOTSPECIFIED = 0, ossimPropertyChangeType_CACHE_REFRESH = 1, ossimPropertyChangeType_FULL_REFRESH = 2, ossimPropertyChangeType_AFFECTS_OTHERS = 4,
  ossimPropertyChangeType_ALL = (ossimPropertyChangeType_CACHE_REFRESH|ossimPropertyChangeType_FULL_REFRESH|ossimPropertyChangeType_AFFECTS_OTHERS)
}
 

Detailed Description

Definition at line 15 of file ossimColorProperty.h.

Constructor & Destructor Documentation

◆ ossimColorProperty() [1/2]

ossimColorProperty::ossimColorProperty ( const ossimString name = ossimString(""),
const ossimRgbVector value = ossimRgbVector(0,0,0) 
)

Definition at line 14 of file ossimColorProperty.cpp.

Referenced by dup().

16  :ossimProperty(name),
17  theValue(value)
18 {
19 }
ossimRgbVector theValue
ossimProperty(const ossimString &name=ossimString(""))

◆ ossimColorProperty() [2/2]

ossimColorProperty::ossimColorProperty ( const ossimColorProperty rhs)

Definition at line 21 of file ossimColorProperty.cpp.

22  :ossimProperty(rhs),
23  theValue(rhs.theValue)
24 {
25 }
ossimRgbVector theValue
ossimProperty(const ossimString &name=ossimString(""))

◆ ~ossimColorProperty()

ossimColorProperty::~ossimColorProperty ( )
protectedvirtual

Definition at line 27 of file ossimColorProperty.cpp.

28 {
29 }

Member Function Documentation

◆ assign()

const ossimProperty & ossimColorProperty::assign ( const ossimProperty rhs)
virtual

Reimplemented from ossimProperty.

Definition at line 36 of file ossimColorProperty.cpp.

References ossimProperty::assign(), setValue(), theValue, and ossimProperty::valueToString().

37 {
39 
40  const ossimColorProperty* rhsPtr = dynamic_cast<const ossimColorProperty*>(&rhs);
41  if(rhsPtr)
42  {
43  theValue = rhsPtr->theValue;
44  }
45  else
46  {
47  setValue(rhs.valueToString());
48  }
49 
50  return *this;
51 }
ossimRgbVector theValue
virtual void valueToString(ossimString &valueResult) const =0
virtual const ossimProperty & assign(const ossimProperty &rhs)
virtual bool setValue(const ossimString &value)

◆ dup()

ossimObject * ossimColorProperty::dup ( ) const
virtual

Reimplemented from ossimObject.

Definition at line 31 of file ossimColorProperty.cpp.

References ossimColorProperty().

32 {
33  return new ossimColorProperty(*this);
34 }
ossimColorProperty(const ossimString &name=ossimString(""), const ossimRgbVector &value=ossimRgbVector(0, 0, 0))

◆ getBlue()

ossim_uint8 ossimColorProperty::getBlue ( ) const

Definition at line 102 of file ossimColorProperty.cpp.

References ossimRgbVector::getB(), and theValue.

Referenced by ossimNitfFileHeaderV2_1::setProperty().

103 {
104  return theValue.getB();
105 }
ossimRgbVector theValue
unsigned char getB() const

◆ getColor()

const ossimRgbVector & ossimColorProperty::getColor ( ) const

Definition at line 82 of file ossimColorProperty.cpp.

References theValue.

Referenced by ossimMapCompositionSource::setProperty().

83 {
84  return theValue;
85 }
ossimRgbVector theValue

◆ getGreen()

ossim_uint8 ossimColorProperty::getGreen ( ) const

Definition at line 97 of file ossimColorProperty.cpp.

References ossimRgbVector::getG(), and theValue.

Referenced by ossimNitfFileHeaderV2_1::setProperty().

98 {
99  return theValue.getG();
100 }
ossimRgbVector theValue
unsigned char getG() const

◆ getRed()

ossim_uint8 ossimColorProperty::getRed ( ) const

Definition at line 92 of file ossimColorProperty.cpp.

References ossimRgbVector::getR(), and theValue.

Referenced by ossimNitfFileHeaderV2_1::setProperty().

93 {
94  return theValue.getR();
95 }
ossimRgbVector theValue
unsigned char getR() const

◆ setBlue()

void ossimColorProperty::setBlue ( ossim_uint8  r)

Definition at line 117 of file ossimColorProperty.cpp.

References ossimRgbVector::setB(), and theValue.

118 {
119  theValue.setB(b);
120 }
ossimRgbVector theValue
void setB(unsigned char B)

◆ setColor()

void ossimColorProperty::setColor ( const ossimRgbVector value)

Definition at line 87 of file ossimColorProperty.cpp.

References theValue.

88 {
89  theValue = value;
90 }
ossimRgbVector theValue

◆ setGreen()

void ossimColorProperty::setGreen ( ossim_uint8  r)

Definition at line 112 of file ossimColorProperty.cpp.

References ossimRgbVector::setG(), and theValue.

113 {
114  theValue.setG(g);
115 }
ossimRgbVector theValue
void setG(unsigned char G)

◆ setRed()

void ossimColorProperty::setRed ( ossim_uint8  r)

Definition at line 107 of file ossimColorProperty.cpp.

References ossimRgbVector::setR(), and theValue.

108 {
109  theValue.setR(r);
110 }
ossimRgbVector theValue
void setR(unsigned char R)

◆ setValue()

bool ossimColorProperty::setValue ( const ossimString value)
virtual

Implements ossimProperty.

Definition at line 53 of file ossimColorProperty.cpp.

References ossimString::split(), and theValue.

Referenced by assign().

54 {
55  bool result = false;
56  std::vector<ossimString> splitArray;
57 
58  value.split(splitArray, " ");
59  if(splitArray.size() == 3)
60  {
61  int r,g,b;
62  r = splitArray[0].toInt32();
63  g = splitArray[1].toInt32();
64  b = splitArray[2].toInt32();
65  result = true;
66 
67  theValue = ossimRgbVector(r,g,b);
68  }
69 
70  return result;
71 }
ossimRgbVector theValue
void split(std::vector< ossimString > &result, const ossimString &separatorList, bool skipBlankFields=false) const
Splits this string into a vector of strings (fields) using the delimiter list specified.

◆ valueToString()

void ossimColorProperty::valueToString ( ossimString valueResult) const
virtual

Implements ossimProperty.

Definition at line 73 of file ossimColorProperty.cpp.

References ossimString::c_str(), ossimRgbVector::getB(), ossimRgbVector::getG(), ossimRgbVector::getR(), and theValue.

74 {
75  ostringstream out;
76 
77  out << (int)theValue.getR() << " " << (int)theValue.getG() << " " << (int)theValue.getB() << endl;
78 
79  valueResult = out.str().c_str();
80 }
ossimRgbVector theValue
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
unsigned char getR() const
unsigned char getB() const
unsigned char getG() const
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396

Member Data Documentation

◆ theValue

ossimRgbVector ossimColorProperty::theValue
protected

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