MCPcopy Create free account
hub / github.com/Kitware/VTK / vtkImageDataCastExecute

Function vtkImageDataCastExecute

Common/DataModel/vtkImageData.cxx:1084–1120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1082// This templated function executes the filter for any type of data.
1083template <class IT, class OT>
1084void vtkImageDataCastExecute(
1085 vtkImageData* inData, IT* inPtr, vtkImageData* outData, OT* outPtr, int outExt[6])
1086{
1087 int idxR, idxY, idxZ;
1088 int maxY, maxZ;
1089 vtkIdType inIncX, inIncY, inIncZ;
1090 vtkIdType outIncX, outIncY, outIncZ;
1091 int rowLength;
1092
1093 // find the region to loop over
1094 rowLength = (outExt[1] - outExt[0] + 1) * inData->GetNumberOfScalarComponents();
1095 maxY = outExt[3] - outExt[2];
1096 maxZ = outExt[5] - outExt[4];
1097
1098 // Get increments to march through data
1099 inData->GetContinuousIncrements(outExt, inIncX, inIncY, inIncZ);
1100 outData->GetContinuousIncrements(outExt, outIncX, outIncY, outIncZ);
1101
1102 // Loop through output pixels
1103 for (idxZ = 0; idxZ <= maxZ; idxZ++)
1104 {
1105 for (idxY = 0; idxY <= maxY; idxY++)
1106 {
1107 for (idxR = 0; idxR < rowLength; idxR++)
1108 {
1109 // Pixel operation
1110 *outPtr = static_cast<OT>(*inPtr);
1111 outPtr++;
1112 inPtr++;
1113 }
1114 outPtr += outIncY;
1115 inPtr += inIncY;
1116 }
1117 outPtr += outIncZ;
1118 inPtr += inIncZ;
1119 }
1120}
1121
1122//------------------------------------------------------------------------------
1123template <class T>

Callers 1

CopyAndCastFromMethod · 0.85

Calls 6

GetDataTypeMethod · 0.45
GetScalarsMethod · 0.45
GetPointDataMethod · 0.45

Tested by

no test coverage detected