Qt Virtual Chart Table (QVCT)
CChartGDAL Class Reference

Generic GDAL-based dataset. More...

#include <charts/CChartGDAL.hpp>

Inheritance diagram for CChartGDAL:
CChartGDALElevation CChartGDALRaster

Public Types

enum  EColorEncoding {
  GRAY , GRAY_U16 , GRAY_S16 , GRAY_U32 ,
  GRAY_S32 , GRAY_F32 , GRAY_F64 , PALETTE_GRAY ,
  PALETTE_RGB , PALETTE_CMYK , PALETTE_HSL , ARGB ,
  RGB , YUV
}
 Underlying GDAL dataset color encoding IDs. More...
 

Public Member Functions

QVCT::EStatus getStatus () const
 Returns the chart internal status (after constructing object) More...
 
QString getFileName () const
 Returns the chart (GDAL dataset) file name. More...
 
QRect getDatGeometry () const
 Returns the chart (GDAL dataset) geometry (size) More...
 
EColorEncoding getColorEncoding () const
 Returns the chart (GDAL dataset) color encoding. More...
 
QPointF getDatPosition () const
 Returns the last drawn chart (GDAL dataset) center pixel position. More...
 
double getZoom () const
 Returns the last drawn chart (GDAL dataset) zoom factor. More...
 
CDataPosition toGeoPosition (const QPointF &_rqPointFDatPosition) const
 Converts the given chart pixel position to geographical position. More...
 
QPointF toDatPosition (const CDataPosition &_roGeoPosition) const
 Converts the given (geographical) position [long,lat,elev] to chart (GDAL dataset) point [px]. More...
 
double getResolution (const QPointF &_rqPointFDatPosition) const
 Returns the resolution at given chart (GDAL dataset) point [px], in meters per pixel [m/px]. More...
 
void draw (QPainter *_pqPainter, const QPointF &_rqPointFDatPosition, double _fdZoom)
 Draws chart, centered on given chart (GDAL dataset) point [px] and zoomed according to given factor. More...
 
void move (const QPointF &_rqPointFDatPosition, double _fdZoom)
 Moves the chart, centered on given chart (GDAL dataset) point [px] and zoomed according to given factor. More...
 

Protected Member Functions

 CChartGDAL ()
 
virtual ~CChartGDAL ()
 
void open (const QString &_rqsFileName)
 Opens the underlying GDAL dataset. More...
 
virtual void rasterBuffer (QImage *_pqImage, const QVector< quint16 > &_rqVector) const
 Rasterizes UInt16 buffer. More...
 
virtual void rasterBuffer (QImage *_pqImage, const QVector< qint16 > &_rqVector) const
 Rasterizes Int16 buffer. More...
 
virtual void rasterBuffer (QImage *_pqImage, const QVector< quint32 > &_rqVector) const
 Rasterizes UInt32 buffer. More...
 
virtual void rasterBuffer (QImage *_pqImage, const QVector< qint32 > &_rqVector) const
 Rasterizes Int32 buffer. More...
 
virtual void rasterBuffer (QImage *_pqImage, const QVector< float > &_rqVector) const
 Rasterizes Float32 buffer. More...
 
virtual void rasterBuffer (QImage *_pqImage, const QVector< double > &_rqVector) const
 Rasterizes Float64 buffer. More...
 

Protected Attributes

QVCT::EStatus eStatus
 Chart internal status. More...
 
QString qsFileName
 Chart (GDAL dataset) file name. More...
 
QRect qRectGeometry
 Chart (GDAL dataset) geometry (size) More...
 
EColorEncoding eColorEncoding
 Chart (GDAL dataset) color encoding. More...
 
QPointF qPointFDatPositionWished
 Last drawn chart (GDAL dataset) center pixel position (requested by user) More...
 
QPointF qPointFDatPositionActual
 Last drawn chart (GDAL dataset) center pixel position (actually rendered) More...
 
double fdZoomWished
 Last drawn chart (GDAL dataset) zoom factor (requested by user) More...
 
double fdZoomActual
 Last drawn chart (GDAL dataset) zoom factor (actually rendered) More...
 
GDALDataset * poGDALDataset
 Underlying GDAL dataset. More...
 
void * pGDALProjectionTransformer
 Underlying GDAL dataset projection transformer (to internal WGS84) More...
 
int * piGDALBandMap
 Underlying GDAL dataset band mapping (for ARGB/RGB/YUV color encodings) More...
 
QPixmap qPixmapBuffer
 Pixmap buffer where the chart (GDAL dataset) is rendered (rasterized) More...
 
