27 #ifndef vtkPixelTransfer_h
28 #define vtkPixelTransfer_h
31 #include "vtkSetGet.h"
73 template<
typename SOURCE_TYPE,
typename DEST_TYPE>
88 template<
typename SOURCE_TYPE>
127 template<
typename SOURCE_TYPE>
134 SOURCE_TYPE *srcData,
151 (VTK_TT*)destData););
157 template<
typename SOURCE_TYPE,
typename DEST_TYPE>
164 SOURCE_TYPE *srcData,
168 if ( (srcData == NULL) || (destData == NULL) )
172 if ( (srcWholeExt == srcSubset)
173 && (destWholeExt == destSubset)
174 && (nSrcComps == nDestComps) )
177 size_t n = srcWholeExt.
Size()*nSrcComps;
178 for (
size_t i=0; i<n; ++i)
180 destData[i] =
static_cast<DEST_TYPE
>(srcData[i]);
189 srcWholeExt.
Size(tmp);
192 destWholeExt.
Size(tmp);
197 srcExt.
Shift(srcWholeExt);
200 destExt.
Shift(destWholeExt);
208 int nCopyComps = nSrcComps < nDestComps ? nSrcComps : nDestComps;
210 for (
int j=0; j<nxny[1]; ++j)
212 int sjj = swnx*(srcExt[2]+j)+srcExt[0];
213 int djj = dwnx*(destExt[2]+j)+destExt[0];
214 for (
int i=0; i<nxny[0]; ++i)
216 int sidx = nSrcComps*(sjj+i);
217 int didx = nDestComps*(djj+i);
219 for (
int p=0; p<nCopyComps; ++p)
221 destData[didx+p] =
static_cast<DEST_TYPE
>(srcData[sidx+p]);
224 for (
int p=nCopyComps; p<nDestComps; ++p)
226 destData[didx+p] =
static_cast<DEST_TYPE
>(0);
ostream & operator<<(ostream &os, const vtkPixelTransfer >)
#define VTKRENDERINGLIC_EXPORT
static int Blit(const vtkPixelExtent &ext, int nComps, int srcType, void *srcData, int destType, void *destData)
void Size(T nCells[2]) const