A singleton for keeping raster summaries (most statistics). It stores an internal map of raster conn info str and their respective summaries. More...
#include <RasterSummaryManager.h>
Classes | |
class | SumManKey |
Summary manager key. More... | |
Public Member Functions | |
void | enableDeletedRastersCache (const bool enabled) |
Enable/disable the cache of deleted rasters. | |
bool | find (const Raster *raster, const unsigned int bandIndex, const unsigned int rowStart, const unsigned int colStart, const unsigned int finalRow, const unsigned int finalCol, const unsigned int histoBins, const unsigned int sampleStep, BandSummary &summary) const |
Searches for a band summary. | |
bool | find (const Raster *raster, RasterSummary &summary) const |
Searches for a raster summary. | |
bool | get (const Raster *raster, bool readall, RasterSummary &summary) |
It searches for a raster summary. If not found it creates the summary and returns it. | |
bool | get (const Raster *raster, const unsigned int bandIndex, bool readall, BandSummary &summary) |
Searches for a band summary and creates it if it does not exist. | |
bool | get (const Raster *raster, const unsigned int bandIndex, const unsigned int rowStart, const unsigned int colStart, const unsigned int finalRow, const unsigned int finalCol, const unsigned int histoBins, const unsigned int sampleStep, bool readall, BandSummary &summary) |
Searches for a band summary and creates it if it does not exist. | |
bool | get (const Raster *raster, const unsigned int rowStart, const unsigned int colStart, const unsigned int finalRow, const unsigned int finalCol, const unsigned int histoBins, const unsigned int sampleStep, bool readall, RasterSummary &summary) |
It searches for a raster summary. If not found it creates the summary and returns it. | |
unsigned int | getDefaultRasterHistSize () |
Get the default rasters histograms bins. | |
void | remove (const Raster *raster) |
Removes all summary ocurrences related to the specified raster pointer. | |
void | remove (const Raster *raster, const unsigned int bandIndex, const unsigned int rowStart, const unsigned int colStart, const unsigned int finalRow, const unsigned int finalCol, const unsigned int histoBins, const unsigned int sampleStep) |
Removes the summary from the specified raster. | |
void | removeAll () |
Removes all raster summary entries. | |
void | setDefaultRasterHistSize (const unsigned int binsNumber) |
Set the default rasters histograms bins. | |
~RasterSummaryManager () | |
Destructor. | |
Static Public Member Functions | |
static RasterSummaryManager & | getInstance () |
It returns a reference to the singleton instance. | |
Protected Types | |
typedef std::list< SumManKey > | SummaryContT |
Protected Member Functions | |
RasterSummaryManager () | |
Private Attributes | |
unsigned int | m_defRastersHistBins |
bool | m_enableDeletedRastersCache |
SummaryContT | m_rasterSummaries |
A rasters band summaries. | |
std::mutex | m_syncMutex |
Internal mutex. | |
Friends | |
class | te::common::Singleton< RasterSummaryManager > |
A singleton for keeping raster summaries (most statistics). It stores an internal map of raster conn info str and their respective summaries.
Definition at line 58 of file RasterSummaryManager.h.
|
protected |
Definition at line 240 of file RasterSummaryManager.h.
te::rst::RasterSummaryManager::~RasterSummaryManager | ( | ) |
Destructor.
|
protected |
void te::rst::RasterSummaryManager::enableDeletedRastersCache | ( | const bool | enabled | ) |
Enable/disable the cache of deleted rasters.
enabled | Enable or disable this feature. |
bool te::rst::RasterSummaryManager::find | ( | const Raster * | raster, |
const unsigned int | bandIndex, | ||
const unsigned int | rowStart, | ||
const unsigned int | colStart, | ||
const unsigned int | finalRow, | ||
const unsigned int | finalCol, | ||
const unsigned int | histoBins, | ||
const unsigned int | sampleStep, | ||
BandSummary & | summary | ||
) | const |
Searches for a band summary.
raster | The raster to be found. |
rowStart | The starting row. |
colStart | The starting column. |
finalRow | The final row. |
finalCol | The final column. |
histoBins | The number of bins (intervals from minimum pixel to maximum). When b = 0, the histogram will be divided according to all pixel values. |
sampleStep | The row/column step used when reading pixels (to read all pixels sampleStep=1, to read half of pixels use sampleStep=2 ); |
summary | The found raster summary. |
bool te::rst::RasterSummaryManager::find | ( | const Raster * | raster, |
RasterSummary & | summary | ||
) | const |
Searches for a raster summary.
raster | The raster to be found. |
summary | The found raster summary. |
bool te::rst::RasterSummaryManager::get | ( | const Raster * | raster, |
bool | readall, | ||
RasterSummary & | summary | ||
) |
It searches for a raster summary. If not found it creates the summary and returns it.
raster | The raster to be found. |
readall | If false, the cache will be used or if true the entire image will be read again (can be slow). |
summary | The found raster summary. |
bool te::rst::RasterSummaryManager::get | ( | const Raster * | raster, |
const unsigned int | bandIndex, | ||
bool | readall, | ||
BandSummary & | summary | ||
) |
Searches for a band summary and creates it if it does not exist.
raster | The raster to be found. |
bandIndex | Band index. |
readall | If false, the cache will be used or if true the entire image will be read again (can be slow). |
summary | The found band summary. |
bool te::rst::RasterSummaryManager::get | ( | const Raster * | raster, |
const unsigned int | bandIndex, | ||
const unsigned int | rowStart, | ||
const unsigned int | colStart, | ||
const unsigned int | finalRow, | ||
const unsigned int | finalCol, | ||
const unsigned int | histoBins, | ||
const unsigned int | sampleStep, | ||
bool | readall, | ||
BandSummary & | summary | ||
) |
Searches for a band summary and creates it if it does not exist.
raster | The raster to be found. |
bandIndex | Band index. |
rowStart | The starting row. |
colStart | The starting column. |
finalRow | The final row. |
finalCol | The final column. |
histoBins | The number of bins (intervals from minimum pixel to maximum). When b = 0, the histogram will be divided according to all pixel values. |
sampleStep | The row/column step used when reading pixels (to read all pixels sampleStep=1, to read half of pixels use sampleStep=2 ); |
readall | Force the reading the entire image (can be slow) for computing min and max values. |
summary | The found band summary. |
bool te::rst::RasterSummaryManager::get | ( | const Raster * | raster, |
const unsigned int | rowStart, | ||
const unsigned int | colStart, | ||
const unsigned int | finalRow, | ||
const unsigned int | finalCol, | ||
const unsigned int | histoBins, | ||
const unsigned int | sampleStep, | ||
bool | readall, | ||
RasterSummary & | summary | ||
) |
It searches for a raster summary. If not found it creates the summary and returns it.
raster | The raster to be found. |
rowStart | The starting row. |
colStart | The starting column. |
finalRow | The final row. |
finalCol | The final column. |
histoBins | The number of bins (intervals from minimum pixel to maximum). When b = 0, the histogram will be divided according to all pixel values. |
sampleStep | The row/column step used when reading pixels (to read all pixels sampleStep=1, to read half of pixels use sampleStep=2 ); |
readall | Force the reading the entire image (can be slow) for computing min and max values. |
summary | The found raster summary. |
unsigned int te::rst::RasterSummaryManager::getDefaultRasterHistSize | ( | ) |
Get the default rasters histograms bins.
|
inlinestaticinherited |
It returns a reference to the singleton instance.
Definition at line 109 of file Singleton.h.
void te::rst::RasterSummaryManager::remove | ( | const Raster * | raster | ) |
Removes all summary ocurrences related to the specified raster pointer.
raster | The raster pointer to remove the summary. |
void te::rst::RasterSummaryManager::remove | ( | const Raster * | raster, |
const unsigned int | bandIndex, | ||
const unsigned int | rowStart, | ||
const unsigned int | colStart, | ||
const unsigned int | finalRow, | ||
const unsigned int | finalCol, | ||
const unsigned int | histoBins, | ||
const unsigned int | sampleStep | ||
) |
Removes the summary from the specified raster.
raster | The raster to be found. |
rowStart | The starting row. |
colStart | The starting column. |
finalRow | The final row. |
finalCol | The final column. |
histoBins | The number of bins (intervals from minimum pixel to maximum). When b = 0, the histogram will be divided according to all pixel values. |
sampleStep | The row/column step used when reading pixels (to read all pixels sampleStep=1, to read half of pixels use sampleStep=2 ); |
void te::rst::RasterSummaryManager::removeAll | ( | ) |
Removes all raster summary entries.
void te::rst::RasterSummaryManager::setDefaultRasterHistSize | ( | const unsigned int | binsNumber | ) |
Set the default rasters histograms bins.
binsNumber | Histograms bins number ( When b = 0, the histogram will be divided according to all pixel values.). |
|
friend |
Definition at line 58 of file RasterSummaryManager.h.
|
private |
Definition at line 247 of file RasterSummaryManager.h.
|
private |
Definition at line 246 of file RasterSummaryManager.h.
|
private |
A rasters band summaries.
Definition at line 248 of file RasterSummaryManager.h.
|
mutableprivate |
Internal mutex.
Definition at line 249 of file RasterSummaryManager.h.