Ejemplo n.º 1
0
void *MEMDataset::GetInternalHandle( const char * pszRequest)

{
    // check for MEMORYnnn string in pszRequest (nnnn can be up to 10 
    // digits, or even omitted)
    if( EQUALN(pszRequest,"MEMORY",6))
    {
        if(int BandNumber = CPLScanLong(&pszRequest[6], 10))
        {
            MEMRasterBand *RequestedRasterBand = 
                (MEMRasterBand *)GetRasterBand(BandNumber);

            // we're within a MEMDataset so the only thing a RasterBand 
            // could be is a MEMRasterBand

            if( RequestedRasterBand != NULL )
            {
                // return the internal band data pointer
                return(RequestedRasterBand->GetData());
            }
        }
    }

    return NULL;
}
Ejemplo n.º 2
0
void *MEMDataset::GetInternalHandle( const char * pszRequest )

{
    // check for MEMORYnnn string in pszRequest (nnnn can be up to 10
    // digits, or even omitted)
    if( STARTS_WITH_CI(pszRequest, "MEMORY"))
    {
        if(int BandNumber = static_cast<int>(CPLScanLong(&pszRequest[6], 10)))
        {
            MEMRasterBand *RequestedRasterBand =
                reinterpret_cast<MEMRasterBand *>( GetRasterBand(BandNumber) );

            // we're within a MEMDataset so the only thing a RasterBand
            // could be is a MEMRasterBand

            if( RequestedRasterBand != NULL )
            {
                // return the internal band data pointer
                return(RequestedRasterBand->GetData());
            }
        }
    }

    return NULL;
}