NAME
create_cosine - creates a cosine wave image
SYNOPSIS
#include "CVIPtoolkit.h"
#include "waves.h"
Image *create_cosine(int img_size, int frequency, int
choice)
<img_size> - number of rows (and columns) in new image
<frequency> - sine wave frequency
<choice> - enter 1 for horizontal, 2 for vertical cosine
wave
PATH
$CVIPHOME/GEOMETRY/cosine.c
DESCRIPTION
This function creates a horizontal or vertical cosine wave
image of size img_sizeXimg_size, of frequency 1 to 256. For
each pixel in a row, the pixel value is calculated as
{127 + 128*Cos(2*PI*f*j/img_size)}
where f is the frequency chosen by the user and j is the
column number.
TYPES AND CONSTANTS
RETURN VALUES
A pointer to the new image.
HISTORY
History information recorded: None
EXAMPLE
#include <CVIPtoolkit.h>
#include <CVIPimage.h>
#include <CVIPdef.h>
#include <CVIPdrawimg.h>
#include <CVIPconvert.h>
#include <CVIPview.h>
#define VIEWER "picture"
#define VIDEO_APP "SunVideo &"
void main()
{
Image *cvipImage;
IMAGE_FORMAT format;
char *outputfile;
setDisplay_Image(VIEWER, "Default");
/* the following call creates a image of size 100 x 100 wi
th frequency 32 and the cosine wave in the horizontal dir
ection */
cvipImage = create_cosine(100,32,1);
print_CVIP("\n\t\tEnter the Output File Name: ");
outputfile = getString_CVIP();
view_Image(cvipImage,outputfile);
getFileFormat_Image(cvipImage);
write_Image(cvipImage,outputfile,CVIP_NO,CVIP_NO,format,1)
;
free(outputfile);
}
SEE ALSO
libgeometry
AUTHOR
Copyright (C) 1996 SIUE - by Scott E. Umbaugh , Srinivas M
adiraju, and kun luo.