84 for (ldest=0; ldest < destbuf.
nline; ldest++) {
85 for (sdest=0; sdest < destbuf.
nsample; sdest++) {
86 lsrc = (int)floorf(linebuf.
data.
f[ldest][sdest] + 0.5);
87 ssrc = (int)floorf(samplebuf.
data.
f[ldest][sdest] + 0.5);
88 srcoff = lsrc * srcbuf.
nsample + ssrc;
89 destoff = ldest * destbuf.
nsample + sdest;
90 if (destoff >= 0 && destoff < destnum && srcoff >= 0 && srcoff < srcnum) {
91 memcpy((
void *)((
char *)destbuf.
dataptr + (destoff * destbuf.
datasize)),
MTKt_status MtkDataBufferAllocate(int nline, int nsample, MTKt_DataType datatype, MTKt_DataBuffer *databuf)
Allocate Data Buffer.
MTKt_status MtkResampleNearestNeighbor(MTKt_DataBuffer srcbuf, MTKt_DataBuffer linebuf, MTKt_DataBuffer samplebuf, MTKt_DataBuffer *resampbuf)
Perform nearest neighbor resampling.
2-dimensional Data Buffer
#define MTKT_DATABUFFER_INIT
MTKt_status MtkDataBufferFree(MTKt_DataBuffer *databuf)
Free data buffer.
#define MTK_ERR_COND_JUMP(code)