@@ -394,7 +394,7 @@ vips_text_build(VipsObject *object)
394
394
VipsImage * * t = (VipsImage * * ) vips_object_local_array (object , 3 );
395
395
396
396
VipsRect extents ;
397
- VipsImage * image ;
397
+ VipsImage * in ;
398
398
cairo_surface_t * surface ;
399
399
cairo_t * cr ;
400
400
cairo_status_t status ;
@@ -470,26 +470,26 @@ vips_text_build(VipsObject *object)
470
470
return -1 ;
471
471
}
472
472
473
- image = t [0 ] = vips_image_new_memory ();
474
- vips_image_init_fields (image ,
473
+ t [0 ] = vips_image_new_memory ();
474
+ vips_image_init_fields (t [ 0 ] ,
475
475
extents .width , extents .height , 4 ,
476
- VIPS_FORMAT_UCHAR , VIPS_CODING_NONE ,
477
- VIPS_INTERPRETATION_sRGB ,
476
+ VIPS_FORMAT_UCHAR , VIPS_CODING_NONE , VIPS_INTERPRETATION_sRGB ,
478
477
text -> dpi / 25.4 , text -> dpi / 25.4 );
479
- image -> Xoffset = extents .left ;
480
- image -> Yoffset = extents .top ;
478
+ t [ 0 ] -> Xoffset = extents .left ;
479
+ t [ 0 ] -> Yoffset = extents .top ;
481
480
482
- if (vips_image_pipelinev (image , VIPS_DEMAND_STYLE_ANY , NULL ) ||
483
- vips_image_write_prepare (image )) {
481
+ if (vips_image_pipelinev (t [ 0 ] , VIPS_DEMAND_STYLE_ANY , NULL ) ||
482
+ vips_image_write_prepare (t [ 0 ] )) {
484
483
g_mutex_unlock (vips_text_lock );
485
484
return -1 ;
486
485
}
486
+ in = t [0 ];
487
487
488
488
surface = cairo_image_surface_create_for_data (
489
- VIPS_IMAGE_ADDR (image , 0 , 0 ),
489
+ VIPS_IMAGE_ADDR (in , 0 , 0 ),
490
490
CAIRO_FORMAT_ARGB32 ,
491
- image -> Xsize , image -> Ysize ,
492
- VIPS_IMAGE_SIZEOF_LINE (image ));
491
+ in -> Xsize , in -> Ysize ,
492
+ VIPS_IMAGE_SIZEOF_LINE (in ));
493
493
494
494
status = cairo_surface_status (surface );
495
495
if (status ) {
@@ -512,29 +512,26 @@ vips_text_build(VipsObject *object)
512
512
g_mutex_unlock (vips_text_lock );
513
513
514
514
if (text -> rgba ) {
515
- int y ;
516
-
517
515
/* Cairo makes pre-multipled BRGA -- we must byteswap and
518
516
* unpremultiply.
519
517
*/
520
- for (y = 0 ; y < image -> Ysize ; y ++ )
518
+ for (int y = 0 ; y < in -> Ysize ; y ++ )
521
519
vips__premultiplied_bgra2rgba (
522
- (guint32 * )
523
- VIPS_IMAGE_ADDR (image , 0 , y ),
524
- image -> Xsize );
520
+ (guint32 * ) VIPS_IMAGE_ADDR (in , 0 , y ),
521
+ in -> Xsize );
525
522
}
526
523
else {
527
524
/* We just want the alpha channel.
528
525
*/
529
- if (vips_extract_band (image , & t [1 ], 3 , NULL ) ||
526
+ if (vips_extract_band (in , & t [1 ], 3 , NULL ) ||
530
527
vips_copy (t [1 ], & t [2 ],
531
528
"interpretation" , VIPS_INTERPRETATION_MULTIBAND ,
532
529
NULL ))
533
530
return -1 ;
534
- image = t [2 ];
531
+ in = t [2 ];
535
532
}
536
533
537
- if (vips_image_write (image , create -> out ))
534
+ if (vips_image_write (in , create -> out ))
538
535
return -1 ;
539
536
540
537
return 0 ;
0 commit comments