NAME

     create_sine - creates a sine wave image

SYNOPSIS

      #include "CVIPtoolkit.h"
      #include "waves.h"

     Image *create_sine(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 sine wave

PATH

     $CVIPHOME/GEOMETRY/sine.c

DESCRIPTION

     This function creates a horizontal  or  vertical  sine  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*Sin2(PI)*x*f}, where f is the frequency chosen by the
     user and x is the row 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
     with  freq  uency  32 and the sine wave is in the horizontal
     direction */

      cvipImage = create_sine(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
     Madiraju, and Kun Luo .