Jafar
|
RasterRect class. More...
RasterRect class.
This object is used to deal with clusters of pixels. Its coordinates are pointed by the top left corner of its TOP-LEFT pixel and by the coordinates of the top-left corner of the BOTTOM-RIGHT pixel.
To correspond to GDAL Raster system the coordinates frame is the following : +----------- (+ x) ------> | | | | (+y) | | V
Definition at line 90 of file Raster.hpp.
#include <Raster.hpp>
Public Member Functions | |
RasterRect (int _xroot, int _yroot, int _xsize, int _ysize) | |
bool | isValid () const |
Valid rectangles return true if the bottom right corner is really at the bottom right or on the top left corner or at least the same. | |
int & | rLeft () |
int & | rTop () |
int & | rRight () |
int & | rBottom () |
int | xroot () const |
Get the X coordinate of the top left corner of the top left pixel/cell of the current rectangle. | |
int | yroot () const |
Get the Y coordinate of the top left corner of the top left pixel/cell of the current rectangle. | |
int | xend () const |
Get the X coordinate of the top left corner of the bottom right pixel/cell of the current rectangle. | |
int | yend () const |
Get the Y coordinate of the top left corner of the bottom right pixel/cell of the current rectangle. | |
void | setXTopLeft (int pos) |
void | setYTopLeft (int pos) |
void | setXBottomRight (int pos) |
void | setYBottomRight (int pos) |
void | setX (int x) |
void | setY (int y) |
RasterPoint | topLeft () const |
RasterPoint | bottomRight () const |
RasterPoint | topRight () const |
RasterPoint | bottomLeft () const |
RasterPoint | center () const |
The center is calculated in integer values. | |
void | rect (int &_xtopleft, int &_ytopleft, int &_xsize, int &_ysize) const |
void | coords (int &xtopleft, int &ytopleft, int &xbottomright, int &ybottomright) const |
void | setRect (int x, int y, int w, int h) |
void | setCoords (int xtopleft, int ytopleft, int xbottomright, int ybottomright) |
int | size () const |
Returns the total number of pixels inside the rectangle. | |
int | xsize () const |
Returns xsize. | |
int | ysize () const |
Returns ysize. | |
RasterRect & | operator= (const RasterRect &rect) |
bool | contains (const RasterCellIndex &cell, bool inside=true) const |
This function tells (true) if the given cell index is part of the current raster rectangle (R.O.I.) Raster cells indexes are given as the top left coordinates of a cell. | |
bool | contains (const RasterRect &r, bool inside=true) const |
This function tells (true) if the given RasterRect is part of the current raster rectangle (R.O.I.) | |
bool | intersects (const RasterRect &r, RasterRect &result) const |
Test RasterRect intersection and creates resulting intersection. | |
Public Attributes | |
int | xtopleft |
Top left corner X coordinate in raster cell number. | |
int | ytopleft |
Top left corner Y coordinate in raster cell number. | |
int | xbottomright |
Bottom right corner X coordinate in raster cell number. | |
int | ybottomright |
Bottom right corner Y coordinate in raster cell number. | |
int | xpsize |
Size in pixel units on X axis. | |
int | ypsize |
Size in pixel units on Y axis. | |
Friends | |
bool | operator== (const RasterRect &, const RasterRect &) |
bool | operator!= (const RasterRect &, const RasterRect &) |
std::ostream & | operator<< (std::ostream &, const RasterRect &) |
bool jafar::lgl::RasterRect::contains | ( | const RasterCellIndex & | cell, |
bool | inside = true |
||
) | const |
This function tells (true) if the given cell index is part of the current raster rectangle (R.O.I.) Raster cells indexes are given as the top left coordinates of a cell.
So fully contained cells cannot have coordinates equal to right and bottom sides of the container.
cell | RasterCellIndex to be checked if contained by the current rectangle |
inside | if true only fully contained cells are considered else cells origin contained in the rectangle and its borders are considered |
Referenced by jafar::lgl::QuadNode< T, RasterT >::contains().
bool jafar::lgl::RasterRect::contains | ( | const RasterRect & | r, |
bool | inside = true |
||
) | const |
This function tells (true) if the given RasterRect is part of the current raster rectangle (R.O.I.)
r | RasterRect to be checked if contained by the current rectangle |
inside | if true only fully contained rects are considered else rects origin contained in the rectangle and its borders are considered |
bool jafar::lgl::RasterRect::isValid | ( | ) | const |
Valid rectangles return true if the bottom right corner is really at the bottom right or on the top left corner or at least the same.
int jafar::lgl::RasterRect::xend | ( | ) | const |
Get the X coordinate of the top left corner of the bottom right pixel/cell of the current rectangle.
One should use (xend() + 1) to get the coordinate of the bottom right corner of the full rectangle
Referenced by jafar::lgl::Quadtree< T, RasterT >::setNewLeaf().
int jafar::lgl::RasterRect::xsize | ( | ) | const [inline] |
Returns xsize.
Definition at line 154 of file Raster.hpp.
References xpsize.
Referenced by jafar::lgl::QuadNodeInternal< T, RasterT >::divide(), jafar::lgl::GDRasterBand< T >::getxsize_m(), jafar::lgl::GDRasterBand< T >::nearlySameValue(), jafar::lgl::Quadtree< T, RasterT >::Quadtree(), jafar::lgl::GDRasterBand< T >::sameValue(), and jafar::lgl::GDRasterBand< T >::sigmaSameValue().
int jafar::lgl::RasterRect::yend | ( | ) | const |
Get the Y coordinate of the top left corner of the bottom right pixel/cell of the current rectangle.
One should use (yend() + 1) to get the coordinate of the bottom right corner of the full rectangle
Referenced by jafar::lgl::Quadtree< T, RasterT >::setNewLeaf().
int jafar::lgl::RasterRect::ysize | ( | ) | const [inline] |
Returns ysize.
Definition at line 159 of file Raster.hpp.
References ypsize.
Referenced by jafar::lgl::QuadNodeInternal< T, RasterT >::divide(), jafar::lgl::GDRasterBand< T >::getysize_m(), jafar::lgl::GDRasterBand< T >::nearlySameValue(), jafar::lgl::Quadtree< T, RasterT >::Quadtree(), jafar::lgl::GDRasterBand< T >::sameValue(), and jafar::lgl::GDRasterBand< T >::sigmaSameValue().
Generated on Wed Oct 15 2014 00:37:42 for Jafar by doxygen 1.7.6.1 |