PgmCommon

PgmCommon — Various enums and macros used for common tasks.

Synopsis


#include <pgm/pgm.h>


#define     PGM_DEGREES_TO_RADIANS          (theta)
#define     PGM_RADIANS_TO_DEGREES          (theta)
#define     PGM_SINCOS                      (theta,s,c)
#define     PGM_FABSF                       (x)
enum        PgmError;

Description

Various enumerations and macros used by Pigment for common tasks.

Last reviewed on 2007-04-12 (0.1.5)

Details

PGM_DEGREES_TO_RADIANS()

#define PGM_DEGREES_TO_RADIANS(theta) ((theta) * (G_PI / 180.0f))

Converts from degrees to radians.

theta : an angle in degrees.

PGM_RADIANS_TO_DEGREES()

#define PGM_RADIANS_TO_DEGREES(theta) ((theta) * (180.0f / G_PI))

Converts from radians to degrees.

theta : an angle in radians.

PGM_SINCOS()

#define     PGM_SINCOS(theta,s,c)

Calculates sine and cosine of the angle theta simultaneously.

theta : a float representing an angle in radians.
s : the address of the float where the sine value is going to be stored.
c : the address of the float where the cosine value is going to be stored.

PGM_FABSF()

#define     PGM_FABSF(x)

Calculates the absolute value of float.

x : the floating-point number.

enum PgmError

typedef enum {
  PGM_ERROR_X,
  PGM_ERROR_OK
} PgmError;

Every Pigment method returns an error code from that list.

PGM_ERROR_X Generic error code.
PGM_ERROR_OK No error occured.