remove some casts
and use VIPS_AREA instead
This commit is contained in:
parent
42b04e48de
commit
34970d0cf2
@ -113,7 +113,7 @@ vips_getpoint_build( VipsObject *object )
|
||||
g_object_set( object,
|
||||
"out_array", out_array,
|
||||
NULL );
|
||||
vips_area_unref( (VipsArea *) out_array );
|
||||
vips_area_unref( VIPS_AREA( out_array ) );
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
@ -426,8 +426,8 @@ vips_linearv( VipsImage *in, VipsImage **out,
|
||||
VipsArea *area_b;
|
||||
int result;
|
||||
|
||||
area_a = (VipsArea *) vips_array_double_new( a, n );
|
||||
area_b = (VipsArea *) vips_array_double_new( b, n );
|
||||
area_a = VIPS_AREA( vips_array_double_new( a, n ) );
|
||||
area_b = VIPS_AREA( vips_array_double_new( b, n ) );
|
||||
|
||||
result = vips_call_split( "linear", ap, in, out, area_a, area_b );
|
||||
|
||||
|
@ -241,9 +241,9 @@ vips_max_build( VipsObject *object )
|
||||
"y_array", y_array,
|
||||
NULL );
|
||||
|
||||
vips_area_unref( (VipsArea *) out_array );
|
||||
vips_area_unref( (VipsArea *) x_array );
|
||||
vips_area_unref( (VipsArea *) y_array );
|
||||
vips_area_unref( VIPS_AREA( out_array ) );
|
||||
vips_area_unref( VIPS_AREA( x_array ) );
|
||||
vips_area_unref( VIPS_AREA( y_array ) );
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
@ -241,9 +241,9 @@ vips_min_build( VipsObject *object )
|
||||
"y_array", y_array,
|
||||
NULL );
|
||||
|
||||
vips_area_unref( (VipsArea *) out_array );
|
||||
vips_area_unref( (VipsArea *) x_array );
|
||||
vips_area_unref( (VipsArea *) y_array );
|
||||
vips_area_unref( VIPS_AREA( out_array ) );
|
||||
vips_area_unref( VIPS_AREA( x_array ) );
|
||||
vips_area_unref( VIPS_AREA( y_array ) );
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
@ -80,7 +80,7 @@ vips_arrayjoin_gen( VipsRegion *or, void *seq,
|
||||
VipsRegion **ir = (VipsRegion **) seq;
|
||||
VipsArrayjoin *join = (VipsArrayjoin *) b;
|
||||
VipsRect *r = &or->valid;
|
||||
int n = ((VipsArea *) join->in)->n;
|
||||
int n = VIPS_AREA( join->in )->n;
|
||||
|
||||
int i;
|
||||
|
||||
|
@ -3383,7 +3383,7 @@ im_Lab2XYZ_temp( IMAGE *in, IMAGE *out, double X0, double Y0, double Z0 )
|
||||
VipsArea *temp;
|
||||
VipsImage *x;
|
||||
|
||||
temp = (VipsArea *) vips_array_double_newv( 3, X0, Y0, Z0 );
|
||||
temp = VIPS_AREA( vips_array_double_newv( 3, X0, Y0, Z0 ) );
|
||||
if( vips_Lab2XYZ( in, &x, "temp", temp, NULL ) ) {
|
||||
vips_area_unref( temp );
|
||||
return( -1 );
|
||||
@ -3425,7 +3425,7 @@ im_XYZ2Lab_temp( IMAGE *in, IMAGE *out, double X0, double Y0, double Z0 )
|
||||
ary[0] = X0;
|
||||
ary[1] = Y0;
|
||||
ary[2] = Z0;
|
||||
temp = (VipsArea *) vips_array_double_new( ary, 3 );
|
||||
temp = VIPS_AREA( vips_array_double_new( ary, 3 ) );
|
||||
if( vips_XYZ2Lab( in, &x, "temp", temp, NULL ) ) {
|
||||
vips_area_unref( temp );
|
||||
return( -1 );
|
||||
@ -4562,9 +4562,9 @@ im__affinei( VipsImage *in, VipsImage *out,
|
||||
VipsArea *oarea;
|
||||
gboolean repack;
|
||||
|
||||
oarea = (VipsArea *) vips_array_int_newv( 4,
|
||||
oarea = VIPS_AREA( vips_array_int_newv( 4,
|
||||
trn->oarea.left, trn->oarea.top,
|
||||
trn->oarea.width, trn->oarea.height );
|
||||
trn->oarea.width, trn->oarea.height ) );
|
||||
|
||||
/* vips7 affine would repack labq and im_benchmark() depends upon
|
||||
* this.
|
||||
|
@ -274,7 +274,7 @@ vips_draw_circlev( VipsImage *image,
|
||||
VipsArea *area_ink;
|
||||
int result;
|
||||
|
||||
area_ink = (VipsArea *) vips_array_double_new( ink, n );
|
||||
area_ink = VIPS_AREA( vips_array_double_new( ink, n ) );
|
||||
result = vips_call_split( "draw_circle", ap,
|
||||
image, area_ink, cx, cy, radius );
|
||||
vips_area_unref( area_ink );
|
||||
|
@ -670,7 +670,7 @@ vips_draw_floodv( VipsImage *image,
|
||||
VipsArea *area_ink;
|
||||
int result;
|
||||
|
||||
area_ink = (VipsArea *) vips_array_double_new( ink, n );
|
||||
area_ink = VIPS_AREA( vips_array_double_new( ink, n ) );
|
||||
result = vips_call_split( "draw_flood", ap, image, area_ink, x, y );
|
||||
vips_area_unref( area_ink );
|
||||
|
||||
|
@ -322,7 +322,7 @@ vips_draw_linev( VipsImage *image,
|
||||
VipsArea *area_ink;
|
||||
int result;
|
||||
|
||||
area_ink = (VipsArea *) vips_array_double_new( ink, n );
|
||||
area_ink = VIPS_AREA( vips_array_double_new( ink, n ) );
|
||||
result = vips_call_split( "draw_line", ap,
|
||||
image, area_ink, x1, y1, x2, y2 );
|
||||
vips_area_unref( area_ink );
|
||||
|
@ -353,7 +353,7 @@ vips_draw_maskv( VipsImage *image,
|
||||
VipsArea *area_ink;
|
||||
int result;
|
||||
|
||||
area_ink = (VipsArea *) vips_array_double_new( ink, n );
|
||||
area_ink = VIPS_AREA( vips_array_double_new( ink, n ) );
|
||||
result = vips_call_split( "draw_mask", ap,
|
||||
image, area_ink, mask, x, y );
|
||||
vips_area_unref( area_ink );
|
||||
|
@ -219,7 +219,7 @@ vips_draw_rectv( VipsImage *image,
|
||||
VipsArea *area_ink;
|
||||
int result;
|
||||
|
||||
area_ink = (VipsArea *) vips_array_double_new( ink, n );
|
||||
area_ink = VIPS_AREA( vips_array_double_new( ink, n ) );
|
||||
result = vips_call_split( "draw_rect", ap,
|
||||
image, area_ink, left, top, width, height );
|
||||
vips_area_unref( area_ink );
|
||||
|
@ -805,7 +805,7 @@ write_blank( VipsForeignSaveDz *dz )
|
||||
* vips_black() to make sure we set Type correctly, otherwise we can
|
||||
* try saving a B_W image as PNG, with disasterous results.
|
||||
*/
|
||||
bg = (double *) vips_area_get_data( (VipsArea *) save->background,
|
||||
bg = (double *) vips_area_get_data( VIPS_AREA( save->background ),
|
||||
NULL, &n, NULL, NULL );
|
||||
|
||||
if( vips_black( &x, dz->tile_size, dz->tile_size, "bands", n, NULL ) )
|
||||
|
@ -1915,7 +1915,7 @@ vips_object_set_argument_from_string( VipsObject *object,
|
||||
/* Setting gvalue will have upped @array_image's count again,
|
||||
* go back to 1 so that gvalue has the only ref.
|
||||
*/
|
||||
vips_area_unref( (VipsArea *) array_image );
|
||||
vips_area_unref( VIPS_AREA( array_image ) );
|
||||
}
|
||||
else if( g_type_is_a( otype, VIPS_TYPE_OBJECT ) &&
|
||||
(oclass = g_type_class_ref( otype )) ) {
|
||||
|
@ -276,7 +276,7 @@ vips__type_leak( void )
|
||||
fprintf( stderr, "%d VipsArea alive\n",
|
||||
g_slist_length( vips_area_all ) );
|
||||
for( p = vips_area_all; p; p = p->next ) {
|
||||
VipsArea *area = (VipsArea *) p->data;
|
||||
VipsArea *area = VIPS_AREA( p->data );
|
||||
|
||||
fprintf( stderr, "\t%p count = %d, bytes = %zd\n",
|
||||
area, area->count, area->length );
|
||||
@ -1325,7 +1325,7 @@ transform_g_string_array_image( const GValue *src_value, GValue *dest_value )
|
||||
g_free( str );
|
||||
|
||||
g_value_set_boxed( dest_value, array_image );
|
||||
vips_area_unref( (VipsArea *) array_image );
|
||||
vips_area_unref( VIPS_AREA( array_image ) );
|
||||
}
|
||||
|
||||
GType
|
||||
|
@ -652,7 +652,7 @@ vips_affine( VipsImage *in, VipsImage **out,
|
||||
VipsArea *matrix;
|
||||
int result;
|
||||
|
||||
matrix = (VipsArea *) vips_array_double_newv( 4, a, b, c, d );
|
||||
matrix = VIPS_AREA( vips_array_double_newv( 4, a, b, c, d ) );
|
||||
|
||||
va_start( ap, d );
|
||||
result = vips_call_split( "affine", ap, in, out, matrix );
|
||||
|
Loading…
Reference in New Issue
Block a user