| 82 | } |
| 83 | |
| 84 | void vtkImageNoiseSource::ExecuteDataWithInformation(vtkDataObject* output, vtkInformation* outInfo) |
| 85 | { |
| 86 | vtkImageData* data = this->AllocateOutputData(output, outInfo); |
| 87 | |
| 88 | if (data->GetScalarType() != VTK_DOUBLE) |
| 89 | { |
| 90 | vtkErrorMacro("Execute: This source only outputs doubles"); |
| 91 | } |
| 92 | |
| 93 | vtkImageProgressIterator<double> outIt(data, data->GetExtent(), this, 0); |
| 94 | |
| 95 | // Loop through output pixels |
| 96 | while (!outIt.IsAtEnd()) |
| 97 | { |
| 98 | double* outSI = outIt.BeginSpan(); |
| 99 | double* outSIEnd = outIt.EndSpan(); |
| 100 | while (outSI != outSIEnd) |
| 101 | { |
| 102 | // now process the components |
| 103 | *outSI = this->Minimum + (this->Maximum - this->Minimum) * vtkMath::Random(); |
| 104 | outSI++; |
| 105 | } |
| 106 | outIt.NextSpan(); |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | void vtkImageNoiseSource::PrintSelf(ostream& os, vtkIndent indent) |
| 111 | { |
nothing calls this directly
no test coverage detected