Quantum GIS API Documentation  1.7.4
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.

Definition at line 4610 of file qgsrasterlayer.cpp.

References mCurrentGDALData, and mCurrentImage.


Member Function Documentation

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

Member Data Documentation

Definition at line 948 of file qgsrasterlayer.h.

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

Definition at line 971 of file qgsrasterlayer.h.

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

Definition at line 967 of file qgsrasterlayer.h.

Referenced by createNextPartImage(), and reset().

Definition at line 964 of file qgsrasterlayer.h.

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

Definition at line 963 of file qgsrasterlayer.h.

Referenced by createNextPartImage(), and reset().

Definition at line 962 of file qgsrasterlayer.h.

Referenced by createNextPartImage(), and reset().

Definition at line 959 of file qgsrasterlayer.h.

Referenced by createNextPartImage(), and nextScanLine().

Definition at line 947 of file qgsrasterlayer.h.

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

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().

Definition at line 952 of file qgsrasterlayer.h.

Referenced by createNextPartImage(), and drawPixelRectangle().

Definition at line 951 of file qgsrasterlayer.h.

Referenced by createNextPartImage(), and drawPixelRectangle().

Definition at line 965 of file qgsrasterlayer.h.

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

Definition at line 960 of file qgsrasterlayer.h.

Referenced by reset().

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().

Definition at line 954 of file qgsrasterlayer.h.

Referenced by nextScanLine(), and reset().

Definition at line 950 of file qgsrasterlayer.h.

Referenced by createNextPartImage(), drawPixelRectangle(), 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 956 of file qgsrasterlayer.h.

Referenced by createNextPartImage(), and nextScanLine().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines