71 static const int gdCosT[] =
435 static const int gdSinT[] =
904 if(imageData.
valid())
939 for (i = 1; (i <
n); i++)
966 for (i = 1; (i <
n); i++)
981 int n = (int)p.size();
994 for (i = 1; (i <
n); i++)
1008 int n = (int)p.size();
1021 for (i = 1; (i <
n); i++)
1031 return (*(
const int *) a) - (*(
const int *) b);
1077 for (i = s; (i <= e); i++)
1124 for (i = s; (i <= e); i++)
1156 int w2 = axisMinor/2;
1157 int h2 = axisMajor/2;
1160 float sinRot = sin(rot);
1161 float cosRot = cos(rot);
1163 for (
int i = 0; i <= 360; ++i)
1168 int rx = (
ossim_int32)((
float)
x*cosRot - (float)
y*sinRot + cx);
1169 int ry = (
ossim_int32)((
float)
y*cosRot + (float)
x*sinRot + cy);
1208 int w2 = axisMinor/2;
1209 int h2 = axisMajor/2;
1211 float sinRot = sin(rot);
1212 float cosRot = cos(rot);
1227 for (
int i = 0; i <= 360; i++)
1234 int rx = (
ossim_int32)((
float)
x*cosRot - (float)
y*sinRot + cx);
1235 int ry = (
ossim_int32)((
float)
y*cosRot + (float)
x*sinRot + cy);
1285 drawLine (xMin[0], yMin[0], xMin[1], yMin[1]);
1291 drawLine (xMaj[0], yMaj[0], xMaj[1], yMaj[1]);
1318 polyInts =
new int[
n];
1324 for (i = 1; (i <
n); i++)
1332 for (
y = miny; (
y <= maxy);
y++)
1335 for (i = 0; (i <
n); i++)
1365 if ((
y >= y1) && (
y < y2))
1367 polyInts[ints++] = (
y - y1) * (x2 - x1) / (y2 - y1) + x1;
1369 else if ((
y == maxy) && (
y > y1) && (
y <= y2))
1371 polyInts[ints++] = (
y - y1) * (x2 - x1) / (y2 - y1) + x1;
1378 for (i = 0; (i < (ints)); i += 2)
1381 polyInts[i + 1],
y);
1386 if((miny == maxy) && (minx==maxx))
1388 drawLine((
int)p[0].
x, (
int)p[0].
y, (
int)p[0].
x, (
int)p[0].
y);
1393 if (polyInts)
delete [] polyInts;
1416 polyInts =
new int[
n];
1420 miny = (int)(p[0].
y);
1421 maxy = (int)(p[0].
y);
1422 for (i = 1; (i <
n); i++)
1425 int testPy = (int)(p[i].
y);
1436 for (
y = miny; (
y <= maxy);
y++)
1439 for (i = 0; (i <
n); i++)
1453 y1 = (int)(p[ind1].
y);
1454 y2 = (int)(p[ind2].
y);
1457 x1 = ossim::round<int>(p[ind1].
x);
1458 x2 = ossim::round<int>(p[ind2].
x);
1466 y2 = (int)(p[ind1].
y);
1467 y1 = (int)(p[ind2].
y);
1468 x2 = (int)(p[ind1].
x);
1469 x1 = (int)(p[ind2].
x);
1475 if ((
y >= y1) && (
y < y2))
1477 polyInts[ints++] = (
y - y1) * (x2 - x1) / (y2 - y1) + x1;
1479 else if ((
y == maxy) && (
y > y1) && (
y <= y2))
1481 polyInts[ints++] = (
y - y1) * (x2 - x1) / (y2 - y1) + x1;
1486 for (i = 0; (i < (ints)); i += 2)
1489 polyInts[i + 1],
y);
1493 if (polyInts)
delete [] polyInts;
1502 int n = (int)p.size();
1516 polyInts =
new int[
n];
1520 for (i = 1; (i <
n); i++)
1532 for (
y = miny; (
y <= maxy);
y++)
1535 for (i = 0; (i <
n); i++)
1565 if ((
y >= y1) && (
y < y2))
1567 polyInts[ints++] = (
y - y1) * (x2 - x1) / (y2 - y1) + x1;
1569 else if ((
y == maxy) && (
y > y1) && (
y <= y2))
1571 polyInts[ints++] = (
y - y1) * (x2 - x1) / (y2 - y1) + x1;
1576 for (i = 0; (i < (ints)); i += 2)
1579 polyInts[i + 1],
y);
1583 if (polyInts)
delete [] polyInts;
1592 int n = (int)p.size();
1606 polyInts =
new int[
n];
1610 for (i = 1; (i <
n); i++)
1612 int testPy = (int)p[i].
y;
1623 for (
y = miny; (
y <= maxy);
y++)
1626 for (i = 0; (i <
n); i++)
1640 y1 = (int)(p[ind1].
y);
1641 y2 = (int)(p[ind2].
y);
1646 x1 = (int)(p[ind1].
x);
1647 x2 = (int)(p[ind2].
x);
1655 y2 = (int)(p[ind1].
y);
1656 y1 = (int)(p[ind2].
y);
1657 x2 = (int)(p[ind1].
x);
1658 x1 = (int)(p[ind2].
x);
1664 if ((
y >= y1) && (
y < y2))
1666 polyInts[ints++] = (
y - y1) * (x2 - x1) / (y2 - y1) + x1;
1668 else if ((
y == maxy) && (
y > y1) && (
y <= y2))
1670 polyInts[ints++] = (
y - y1) * (x2 - x1) / (y2 - y1) + x1;
1675 for (i = 0; (i < (ints)); i += 2)
1678 polyInts[i + 1],
y);
1682 if (polyInts)
delete [] polyInts;
1756 int dx, dy, incr1, incr2, d,
x,
y, xend, yend, xdirflag, ydirflag;
1767 if ((dx == 0) && (dy == 0))
1775 double ac = cos (atan2 ((
double)dy, (
double)dx));
1778 wid = ossim::round<int>(thick / ac);
1791 incr2 = 2 * (dy - dx);
1808 wstart =
y - wid / 2;
1809 for (w = wstart; w < wstart + wid; w++)
1812 if (((y2 - y1) * ydirflag) > 0)
1826 wstart =
y - wid / 2;
1827 for (w = wstart; w < wstart + wid; w++)
1845 wstart =
y - wid / 2;
1846 for (w = wstart; w < wstart + wid; w++)
1856 double as = sin (atan2 ((
double)dy, (
double)dx));
1859 wid = ossim::round<int>(thick / as);
1870 incr2 = 2 * (dx - dy);
1887 wstart =
x - wid / 2;
1888 for (w = wstart; w < wstart + wid; w++)
1891 if (((x2 - x1) * xdirflag) > 0)
1905 wstart =
x - wid / 2;
1906 for (w = wstart; w < wstart + wid; w++)
1924 wstart =
x - wid / 2;
1925 for (w = wstart; w < wstart + wid; w++)
1973 int half = thick / 2;
1974 int half1 = thick - half;
1979 y2v = y2h + half1 - 1;
1983 y1v = y1h + half1 - 1;
2025 for (
y = y1; (
y <= y2);
y++)
2027 for (
x = x1; (
x <= x2);
x++)
virtual ossim_uint32 getWidth() const
ossim_int32 getThickness() const
ossim_uint8 theGreen
The green component of the color used in drawing the shapes.
void drawPolygon(const std::vector< ossimDpt > &p)
virtual ossim_uint32 getNumberOfBands() const
void fill()
Will fill the entire data object with the specified color set in setDrawColor.
ossimReferenced allows for shared object ref counting if the reference count ever gets to 0 or less i...
virtual void createNewGrey(ossim_int32 width, ossim_int32 height)
Will construct a new single band image data object.
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
void setThickness(ossim_int32 thickness)
All the drawing algorithms have thickness.
void drawRectangle(double x1, double y1, double x2, double y2)
Will draw a rectangle.
ossim_int32 theThickness
Holds the draw thickness.
void drawEllipse(int cx, int cy, int sminor, int smajor, double rot, bool drawAxes=false)
Draws an ellipse.
virtual void initialize()
Initialize the data buffer.
ossim_int32 theWidth
This is here so we don't have to call theWidth and theHeight of the ossimImageData.
ossim_int32 theHeight
This is here so we don't have to call theWidth and theHeight of the ossimImageData.
ossimRefPtr< ossimImageData > getImageData()
Will return the image data.
ossimRefPtr< ossimImageData > theImageData
This object operates on the ossimImageData.
virtual void createNewTrueColor(ossim_int32 width, ossim_int32 height)
Will construct a new 3 band rgb data object.
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.
os2<< "> n<< " > nendobj n
void drawArc(double cx, double cy, double w, double h, double s, double e)
will draw an arc.
ossim_uint8 * theBands[3]
This is a fast access to the start of each band.
void drawLine(double x1, double y1, double x2, double y2)
About all the draw routines will call draw line.
ossim_uint8 theRed
The red component of the color used in drawing the shapes.
virtual ossimScalarType getScalarType() const
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)
void drawFilledPolygon(const std::vector< ossimDpt > &p)
We will cut and paste the code from drawFilledPolygon(ossimIpt *p, int n).
int gdCompareInt(const void *a, const void *b)
virtual const void * getBuf() const
ossim_uint8 theBlue
The blue component of the color used in drawing the shapes.
void drawFilledEllipse(int cx, int cy, int sminor, int smajor, double rot)
Draws a filled ellipse.
ossim_int32 * theOffsets
This will hold precomputed offsets to the start of each row.
void drawFilledRectangle(double x1, double y1, double x2, double y2)
Will draw a filled rectangle with the current draw color.
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
void setCurrentImageData(ossimRefPtr< ossimImageData > &imageData)
Allows you to change the image data that this RgbImage object operates on.
void drawFilledArc(double cx, double cy, double w, double h, double s, double e)
This will draw a filled arc.
virtual void initialize()
Will initilize any pre-computations that are needed.
virtual const ossimIpt & getOrigin() const
unsigned char ossim_uint8