Synopsis
HxImageRep HxSin (HxImageRep img)
Input
HxImageRep img
Return value
HxImageRep
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
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; }
Output image of the HxSin example.
This example generates an images with a number of stripes, using the sine function.
See also
Keywords
Unary, Trigonometric,