im_flip* gtkdoc

This commit is contained in:
John Cupitt 2010-01-29 14:26:29 +00:00
parent 849823edcb
commit 58eae72a15
2 changed files with 42 additions and 68 deletions

View File

@ -1,11 +1,5 @@
/* @(#) Flips image left-right. /* im_fliphor
* @(#) *
* @(#) Usage:
* @(#)
* @(#) int im_fliphor( IMAGE *in, IMAGE *out )
* @(#)
* @(#) Returns 0 on sucess and -1 on error
* @(#)
* Copyright: 1990, N. Dessipris * Copyright: 1990, N. Dessipris
* Written on: 28/10/91 * Written on: 28/10/91
* Updated on: * Updated on:
@ -18,6 +12,9 @@
* - sets Xoffset / Yoffset * - sets Xoffset / Yoffset
* 24/3/09 * 24/3/09
* - added IM_CODING_RAD support * - added IM_CODING_RAD support
* 29/1/10
* - cleanups
* - gtkdoc
*/ */
/* /*
@ -117,36 +114,26 @@ flip_gen( REGION *or, void *seq, void *a, void *b )
return( 0 ); return( 0 );
} }
/* Copy image. /**
* im_fliphor:
* @in: input image
* @out: output image
*
* Flips an image left-right.
*
* See also: im_flipver(), im_rot90().
*
* Returns: 0 on success, -1 on error
*/ */
int int
im_fliphor( IMAGE *in, IMAGE *out ) im_fliphor( IMAGE *in, IMAGE *out )
{ {
/* Check args. if( im_piocheck( in, out ) ||
*/ im_check_coding_known( "im_fliphor", in ) ||
if( im_piocheck( in, out ) ) im_cp_desc( out, in ) ||
return( -1 ); im_demand_hint( out, IM_THINSTRIP, in, NULL ) ||
if( in->Coding != IM_CODING_NONE && im_generate( out,
in->Coding != IM_CODING_LABQ && im_start_one, flip_gen, im_stop_one, in, NULL ) )
in->Coding != IM_CODING_RAD ) {
im_error( "im_fliphor", "%s",
_( "Coding must be NONE, LABQ or RAD" ) );
return( -1 );
}
/* Prepare output header.
*/
if( im_cp_desc( out, in ) )
return( -1 );
/* Set demand hints.
*/
if( im_demand_hint( out, IM_THINSTRIP, in, NULL ) )
return( -1 );
/* Generate!
*/
if( im_generate( out, im_start_one, flip_gen, im_stop_one, in, NULL ) )
return( -1 ); return( -1 );
out->Xoffset = in->Xsize; out->Xoffset = in->Xsize;

View File

@ -1,11 +1,5 @@
/* @(#) Flips image up-down. /* im_flipver
* @(#) *
* @(#) Usage:
* @(#)
* @(#) int im_flipver( IMAGE *in, IMAGE *out )
* @(#)
* @(#) Returns 0 on sucess and -1 on error
* @(#)
* Copyright: 1990, N. Dessipris * Copyright: 1990, N. Dessipris
* Written on: 28/10/91 * Written on: 28/10/91
* Updated on: * Updated on:
@ -20,6 +14,9 @@
* - sets Xoffset / Yoffset * - sets Xoffset / Yoffset
* 24/3/09 * 24/3/09
* - added IM_CODING_RAD support * - added IM_CODING_RAD support
* 29/1/10
* - cleanups
* - gtkdoc
*/ */
/* /*
@ -108,36 +105,26 @@ flip_gen( REGION *or, void *seq, void *a, void *b )
return( 0 ); return( 0 );
} }
/* Copy image. /**
* im_flipver:
* @in: input image
* @out: output image
*
* Flips an image top-bottom.
*
* See also: im_fliphor(), im_rot90().
*
* Returns: 0 on success, -1 on error
*/ */
int int
im_flipver( IMAGE *in, IMAGE *out ) im_flipver( IMAGE *in, IMAGE *out )
{ {
/* Check args. if( im_piocheck( in, out ) ||
*/ im_check_coding_known( "im_flipver", in ) ||
if( im_piocheck( in, out ) ) im_cp_desc( out, in ) ||
return( -1 ); im_demand_hint( out, IM_THINSTRIP, in, NULL ) ||
if( in->Coding != IM_CODING_NONE && im_generate( out,
in->Coding != IM_CODING_LABQ && im_start_one, flip_gen, im_stop_one, in, NULL ) )
in->Coding != IM_CODING_RAD ) {
im_error( "im_flipver", "%s",
_( "Coding must be NONE, LABQ or RAD" ) );
return( -1 );
}
/* Prepare output header.
*/
if( im_cp_desc( out, in ) )
return( -1 );
/* Set demand hints.
*/
if( im_demand_hint( out, IM_THINSTRIP, in, NULL ) )
return( -1 );
/* Generate!
*/
if( im_generate( out, im_start_one, flip_gen, im_stop_one, in, NULL ) )
return( -1 ); return( -1 );
out->Xoffset = 0; out->Xoffset = 0;