mp_stickers
Shocking Stickers
|
A subclass of PNG with more member functions for modifying the image. More...
#include <Image.h>
Public Member Functions | |
void | lighten () |
Lighten an Image by increasing the luminance of every pixel by 0.1. More... | |
void | lighten (double amount) |
Lighten an Image by increasing the luminance of every pixel by amount . More... | |
void | darken () |
Darken an Image by decreasing the luminance of every pixel by 0.1. More... | |
void | darken (double amount) |
Darkens an Image by decreasing the luminance of every pixel by amount . More... | |
void | saturate () |
Saturates an Image by increasing the saturation of every pixel by 0.1. More... | |
void | saturate (double amount) |
Saturates an Image by increasing the saturation of every pixel by amount . More... | |
void | desaturate () |
Desaturates an Image by decreasing the saturation of every pixel by 0.1. More... | |
void | desaturate (double amount) |
Desaturates an Image by decreasing the saturation of every pixel by amount . More... | |
void | grayscale () |
Turns the image grayscale. More... | |
void | rotateColor (double degrees) |
Rotates the color wheel by degrees . More... | |
void | illinify () |
Illinify the image. More... | |
void | scale (double factor) |
Scale the Image by a given factor . More... | |
void | scale (unsigned w, unsigned h) |
Scales the image to fit within the size (w x h ). More... | |
A subclass of PNG with more member functions for modifying the image.
void Image::darken | ( | ) |
Darken an Image by decreasing the luminance of every pixel by 0.1.
This function ensures that the luminance remains in the range [0, 1].
void Image::darken | ( | double | amount | ) |
Darkens an Image by decreasing the luminance of every pixel by amount
.
This function ensures that the luminance remains in the range [0, 1].
amount | The desired decrease in luminance. |
void Image::desaturate | ( | ) |
Desaturates an Image by decreasing the saturation of every pixel by 0.1.
This function ensures that the saturation remains in the range [0, 1].
void Image::desaturate | ( | double | amount | ) |
Desaturates an Image by decreasing the saturation of every pixel by amount
.
This function ensures that the saturation remains in the range [0, 1].
amount | The desired decrease in saturation. |
void Image::grayscale | ( | ) |
Turns the image grayscale.
void Image::illinify | ( | ) |
Illinify the image.
void Image::lighten | ( | ) |
Lighten an Image by increasing the luminance of every pixel by 0.1.
This function ensures that the luminance remains in the range [0, 1].
void Image::lighten | ( | double | amount | ) |
Lighten an Image by increasing the luminance of every pixel by amount
.
This function ensures that the luminance remains in the range [0, 1].
amount | The desired increase in luminance. |
void Image::rotateColor | ( | double | degrees | ) |
Rotates the color wheel by degrees
.
Rotating in a positive direction increases the degree of the hue. This function ensures that the hue remains in the range [0, 360].
degrees | The desired amount of rotation. |
void Image::saturate | ( | ) |
Saturates an Image by increasing the saturation of every pixel by 0.1.
This function ensures that the saturation remains in the range [0, 1].
void Image::saturate | ( | double | amount | ) |
Saturates an Image by increasing the saturation of every pixel by amount
.
This function ensures that the saturation remains in the range [0, 1].
amount | The desired increase in saturation. |
void Image::scale | ( | double | factor | ) |
Scale the Image by a given factor
.
For example:
factor
of 1.0 does not change the image.factor
of 0.5 results in an image with half the width and half the height.factor
of 2 results in an image with twice the width and twice the height.This function both resizes the Image and scales the contents.
factor | Scale factor. |
void Image::scale | ( | unsigned | w, |
unsigned | h | ||
) |
Scales the image to fit within the size (w
x h
).
This function preserves the aspect ratio of the image, so the result will always be an image of width w
or of height h
(not necessarily both).
For example, if the Image is currently (10, 20) and we want to scale to (100, 100), then this should scale the Image to (50, 100). Note that scaling the image to (100, 200) does not fit within the (100,100) dimensions given and is therefore incorrect.
This function both resizes the Image and scales the contents.