30 #ifndef vtkPixelTransfer_h
31 #define vtkPixelTransfer_h
34 #include "vtkSetGet.h"
75 template<
typename SOURCE_TYPE,
typename DEST_TYPE>
90 template<
typename SOURCE_TYPE>
129 template<
typename SOURCE_TYPE>
136 SOURCE_TYPE *srcData,
153 (VTK_TT*)destData););
159 template<
typename SOURCE_TYPE,
typename DEST_TYPE>
166 SOURCE_TYPE *srcData,
170 if ( (srcData == NULL) || (destData == NULL) )
174 if ( (srcWholeExt == srcSubset)
175 && (destWholeExt == destSubset)
176 && (nSrcComps == nDestComps) )
179 size_t n = srcWholeExt.
Size()*nSrcComps;
180 for (
size_t i=0; i<n; ++i)
182 destData[i] =
static_cast<DEST_TYPE
>(srcData[i]);
191 srcWholeExt.
Size(tmp);
194 destWholeExt.
Size(tmp);
199 srcExt.
Shift(srcWholeExt);
202 destExt.
Shift(destWholeExt);
210 int nCopyComps = nSrcComps < nDestComps ? nSrcComps : nDestComps;
212 for (
int j=0; j<nxny[1]; ++j)
214 int sjj = swnx*(srcExt[2]+j)+srcExt[0];
215 int djj = dwnx*(destExt[2]+j)+destExt[0];
216 for (
int i=0; i<nxny[0]; ++i)
218 int sidx = nSrcComps*(sjj+i);
219 int didx = nDestComps*(djj+i);
221 for (
int p=0; p<nCopyComps; ++p)
223 destData[didx+p] =
static_cast<DEST_TYPE
>(srcData[sidx+p]);
226 for (
int p=nCopyComps; p<nDestComps; ++p)
228 destData[didx+p] =
static_cast<DEST_TYPE
>(0);
static int Blit(const vtkPixelExtent &ext, int nComps, int srcType, void *srcData, int destType, void *destData)
void Size(T nCells[2]) const
#define VTKCOMMONDATAMODEL_EXPORT