QGIS API Documentation
4.3.0-Master (52aa6503bed)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
raster
qgssortedrasterblockindex.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgssortedrasterblockindex.h
3
--------------------------------------
4
Date : September 2026
5
Copyright : (C) 2026 by Nyall Dawson
6
email : nyall.dawson@gmail.com
7
***************************************************************************/
8
9
/***************************************************************************
10
* *
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
* *
16
***************************************************************************/
17
18
#ifndef QGSSORTEDRASTERBLOCKINDEX_H
19
#define QGSSORTEDRASTERBLOCKINDEX_H
20
21
#include <variant>
22
23
#include "
qgis.h
"
24
#include "qgis_core.h"
25
#include "
qgis_sip.h
"
26
27
class
QgsRasterBlock
;
28
45
class
CORE_EXPORT
QgsSortedRasterBlockIndex
46
{
47
public
:
53
QgsSortedRasterBlockIndex
(
const
QgsRasterBlock
*
block
);
54
58
qgssize
sortedCount
()
const
;
59
63
const
QgsRasterBlock
*
block
()
const
{
return
mBlock; }
64
71
qgssize
sortedIndex(
qgssize
rank, Qt::SortOrder order = Qt::AscendingOrder )
const
;
72
81
void
sortedColumnRow(
qgssize
rank,
int
&column
SIP_OUT
,
int
&row
SIP_OUT
, Qt::SortOrder order = Qt::AscendingOrder )
const
;
82
89
double
sortedValue(
qgssize
rank, Qt::SortOrder order = Qt::AscendingOrder )
const
;
90
91
private
:
92
const
QgsRasterBlock
*mBlock =
nullptr
;
93
94
int
mCols = 0;
95
int
mRows = 0;
96
97
std::variant<std::vector<uint32_t>, std::vector<qgssize>> mSortedIndices;
98
99
inline
void
indexToColumnAndRow(
qgssize
index,
int
&column,
int
&row )
const
100
{
101
column =
static_cast<
int
>
( index % mCols );
102
row =
static_cast<
int
>
( index / mCols );
103
}
104
};
105
106
#endif
// QGSSORTEDRASTERBLOCKINDEX_H
QgsRasterBlock
Raster data container.
Definition
qgsrasterblock.h:42
QgsSortedRasterBlockIndex::block
const QgsRasterBlock * block() const
Returns a pointer to source QgsRasterBlock.
Definition
qgssortedrasterblockindex.h:63
QgsSortedRasterBlockIndex::sortedCount
qgssize sortedCount() const
Returns the number of valid (non-NoData) sorted cells.
Definition
qgssortedrasterblockindex.cpp:132
QgsSortedRasterBlockIndex::QgsSortedRasterBlockIndex
QgsSortedRasterBlockIndex(const QgsRasterBlock *block)
Constructor for QgsSortedRasterBlockIndex, indexing the specified raster block.
Definition
qgssortedrasterblockindex.cpp:113
qgis.h
qgssize
unsigned long long qgssize
Qgssize is used instead of size_t, because size_t is stdlib type, unknown by SIP, and it would be har...
Definition
qgis.h:8388
qgis_sip.h
SIP_OUT
#define SIP_OUT
Definition
qgis_sip.h:57
Generated on
for QGIS API Documentation by
1.17.0