create funcs always make MULTIBAND
Before, they could make B_W for one-band output. This caused problems with (for example) two black image bandjoined: the second band then looked like an alpha to hasalpha() and enabled premultiply/unpremultiply for operations like affine. Now, it's always MULTIBAND. This is the generic multiband image type, so you don't get any unexpected alpha handling.
This commit is contained in:
parent
0dd6b095aa
commit
aebb8af803
@ -11,6 +11,7 @@
|
|||||||
- better header sniffing for small files
|
- better header sniffing for small files
|
||||||
- drop incompatible ICC profiles before save
|
- drop incompatible ICC profiles before save
|
||||||
- better hasalpha rules
|
- better hasalpha rules
|
||||||
|
- create funcs always make MULTIBAND (ie. no alpha)
|
||||||
|
|
||||||
12/3/18 started 8.6.4
|
12/3/18 started 8.6.4
|
||||||
- better fitting of fonts with overhanging edges, thanks Adrià
|
- better fitting of fonts with overhanging edges, thanks Adrià
|
||||||
|
@ -15,6 +15,9 @@
|
|||||||
* - gtkdoc
|
* - gtkdoc
|
||||||
* 31/10/11
|
* 31/10/11
|
||||||
* - redo as a class
|
* - redo as a class
|
||||||
|
* 3/4/18
|
||||||
|
* - always write MULTIBAND, otherwise when we join up these things it'll
|
||||||
|
* look like we have an alpha
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -97,8 +100,7 @@ vips_black_build( VipsObject *object )
|
|||||||
vips_image_init_fields( create->out,
|
vips_image_init_fields( create->out,
|
||||||
black->width, black->height, black->bands,
|
black->width, black->height, black->bands,
|
||||||
VIPS_FORMAT_UCHAR, VIPS_CODING_NONE,
|
VIPS_FORMAT_UCHAR, VIPS_CODING_NONE,
|
||||||
black->bands == 1 ?
|
VIPS_INTERPRETATION_MULTIBAND,
|
||||||
VIPS_INTERPRETATION_B_W : VIPS_INTERPRETATION_MULTIBAND,
|
|
||||||
1.0, 1.0 );
|
1.0, 1.0 );
|
||||||
vips_image_pipelinev( create->out,
|
vips_image_pipelinev( create->out,
|
||||||
VIPS_DEMAND_STYLE_ANY, NULL );
|
VIPS_DEMAND_STYLE_ANY, NULL );
|
||||||
|
@ -134,7 +134,8 @@ vips_gaussmat_build( VipsObject *object )
|
|||||||
|
|
||||||
vips_image_init_fields( create->out,
|
vips_image_init_fields( create->out,
|
||||||
width, height, 1,
|
width, height, 1,
|
||||||
VIPS_FORMAT_DOUBLE, VIPS_CODING_NONE, VIPS_INTERPRETATION_B_W,
|
VIPS_FORMAT_DOUBLE, VIPS_CODING_NONE,
|
||||||
|
VIPS_INTERPRETATION_MULTIBAND,
|
||||||
1.0, 1.0 );
|
1.0, 1.0 );
|
||||||
vips_image_pipelinev( create->out,
|
vips_image_pipelinev( create->out,
|
||||||
VIPS_DEMAND_STYLE_ANY, NULL );
|
VIPS_DEMAND_STYLE_ANY, NULL );
|
||||||
|
@ -134,7 +134,7 @@ vips_gaussnoise_build( VipsObject *object )
|
|||||||
vips_image_init_fields( create->out,
|
vips_image_init_fields( create->out,
|
||||||
gaussnoise->width, gaussnoise->height, 1,
|
gaussnoise->width, gaussnoise->height, 1,
|
||||||
VIPS_FORMAT_FLOAT, VIPS_CODING_NONE,
|
VIPS_FORMAT_FLOAT, VIPS_CODING_NONE,
|
||||||
VIPS_INTERPRETATION_B_W, 1.0, 1.0 );
|
VIPS_INTERPRETATION_MULTIBAND, 1.0, 1.0 );
|
||||||
vips_image_pipelinev( create->out,
|
vips_image_pipelinev( create->out,
|
||||||
VIPS_DEMAND_STYLE_ANY, NULL );
|
VIPS_DEMAND_STYLE_ANY, NULL );
|
||||||
|
|
||||||
|
@ -153,7 +153,8 @@ vips_logmat_build( VipsObject *object )
|
|||||||
|
|
||||||
vips_image_init_fields( create->out,
|
vips_image_init_fields( create->out,
|
||||||
width, height, 1,
|
width, height, 1,
|
||||||
VIPS_FORMAT_DOUBLE, VIPS_CODING_NONE, VIPS_INTERPRETATION_B_W,
|
VIPS_FORMAT_DOUBLE, VIPS_CODING_NONE,
|
||||||
|
VIPS_INTERPRETATION_MULTIBAND,
|
||||||
1.0, 1.0 );
|
1.0, 1.0 );
|
||||||
vips_image_pipelinev( create->out,
|
vips_image_pipelinev( create->out,
|
||||||
VIPS_DEMAND_STYLE_ANY, NULL );
|
VIPS_DEMAND_STYLE_ANY, NULL );
|
||||||
|
@ -249,7 +249,7 @@ vips_perlin_build( VipsObject *object )
|
|||||||
vips_image_init_fields( create->out,
|
vips_image_init_fields( create->out,
|
||||||
perlin->width, perlin->height, 1,
|
perlin->width, perlin->height, 1,
|
||||||
perlin->uchar ? VIPS_FORMAT_UCHAR : VIPS_FORMAT_FLOAT,
|
perlin->uchar ? VIPS_FORMAT_UCHAR : VIPS_FORMAT_FLOAT,
|
||||||
VIPS_CODING_NONE, VIPS_INTERPRETATION_B_W,
|
VIPS_CODING_NONE, VIPS_INTERPRETATION_MULTIBAND,
|
||||||
1.0, 1.0 );
|
1.0, 1.0 );
|
||||||
vips_image_pipelinev( create->out,
|
vips_image_pipelinev( create->out,
|
||||||
VIPS_DEMAND_STYLE_ANY, NULL );
|
VIPS_DEMAND_STYLE_ANY, NULL );
|
||||||
|
@ -109,10 +109,9 @@ vips_point_build( VipsObject *object )
|
|||||||
return( -1 );
|
return( -1 );
|
||||||
in = t[2];
|
in = t[2];
|
||||||
|
|
||||||
/* uchar mode always does B_W. We don't want FOURIER or
|
/* We don't want FOURIER or whatever in this case.
|
||||||
* whatever in this case.
|
|
||||||
*/
|
*/
|
||||||
in->Type = VIPS_INTERPRETATION_B_W;
|
in->Type = VIPS_INTERPRETATION_MULTIBAND;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( vips_image_write( in, create->out ) )
|
if( vips_image_write( in, create->out ) )
|
||||||
@ -137,7 +136,7 @@ vips_point_class_init( VipsPointClass *class )
|
|||||||
class->point = NULL;
|
class->point = NULL;
|
||||||
class->min = -1.0;
|
class->min = -1.0;
|
||||||
class->max = 1.0;
|
class->max = 1.0;
|
||||||
class->interpretation = VIPS_INTERPRETATION_B_W;
|
class->interpretation = VIPS_INTERPRETATION_MULTIBAND;
|
||||||
|
|
||||||
VIPS_ARG_INT( class, "width", 2,
|
VIPS_ARG_INT( class, "width", 2,
|
||||||
_( "Width" ),
|
_( "Width" ),
|
||||||
|
@ -379,7 +379,8 @@ vips_text_build( VipsObject *object )
|
|||||||
|
|
||||||
vips_image_init_fields( create->out,
|
vips_image_init_fields( create->out,
|
||||||
text->bitmap.width, text->bitmap.rows, 1,
|
text->bitmap.width, text->bitmap.rows, 1,
|
||||||
VIPS_FORMAT_UCHAR, VIPS_CODING_NONE, VIPS_INTERPRETATION_B_W,
|
VIPS_FORMAT_UCHAR, VIPS_CODING_NONE,
|
||||||
|
VIPS_INTERPRETATION_MULTIBAND,
|
||||||
1.0, 1.0 );
|
1.0, 1.0 );
|
||||||
vips_image_pipelinev( create->out,
|
vips_image_pipelinev( create->out,
|
||||||
VIPS_DEMAND_STYLE_ANY, NULL );
|
VIPS_DEMAND_STYLE_ANY, NULL );
|
||||||
|
@ -281,7 +281,8 @@ vips_worley_build( VipsObject *object )
|
|||||||
|
|
||||||
vips_image_init_fields( create->out,
|
vips_image_init_fields( create->out,
|
||||||
worley->width, worley->height, 1,
|
worley->width, worley->height, 1,
|
||||||
VIPS_FORMAT_FLOAT, VIPS_CODING_NONE, VIPS_INTERPRETATION_B_W,
|
VIPS_FORMAT_FLOAT, VIPS_CODING_NONE,
|
||||||
|
VIPS_INTERPRETATION_MULTIBAND,
|
||||||
1.0, 1.0 );
|
1.0, 1.0 );
|
||||||
vips_image_pipelinev( create->out,
|
vips_image_pipelinev( create->out,
|
||||||
VIPS_DEMAND_STYLE_ANY, NULL );
|
VIPS_DEMAND_STYLE_ANY, NULL );
|
||||||
|
Loading…
Reference in New Issue
Block a user