QVector< QRgb > qColorTable
 Color table (for GRAY/PALETTE_* color encodings) More...
 

Detailed Description

Generic GDAL-based dataset.

This class defines the generic resources to wrap a GDAL dataset and use it as a chart along Qt drawing resources (QPainter, QImage, etc.).

The GDAL dataset internal projection data are used to convert pixel to geographical coordinates and vice-versa (using QVCT internal Longitude/Latitude WGS84 reference).

In order to improve I/O performances, rendering (rasterization) is performed only when necessary (the rendering buffer being cached between calls to the drawing primitive).

Author
Cedric Dufour http://cedric.dufour.name

Definition at line 52 of file CChartGDAL.hpp.

Member Enumeration Documentation

◆ EColorEncoding

Underlying GDAL dataset color encoding IDs.

Enumerator
GRAY 
GRAY_U16 
GRAY_S16 
GRAY_U32 
GRAY_S32 
GRAY_F32 
GRAY_F64 
PALETTE_GRAY 
PALETTE_RGB 
PALETTE_CMYK 
PALETTE_HSL 
ARGB 
RGB 
YUV 

Definition at line 61 of file CChartGDAL.hpp.

Constructor & Destructor Documentation

◆ CChartGDAL()

CChartGDAL::CChartGDAL ( )
protected

Definition at line 47 of file CChartGDAL.cpp.

◆ ~CChartGDAL()

CChartGDAL::~CChartGDAL ( )
protectedvirtual

Definition at line 54 of file CChartGDAL.cpp.

Member Function Documentation

◆ open()

void CChartGDAL::open ( const QString &  _rqsFileName)
protected

Opens the underlying GDAL dataset.

Definition at line 61 of file CChartGDAL.cpp.

◆ getStatus()

QVCT::EStatus CChartGDAL::getStatus ( ) const
inline

Returns the chart internal status (after constructing object)

Definition at line 132 of file CChartGDAL.hpp.

◆ getFileName()

QString CChartGDAL::getFileName ( ) const
inline

Returns the chart (GDAL dataset) file name.

Definition at line 134 of file CChartGDAL.hpp.

◆ getDatGeometry()

QRect CChartGDAL::getDatGeometry ( ) const
inline

Returns the chart (GDAL dataset) geometry (size)

Definition at line 136 of file CChartGDAL.hpp.

◆ getColorEncoding()

EColorEncoding CChartGDAL::getColorEncoding ( ) const
inline

Returns the chart (GDAL dataset) color encoding.

Definition at line 138 of file CChartGDAL.hpp.

◆ getDatPosition()

QPointF CChartGDAL::getDatPosition ( ) const
inline

Returns the last drawn chart (GDAL dataset) center pixel position.

Definition at line 140 of file CChartGDAL.hpp.

◆ getZoom()

double CChartGDAL::getZoom ( ) const
inline

Returns the last drawn chart (GDAL dataset) zoom factor.

Definition at line 142 of file CChartGDAL.hpp.

◆ toGeoPosition()

CDataPosition CChartGDAL::toGeoPosition ( const QPointF &  _rqPointFDatPosition) const

Converts the given chart pixel position to geographical position.

Definition at line 356 of file CChartGDAL.cpp.

◆ toDatPosition()

QPointF CChartGDAL::toDatPosition ( const CDataPosition _roGeoPosition) const

Converts the given (geographical) position [long,lat,elev] to chart (GDAL dataset) point [px].

Definition at line 368 of file CChartGDAL.cpp.

◆ getResolution()

double CChartGDAL::getResolution ( const QPointF &  _rqPointFDatPosition) const

Returns the resolution at given chart (GDAL dataset) point [px], in meters per pixel [m/px].

Definition at line 383 of file CChartGDAL.cpp.

◆ draw()

void CChartGDAL::draw ( QPainter *  _pqPainter,
const QPointF &  _rqPointFDatPosition,
double  _fdZoom 
)

Draws chart, centered on given chart (GDAL dataset) point [px] and zoomed according to given factor.

Definition at line 392 of file CChartGDAL.cpp.

◆ move()

void CChartGDAL::move ( const QPointF &  _rqPointFDatPosition,
double  _fdZoom 
)

Moves the chart, centered on given chart (GDAL dataset) point [px] and zoomed according to given factor.

Definition at line 683 of file CChartGDAL.cpp.

◆ rasterBuffer() [1/6]

void CChartGDAL::rasterBuffer ( QImage *  _pqImage,
const QVector< quint16 > &  _rqVector 
) const
protectedvirtual

