[gdal-dev] RE: progressive rendering
Norman Barker
nbarker at ittvis.com
Tue Sep 2 15:49:14 EDT 2008
Adam, all
Thanks for the comments and updates, I am working as fast as I can
(after a long weekend without a computer :-) ) to capture all of your
comments and interface definitions and to produce the documented
interfaces (header definitions) for the RFC. I am taking the last email
from Tamas, and the enum definition below and will hopefully have an
updated RFC out for comment tomorrow.
Please add your names to the RFC in the author section, this is a
collaborative effort, and after I have put up the code interfaces please
edit directly.
Many thanks,
Norman
-----Original Message-----
From: gdal-dev-bounces at lists.osgeo.org
[mailto:gdal-dev-bounces at lists.osgeo.org] On Behalf Of Adam Nowacki
Sent: Tuesday, September 02, 2008 1:40 PM
To: gdal-dev at lists.osgeo.org
Subject: Re: [gdal-dev] RE: progressive rendering
Tamas Szekeres wrote:
> Hi All,
>
> Upon thinking about the issues I've been come up with previously, I
> consider the following approach could be implemented easily either at
> driver or at SWIG interface level. Requires a new class to be
> implemented by the async IO supported drivers and a new additional
> method should be added to the GDALDataset and GDALRasterBand.
> The user could implement the async IO by using the following pseudo
sequence:
>
> <Code>
> ...
> </Code>
I like it :)
typedef enum {
...,
CE_Again = 5 // timeout, buffer not updated, call RasterIO() again
} CPLErr;
typedef enum { // Async raster io status
GRS_Complete = 0, // raster io is complete, call to
GDALRasterIOContext->RasterIO() will return CE_Failure
GRS_InProgress = 1, // raster io in progress, call
GDALRasterIOContext->RasterIO() to get more data
GRS_Error = 2 // error, call to GDALRasterIOContext->RasterIO()
will return CE_Failure
} GDALRasterIOStatus;
typedef enum { // Hints for GDALRasterIOContext->RasterIO(), driver
implementations may ignore any or all
GRH_SingleBlock = 0x1, // exit after single block update, even if
there is more data immediately available
GRH_Progressive = 0x2, // update with lower resolution data / fill
with interlaced rows
GRH_WaitForTimeout = 0x4 // wait for timeout even if already
updated some data
} GDALRasterIOHint;
class GDALRasterIOContext {
public:
GDALRasterIOContext() {
eStatus = GRS_Continue;
pszError = NULL;
}
public:
// Continue raster io, update pData buffer with new data, nUpdate??? =
bounding box of all updated blocks
// return CE_None if updated with new data
// return CE_Again on timeout
// return CE_Failure on error
virtual CPLErr RasterIO(void *pData, int nTimeoutMilliseconds = -1,
int nHint = 0);
public:
GDALRasterIOStatus eStatus;
char *pszError; // if eStatus == GRS_Error this should contain
human readable error message, NULL otherwise
int nUpdateXOff;
int nUpdateYOff;
int nUpdateXSize;
int nUpdateYSize;
};
class GDALDataset {
...
public:
virtual GDALRasterIOContext *StartRasterIO(
GDALRWFlag eRWFlag, int nXOff, int nYOff, int nXSize, int
nYSize,
int nBufXSize, int nBufYSize, GDALDataType eBufType,
int nBandCount, int *panBandMap, int nPixelSpace, int
nLineSpace, int nBandSpace
);
virtual void EndRasterIO(GDALAsyncRasterIOContext *poContext);
};
_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev
More information about the gdal-dev
mailing list