IM_OFFSETS45

Section: C Library Functions (3)
Updated: 28 May 1991
Index Return to Main Contents
 

NAME

im_offsets45, im_offsets90, im_rotate_imask45, im_rotate_dmask45, im_rotate_imask90, im_rotate_dmask90 - rotate square masks  

SYNOPSIS

int *im_offsets45( size )
int size;

int *im_offsets90( size )
int size;

INTMASK *im_rotate_imask45( m, name )
INTMASK *m;
char *name;

DOUBLEMASK *im_rotate_dmask45( m, name )
DOUBLEMASK *m;
char *name;

INTMASK *im_rotate_imask90( m, name )
INTMASK *m;
char *name;

DOUBLEMASK *im_rotate_dmask90( m, name )
DOUBLEMASK *m;
char *name;

 

DESCRIPTION

These functions can be used to produce the integer offsets needed to rotate masks by 45 or 90 degrees clockwise.

im_offsets45() accepts only even size and returns a pointer to an int buffer of size*size. The program mallocs the buffer and puts into it the integer offsets needed to rotate a mask of even size size by 45 degrees. For instance if size is 3 the program returns the buffer 3 0 1 6 4 2 7 8 5 which is the offsets needed to rotate a mask with offsets 0 1 2 3 4 5 6 7 8. The function return a pointer to valid data on success or NULL on error. Since the program mallocs a buffer, the user should free the returned pointer accordingly.

im_offsets90() accepts any size and returns a pointer to an int buffer of size*size. The program mallocs the buffer and puts into it the integer offsets needed to rotate a mask of size size by 90 degrees. For instance if size is 3 the program returns the buffer 6 3 0 7 4 1 8 5 2 which is the offsets needed to rotate a mask with offsets 0 1 2 3 4 5 6 7 8. The function return a pointers to valid data on success or NULL on error. Since the program mallocs a buffer, the user should free the returned pointer accordingly.

im_rotate_imask45() rotates the INTMASK m by 45 degrees and returns the rotated mask. The filename member of the returned structure is set to name. The program allocates memory for the new mask and therefore the user must free the returned mask by a call to im_free_imask(3). The returned mask is rotated by 45 degrees clockwise. The function return a valid INTMASK pointer on success or NULL on error.

im_rotate_dmask45() rotates the DOUBLEMASK m by 45 degrees and returns the rotated mask. The filename member of the returned structure is set to name. The program allocates memory for the new mask and therefore the user must free the returned mask by a call to im_free_dmask(3). The returned mask is rotated by 45 degrees clockwise. The function return a valid DOUBLEMASK pointer on success or NULL on error.

im_rotate_imask90() rotates the INTMASK m by 90 degrees and returns the rotated mask. The filename member of the returned structure is set to name. The program allocates memory for the new mask and therefore the user must free the returned mask by a call to im_free_imask(3). The returned mask is rotated by 90 degrees clockwise. The function return a valid INTMASK pointer on success or NULL on error.

im_rotate_dmask90() rotates the DOUBLEMASK m by 90 degrees and returns the rotated mask. The filename member of the returned structure is set to name. The program allocates memory for the new mask and therefore the user must free the returned mask by a call to im_free_dmask(3). The returned mask is rotated by 90 degrees clockwise. The function return a valid DOUBLEMASK pointer on success or NULL on error.

 

RETURN VALUE

 

SEE ALSO

im_read_imask(3), im_read_dmask(3), im_free_imask(3), im_free_dmask(3), im_gradient(3), im_compass(3), im_conv(3).  

COPYRIGHT


N. Dessipris  

AUTHOR

N. Dessipris -28/05/1991