Quantum GIS API Documentation
1.8
|
A class encapsulates reading from a raster band and drawing the pixels to a painter. More...
#include <qgsrasterlayer.h>
Public Member Functions | |
QgsRasterImageBuffer (QgsRasterDataProvider *dataProvider, int bandNo, QPainter *p, QgsRasterViewPort *viewPort, const QgsMapToPixel *mapToPixel, double *mGeoTransform) | |
~QgsRasterImageBuffer () | |
void | reset (int maxPixelsInVirtualMemory=5000000) |
bool | nextScanLine (QRgb **imageScanLine, void **rasterScanLine) |
Returns a pointer to the next scan line (or 0 if end) | |
void | setWritingEnabled (bool enabled) |
Private Member Functions | |
QgsRasterImageBuffer () | |
bool | createNextPartImage () |
Creates next part image. | |
void | drawPixelRectangle () |
Peter's fix for zoomed in rasters. | |
Private Attributes | |
QgsRasterDataProvider * | mDataProvider |
int | mBandNo |
QPainter * | mPainter |
QgsRasterViewPort * | mViewPort |
const QgsMapToPixel * | mMapToPixel |
double * | mGeoTransform |
bool | mValid |
bool | mWritingEnabled |
True (default), if values are written to an image. | |
bool | mDrawPixelRect |
Draws the raster pixels as rectangles. | |
int | mCurrentRow |
int | mNumPartImages |
int | mNumRasterRowsPerPart |
int | mCurrentPartRasterMin |
int | mCurrentPartRasterMax |
int | mCurrentPartImageRow |
int | mNumCurrentImageRows |
int | mCurrentPart |
QImage * | mCurrentImage |
void * | mCurrentGDALData |
A class encapsulates reading from a raster band and drawing the pixels to a painter.
The class allows sequential reading of the scan lines and setting the image scan line pixels. It automatically decides on how much of the band / image should stay in virtual memory at a time
Definition at line 942 of file qgsrasterlayer.h.
QgsRasterImageBuffer::QgsRasterImageBuffer | ( | QgsRasterDataProvider * | dataProvider, |
int | bandNo, | ||
QPainter * | p, | ||
QgsRasterViewPort * | viewPort, | ||
const QgsMapToPixel * | mapToPixel, | ||
double * | mGeoTransform | ||
) |
Definition at line 4748 of file qgsrasterlayer.cpp.
Definition at line 4754 of file qgsrasterlayer.cpp.
References mCurrentGDALData, and mCurrentImage.
QgsRasterImageBuffer::QgsRasterImageBuffer | ( | ) | [private] |
bool QgsRasterImageBuffer::createNextPartImage | ( | ) | [private] |
Creates next part image.
Returns false if at end
Definition at line 4831 of file qgsrasterlayer.cpp.
References QgsRasterDataProvider::dataTypeSize(), QgsRasterViewPort::drawableAreaXDim, QgsRasterViewPort::drawableAreaYDim, drawPixelRectangle(), QgsMapToPixel::mapUnitsPerPixel(), mBandNo, mCurrentGDALData, mCurrentImage, mCurrentPart, mCurrentPartImageRow, mCurrentPartRasterMax, mCurrentPartRasterMin, mCurrentRow, mDataProvider, QgsRasterViewPort::mDestCRS, QgsRasterViewPort::mDrawnExtent, mGeoTransform, mMapToPixel, mNumCurrentImageRows, mNumRasterRowsPerPart, mPainter, QgsRasterViewPort::mSrcCRS, mViewPort, mWritingEnabled, QgsDebugMsg, QgsRasterDataProvider::readBlock(), size, QgsRasterViewPort::topLeftPoint, QgsPoint::x(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsPoint::y(), and QgsRectangle::yMaximum().
Referenced by nextScanLine(), and reset().
void QgsRasterImageBuffer::drawPixelRectangle | ( | ) | [private] |
Peter's fix for zoomed in rasters.
Definition at line 4953 of file qgsrasterlayer.cpp.
References QgsRasterViewPort::bottomRightPoint, QgsMapToPixel::mapUnitsPerPixel(), mCurrentImage, mGeoTransform, mMapToPixel, mPainter, mViewPort, QgsRasterViewPort::topLeftPoint, QgsPoint::x(), and QgsPoint::y().
Referenced by createNextPartImage().
bool QgsRasterImageBuffer::nextScanLine | ( | QRgb ** | imageScanLine, |
void ** | rasterScanLine | ||
) |
Returns a pointer to the next scan line (or 0 if end)
Definition at line 4796 of file qgsrasterlayer.cpp.
References createNextPartImage(), QgsRasterDataProvider::dataTypeSize(), QgsRasterViewPort::drawableAreaXDim, mBandNo, mCurrentGDALData, mCurrentImage, mCurrentPartImageRow, mCurrentRow, mDataProvider, mNumCurrentImageRows, mValid, mViewPort, mWritingEnabled, and size.
Referenced by QgsRasterLayer::drawMultiBandColor(), QgsRasterLayer::drawPalettedSingleBandColor(), QgsRasterLayer::drawPalettedSingleBandGray(), QgsRasterLayer::drawPalettedSingleBandPseudoColor(), QgsRasterLayer::drawSingleBandColorData(), QgsRasterLayer::drawSingleBandGray(), and QgsRasterLayer::drawSingleBandPseudoColor().
void QgsRasterImageBuffer::reset | ( | int | maxPixelsInVirtualMemory = 5000000 | ) |
Definition at line 4760 of file qgsrasterlayer.cpp.
References createNextPartImage(), QgsRasterViewPort::drawableAreaXDim, QgsRasterViewPort::drawableAreaYDim, mBandNo, mCurrentPart, mCurrentPartImageRow, mCurrentPartRasterMax, mCurrentPartRasterMin, mDataProvider, mDrawPixelRect, mNumCurrentImageRows, mNumPartImages, mNumRasterRowsPerPart, mPainter, mValid, mViewPort, and QgsDebugMsg.
Referenced by QgsRasterLayer::drawMultiBandColor(), QgsRasterLayer::drawPalettedSingleBandColor(), QgsRasterLayer::drawPalettedSingleBandGray(), QgsRasterLayer::drawPalettedSingleBandPseudoColor(), QgsRasterLayer::drawSingleBandColorData(), QgsRasterLayer::drawSingleBandGray(), and QgsRasterLayer::drawSingleBandPseudoColor().
void QgsRasterImageBuffer::setWritingEnabled | ( | bool | enabled | ) | [inline] |
Definition at line 952 of file qgsrasterlayer.h.
Referenced by QgsRasterLayer::drawMultiBandColor(), QgsRasterLayer::drawPalettedSingleBandColor(), QgsRasterLayer::drawPalettedSingleBandGray(), QgsRasterLayer::drawPalettedSingleBandPseudoColor(), QgsRasterLayer::drawSingleBandGray(), and QgsRasterLayer::drawSingleBandPseudoColor().
int QgsRasterImageBuffer::mBandNo [private] |
Definition at line 963 of file qgsrasterlayer.h.
Referenced by createNextPartImage(), nextScanLine(), and reset().
void* QgsRasterImageBuffer::mCurrentGDALData [private] |
Definition at line 986 of file qgsrasterlayer.h.
Referenced by createNextPartImage(), nextScanLine(), and ~QgsRasterImageBuffer().
QImage* QgsRasterImageBuffer::mCurrentImage [private] |
Definition at line 985 of file qgsrasterlayer.h.
Referenced by createNextPartImage(), drawPixelRectangle(), nextScanLine(), and ~QgsRasterImageBuffer().
int QgsRasterImageBuffer::mCurrentPart [private] |
Definition at line 982 of file qgsrasterlayer.h.
Referenced by createNextPartImage(), and reset().
int QgsRasterImageBuffer::mCurrentPartImageRow [private] |
Definition at line 979 of file qgsrasterlayer.h.
Referenced by createNextPartImage(), nextScanLine(), and reset().
int QgsRasterImageBuffer::mCurrentPartRasterMax [private] |
Definition at line 978 of file qgsrasterlayer.h.
Referenced by createNextPartImage(), and reset().
int QgsRasterImageBuffer::mCurrentPartRasterMin [private] |
Definition at line 977 of file qgsrasterlayer.h.
Referenced by createNextPartImage(), and reset().
int QgsRasterImageBuffer::mCurrentRow [private] |
Definition at line 974 of file qgsrasterlayer.h.
Referenced by createNextPartImage(), and nextScanLine().
Definition at line 962 of file qgsrasterlayer.h.
Referenced by createNextPartImage(), nextScanLine(), and reset().
bool QgsRasterImageBuffer::mDrawPixelRect [private] |
Draws the raster pixels as rectangles.
This is only used if the map units per pixel is very, very small
Definition at line 973 of file qgsrasterlayer.h.
Referenced by reset().
double* QgsRasterImageBuffer::mGeoTransform [private] |
Definition at line 967 of file qgsrasterlayer.h.
Referenced by createNextPartImage(), and drawPixelRectangle().
const QgsMapToPixel* QgsRasterImageBuffer::mMapToPixel [private] |
Definition at line 966 of file qgsrasterlayer.h.
Referenced by createNextPartImage(), and drawPixelRectangle().
int QgsRasterImageBuffer::mNumCurrentImageRows [private] |
Definition at line 980 of file qgsrasterlayer.h.
Referenced by createNextPartImage(), nextScanLine(), and reset().
int QgsRasterImageBuffer::mNumPartImages [private] |
Definition at line 975 of file qgsrasterlayer.h.
Referenced by reset().
int QgsRasterImageBuffer::mNumRasterRowsPerPart [private] |
Definition at line 976 of file qgsrasterlayer.h.
Referenced by createNextPartImage(), and reset().
QPainter* QgsRasterImageBuffer::mPainter [private] |
Definition at line 964 of file qgsrasterlayer.h.
Referenced by createNextPartImage(), drawPixelRectangle(), and reset().
bool QgsRasterImageBuffer::mValid [private] |
Definition at line 969 of file qgsrasterlayer.h.
Referenced by nextScanLine(), and reset().
QgsRasterViewPort* QgsRasterImageBuffer::mViewPort [private] |
Definition at line 965 of file qgsrasterlayer.h.
Referenced by createNextPartImage(), drawPixelRectangle(), nextScanLine(), and reset().
bool QgsRasterImageBuffer::mWritingEnabled [private] |
True (default), if values are written to an image.
If false, the class only reads the values, but does not create an image
Definition at line 971 of file qgsrasterlayer.h.
Referenced by createNextPartImage(), and nextScanLine().