Quantum GIS API Documentation  1.7.5-Wroclaw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes
QgsRasterImageBuffer Class Reference

A class encapsulates reading from a raster band and drawing the pixels to a painter. More...

#include <qgsrasterlayer.h>

Collaboration diagram for QgsRasterImageBuffer:
Collaboration graph
[legend]

List of all members.

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

QgsRasterDataProvidermDataProvider
int mBandNo
QPainter * mPainter
QgsRasterViewPortmViewPort
const QgsMapToPixelmMapToPixel
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

Detailed Description

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 927 of file qgsrasterlayer.h.


Constructor & Destructor Documentation

QgsRasterImageBuffer::QgsRasterImageBuffer ( QgsRasterDataProvider dataProvider,
int  bandNo,
QPainter *  p,
QgsRasterViewPort viewPort,
const QgsMapToPixel mapToPixel,
double *  mGeoTransform 
)

Definition at line 4604 of file qgsrasterlayer.cpp.

QgsRasterImageBuffer::~QgsRasterImageBuffer ( )

Definition at line 4610 of file qgsrasterlayer.cpp.

References mCurrentGDALData, and mCurrentImage.

QgsRasterImageBuffer::QgsRasterImageBuffer ( )
private

Member Function Documentation

bool QgsRasterImageBuffer::createNextPartImage ( )
private
void QgsRasterImageBuffer::drawPixelRectangle ( )
private
bool QgsRasterImageBuffer::nextScanLine ( QRgb **  imageScanLine,
void **  rasterScanLine 
)
void QgsRasterImageBuffer::reset ( int  maxPixelsInVirtualMemory = 5000000)
void QgsRasterImageBuffer::setWritingEnabled ( bool  enabled)
inline

Member Data Documentation

int QgsRasterImageBuffer::mBandNo
private

Definition at line 948 of file qgsrasterlayer.h.

Referenced by createNextPartImage(), nextScanLine(), and reset().

void* QgsRasterImageBuffer::mCurrentGDALData
private

Definition at line 971 of file qgsrasterlayer.h.

Referenced by createNextPartImage(), nextScanLine(), and ~QgsRasterImageBuffer().

QImage* QgsRasterImageBuffer::mCurrentImage
private
int QgsRasterImageBuffer::mCurrentPart
private

Definition at line 967 of file qgsrasterlayer.h.

Referenced by createNextPartImage(), and reset().

int QgsRasterImageBuffer::mCurrentPartImageRow
private

Definition at line 964 of file qgsrasterlayer.h.

Referenced by createNextPartImage(), nextScanLine(), and reset().

int QgsRasterImageBuffer::mCurrentPartRasterMax
private

Definition at line 963 of file qgsrasterlayer.h.

Referenced by createNextPartImage(), and reset().

int QgsRasterImageBuffer::mCurrentPartRasterMin
private

Definition at line 962 of file qgsrasterlayer.h.

Referenced by createNextPartImage(), and reset().

int QgsRasterImageBuffer::mCurrentRow
private

Definition at line 959 of file qgsrasterlayer.h.

Referenced by createNextPartImage(), and nextScanLine().

QgsRasterDataProvider* QgsRasterImageBuffer::mDataProvider
private

Definition at line 947 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 958 of file qgsrasterlayer.h.

Referenced by reset().

double* QgsRasterImageBuffer::mGeoTransform
private

Definition at line 952 of file qgsrasterlayer.h.

Referenced by createNextPartImage(), and drawPixelRectangle().

const QgsMapToPixel* QgsRasterImageBuffer::mMapToPixel
private

Definition at line 951 of file qgsrasterlayer.h.

Referenced by createNextPartImage(), and drawPixelRectangle().

int QgsRasterImageBuffer::mNumCurrentImageRows
private

Definition at line 965 of file qgsrasterlayer.h.

Referenced by createNextPartImage(), nextScanLine(), and reset().

int QgsRasterImageBuffer::mNumPartImages
private

Definition at line 960 of file qgsrasterlayer.h.

Referenced by reset().

int QgsRasterImageBuffer::mNumRasterRowsPerPart
private

Definition at line 961 of file qgsrasterlayer.h.

Referenced by createNextPartImage(), and reset().

QPainter* QgsRasterImageBuffer::mPainter
private

Definition at line 949 of file qgsrasterlayer.h.

Referenced by createNextPartImage(), drawPixelRectangle(), and reset().

bool QgsRasterImageBuffer::mValid
private

Definition at line 954 of file qgsrasterlayer.h.

Referenced by nextScanLine(), and reset().

QgsRasterViewPort* QgsRasterImageBuffer::mViewPort
private

Definition at line 950 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 956 of file qgsrasterlayer.h.

Referenced by createNextPartImage(), and nextScanLine().


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