NAME
gray_multiply - multiplies each pixel by a fixed ratio
SYNOPSIS
#include <CVIPtoolkit.h>
#include <CVIPimage.h>
#include <CVIPmatrix.h>
Image *gray_multiply(Image *input,float ratio)
<input> - pointer to an Image
<ratio> - multiplier
PATH
$CVIPHOME/HISTOGRAM/graylevel_mod.c
DESCRIPTION
The function gray_multiply multiplies each pixel in an image
by a fixed value. The function clips to 0 and 255, and
requires CVIP_BYTE type input.
TYPES AND CONSTANTS
None
RETURN VALUES
Pointer to an image
HISTORY
History information recorded: None
#include <CVIPtoolkit.h>
#include <CVIPimage.h>
#include <CVIPconvert.h>
#include <CVIPview.h>
#include "histogram.h"
#define VIEWER "picture"
#define VIDEO_APP "SunVideo &"
void main()
{
Image *cvipImage;
IMAGE_FORMAT format;
char *inputfile,*outputfile;
setDisplay_Image(VIEWER, "Default");
print_CVIP("\n\t\tEnter the Input File Name: ");
inputfile =(char *) getString_CVIP();
format = getFormat_CVIP(inputfile);
cvipImage = read_Image(inputfile, 1);
view_Image(cvipImage, inputfile);
free(inputfile);
/* the following call multiplies each pixel value by
a factor of 2.0 with clipping at 255 */
cvipImage = gray_multiply(cvipImage,2.0);
print_CVIP("\n\t\tEnter the Output File Name: ");
outputfile = getString_CVIP();
view_Image(cvipImage,outputfile);
write_Image(cvipImage,outputfile,CVIP_NO,CVIP_NO,format,1);
free(outputfile);
}
SEE ALSO
libhisto, gray_multiply2
AUTHOR
Copyright (C) 1996 SIUE - by Scott E. Umbaugh and Kun Luo.