------------------------------------------------------------------------------ This method contains a switch statement that calls the correct templated function for the input region type. The output region must be of type double. This method does handle boundary conditions. The third axis is the component axis for the output.
| 162 | // must be of type double. This method does handle boundary conditions. |
| 163 | // The third axis is the component axis for the output. |
| 164 | void vtkImageSobel2D::ThreadedRequestData(vtkInformation* vtkNotUsed(request), |
| 165 | vtkInformationVector** inputVector, vtkInformationVector* vtkNotUsed(outputVector), |
| 166 | vtkImageData*** inData, vtkImageData** outData, int outExt[6], int id) |
| 167 | { |
| 168 | void *inPtr, *outPtr; |
| 169 | int inExt[6], wholeExt[6]; |
| 170 | |
| 171 | vtkInformation* inInfo = inputVector[0]->GetInformationObject(0); |
| 172 | inInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(), wholeExt); |
| 173 | this->InternalRequestUpdateExtent(inExt, outExt, wholeExt); |
| 174 | |
| 175 | inPtr = inData[0][0]->GetScalarPointerForExtent(inExt); |
| 176 | outPtr = outData[0]->GetScalarPointerForExtent(outExt); |
| 177 | |
| 178 | // this filter expects that output is type double. |
| 179 | if (outData[0]->GetScalarType() != VTK_DOUBLE) |
| 180 | { |
| 181 | vtkErrorMacro(<< "Execute: output ScalarType, " |
| 182 | << vtkImageScalarTypeNameMacro(outData[0]->GetScalarType()) |
| 183 | << ", must be double"); |
| 184 | return; |
| 185 | } |
| 186 | |
| 187 | // this filter cannot handle multi component input. |
| 188 | if (inData[0][0]->GetNumberOfScalarComponents() != 1) |
| 189 | { |
| 190 | vtkWarningMacro("Expecting input with only one component.\n"); |
| 191 | } |
| 192 | |
| 193 | switch (inData[0][0]->GetScalarType()) |
| 194 | { |
| 195 | vtkTemplateMacro(vtkImageSobel2DExecute(this, inData[0][0], static_cast<VTK_TT*>(inPtr), |
| 196 | outData[0], outExt, static_cast<double*>(outPtr), id, inInfo)); |
| 197 | default: |
| 198 | vtkErrorMacro(<< "Execute: Unknown ScalarType"); |
| 199 | return; |
| 200 | } |
| 201 | } |
| 202 | VTK_ABI_NAMESPACE_END |
nothing calls this directly
no test coverage detected