OSSIM - Open Source Software Image Map
Version 1.9.0 (20180803)
|
#include <ossimAnnotationGdBitmapFont.h>
Public Member Functions | |
ossimAnnotationGdBitmapFont (const ossimDpt &position=ossimDpt(0, 0), const ossimString &text=ossimString(""), ossimGdFontPtr font=ossimGdFontLarge, unsigned char r=255, unsigned char g=255, unsigned char b=255, long thickness=1) | |
ossimAnnotationGdBitmapFont (const ossimAnnotationGdBitmapFont &rhs) | |
virtual ossimObject * | dup () const |
virtual void | applyScale (double x, double y) |
virtual void | draw (ossimRgbImage &anImage) const |
virtual bool | intersects (const ossimDrect &rect) const |
virtual ossimAnnotationObject * | getNewClippedObject (const ossimDrect &rect) const |
virtual std::ostream & | print (std::ostream &out) const |
Generic print method. More... | |
virtual void | getBoundingRect (ossimDrect &rect) const |
virtual void | computeBoundingRect () |
virtual void | setFont (ossimGdFontPtr font) |
virtual void | setText (const ossimString &text) |
virtual void | setCenterText (const ossimDpt ¢er, const ossimString &text) |
virtual void | setUpperLeftText (const ossimDpt &upperLeft, const ossimString &text) |
virtual void | setCenterTextPosition (const ossimDpt &position) |
virtual void | setUpperLeftTextPosition (const ossimDpt &position) |
virtual bool | isPointWithin (const ossimDpt &imagePoint) const |
![]() | |
virtual | ~ossimAnnotationObject () |
ossimAnnotationObject (ossim_uint8 r=255, ossim_uint8 g=255, ossim_uint8 b=255, ossim_uint8 thickness=1) | |
virtual void | applyScale (const ossimDpt &scale) |
virtual ossimDrect | getBoundingRect () const |
virtual void | setColor (ossim_uint8 r, ossim_uint8 g, ossim_uint8 b) |
void | getColor (ossim_uint8 &r, ossim_uint8 &g, ossim_uint8 &b) const |
ossim_uint8 | getThickness () const |
virtual void | setThickness (ossim_uint8 thickness) |
virtual bool | saveState (ossimKeywordlist &kwl, const char *prefix=0) const |
Saves the current state of this object. More... | |
virtual bool | loadState (const ossimKeywordlist &kwl, const char *prefix=0) |
Method to the load (recreate) the state of an object from a keyword list. More... | |
virtual ossimString | getName () const |
virtual void | setName (const ossimString &name) |
ossim_uint32 | getId () const |
virtual ossim_uint32 | setId () |
![]() | |
ossimObject () | |
virtual | ~ossimObject () |
virtual ossimString | getShortName () const |
virtual ossimString | getLongName () const |
virtual ossimString | getDescription () 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 |
virtual void | accept (ossimVisitor &visitor) |
![]() | |
ossimReferenced () | |
ossimReferenced (const ossimReferenced &) | |
ossimReferenced & | operator= (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 | ~ossimAnnotationGdBitmapFont () |
![]() | |
virtual | ~ossimReferenced () |
Protected Attributes | |
ossimGdFontPtr | theFontPtr |
ossimString | theText |
ossimDrect | theBoundingRect |
ossimDpt | thePosition |
![]() | |
ossim_uint8 | theRed |
ossim_uint8 | theGreen |
ossim_uint8 | theBlue |
ossim_uint8 | theThickness |
ossimString | theName |
ossim_uint32 | theId |
Additional Inherited Members | |
![]() | |
static ossim_uint32 | getNextId () |
static void | restIdCounter () |
![]() | |
static ossim_uint32 | theIdCounter = 0 |
This is a class that will have hardcoded bitmap fonts. These fonts will be from the gd library.
Definition at line 22 of file ossimAnnotationGdBitmapFont.h.
ossimAnnotationGdBitmapFont::ossimAnnotationGdBitmapFont | ( | const ossimDpt & | position = ossimDpt(0,0) , |
const ossimString & | text = ossimString("") , |
||
ossimGdFontPtr | font = ossimGdFontLarge , |
||
unsigned char | r = 255 , |
||
unsigned char | g = 255 , |
||
unsigned char | b = 255 , |
||
long | thickness = 1 |
||
) |
Definition at line 20 of file ossimAnnotationGdBitmapFont.cpp.
References computeBoundingRect().
ossimAnnotationGdBitmapFont::ossimAnnotationGdBitmapFont | ( | const ossimAnnotationGdBitmapFont & | rhs | ) |
Definition at line 35 of file ossimAnnotationGdBitmapFont.cpp.
|
protectedvirtual |
Definition at line 44 of file ossimAnnotationGdBitmapFont.cpp.
|
virtual |
Implements ossimAnnotationObject.
Definition at line 53 of file ossimAnnotationGdBitmapFont.cpp.
References theBoundingRect, thePosition, ossimDpt::x, x, ossimDpt::y, and y.
Referenced by ossimGeoAnnotationGdBitmapFont::applyScale().
|
virtual |
will compute the bounding rectangle.
Implements ossimAnnotationObject.
Definition at line 131 of file ossimAnnotationGdBitmapFont.cpp.
References ossimGdFont::h, ossimString::size(), theBoundingRect, theFontPtr, thePosition, theText, ossimGdFont::w, ossimDpt::x, and ossimDpt::y.
Referenced by ossimGeoAnnotationGdBitmapFont::computeBoundingRect(), ossimAnnotationGdBitmapFont(), setCenterTextPosition(), setText(), and setUpperLeftTextPosition().
|
virtual |
Will draw the bitmap to the screen.
Implements ossimAnnotationObject.
Definition at line 61 of file ossimAnnotationGdBitmapFont.cpp.
References ossimGdFont::data, ossimRgbImage::getImageData(), ossimImageData::getImageRectangle(), ossimImageData::getOrigin(), ossimGdFont::h, ossimDrect::intersects(), ossimRgbImage::setDrawColor(), ossimString::size(), ossimRgbImage::slowPlotPixel(), ossimAnnotationObject::theBlue, theBoundingRect, theFontPtr, ossimAnnotationObject::theGreen, thePosition, ossimAnnotationObject::theRed, theText, ossimGdFont::w, ossimDpt::x, and ossimDpt::y.
Referenced by ossimGeographicAnnotationGrid::draw(), and ossimGeoAnnotationGdBitmapFont::draw().
|
inlinevirtual |
Reimplemented from ossimObject.
Definition at line 34 of file ossimAnnotationGdBitmapFont.h.
Referenced by getNewClippedObject().
|
virtual |
Will retrieve the bound rectangle for this object.
Implements ossimAnnotationObject.
Definition at line 48 of file ossimAnnotationGdBitmapFont.cpp.
References theBoundingRect.
Referenced by ossimGeographicAnnotationGrid::computeBoundingRect(), ossimGeographicAnnotationGrid::draw(), and ossimGeoAnnotationGdBitmapFont::getBoundingRect().
|
virtual |
Will allocate a new object that is clipped to the passed. in rect. Look at derived classes to see if the object is actually clipped or not. A new object is returned if it clips to the rect else NULL should be returned it doesn't clip.
Implements ossimAnnotationObject.
Definition at line 111 of file ossimAnnotationGdBitmapFont.cpp.
References dup(), and intersects().
Referenced by ossimGeoAnnotationGdBitmapFont::getNewClippedObject().
|
inlinevirtual |
Implements ossimAnnotationObject.
Definition at line 45 of file ossimAnnotationGdBitmapFont.h.
References ossimDrect::intersects().
Referenced by getNewClippedObject(), and ossimGeoAnnotationGdBitmapFont::intersects().
|
virtual |
Will determine if the point is within the font
Reimplemented from ossimAnnotationObject.
Definition at line 180 of file ossimAnnotationGdBitmapFont.cpp.
References ossimDrect::pointWithin(), and theBoundingRect.
|
virtual |
Generic print method.
Derived classes should re-implement as they see fit.
Reimplemented from ossimAnnotationObject.
Definition at line 123 of file ossimAnnotationGdBitmapFont.cpp.
References theBoundingRect, thePosition, and theText.
Referenced by ossimGeoAnnotationGdBitmapFont::print().
|
virtual |
Set's the text string to render. This will assume that the x,y passed in is suppose to be the center. We will compute the upper left corner from this
Definition at line 166 of file ossimAnnotationGdBitmapFont.cpp.
References setCenterTextPosition(), and setText().
Referenced by ossimGeographicAnnotationGrid::computeBoundingRect(), and ossimGeographicAnnotationGrid::draw().
|
virtual |
Sets the center position of the string. will use this value to compute the actual origin of upper left corner of the first character. Make sure you have the text set before you call this method
Definition at line 173 of file ossimAnnotationGdBitmapFont.cpp.
References computeBoundingRect(), ossimDrect::height(), theBoundingRect, thePosition, ossimDrect::width(), ossimDpt::x, and ossimDpt::y.
Referenced by ossimGeographicAnnotationGrid::draw(), and setCenterText().
|
virtual |
Sets the current bitmap font to use.
Definition at line 142 of file ossimAnnotationGdBitmapFont.cpp.
References theFontPtr.
Referenced by ossimGeoAnnotationGdBitmapFont::setFont().
|
virtual |
Set's the text string to render.
Definition at line 147 of file ossimAnnotationGdBitmapFont.cpp.
References computeBoundingRect(), and theText.
Referenced by ossimGeographicAnnotationGrid::draw(), setCenterText(), ossimGeoAnnotationGdBitmapFont::setText(), and setUpperLeftText().
|
virtual |
Set's the text string to render. This will assume that the x,y passed in is suppose to be the upper left.
Definition at line 153 of file ossimAnnotationGdBitmapFont.cpp.
References setText(), and setUpperLeftTextPosition().
|
virtual |
The actual upper left corner of the character.
Definition at line 160 of file ossimAnnotationGdBitmapFont.cpp.
References computeBoundingRect(), and thePosition.
Referenced by setUpperLeftText(), and ossimGeoAnnotationGdBitmapFont::transform().
|
protected |
Definition at line 114 of file ossimAnnotationGdBitmapFont.h.
Referenced by applyScale(), computeBoundingRect(), draw(), getBoundingRect(), isPointWithin(), print(), and setCenterTextPosition().
|
protected |
Definition at line 112 of file ossimAnnotationGdBitmapFont.h.
Referenced by computeBoundingRect(), draw(), and setFont().
|
protected |
This position is suppose to be the upperleft corner of the first character in the string
Definition at line 120 of file ossimAnnotationGdBitmapFont.h.
Referenced by applyScale(), computeBoundingRect(), draw(), print(), setCenterTextPosition(), and setUpperLeftTextPosition().
|
protected |
Definition at line 113 of file ossimAnnotationGdBitmapFont.h.
Referenced by computeBoundingRect(), draw(), print(), and setText().