コード例 #1
0
ファイル: other_dispatch.c プロジェクト: imclab/libvips
/* Call im_fgrey via arg vector.
 */
static int
fgrey_vec( im_object *argv )
{
    int xsize = *((int *) argv[1]);
    int ysize = *((int *) argv[2]);

    return( im_fgrey( argv[0], xsize, ysize ) );
}
コード例 #2
0
ファイル: im_grey.c プロジェクト: alon/libvips
/**
 * im_grey:
 * @out: output image
 * @xsize: image size
 * @ysize: image size
 *
 * Create a one-band uchar image with the left-most column zero and the
 * right-most 255. Intermediate pixels are a linear ramp.
 *
 * See also: im_fgrey(), im_make_xy(), im_identity().
 *
 * Returns: 0 on success, -1 on error
 */
int
im_grey( IMAGE *out, const int xsize, const int ysize )
{
	IMAGE *t[2];

	/* Change range to [0,255].
	 */
	if( im_open_local_array( out, t, 2, "im_grey", "p" ) ||
		im_fgrey( t[0], xsize, ysize ) || 
		im_lintra( 255.0, t[0], 0.0, t[1] ) ||
		im_clip2fmt( t[1], out, IM_BANDFMT_UCHAR ) )
		return( -1 );

	return( 0 );
}