This commit is contained in:
John Cupitt 2009-03-18 16:47:17 +00:00
parent 42827cac86
commit 150cabd6c0
4 changed files with 21 additions and 23 deletions

View File

@ -3,6 +3,7 @@
- remove fading stuff from im_render() -- cleaner and simpler
- configure spots support for "restrict"
- reset dcm:display-range on magick read to help DICOM
- saner im_buildlut() behaviour
3/3/09 started 7.17.2
- im_magick2vips.c: allow funky bit depths, like 14 (thanks Mikkel)

View File

@ -1,18 +1,14 @@
/* @(#) Build a LUT from a set of x/y points. Eg. if input is
* @(#)
* @(#) 12 100
* @(#) 14 110
* @(#) 18 120
* @(#) 0 0
* @(#) 255 100
* @(#)
* @(#) we generate
* @(#)
* @(#) 100 (12)
* @(#) 105
* @(#) 110
* @(#) 112.5
* @(#) 115
* @(#) 117.5
* @(#) 120 (18)
* @(#) 0 0
* @(#) 1 0.4
* @(#) .. etc. linear interpolation
* @(#) 255 100
* @(#)
* @(#) The x/y points don't need to be sorted: we do that. You can have
* @(#) several Ys ... each becomes a band in the output LUT.
@ -21,6 +17,8 @@
* - from im_invertlut()
* 9/10/06
* - don't output x values
* 18/3/09
* - saner limit and rounding behaviour
*/
/*
@ -141,7 +139,7 @@ build_state( State *state, DOUBLEMASK *input )
if( v > xhigh )
xhigh = v;
}
state->lut_size = xhigh - xlow;
state->lut_size = xhigh - xlow + 1;
if( state->lut_size < 1 ) {
im_error( "im_buildlut", "%s", _( "x range too small" ) );
@ -202,7 +200,7 @@ buildlut( State *state, IMAGE *output )
const int dx = x2 - x1;
const double dy = y2 - y1;
for( i = 0; i < dx; i++, x += xsize - 1 )
for( i = 0; i <= dx; i++, x += xsize - 1 )
odata[x] = y1 + i * dy / dx;
}

View File

@ -501,8 +501,6 @@ vips_interpolate_snohalo1_interpolate( VipsInterpolate* restrict interpolate,
double absolute_x,
double absolute_y )
{
VipsInterpolateSnohalo1Class *snohalo1_class =
VIPS_INTERPOLATE_SNOHALO1_GET_CLASS( interpolate );
VipsInterpolateSnohalo1 *snohalo1 =
VIPS_INTERPOLATE_SNOHALO1( interpolate );
/*

View File

@ -13,18 +13,19 @@ im_buildlut( DOUBLEMASK *input, IMAGE *output )
constructs a LUT, interpolating a set of x/y points. Interpolation is strictly
piecewise linear. For example, if the input is:
12 100
14 110
18 120
0 0
128 20
255 100
we generate
100 (12)
105
110
112.5
115
117.5 (17)
0 0
1 0.01
.. etc. linear interpolation
128 20
129 20.5
.. etc. linear interpolation
255 100
the x axis (12 .. 17) is implied. The x/y points don't need to be
sorted: we do that. You can have several Ys ... each becomes a band in the