Rasterizes UInt16 buffer.

Reimplemented in CChartGDALElevation.

Definition at line 690 of file CChartGDAL.cpp.

◆ rasterBuffer() [2/6]

void CChartGDAL::rasterBuffer ( QImage *  _pqImage,
const QVector< qint16 > &  _rqVector 
) const
protectedvirtual

Rasterizes Int16 buffer.

Reimplemented in CChartGDALElevation.

Definition at line 699 of file CChartGDAL.cpp.

◆ rasterBuffer() [3/6]

void CChartGDAL::rasterBuffer ( QImage *  _pqImage,
const QVector< quint32 > &  _rqVector 
) const
protectedvirtual

Rasterizes UInt32 buffer.

Reimplemented in CChartGDALElevation.

Definition at line 708 of file CChartGDAL.cpp.

◆ rasterBuffer() [4/6]

void CChartGDAL::rasterBuffer ( QImage *  _pqImage,
const QVector< qint32 > &  _rqVector 
) const
protectedvirtual

Rasterizes Int32 buffer.

Reimplemented in CChartGDALElevation.

Definition at line 717 of file CChartGDAL.cpp.

◆ rasterBuffer() [5/6]

void CChartGDAL::rasterBuffer ( QImage *  _pqImage,
const QVector< float > &  _rqVector 
) const
protectedvirtual

Rasterizes Float32 buffer.

Reimplemented in CChartGDALElevation.

Definition at line 726 of file CChartGDAL.cpp.

◆ rasterBuffer() [6/6]

void CChartGDAL::rasterBuffer ( QImage *  _pqImage,
const QVector< double > &  _rqVector 
) const
protectedvirtual

Rasterizes Float64 buffer.

Reimplemented in CChartGDALElevation.

Definition at line 735 of file CChartGDAL.cpp.

Member Data Documentation

◆ eStatus

QVCT::EStatus CChartGDAL::eStatus
protected

Chart internal status.

Definition at line 75 of file CChartGDAL.hpp.

◆ qsFileName

QString CChartGDAL::qsFileName
protected

Chart (GDAL dataset) file name.

Definition at line 77 of file CChartGDAL.hpp.

◆ qRectGeometry

QRect CChartGDAL::qRectGeometry
protected

Chart (GDAL dataset) geometry (size)

Definition at line 79 of file CChartGDAL.hpp.

◆ eColorEncoding

EColorEncoding CChartGDAL::eColorEncoding
protected

Chart (GDAL dataset) color encoding.

Definition at line 81 of file CChartGDAL.hpp.

◆ qPointFDatPositionWished

QPointF CChartGDAL::qPointFDatPositionWished
protected

Last drawn chart (GDAL dataset) center pixel position (requested by user)

Definition at line 83 of file CChartGDAL.hpp.

◆ qPointFDatPositionActual

QPointF CChartGDAL::qPointFDatPositionActual
protected

Last drawn chart (GDAL dataset) center pixel position (actually rendered)

Definition at line 85 of file CChartGDAL.hpp.

◆ fdZoomWished

double CChartGDAL::fdZoomWished
protected

Last drawn chart (GDAL dataset) zoom factor (requested by user)

Definition at line 87 of file CChartGDAL.hpp.

◆ fdZoomActual

double CChartGDAL::fdZoomActual
protected

Last drawn chart (GDAL dataset) zoom factor (actually rendered)

Definition at line 89 of file CChartGDAL.hpp.

◆ poGDALDataset

GDALDataset* CChartGDAL::poGDALDataset
protected

Underlying GDAL dataset.

Definition at line 96 of file CChartGDAL.hpp.

◆ pGDALProjectionTransformer

void* CChartGDAL::pGDALProjectionTransformer
protected

Underlying GDAL dataset projection transformer (to internal WGS84)

Definition at line 98 of file CChartGDAL.hpp.

◆ piGDALBandMap

int* CChartGDAL::piGDALBandMap
protected

Underlying GDAL dataset band mapping (for ARGB/RGB/YUV color encodings)

Definition at line 100 of file CChartGDAL.hpp.

◆ qPixmapBuffer

QPixmap CChartGDAL::qPixmapBuffer
protected

Pixmap buffer where the chart (GDAL dataset) is rendered (rasterized)

Definition at line 107 of file CChartGDAL.hpp.

◆ qColorTable

QVector<QRgb> CChartGDAL::qColorTable
protected

Color table (for GRAY/PALETTE_* color encodings)

Definition at line 109 of file CChartGDAL.hpp.


The documentation for this class was generated from the following files: