(hopefully) fixed the window_offset compile errors

This commit is contained in:
Nicolas Robidoux 2010-05-16 15:42:57 +00:00
parent 504221925f
commit b95939f0e1
3 changed files with 632 additions and 269 deletions

View File

@ -60,7 +60,7 @@ typedef struct _VipsInterpolate {
* function for it to speed up dispatch. Write to the memory at "out",
* interpolate the value at position (x, y) in "in".
*/
typedef void (*VipsInterpolateMethod)( VipsInterpolate *,
typedef void (*VipsInterpolateMethod)( VipsInterpolate *,
PEL *out, REGION *in, double x, double y );
typedef struct _VipsInterpolateClass {
@ -79,14 +79,15 @@ typedef struct _VipsInterpolateClass {
*/
int window_size;
/* Stencils are offset by this much. Default to window_size / 2
* (centering) if undefined.
/* Stencils are offset by this much. Default to window_size / 2
* (centering) if undefined.
*/
int (*get_window_offset)( VipsInterpolate * );
int window_offset;
} VipsInterpolateClass;
GType vips_interpolate_get_type( void );
void vips_interpolate( VipsInterpolate *interpolate,
void vips_interpolate( VipsInterpolate *interpolate,
PEL *out, REGION *in, double x, double y );
VipsInterpolateMethod vips_interpolate_get_method( VipsInterpolate * );
int vips_interpolate_get_window_size( VipsInterpolate *interpolate );
@ -100,7 +101,7 @@ int vips_interpolate_get_window_offset( VipsInterpolate *interpolate );
/* How many bits of precision we keep for interpolation, ie. where the decimal
* is in the fixed-point tables. For 16-bit pixels, we need 16 bits for the
* data and 4 bits to add 16 values together. That leaves 12 bits for the
* data and 4 bits to add 16 values together. That leaves 12 bits for the
* fractional part.
*/
#define VIPS_INTERPOLATE_SHIFT (12)
@ -112,7 +113,7 @@ VipsInterpolate *vips_interpolate_nearest_static( void );
VipsInterpolate *vips_interpolate_bilinear_static( void );
VipsInterpolate *vips_interpolate_bicubic_static( void );
/* Convenience: make an interpolator from a nickname. g_object_unref() when
/* Convenience: make an interpolator from a nickname. g_object_unref() when
* you're done with it.
*/
VipsInterpolate *vips_interpolate_new( const char *nickname );

View File

@ -107,9 +107,15 @@ vips_interpolate_real_get_window_size( VipsInterpolate *interpolate )
static int
vips_interpolate_real_get_window_offset( VipsInterpolate *interpolate )
{
/* Default to half window size.
*/
return( vips_interpolate_get_window_size( interpolate ) / 2 );
VipsInterpolateClass *class = VIPS_INTERPOLATE_GET_CLASS( interpolate );
g_assert( class->window_offset != -1 );
return( class->window_offset );
/* /\* Default to half window size. */
/* *\/ */
/* return( vips_interpolate_get_window_size( interpolate ) / 2 ); */
}
static void
@ -126,6 +132,7 @@ vips_interpolate_class_init( VipsInterpolateClass *class )
class->get_window_size = vips_interpolate_real_get_window_size;
class->get_window_offset = vips_interpolate_real_get_window_offset;
class->window_size = -1;
class->window_offset = -1;
}
static void
@ -269,7 +276,7 @@ vips_interpolate_nearest_new( void )
/* Convenience: return a static nearest you don't need to free.
*/
VipsInterpolate *
<vips_interpolate_nearest_static( void )
vips_interpolate_nearest_static( void )
{
static VipsInterpolate *interpolate = NULL;

File diff suppressed because it is too large Load Diff