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

HxCos

Synopsis

HxImageRep HxCos (HxImageRep img)

Input

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

Return value

HxImageRep
The pixelwise cosine of the input image.

Description

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

Remarks

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

Examples

Taking the cosine of an image.

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

HxImageRep HxCosExample1() {
   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 = HxCos(img);
   img = HxContrastStretch(img, 255.0);
   img = HxImageAsByte(img);

   return img;
}

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

    return 0;
}

HxCosResult1.gif

Output image of the HxCos example.

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

See also

HxSin, HxTan, HxAcos, HxCosh,

Keywords

Unary, Trigonometric,


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