AlgoSim
Homepage | Screenshots | Gallery of Visualisation | User's Guide | Function Reference | Download | FAQ | Support | Bugs and Solutions | Donate

Reference: pmRGBAdjustment

pmRGBAdjustment(pm, Rmode, Rval, Gmode, Gval, Bmode, Bval) returns the pixmap pm whith the red, green, and blue intensities of each pixel transformed separately according to the component's Xmode and Xval (X = R, G, or B) parameters.

Each Xmode can be either "fixed", "add", or "mul".

 * If Xmode is "fixed", each pixel's X component will be set to Xval.
 * If Xmode is "add", each pixel's X component will be increased by Xval, that is, its new value will be the sum of its old value and Xval.
 * If Xmode is "mul", each pixel's X component will be multiplied by Xval, that is, its new value will be the product of its old value and Xval.

Notice that the component identity operation is achieved either by setting Xmode = "add" and Xval = 0 or by setting Xmode = "mul" and Xval = 1.

Notice! The resulting red, green, and blue intensities are finally truncated to [0, 1].

Examples: Let pm be a pixmap variable. Then

  pmRGBAdjustment(pm, "fixed", 0, "add", 0, "add", 0.2)

will return the pixmap pm where the red component of each pixel has been set to zero and the blue component of each pixel has been increased by 0.2.

  pmRGBAdjustment(pm, "mul", 5, "add", 0, "add", 0)

will multiply the red component of each pixel by 5.