MedicalVisualization

1D Texture Interpolation

1D Textures | | Bilinear Interpolation

For the case of a nearest-neighbour interpolation (GL_NEAREST) the closest color value of the table for the index $t$ is:

$\displaystyle{ f_{nearest}(t) = RGB[\lfloor t \cdot n+0.5 \rfloor] }$

For the case of a linear interpolation (GL_LINEAR) we require the left- and right-hand color values for the index $t$:

$\displaystyle{ f_{left}(t) = RGB[\lfloor t \cdot n \rfloor] }$
$\displaystyle{ f_{right}(t) = RGB[\lfloor t \cdot n \rfloor + 1] }$

The interpolated color value is computed by linear interpolation of the above two color values with the interpolation weight $w$ with

$\displaystyle{ w = t \cdot n - \lfloor t \cdot n \rfloor }$

so that

$\displaystyle{ f(t) = (1-w) RGB[\lfloor t \cdot n \rfloor] + w RGB[\lfloor t \cdot n \rfloor + 1] }$

This interpolation scheme is done automatically by the graphics hardware requiring about 6 flops (per rasterized fragment). The same scheme applies to 2D (bilinear) and 3D textures (trilinear).

1D Textures | | Bilinear Interpolation

Options: