|
QGIS API Documentation 4.3.0-Master (0de80482b60)
|
Creates a flat index over a QgsRasterBlock, sorted by cell values. More...
#include <qgssortedrasterblockindex.h>
Public Member Functions | |
| QgsSortedRasterBlockIndex (const QgsRasterBlock *block) | |
| Constructor for QgsSortedRasterBlockIndex, indexing the specified raster block. | |
| const QgsRasterBlock * | block () const |
| Returns a pointer to source QgsRasterBlock. | |
| void | sortedColumnRow (qgssize rank, int &column, int &row, Qt::SortOrder order=Qt::AscendingOrder) const |
| Retrieves the source raster block column and row corresponding to the specified sorted rank. | |
| qgssize | sortedCount () const |
| Returns the number of valid (non-NoData) sorted cells. | |
| qgssize | sortedIndex (qgssize rank, Qt::SortOrder order=Qt::AscendingOrder) const |
| Returns the source raster block index corresponding to the specified sorted rank. | |
| double | sortedValue (qgssize rank, Qt::SortOrder order=Qt::AscendingOrder) const |
| Returns the raster block value corresponding to the specified sorted rank. | |
Creates a flat index over a QgsRasterBlock, sorted by cell values.
This index allows for efficient retrieval of raster block cells by their sorted order. The index is sorted once during initialization, and cell values or coordinates can be requested in either ascending or descending order on demand.
Definition at line 45 of file qgssortedrasterblockindex.h.
| QgsSortedRasterBlockIndex::QgsSortedRasterBlockIndex | ( | const QgsRasterBlock * | block | ) |
Constructor for QgsSortedRasterBlockIndex, indexing the specified raster block.
Definition at line 113 of file qgssortedrasterblockindex.cpp.
|
inline |
Returns a pointer to source QgsRasterBlock.
Definition at line 63 of file qgssortedrasterblockindex.h.
| void QgsSortedRasterBlockIndex::sortedColumnRow | ( | qgssize | rank, |
| int & | column, | ||
| int & | row, | ||
| Qt::SortOrder | order = Qt::AscendingOrder ) const |
Retrieves the source raster block column and row corresponding to the specified sorted rank.
| rank | Sorted position (0 to sortedCount() - 1). E.g. 0 for the lowest value, when using an ascending order. |
| column | Output column |
| row | Output row |
| order | Sort order to query |
Definition at line 153 of file qgssortedrasterblockindex.cpp.
| qgssize QgsSortedRasterBlockIndex::sortedCount | ( | ) | const |
Returns the number of valid (non-NoData) sorted cells.
Definition at line 132 of file qgssortedrasterblockindex.cpp.
| qgssize QgsSortedRasterBlockIndex::sortedIndex | ( | qgssize | rank, |
| Qt::SortOrder | order = Qt::AscendingOrder ) const |
Returns the source raster block index corresponding to the specified sorted rank.
| rank | Sorted position (0 to sortedCount() - 1). E.g. 0 for the lowest value, when using an ascending order. |
| order | Sort order to query |
Definition at line 137 of file qgssortedrasterblockindex.cpp.
| double QgsSortedRasterBlockIndex::sortedValue | ( | qgssize | rank, |
| Qt::SortOrder | order = Qt::AscendingOrder ) const |
Returns the raster block value corresponding to the specified sorted rank.
| rank | Sorted position (0 to sortedCount() - 1). E.g. 0 for the lowest value, when using an ascending order. |
| order | Sort order to query |
Definition at line 148 of file qgssortedrasterblockindex.cpp.