OSSIM - Open Source Software Image Map
Version 1.9.0 (20180803)
|
#include <ossimRgbImage.h>
Public Member Functions | |
ossimRgbImage () | |
ossimRgbImage (ossimRefPtr< ossimImageData > ¤tImageData) | |
virtual void | createNewGrey (ossim_int32 width, ossim_int32 height) |
Will construct a new single band image data object. More... | |
virtual void | createNewTrueColor (ossim_int32 width, ossim_int32 height) |
Will construct a new 3 band rgb data object. More... | |
virtual void | initialize () |
Will initilize any pre-computations that are needed. More... | |
void | slowPlotPixel (ossim_int32 x, ossim_int32 y, ossim_uint8 r, ossim_uint8 g, ossim_uint8 b) |
This will plot a pixel and will do inside outside compares. More... | |
void | fastPlotPixel (ossim_int32 x, ossim_int32 y, ossim_uint8 r, ossim_uint8 g, ossim_uint8 b) |
same thing as slowPlotPixel but without the inside outside compare More... | |
void | setThickness (ossim_int32 thickness) |
All the drawing algorithms have thickness. More... | |
ossim_int32 | getThickness () const |
void | setCurrentImageData (ossimRefPtr< ossimImageData > &imageData) |
Allows you to change the image data that this RgbImage object operates on. More... | |
ossimRefPtr< ossimImageData > | getImageData () |
Will return the image data. More... | |
void | drawFilledPolygon (const std::vector< ossimDpt > &p) |
We will cut and paste the code from drawFilledPolygon(ossimIpt *p, int n). More... | |
void | drawFilledPolygon (const std::vector< ossimIpt > &p) |
We will cut and paste the code from drawFilledPolygon(ossimIpt *p, int n). More... | |
void | drawFilledPolygon (ossimDpt *p, int n) |
This will draw a polygon and fill it with the specified color. More... | |
void | drawFilledPolygon (ossimIpt *p, int n) |
This will draw a polygon and fill it with the specified color. More... | |
void | drawArc (double cx, double cy, double w, double h, double s, double e) |
will draw an arc. More... | |
void | drawArc (int cx, int cy, int w, int h, int s, int e) |
will draw an arc. More... | |
void | drawFilledEllipse (int cx, int cy, int sminor, int smajor, double rot) |
Draws a filled ellipse. More... | |
void | drawEllipse (int cx, int cy, int sminor, int smajor, double rot, bool drawAxes=false) |
Draws an ellipse. More... | |
void | drawFilledArc (double cx, double cy, double w, double h, double s, double e) |
This will draw a filled arc. More... | |
void | drawFilledArc (int cx, int cy, int w, int h, int s, int e) |
This will draw a filled arc. More... | |
void | drawPolygon (const std::vector< ossimDpt > &p) |
void | drawPolygon (const std::vector< ossimIpt > &p) |
void | drawPolygon (ossimDpt *p, int n) |
Draws a polygon. More... | |
void | drawPolygon (ossimIpt *p, int n) |
Draws a polygon. More... | |
void | drawLine (double x1, double y1, double x2, double y2) |
About all the draw routines will call draw line. More... | |
void | drawLine (int x1, int y1, int x2, int y2) |
About all the draw routines will call draw line. More... | |
void | drawLine (const ossimIpt &start, const ossimIpt &end) |
About all the draw routines will call draw line. More... | |
void | drawLine (const ossimDpt &start, const ossimDpt &end) |
About all the draw routines will call draw line. More... | |
void | drawRectangle (double x1, double y1, double x2, double y2) |
Will draw a rectangle. More... | |
void | drawRectangle (int x1, int y1, int x2, int y2) |
Will draw a rectangle. More... | |
void | drawFilledRectangle (double x1, double y1, double x2, double y2) |
Will draw a filled rectangle with the current draw color. More... | |
void | drawFilledRectangle (int x1, int y1, int x2, int y2) |
Will draw a filled rectangle with the current draw color. More... | |
void | fill () |
Will fill the entire data object with the specified color set in setDrawColor. More... | |
void | setDrawColor (ossim_uint8 r=255, ossim_uint8 g=255, ossim_uint8 b=255) |
void | getDrawColor (ossim_uint8 &rCurr, ossim_uint8 &gCurr, ossim_uint8 &bCurr) |
const ossimRefPtr< ossimImageData > | getImageData () const |
Will take the point passed in and translate to a 0,0. More... | |
![]() | |
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 | ~ossimRgbImage () |
![]() | |
virtual | ~ossimReferenced () |
Protected Attributes | |
ossimRefPtr< ossimImageData > | theImageData |
This object operates on the ossimImageData. More... | |
ossim_int32 * | theOffsets |
This will hold precomputed offsets to the start of each row. More... | |
ossim_uint8 * | theBands [3] |
This is a fast access to the start of each band. More... | |
ossim_int32 | theWidth |
This is here so we don't have to call theWidth and theHeight of the ossimImageData. More... | |
ossim_int32 | theHeight |
This is here so we don't have to call theWidth and theHeight of the ossimImageData. More... | |
ossim_int32 | theThickness |
Holds the draw thickness. More... | |
ossim_uint8 | theRed |
The red component of the color used in drawing the shapes. More... | |
ossim_uint8 | theGreen |
The green component of the color used in drawing the shapes. More... | |
ossim_uint8 | theBlue |
The blue component of the color used in drawing the shapes. More... | |
Definition at line 18 of file ossimRgbImage.h.
ossimRgbImage::ossimRgbImage | ( | ) |
Definition at line 799 of file ossimRgbImage.cpp.
ossimRgbImage::ossimRgbImage | ( | ossimRefPtr< ossimImageData > & | currentImageData | ) |
currentImageData | The tile to annotate or draw to. |
Definition at line 810 of file ossimRgbImage.cpp.
References setCurrentImageData().
|
protectedvirtual |
Definition at line 823 of file ossimRgbImage.cpp.
References theOffsets.
|
virtual |
Will construct a new single band image data object.
Definition at line 837 of file ossimRgbImage.cpp.
References ossimImageData::initialize(), OSSIM_UCHAR, setCurrentImageData(), and theImageData.
|
virtual |
Will construct a new 3 band rgb data object.
Definition at line 850 of file ossimRgbImage.cpp.
References ossimImageData::initialize(), OSSIM_UCHAR, and theImageData.
void ossimRgbImage::drawArc | ( | double | cx, |
double | cy, | ||
double | w, | ||
double | h, | ||
double | s, | ||
double | e | ||
) |
will draw an arc.
The cx and cy specifies the center point in image space. The parameters w, h are the width and height of the arc. The s and e are the starting and ending angles. So if I want to draw a complete circle at point 45, 45 with width 10 and height 23 then we set the angles s =0 and e = 360: drawArc(45, 45, 10, 23, 0, 360).
Referenced by ossimAnnotationMultiEllipseObject::draw().
void ossimRgbImage::drawArc | ( | int | cx, |
int | cy, | ||
int | w, | ||
int | h, | ||
int | s, | ||
int | e | ||
) |
will draw an arc.
The cx and cy specifies the center point in image space. The parameters w, h are the width and height of the arc. The s and e are the starting and ending angles. So if I want to draw a complete circle at point 45, 45 with width 10 and height 23 then we set the angles s =0 and e = 360: drawArc(45, 45, 10, 23, 0, 360).
Definition at line 1103 of file ossimRgbImage.cpp.
References theImageData, x, and y.
void ossimRgbImage::drawEllipse | ( | int | cx, |
int | cy, | ||
int | sminor, | ||
int | smajor, | ||
double | rot, | ||
bool | drawAxes = false |
||
) |
Draws an ellipse.
Rot is the major axis rotation from up. rot (rotation is in radians).
Definition at line 1188 of file ossimRgbImage.cpp.
References theImageData, TWO_PI, and x.
Referenced by ossimAnnotationEllipseObject::draw().
void ossimRgbImage::drawFilledArc | ( | double | cx, |
double | cy, | ||
double | w, | ||
double | h, | ||
double | s, | ||
double | e | ||
) |
This will draw a filled arc.
See drawArc for documentation of parameters.
Definition at line 1034 of file ossimRgbImage.cpp.
Referenced by ossimAnnotationMultiEllipseObject::draw().
void ossimRgbImage::drawFilledArc | ( | int | cx, |
int | cy, | ||
int | w, | ||
int | h, | ||
int | s, | ||
int | e | ||
) |
This will draw a filled arc.
See drawArc for documentation of parameters.
Definition at line 1055 of file ossimRgbImage.cpp.
References theImageData, x, and y.
void ossimRgbImage::drawFilledEllipse | ( | int | cx, |
int | cy, | ||
int | sminor, | ||
int | smajor, | ||
double | rot | ||
) |
Draws a filled ellipse.
Rot is the major axis rotation from up. rot (rotaition) is in radians.
Definition at line 1143 of file ossimRgbImage.cpp.
References theImageData, and x.
Referenced by ossimAnnotationEllipseObject::draw().
void ossimRgbImage::drawFilledPolygon | ( | const std::vector< ossimDpt > & | p | ) |
We will cut and paste the code from drawFilledPolygon(ossimIpt *p, int n).
Definition at line 1586 of file ossimRgbImage.cpp.
References drawLine(), gdCompareInt(), n, theImageData, x, and y.
Referenced by ossimAnnotationMultiPolyObject::draw(), and ossimAnnotationPolyObject::draw().
void ossimRgbImage::drawFilledPolygon | ( | const std::vector< ossimIpt > & | p | ) |
We will cut and paste the code from drawFilledPolygon(ossimIpt *p, int n).
Definition at line 1496 of file ossimRgbImage.cpp.
References drawLine(), gdCompareInt(), n, theImageData, and y.
void ossimRgbImage::drawFilledPolygon | ( | ossimDpt * | p, |
int | n | ||
) |
This will draw a polygon and fill it with the specified color.
Definition at line 1396 of file ossimRgbImage.cpp.
References drawLine(), gdCompareInt(), n, theImageData, ossimDpt::x, x, and y.
void ossimRgbImage::drawFilledPolygon | ( | ossimIpt * | p, |
int | n | ||
) |
This will draw a polygon and fill it with the specified color.
Definition at line 1297 of file ossimRgbImage.cpp.
References drawLine(), gdCompareInt(), max, min, n, theImageData, ossimIpt::x, x, ossimIpt::y, and y.
void ossimRgbImage::drawFilledRectangle | ( | double | x1, |
double | y1, | ||
double | x2, | ||
double | y2 | ||
) |
Will draw a filled rectangle with the current draw color.
Use setDrawColor to set it.
Definition at line 1995 of file ossimRgbImage.cpp.
void ossimRgbImage::drawFilledRectangle | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2 | ||
) |
Will draw a filled rectangle with the current draw color.
Use setDrawColor to set it.
Definition at line 2010 of file ossimRgbImage.cpp.
References slowPlotPixel(), theBlue, theGreen, theRed, x, and y.
void ossimRgbImage::drawLine | ( | double | x1, |
double | y1, | ||
double | x2, | ||
double | y2 | ||
) |
About all the draw routines will call draw line.
it takes a start and an end point and a color value. theColor used is set by the setDrawColor.
Definition at line 1710 of file ossimRgbImage.cpp.
Referenced by ossimAnnotationMultiPolyLineObject::draw(), ossimAnnotationMultiPolyObject::draw(), ossimAnnotationPolyObject::draw(), ossimAnnotationLineObject::draw(), ossimAnnotationMultiLineObject::draw(), drawFilledPolygon(), drawLine(), drawPolygon(), and drawRectangle().
void ossimRgbImage::drawLine | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2 | ||
) |
About all the draw routines will call draw line.
it takes a start and an end point and a color value. theColor used is set by the setDrawColor.
Definition at line 1725 of file ossimRgbImage.cpp.
References abs, ossimImageData::getOrigin(), slowPlotPixel(), theBlue, theGreen, theImageData, theRed, theThickness, ossimIpt::x, x, ossimIpt::y, and y.
About all the draw routines will call draw line.
it takes a start and an end point and a color value. theColor used is set by the setDrawColor.
Definition at line 1685 of file ossimRgbImage.cpp.
References drawLine(), ossimIpt::x, and ossimIpt::y.
About all the draw routines will call draw line.
it takes a start and an end point and a color value. theColor used is set by the setDrawColor.
Definition at line 1695 of file ossimRgbImage.cpp.
References drawLine(), ossimDpt::x, and ossimDpt::y.
void ossimRgbImage::drawPolygon | ( | const std::vector< ossimDpt > & | p | ) |
Definition at line 1002 of file ossimRgbImage.cpp.
References drawLine(), n, theImageData, x, and y.
void ossimRgbImage::drawPolygon | ( | const std::vector< ossimIpt > & | p | ) |
Definition at line 975 of file ossimRgbImage.cpp.
References drawLine(), n, theImageData, x, and y.
void ossimRgbImage::drawPolygon | ( | ossimDpt * | p, |
int | n | ||
) |
Draws a polygon.
The first argument is an array of points. The second argument is the number of points and the rest are the rgb color values. theColor used is set by the setDrawColor.
Definition at line 948 of file ossimRgbImage.cpp.
References drawLine(), n, theImageData, ossimDpt::x, x, ossimDpt::y, and y.
void ossimRgbImage::drawPolygon | ( | ossimIpt * | p, |
int | n | ||
) |
Draws a polygon.
The first argument is an array of points. The second argument is the number of points and the rest are the rgb color values. theColor used is set by the setDrawColor.
Definition at line 921 of file ossimRgbImage.cpp.
References drawLine(), n, theImageData, ossimIpt::x, x, ossimIpt::y, and y.
void ossimRgbImage::drawRectangle | ( | double | x1, |
double | y1, | ||
double | x2, | ||
double | y2 | ||
) |
Will draw a rectangle.
The color used is set by setDrawColor.
Definition at line 1931 of file ossimRgbImage.cpp.
void ossimRgbImage::drawRectangle | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2 | ||
) |
Will draw a rectangle.
The color used is set by setDrawColor.
Definition at line 1946 of file ossimRgbImage.cpp.
References drawLine(), and theThickness.
|
inline |
same thing as slowPlotPixel but without the inside outside compare
Definition at line 395 of file ossimRgbImage.h.
References theBands, theOffsets, x, and y.
Referenced by fill().
void ossimRgbImage::fill | ( | ) |
Will fill the entire data object with the specified color set in setDrawColor.
Definition at line 2034 of file ossimRgbImage.cpp.
References fastPlotPixel(), theBlue, theGreen, theHeight, theImageData, theRed, and theWidth.
void ossimRgbImage::getDrawColor | ( | ossim_uint8 & | rCurr, |
ossim_uint8 & | gCurr, | ||
ossim_uint8 & | bCurr | ||
) |
Definition at line 2062 of file ossimRgbImage.cpp.
References theBlue, theGreen, and theRed.
ossimRefPtr< ossimImageData > ossimRgbImage::getImageData | ( | ) |
Will return the image data.
Definition at line 915 of file ossimRgbImage.cpp.
References theImageData.
Referenced by ossimGeographicAnnotationGrid::draw(), ossimAnnotationEllipseObject::draw(), ossimAnnotationMultiPolyLineObject::draw(), ossimGeoAnnotationBitmap::draw(), ossimAnnotationMultiPolyObject::draw(), ossimAnnotationPolyObject::draw(), ossimAnnotationMultiEllipseObject::draw(), ossimAnnotationGdBitmapFont::draw(), ossimAnnotationLineObject::draw(), ossimAnnotationFontObject::draw(), ossimAnnotationMultiLineObject::draw(), ossimVpfAnnotationSource::drawAnnotations(), ossimAnnotationSource::drawAnnotations(), and ossimMapCompositionSource::drawAnnotations().
const ossimRefPtr< ossimImageData > ossimRgbImage::getImageData | ( | ) | const |
Will take the point passed in and translate to a 0,0.
Example: Let's say that we have origin 45,34 for the image's upper left corner. then a call to this method will translate the point passed in x-45, y-34 Will take the point passed in and translate to a 0,0. Example: Let's say that we have origin 45,34 for the image's upper left corner. then a call to this method will translate the point passed in x-45, y-34
Definition at line 832 of file ossimRgbImage.cpp.
References theImageData.
ossim_int32 ossimRgbImage::getThickness | ( | ) | const |
Definition at line 2076 of file ossimRgbImage.cpp.
References theThickness.
|
virtual |
Will initilize any pre-computations that are needed.
Example: setting up the origin for adjustments and setting up the offsets.
Definition at line 860 of file ossimRgbImage.cpp.
References ossimImageData::getBuf(), ossimImageData::getHeight(), ossimImageData::getNumberOfBands(), ossimImageData::getWidth(), theBands, theHeight, theImageData, theOffsets, and theWidth.
Referenced by setCurrentImageData().
void ossimRgbImage::setCurrentImageData | ( | ossimRefPtr< ossimImageData > & | imageData | ) |
Allows you to change the image data that this RgbImage object operates on.
You can specify if the image owns the data or not. if it doesn't own the data then it will not destroy it when the data is changed to a different data object or if this object is deleted.
imageData | The tile to annotate or draw to. |
Definition at line 902 of file ossimRgbImage.cpp.
References ossimDataObject::getDataObjectStatus(), ossimRectilinearDataObject::getScalarType(), initialize(), OSSIM_NULL, OSSIM_UCHAR, theImageData, and ossimRefPtr< T >::valid().
Referenced by createNewGrey(), ossimVpfAnnotationSource::drawAnnotations(), ossimGdalOgrVectorAnnotation::drawAnnotations(), ossimEsriShapeFileFilter::drawAnnotations(), ossimAnnotationSource::drawAnnotations(), ossimMapCompositionSource::drawAnnotations(), and ossimRgbImage().
void ossimRgbImage::setDrawColor | ( | ossim_uint8 | r = 255 , |
ossim_uint8 | g = 255 , |
||
ossim_uint8 | b = 255 |
||
) |
Definition at line 2053 of file ossimRgbImage.cpp.
References theBlue, theGreen, and theRed.
Referenced by ossimGeographicAnnotationGrid::draw(), ossimAnnotationEllipseObject::draw(), ossimAnnotationMultiPolyLineObject::draw(), ossimAnnotationPolyObject::draw(), ossimAnnotationMultiEllipseObject::draw(), ossimAnnotationMultiPolyObject::draw(), ossimAnnotationGdBitmapFont::draw(), ossimAnnotationLineObject::draw(), and ossimAnnotationMultiLineObject::draw().
void ossimRgbImage::setThickness | ( | ossim_int32 | thickness | ) |
All the drawing algorithms have thickness.
So you can draw a line that has thickness of 3 pixels if you want. Note: the thickness is in pixels
Definition at line 2071 of file ossimRgbImage.cpp.
References theThickness.
Referenced by ossimAnnotationEllipseObject::draw(), ossimAnnotationMultiPolyLineObject::draw(), ossimAnnotationMultiPolyObject::draw(), ossimAnnotationPolyObject::draw(), ossimAnnotationMultiEllipseObject::draw(), ossimAnnotationLineObject::draw(), and ossimAnnotationMultiLineObject::draw().
|
inline |
This will plot a pixel and will do inside outside compares.
This assumes the pixel has already been put into a relative 0,0 to the upper left corner of the image data.
example: if the upperleft corner or origin of the image was 34, 55 then it assumes that the points passed in are already relative to that corner not absolute.
Definition at line 380 of file ossimRgbImage.h.
References theBands, theHeight, theOffsets, theWidth, x, and y.
Referenced by ossimAnnotationGdBitmapFont::draw(), drawFilledRectangle(), and drawLine().
|
protected |
This is a fast access to the start of each band.
Definition at line 344 of file ossimRgbImage.h.
Referenced by fastPlotPixel(), initialize(), and slowPlotPixel().
|
protected |
The blue component of the color used in drawing the shapes.
Definition at line 377 of file ossimRgbImage.h.
Referenced by drawFilledRectangle(), drawLine(), fill(), getDrawColor(), and setDrawColor().
|
protected |
The green component of the color used in drawing the shapes.
Definition at line 372 of file ossimRgbImage.h.
Referenced by drawFilledRectangle(), drawLine(), fill(), getDrawColor(), and setDrawColor().
|
protected |
This is here so we don't have to call theWidth and theHeight of the ossimImageData.
Definition at line 356 of file ossimRgbImage.h.
Referenced by fill(), initialize(), and slowPlotPixel().
|
protected |
This object operates on the ossimImageData.
Note the ossimImageData is a band separate so the bands follow sequentially: all the reds followed by all the blues followed by all greens
Definition at line 331 of file ossimRgbImage.h.
Referenced by createNewGrey(), createNewTrueColor(), drawArc(), drawEllipse(), drawFilledArc(), drawFilledEllipse(), drawFilledPolygon(), drawLine(), drawPolygon(), fill(), getImageData(), initialize(), and setCurrentImageData().
|
protected |
This will hold precomputed offsets to the start of each row.
This will get rid of a multiplication per access. Since we will be accessing on a per pixel basis this will be needed.
Definition at line 339 of file ossimRgbImage.h.
Referenced by fastPlotPixel(), initialize(), slowPlotPixel(), and ~ossimRgbImage().
|
protected |
The red component of the color used in drawing the shapes.
Definition at line 367 of file ossimRgbImage.h.
Referenced by drawFilledRectangle(), drawLine(), fill(), getDrawColor(), and setDrawColor().
|
protected |
Holds the draw thickness.
Definition at line 361 of file ossimRgbImage.h.
Referenced by drawLine(), drawRectangle(), getThickness(), and setThickness().
|
protected |
This is here so we don't have to call theWidth and theHeight of the ossimImageData.
Definition at line 350 of file ossimRgbImage.h.
Referenced by fill(), initialize(), and slowPlotPixel().