update comment

This commit is contained in:
Alexander 2018-03-26 17:34:56 +03:00
parent 3a5f0201f5
commit 845f4dbfe1

View File

@ -144,13 +144,16 @@ ImagingColorLUT3D_linear(Imaging imOut, Imaging imIn, int table_channels,
int size1D, int size2D, int size3D, int size1D, int size2D, int size3D,
INT16* table) INT16* table)
{ {
/* The fractions are a way to avoid overflow. /* This float to int conversion doesn't have rounding
For every pixel, we interpolate 8 elements from the table: error compensation (+ 0.5) for two reasons:
current and +1 for every dimension and they combinations. 1. As we don't hit the highest value,
If we hit the upper cells from the table, we can use one extra bit for precision.
+1 cells will be outside of the table. 2. For every pixel, we interpolate 8 elements from the table:
With this compensation we never hit the upper cells current and +1 for every dimension and they combinations.
but this also doesn't introduce any noticable difference. */ If we hit the upper cells from the table,
+1 cells will be outside of the table.
With this compensation we never hit the upper cells
but this also doesn't introduce any noticable difference. */
UINT32 scale1D = (size1D - 1) / 255.0 * (1<<SCALE_BITS); UINT32 scale1D = (size1D - 1) / 255.0 * (1<<SCALE_BITS);
UINT32 scale2D = (size2D - 1) / 255.0 * (1<<SCALE_BITS); UINT32 scale2D = (size2D - 1) / 255.0 * (1<<SCALE_BITS);
UINT32 scale3D = (size3D - 1) / 255.0 * (1<<SCALE_BITS); UINT32 scale3D = (size3D - 1) / 255.0 * (1<<SCALE_BITS);