gems - Graphic Gems - Graphic Support Methods
Quantum GenerateNoise( const Quantum pixel, const NoiseType noise_type );
void HSLTransform( const double hue, const double saturation, const double luminosity,
Quantum *red, Quantum *green, Quantum *blue
);
void Hull( const int x_offset, const int y_offset, const int polarity, const
unsigned int columns, const unsigned int rows, Quantum *f, Quantum
*g
);
ColorPacket InterpolateColor( Image *image, const double x_offset, const double y_offset );
void Modulate( double percent_hue, double percent_saturation, double percent_brightness,
Quantum *red, Quantum *green, Quantum *blue
)blue );
void TransformHSL( const Quantum red, const Quantum green, const Quantum blue, double *hue,
double *saturation, double *luminosity
);
void Upsample( const unsigned int width, const unsigned int height, const unsigned int
scaled_width, unsigned char *pixels
);
Method Contrast enhances the intensity differences between the lighter and darker elements of the image.
The format of the Contrast method is:
void Contrast(const int sign,Quantum *red,Quantum *green,Quantum *blue)
A description of each parameter follows:
A positive value enhances the contrast otherwise it is reduced.
A pointer to a pixel component of type Quantum.
Method GenerateNoise adds noise to a pixel.
The format of the GenerateNoise method is:
Quantum GenerateNoise ( const Quantum pixel, const NoiseType noise_type );
A description of each parameter follows:
A structure of type Quantum.
The type of noise: Gaussian, multiplicative Gaussian, impulse, laplacian, or Poisson.
Method HSLTransform converts a (hue, saturation, luminosity) to a (red, green, blue) triple.
The format of the HSLTransformImage method is:
void HSLTransform ( const double hue, const double saturation, const double luminosity, Quantum *red, Quantum *green, Quantum *blue );
A description of each parameter follows:
A double value representing a component of the HSL color space.
A pointer to a pixel component of type Quantum.
Method Hull implements the eight hull algorithm described in Applied Optics, Vol. 24, No. 10, 15 May 1985, ``Geometric filter for Speckle Reduction'', by Thomas R Crimmins. Each pixel in the image is replaced by one of its eight of its surrounding pixels using a polarity and negative hull function.
The format of the Hull method is:
void Hull ( const int x_offset, const int y_offset, const int polarity, const unsigned int columns, const unsigned int rows, Quantum *f, Quantum *g );
A description of each parameter follows:
An integer value representing the offset of the current pixel within the image.
An integer value declaring the polarity (+,-).
Specifies the number of rows and columns in the image.
A pointer to an image pixel and one of it's neighbor.
Method InterpolateColor applies bi-linear interpolation between a pixel and it's neighbors.
The format of the InterpolateColor method is:
ColorPacket InterpolateColor ( Image *image, const double x_offset, const double y_offset );
A description of each parameter follows:
The address of a structure of type Image.
A double representing the current (x,y) position of the pixel.
Method Modulate modulates the hue, saturation, and brightness of an image.
The format of the ModulateImage method is:
void Modulate ( double percent_hue, double percent_saturation, double percent_brightness, Quantum *red, Quantum *green, Quantum *blue ) blue );
A description of each parameter follows:
A double value representing the percent change in a component of the HSL color space.
A pointer to a pixel component of type Quantum.
Method TransformHSL converts a (red, green, blue) to a (hue, saturation, luminosity) triple.
The format of the TransformHSL method is:
void TransformHSL ( const Quantum red, const Quantum green, const Quantum blue, double *hue, double *saturation, double *luminosity );
A description of each parameter follows:
A Quantum value representing the red, green, and blue component of a pixel..
A pointer to a double value representing a component of the HSL color space.
Method Upsample doubles the size of the image.
The format of the UpSample method is:
void Upsample ( const unsigned int width, const unsigned int height, const unsigned int scaled_width, unsigned char *pixels );
A description of each parameter follows:
Unsigned values representing the width and height of the image pixel array.
Specifies the final width of the upsampled pixel array.
An unsigned char containing the pixel data. On output the upsampled pixels are returned here.