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; }
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; }