im_replicate() gtkdoc

This commit is contained in:
John Cupitt 2010-02-01 16:51:23 +00:00
parent af8a407b20
commit 66106832a9
2 changed files with 20 additions and 5 deletions

View File

@ -438,6 +438,8 @@ embed( IMAGE *in, IMAGE *out, int flag, int x, int y, int w, int h )
* </tbody> * </tbody>
* </tgroup> * </tgroup>
* *
* See also: im_extract(), im_insert().
*
* Returns: 0 on success, -1 on error. * Returns: 0 on success, -1 on error.
*/ */
int int

View File

@ -4,6 +4,8 @@
* *
* 15/4/04 * 15/4/04
* - some optimisations for some cases * - some optimisations for some cases
* 1/2/10
* - gtkdoc
*/ */
/* /*
@ -46,7 +48,6 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <assert.h>
#include <vips/vips.h> #include <vips/vips.h>
@ -117,7 +118,7 @@ replicate_gen( REGION *or, void *seq, void *a, void *b )
paint.left -= x; paint.left -= x;
paint.top -= y; paint.top -= y;
assert( !im_rect_isempty( &paint ) ); g_assert( !im_rect_isempty( &paint ) );
/* Render into or. /* Render into or.
*/ */
@ -130,6 +131,19 @@ replicate_gen( REGION *or, void *seq, void *a, void *b )
return( 0 ); return( 0 );
} }
/**
* im_replicate:
* @in: input image
* @out: output image
* @across: repeat @in this many times across
* @down: repeat @in this many times down
*
* Replicate an image x times horizontally and vertically.
*
* See also: im_embed(), im_copy().
*
* Returns: 0 on success, -1 on error.
*/
int int
im_replicate( IMAGE *in, IMAGE *out, int across, int down ) im_replicate( IMAGE *in, IMAGE *out, int across, int down )
{ {
@ -137,9 +151,8 @@ im_replicate( IMAGE *in, IMAGE *out, int across, int down )
im_error( "im_replicate", "%s", _( "bad parameters" ) ); im_error( "im_replicate", "%s", _( "bad parameters" ) );
return( -1 ); return( -1 );
} }
if( im_piocheck( in, out ) ) if( im_piocheck( in, out ) ||
return( -1 ); im_cp_desc( out, in ) )
if( im_cp_desc( out, in ) )
return( -1 ); return( -1 );
out->Xsize *= across; out->Xsize *= across;
out->Ysize *= down; out->Ysize *= down;