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 (GDALRasterBandH rasterBand, 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

GDALRasterBandH mRasterBand
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
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 922 of file qgsrasterlayer.h.


Constructor & Destructor Documentation

QgsRasterImageBuffer::QgsRasterImageBuffer ( GDALRasterBandH  rasterBand,
QPainter *  p,
QgsRasterViewPort viewPort,
const QgsMapToPixel mapToPixel,
double *  mGeoTransform 
)

Definition at line 5669 of file qgsrasterlayer.cpp.

QgsRasterImageBuffer::~QgsRasterImageBuffer (  ) 

Definition at line 5675 of file qgsrasterlayer.cpp.

References mCurrentGDALData, and mCurrentImage.

QgsRasterImageBuffer::QgsRasterImageBuffer (  )  [private]


Member Function Documentation

void QgsRasterImageBuffer::reset ( int  maxPixelsInVirtualMemory = 5000000  ) 

bool QgsRasterImageBuffer::nextScanLine ( QRgb **  imageScanLine,
void **  rasterScanLine 
)

void QgsRasterImageBuffer::setWritingEnabled ( bool  enabled  )  [inline]

Definition at line 932 of file qgsrasterlayer.h.

Referenced by QgsRasterLayer::drawMultiBandColor().

bool QgsRasterImageBuffer::createNextPartImage (  )  [private]

void QgsRasterImageBuffer::drawPixelRectangle (  )  [private]


Member Data Documentation

GDALRasterBandH QgsRasterImageBuffer::mRasterBand [private]

Definition at line 942 of file qgsrasterlayer.h.

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

QPainter* QgsRasterImageBuffer::mPainter [private]

Definition at line 943 of file qgsrasterlayer.h.

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

Definition at line 944 of file qgsrasterlayer.h.

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

Definition at line 945 of file qgsrasterlayer.h.

Referenced by createNextPartImage(), and drawPixelRectangle().

Definition at line 946 of file qgsrasterlayer.h.

Referenced by createNextPartImage(), and drawPixelRectangle().

Definition at line 948 of file qgsrasterlayer.h.

Referenced by nextScanLine(), and reset().

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

Referenced by createNextPartImage(), and nextScanLine().

Draws the raster pixels as rectangles.

This is only used if the map units per pixel is very, very small

Definition at line 952 of file qgsrasterlayer.h.

Referenced by reset().

Definition at line 953 of file qgsrasterlayer.h.

Referenced by createNextPartImage(), and nextScanLine().

Definition at line 954 of file qgsrasterlayer.h.

Referenced by reset().

Definition at line 955 of file qgsrasterlayer.h.

Referenced by createNextPartImage(), and reset().

Definition at line 956 of file qgsrasterlayer.h.

Referenced by createNextPartImage(), and reset().

Definition at line 957 of file qgsrasterlayer.h.

Referenced by createNextPartImage(), and reset().

Definition at line 958 of file qgsrasterlayer.h.

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

Definition at line 959 of file qgsrasterlayer.h.

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

Definition at line 963 of file qgsrasterlayer.h.

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


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

Generated on Sat Feb 4 19:17:47 2012 for Quantum GIS API Documentation by  doxygen 1.5.6