From 58eae72a150e3cc4bcffbfe605e8a65d26c481f3 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Fri, 29 Jan 2010 14:26:29 +0000 Subject: [PATCH] im_flip* gtkdoc --- libvips/conversion/im_fliphor.c | 55 +++++++++++++-------------------- libvips/conversion/im_flipver.c | 55 +++++++++++++-------------------- 2 files changed, 42 insertions(+), 68 deletions(-) diff --git a/libvips/conversion/im_fliphor.c b/libvips/conversion/im_fliphor.c index d4f14587..a8be9bfb 100644 --- a/libvips/conversion/im_fliphor.c +++ b/libvips/conversion/im_fliphor.c @@ -1,11 +1,5 @@ -/* @(#) Flips image left-right. - * @(#) - * @(#) Usage: - * @(#) - * @(#) int im_fliphor( IMAGE *in, IMAGE *out ) - * @(#) - * @(#) Returns 0 on sucess and -1 on error - * @(#) +/* im_fliphor + * * Copyright: 1990, N. Dessipris * Written on: 28/10/91 * Updated on: @@ -18,6 +12,9 @@ * - sets Xoffset / Yoffset * 24/3/09 * - 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 ); } -/* 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 im_fliphor( IMAGE *in, IMAGE *out ) { - /* Check args. - */ - if( im_piocheck( in, out ) ) - return( -1 ); - if( in->Coding != IM_CODING_NONE && - in->Coding != IM_CODING_LABQ && - 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 ) ) + if( im_piocheck( in, out ) || + im_check_coding_known( "im_fliphor", in ) || + im_cp_desc( out, in ) || + im_demand_hint( out, IM_THINSTRIP, in, NULL ) || + im_generate( out, + im_start_one, flip_gen, im_stop_one, in, NULL ) ) return( -1 ); out->Xoffset = in->Xsize; diff --git a/libvips/conversion/im_flipver.c b/libvips/conversion/im_flipver.c index 66e065b2..cefe9e3a 100644 --- a/libvips/conversion/im_flipver.c +++ b/libvips/conversion/im_flipver.c @@ -1,11 +1,5 @@ -/* @(#) Flips image up-down. - * @(#) - * @(#) Usage: - * @(#) - * @(#) int im_flipver( IMAGE *in, IMAGE *out ) - * @(#) - * @(#) Returns 0 on sucess and -1 on error - * @(#) +/* im_flipver + * * Copyright: 1990, N. Dessipris * Written on: 28/10/91 * Updated on: @@ -20,6 +14,9 @@ * - sets Xoffset / Yoffset * 24/3/09 * - 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 ); } -/* 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 im_flipver( IMAGE *in, IMAGE *out ) { - /* Check args. - */ - if( im_piocheck( in, out ) ) - return( -1 ); - if( in->Coding != IM_CODING_NONE && - in->Coding != IM_CODING_LABQ && - 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 ) ) + if( im_piocheck( in, out ) || + im_check_coding_known( "im_flipver", in ) || + im_cp_desc( out, in ) || + im_demand_hint( out, IM_THINSTRIP, in, NULL ) || + im_generate( out, + im_start_one, flip_gen, im_stop_one, in, NULL ) ) return( -1 ); out->Xoffset = 0;