------------------------------------------------------------------------------
| 70 | |
| 71 | //------------------------------------------------------------------------------ |
| 72 | void vtkImageInterpolator::ComputeSupportSize(const double matrix[16], int size[3]) |
| 73 | { |
| 74 | int s = 1; |
| 75 | if (this->InterpolationMode == VTK_LINEAR_INTERPOLATION) |
| 76 | { |
| 77 | s = 2; |
| 78 | } |
| 79 | else if (this->InterpolationMode == VTK_CUBIC_INTERPOLATION) |
| 80 | { |
| 81 | s = 4; |
| 82 | } |
| 83 | |
| 84 | size[0] = s; |
| 85 | size[1] = s; |
| 86 | size[2] = s; |
| 87 | |
| 88 | if (matrix == nullptr) |
| 89 | { |
| 90 | return; |
| 91 | } |
| 92 | |
| 93 | // check whether matrix does perspective |
| 94 | if (matrix[12] != 0 || matrix[13] != 0 || matrix[14] != 0 || matrix[15] != 1.0) |
| 95 | { |
| 96 | return; |
| 97 | } |
| 98 | |
| 99 | // find conditions where matrix maps integers to integer |
| 100 | for (int i = 0; i < 3; i++) |
| 101 | { |
| 102 | int integerRow = 1; |
| 103 | for (int j = 0; j < 4; j++) |
| 104 | { |
| 105 | // verify that the element is an integer |
| 106 | double x = matrix[4 * i + j]; |
| 107 | // check fraction that remains after floor operation |
| 108 | double f; |
| 109 | vtkInterpolationMath::Floor(x, f); |
| 110 | integerRow &= (f == 0); |
| 111 | } |
| 112 | // no extra support required in this direction |
| 113 | if (integerRow) |
| 114 | { |
| 115 | size[i] = 1; |
| 116 | } |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | //------------------------------------------------------------------------------ |
| 121 | void vtkImageInterpolator::InternalDeepCopy(vtkAbstractImageInterpolator* a) |
no outgoing calls
no test coverage detected