im_rot*() gtkdoc
This commit is contained in:
parent
e79555000b
commit
f4fd407740
@ -1,10 +1,5 @@
|
|||||||
/* @(#) rotates an image 180 degrees
|
/* im_rot180
|
||||||
* @(#) Usage:
|
*
|
||||||
* @(#) im_rot180(in, out)
|
|
||||||
* @(#) IMAGE *in, *out;
|
|
||||||
* @(#)
|
|
||||||
* @(#) Returns 0 on sucess and -1 on error
|
|
||||||
* @(#)
|
|
||||||
* Copyright: 1991, N. Dessipris
|
* Copyright: 1991, N. Dessipris
|
||||||
* Written on: 28/10/91
|
* Written on: 28/10/91
|
||||||
* Updated on: 2/4/92, J.Cupitt
|
* Updated on: 2/4/92, J.Cupitt
|
||||||
@ -25,6 +20,9 @@
|
|||||||
* - sets Xoffset / Yoffset
|
* - sets Xoffset / Yoffset
|
||||||
* 24/3/09
|
* 24/3/09
|
||||||
* - added IM_CODING_RAD support
|
* - added IM_CODING_RAD support
|
||||||
|
* 1/2/10
|
||||||
|
* - cleanups
|
||||||
|
* - gtkdoc
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -68,8 +66,6 @@
|
|||||||
#include <dmalloc.h>
|
#include <dmalloc.h>
|
||||||
#endif /*WITH_DMALLOC*/
|
#endif /*WITH_DMALLOC*/
|
||||||
|
|
||||||
/* Rotate a small piece.
|
|
||||||
*/
|
|
||||||
static int
|
static int
|
||||||
rot180_gen( REGION *or, void *seq, void *a, void *b )
|
rot180_gen( REGION *or, void *seq, void *a, void *b )
|
||||||
{
|
{
|
||||||
@ -130,30 +126,28 @@ rot180_gen( REGION *or, void *seq, void *a, void *b )
|
|||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* im_rot180:
|
||||||
|
* @in: input image
|
||||||
|
* @out: output image
|
||||||
|
*
|
||||||
|
* Rotate an image 180 degrees.
|
||||||
|
*
|
||||||
|
* See also: im_rot90(), im_rot270(), im_affinei_all().
|
||||||
|
*
|
||||||
|
* Returns: 0 on success, -1 on error
|
||||||
|
*/
|
||||||
int
|
int
|
||||||
im_rot180( IMAGE *in, IMAGE *out )
|
im_rot180( IMAGE *in, IMAGE *out )
|
||||||
{
|
{
|
||||||
/* Make output image.
|
if( im_piocheck( in, out ) ||
|
||||||
*/
|
im_check_coding_known( "im_rot180", in ) )
|
||||||
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_rot180", "%s",
|
|
||||||
_( "Coding should be NONE, LABQ or RAD" ) );
|
|
||||||
return( -1 );
|
|
||||||
}
|
|
||||||
if( im_cp_desc( out, in ) )
|
|
||||||
return( -1 );
|
return( -1 );
|
||||||
|
|
||||||
/* We are fastest with thinstrip.
|
if( im_cp_desc( out, in ) ||
|
||||||
*/
|
im_demand_hint( out, IM_THINSTRIP, in, NULL ) )
|
||||||
if( im_demand_hint( out, IM_THINSTRIP, in, NULL ) )
|
|
||||||
return( -1 );
|
return( -1 );
|
||||||
|
|
||||||
/* Generate!
|
|
||||||
*/
|
|
||||||
if( im_generate( out,
|
if( im_generate( out,
|
||||||
im_start_one, rot180_gen, im_stop_one, in, NULL ) )
|
im_start_one, rot180_gen, im_stop_one, in, NULL ) )
|
||||||
return( -1 );
|
return( -1 );
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
/* @(#) rotates an image 270 degrees
|
/* im_rot270
|
||||||
* @(#) Usage:
|
*
|
||||||
* @(#) im_rot270(in, out)
|
|
||||||
* @(#) IMAGE *in, *out;
|
|
||||||
* @(#)
|
|
||||||
* @(#) Returns 0 on sucess and -1 on error
|
|
||||||
* @(#)
|
|
||||||
* Copyright: 1991, N. Dessipris
|
* Copyright: 1991, N. Dessipris
|
||||||
* Written on: 28/10/91
|
* Written on: 28/10/91
|
||||||
* Updated on: 2/4/92, J.Cupitt
|
* Updated on: 2/4/92, J.Cupitt
|
||||||
@ -26,6 +21,9 @@
|
|||||||
* - sets Xoffset / Yoffset
|
* - sets Xoffset / Yoffset
|
||||||
* 24/3/09
|
* 24/3/09
|
||||||
* - added IM_CODING_RAD support
|
* - added IM_CODING_RAD support
|
||||||
|
* 1/2/10
|
||||||
|
* - cleanups
|
||||||
|
* - gtkdoc
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -132,32 +130,30 @@ rot270_gen( REGION *or, void *seq, void *a, void *b )
|
|||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* im_rot270:
|
||||||
|
* @in: input image
|
||||||
|
* @out: output image
|
||||||
|
*
|
||||||
|
* Rotate an image 270 degrees.
|
||||||
|
*
|
||||||
|
* See also: im_rot180(), im_rot90(), im_affinei_all().
|
||||||
|
*
|
||||||
|
* Returns: 0 on success, -1 on error
|
||||||
|
*/
|
||||||
int
|
int
|
||||||
im_rot270( IMAGE *in, IMAGE *out )
|
im_rot270( IMAGE *in, IMAGE *out )
|
||||||
{
|
{
|
||||||
/* Make output image.
|
if( im_piocheck( in, out ) ||
|
||||||
*/
|
im_check_coding_known( "im_rot270", in ) )
|
||||||
if( im_piocheck( in, out ) )
|
|
||||||
return( -1 );
|
return( -1 );
|
||||||
if( in->Coding != IM_CODING_NONE &&
|
|
||||||
in->Coding != IM_CODING_LABQ &&
|
if( im_cp_desc( out, in ) ||
|
||||||
in->Coding != IM_CODING_RAD ) {
|
im_demand_hint( out, IM_SMALLTILE, in, NULL ) )
|
||||||
im_error( "im_rot270", "%s",
|
|
||||||
_( "Coding should be NONE, LABQ or RAD" ) );
|
|
||||||
return( -1 );
|
|
||||||
}
|
|
||||||
if( im_cp_desc( out, in ) )
|
|
||||||
return( -1 );
|
return( -1 );
|
||||||
out->Xsize = in->Ysize;
|
out->Xsize = in->Ysize;
|
||||||
out->Ysize = in->Xsize;
|
out->Ysize = in->Xsize;
|
||||||
|
|
||||||
/* We want smalltile if possible.
|
|
||||||
*/
|
|
||||||
if( im_demand_hint( out, IM_SMALLTILE, in, NULL ) )
|
|
||||||
return( -1 );
|
|
||||||
|
|
||||||
/* Generate!
|
|
||||||
*/
|
|
||||||
if( im_generate( out,
|
if( im_generate( out,
|
||||||
im_start_one, rot270_gen, im_stop_one, in, NULL ) )
|
im_start_one, rot270_gen, im_stop_one, in, NULL ) )
|
||||||
return( -1 );
|
return( -1 );
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
/* @(#) rotates an image 90 degrees
|
/* im_rot90
|
||||||
* @(#) Usage:
|
*
|
||||||
* @(#) im_rot90(in, out)
|
|
||||||
* @(#) IMAGE *in, *out;
|
|
||||||
* @(#)
|
|
||||||
* @(#) Returns 0 on sucess and -1 on error
|
|
||||||
* @(#)
|
|
||||||
* Copyright: 1991, N. Dessipris
|
* Copyright: 1991, N. Dessipris
|
||||||
* Written on: 28/10/91
|
* Written on: 28/10/91
|
||||||
* Updated on: 2/4/92, J.Cupitt
|
* Updated on: 2/4/92, J.Cupitt
|
||||||
@ -26,6 +21,9 @@
|
|||||||
* - sets Xoffset / Yoffset
|
* - sets Xoffset / Yoffset
|
||||||
* 24/3/09
|
* 24/3/09
|
||||||
* - added IM_CODING_RAD support
|
* - added IM_CODING_RAD support
|
||||||
|
* 1/2/10
|
||||||
|
* - cleanups
|
||||||
|
* - gtkdoc
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -132,32 +130,30 @@ rot90_gen( REGION *or, void *seq, void *a, void *b )
|
|||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* im_rot90:
|
||||||
|
* @in: input image
|
||||||
|
* @out: output image
|
||||||
|
*
|
||||||
|
* Rotate an image 90 degrees.
|
||||||
|
*
|
||||||
|
* See also: im_rot180(), im_rot270(), im_affinei_all().
|
||||||
|
*
|
||||||
|
* Returns: 0 on success, -1 on error
|
||||||
|
*/
|
||||||
int
|
int
|
||||||
im_rot90( IMAGE *in, IMAGE *out )
|
im_rot90( IMAGE *in, IMAGE *out )
|
||||||
{
|
{
|
||||||
/* Make output image.
|
if( im_piocheck( in, out ) ||
|
||||||
*/
|
im_check_coding_known( "im_rot90", in ) )
|
||||||
if( im_piocheck( in, out ) )
|
|
||||||
return( -1 );
|
return( -1 );
|
||||||
if( in->Coding != IM_CODING_NONE &&
|
|
||||||
in->Coding != IM_CODING_LABQ &&
|
if( im_cp_desc( out, in ) ||
|
||||||
in->Coding != IM_CODING_RAD ) {
|
im_demand_hint( out, IM_SMALLTILE, in, NULL ) )
|
||||||
im_error( "im_rot90", "%s",
|
|
||||||
_( "Coding should be NONE, LABQ or RAD" ) );
|
|
||||||
return( -1 );
|
|
||||||
}
|
|
||||||
if( im_cp_desc( out, in ) )
|
|
||||||
return( -1 );
|
return( -1 );
|
||||||
out->Xsize = in->Ysize;
|
out->Xsize = in->Ysize;
|
||||||
out->Ysize = in->Xsize;
|
out->Ysize = in->Xsize;
|
||||||
|
|
||||||
/* We want smalltile if possible.
|
|
||||||
*/
|
|
||||||
if( im_demand_hint( out, IM_SMALLTILE, in, NULL ) )
|
|
||||||
return( -1 );
|
|
||||||
|
|
||||||
/* Generate!
|
|
||||||
*/
|
|
||||||
if( im_generate( out,
|
if( im_generate( out,
|
||||||
im_start_one, rot90_gen, im_stop_one, in, NULL ) )
|
im_start_one, rot90_gen, im_stop_one, in, NULL ) )
|
||||||
return( -1 );
|
return( -1 );
|
||||||
|
Loading…
Reference in New Issue
Block a user