35 const char *fieldname,
48 cache->
gridname = (
char *)malloc(strlen(gridname)+1);
50 cache->
fieldname = (
char *)malloc(strlen(fieldname)+1);
57 for (i = 0; i <=
NBLOCK; i++) {
81 const char *fieldname,
94 cache->
gridname = (
char *)malloc(strlen(gridname)+1);
96 cache->
fieldname = (
char *)malloc(strlen(fieldname)+1);
103 for (i = 0; i <=
NBLOCK; i++) {
159 rline = (int)floor(line+.5);
160 rsample = (int)floor(sample+.5);
162 if (rline < 0 || sample < 0 ||
166 memcpy(pixel, (
void *)&(dptr[rline*nsample*datasize + rsample*datasize]),
202 if (cache->
ncid > 0) {
235 for (i = 0; i <=
NBLOCK; i++) {
MTKt_status MtkCacheLoad(MTKt_Cache *cache, int block)
Load Cache.
MTKt_status MtkDataBufferAllocate(int nline, int nsample, MTKt_DataType datatype, MTKt_DataBuffer *databuf)
Allocate Data Buffer.
HDFFCLIBAPI _fcd _fcd intf intf * datatype
MTKt_status MtkCacheInitFid(int32 fid, const char *gridname, const char *fieldname, MTKt_Cache *cache)
Initialize Cache.
#define MTK_ERR_CODE_JUMP(code)
MTKt_status MtkFileGridFieldToDataTypeNcid(int ncid, const char *gridname, const char *fieldname, MTKt_DataType *datatype)
2-dimensional Data Buffer
MTKt_status MtkReadBlockNcid(int ncid, const char *gridname, const char *fieldname, int block, MTKt_DataBuffer *databuf)
MTKt_status MtkCachePixelGet(MTKt_Cache *cache, int block, float line, float sample, void *pixel)
Get pixel from cache.
MTKt_status MtkFileGridFieldToDataTypeFid(int32 fid, const char *gridname, const char *fieldname, MTKt_DataType *datatype)
Version of MtkFileGridFieldToDataType that takes an HDF-EOS file id rather than a filename...
#define MTKT_DATABUFFER_INIT
MTKt_status MtkFillValueGetFid(int32 fid, const char *gridname, const char *fieldname, MTKt_DataBuffer *fillbuf)
Version of MtkFillValueGet that takes an HDF-EOS file ID rather than a filename.
MTKt_status MtkDataBufferFree(MTKt_DataBuffer *databuf)
Free data buffer.
MTKt_status MtkReadBlockFid(int32 fid, const char *gridname, const char *fieldname, int block, MTKt_DataBuffer *databuf)
Version of MtkReadBlock that takes an HDF-EOS file identifier rather than a filename.
void MtkCacheFree(MTKt_Cache *cache)
Free Cache.
MTKt_status MtkFillValueGetNcid(int ncid, const char *gridname, const char *fieldname, MTKt_DataBuffer *fillbuf)
MTKt_status MtkCacheInitNcid(int ncid, const char *gridname, const char *fieldname, MTKt_Cache *cache)
MTKt_Block block[NBLOCK+1]