(hopefully) fixed the window_offset compile errors
This commit is contained in:
parent
504221925f
commit
b95939f0e1
@ -60,7 +60,7 @@ typedef struct _VipsInterpolate {
|
|||||||
* function for it to speed up dispatch. Write to the memory at "out",
|
* function for it to speed up dispatch. Write to the memory at "out",
|
||||||
* interpolate the value at position (x, y) in "in".
|
* 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 );
|
PEL *out, REGION *in, double x, double y );
|
||||||
|
|
||||||
typedef struct _VipsInterpolateClass {
|
typedef struct _VipsInterpolateClass {
|
||||||
@ -79,14 +79,15 @@ typedef struct _VipsInterpolateClass {
|
|||||||
*/
|
*/
|
||||||
int window_size;
|
int window_size;
|
||||||
|
|
||||||
/* Stencils are offset by this much. Default to window_size / 2
|
/* Stencils are offset by this much. Default to window_size / 2
|
||||||
* (centering) if undefined.
|
* (centering) if undefined.
|
||||||
*/
|
*/
|
||||||
int (*get_window_offset)( VipsInterpolate * );
|
int (*get_window_offset)( VipsInterpolate * );
|
||||||
|
int window_offset;
|
||||||
} VipsInterpolateClass;
|
} VipsInterpolateClass;
|
||||||
|
|
||||||
GType vips_interpolate_get_type( void );
|
GType vips_interpolate_get_type( void );
|
||||||
void vips_interpolate( VipsInterpolate *interpolate,
|
void vips_interpolate( VipsInterpolate *interpolate,
|
||||||
PEL *out, REGION *in, double x, double y );
|
PEL *out, REGION *in, double x, double y );
|
||||||
VipsInterpolateMethod vips_interpolate_get_method( VipsInterpolate * );
|
VipsInterpolateMethod vips_interpolate_get_method( VipsInterpolate * );
|
||||||
int vips_interpolate_get_window_size( VipsInterpolate *interpolate );
|
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
|
/* 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
|
* 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.
|
* fractional part.
|
||||||
*/
|
*/
|
||||||
#define VIPS_INTERPOLATE_SHIFT (12)
|
#define VIPS_INTERPOLATE_SHIFT (12)
|
||||||
@ -112,7 +113,7 @@ VipsInterpolate *vips_interpolate_nearest_static( void );
|
|||||||
VipsInterpolate *vips_interpolate_bilinear_static( void );
|
VipsInterpolate *vips_interpolate_bilinear_static( void );
|
||||||
VipsInterpolate *vips_interpolate_bicubic_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.
|
* you're done with it.
|
||||||
*/
|
*/
|
||||||
VipsInterpolate *vips_interpolate_new( const char *nickname );
|
VipsInterpolate *vips_interpolate_new( const char *nickname );
|
||||||
|
@ -107,9 +107,15 @@ vips_interpolate_real_get_window_size( VipsInterpolate *interpolate )
|
|||||||
static int
|
static int
|
||||||
vips_interpolate_real_get_window_offset( VipsInterpolate *interpolate )
|
vips_interpolate_real_get_window_offset( VipsInterpolate *interpolate )
|
||||||
{
|
{
|
||||||
/* Default to half window size.
|
VipsInterpolateClass *class = VIPS_INTERPOLATE_GET_CLASS( interpolate );
|
||||||
*/
|
|
||||||
return( vips_interpolate_get_window_size( interpolate ) / 2 );
|
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
|
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_size = vips_interpolate_real_get_window_size;
|
||||||
class->get_window_offset = vips_interpolate_real_get_window_offset;
|
class->get_window_offset = vips_interpolate_real_get_window_offset;
|
||||||
class->window_size = -1;
|
class->window_size = -1;
|
||||||
|
class->window_offset = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -269,7 +276,7 @@ vips_interpolate_nearest_new( void )
|
|||||||
/* Convenience: return a static nearest you don't need to free.
|
/* Convenience: return a static nearest you don't need to free.
|
||||||
*/
|
*/
|
||||||
VipsInterpolate *
|
VipsInterpolate *
|
||||||
<vips_interpolate_nearest_static( void )
|
vips_interpolate_nearest_static( void )
|
||||||
{
|
{
|
||||||
static VipsInterpolate *interpolate = NULL;
|
static VipsInterpolate *interpolate = NULL;
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user