Horus Doc || Global Function Guide || General documentation   | Function documentation  

HxSin

Synopsis

HxImageRep HxSin (HxImageRep img)

Input

HxImageRep img
The image you want to take the sine of.

Return value

HxImageRep
The pixelwise sine of the input image.

Description

This function takes the sine of every pixel value of the input image. For vector images, the sine of every element of the vector is taken.

Remarks

No possible errors
This function can not result in any errors.

Examples

Taking the sine of an image.

#include "HxImageRepGlobalFuncs.h"
#include "HxImageRep.h"

HxImageRep HxSinExample1() {
   HxSizes sizes(256, 256, 0);
   double data[256*256];
   for(int i=0; i<256; i++)
        for(int j=0; j<256; j++) {
                data[i+j*256]=(i/32.0)*(i/32.0);
   }
   HxImageRep img = HxMakeFromDoubleData(1, 2, sizes, data);
   img = HxSin(img);
   img = HxContrastStretch(img, 255.0);
   img = HxImageAsByte(img);

   return img;
}

int main(int argc, char* argv[])
{
    HxImageRep img = HxSinExample1();
    HxWriteFile(img, argv[1]);

    return 0;
}

HxSinResult1.gif

Output image of the HxSin example.

This example generates an images with a number of stripes, using the sine function.

See also

HxCos, HxTan, HxAsin, HxSinh,

Keywords

Unary, Trigonometric,


Generated on Mon Jan 27 15:45:01 2003 for GlobalFunctionGuide by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001