Assignments
Assignments
|
#include <image.h>
Classes | |
struct | iterator |
Public Member Functions | |
iterator | begin (void) |
iterator | end (void) |
Image32 (void) | |
Image32 (const Image32 &img) | |
Image32 (Image32 &&img) | |
Image32 & | operator= (const Image32 &img) |
Image32 & | operator= (Image32 &&img) |
~Image32 (void) | |
void | setSize (int width, int height) |
int | width (void) const |
int | height (void) const |
Pixel32 & | operator() (int x, int y) |
const Pixel32 & | operator() (int x, int y) const |
void | read (std::string fileName) |
void | write (std::string fileName) const |
Image32 | addRandomNoise (double noise) const |
Image32 | brighten (double brightness) const |
Image32 | luminance (void) const |
Image32 | contrast (double contrast) const |
Image32 | saturate (double saturation) const |
Image32 | quantize (int bits) const |
Image32 | randomDither (int bits) const |
Image32 | orderedDither2X2 (int bits) const |
Image32 | floydSteinbergDither (int bits) const |
Image32 | blur3X3 (void) const |
Image32 | edgeDetect3X3 (void) const |
Image32 | scaleNearest (double scaleFactor) const |
Image32 | scaleBilinear (double scaleFactor) const |
Image32 | scaleGaussian (double scaleFactor) const |
Image32 | rotateNearest (double angle) const |
Image32 | rotateBilinear (double angle) const |
Image32 | rotateGaussian (double angle) const |
void | setAlpha (const Image32 &matte) |
Image32 | composite (const Image32 &overlay) const |
Image32 | crop (int x1, int y1, int x2, int y2) const |
Image32 | funFilter (void) const |
Image32 | warp (const OrientedLineSegmentPairs &olsp) const |
Pixel32 | nearestSample (Util::Point2D p) const |
Pixel32 | bilinearSample (Util::Point2D p) const |
Pixel32 | gaussianSample (Util::Point2D p, double variance, double radius) const |
Static Public Member Functions | |
static Image32 | BeierNeelyMorph (const Image32 &source, const Image32 &destination, const OrientedLineSegmentPairs &olsp, double timeStep) |
static Image32 | CrossDissolve (const Image32 &source, const Image32 &destination, double blendWeight) |
Private Member Functions | |
void | _assertInBounds (int x, int y) const |
Private Attributes | |
int | _width |
int | _height |
Pixel32 * | _pixels |
This class represents an RGBA image with 8 bits per channel.
Image32::Image32 | ( | void | ) |
The default constructor
Image32::Image32 | ( | const Image32 & | img | ) |
The copy constructor copies pixel values
Image32::Image32 | ( | Image32 && | img | ) |
The move constructor moves pixel ownership from the input to the new object.
Image32::~Image32 | ( | void | ) |
The destructor deallocates memory associated with the image.
|
private |
The method validates that the pixel index is valid
Image32 Image32::addRandomNoise | ( | double | noise | ) | const |
This method outputs a new image image with random noise added to each pixel. The value of the input parameter should be in the range [0,1] representing the fraction of noise that should be added. The actual amount of noise added is in the range [-noise,noise].
|
inline |
|
static |
This static method outputs the result a Beier-Neely morph. The method uses the set of line segment pairs to define correspondences between the source and destination image. The time-step parameter, in the range of [0,1], specifies the point in the morph at which the output image should be obtained.
Pixel32 Image32::bilinearSample | ( | Util::Point2D | p | ) | const |
This method returns the value of the image, sampled at position p using bilinear-weighted sampling.
Image32 Image32::blur3X3 | ( | void | ) | const |
This method outputs a blur of the image using a 3x3 mask.
Image32 Image32::brighten | ( | double | brightness | ) | const |
This method outputs a new image in which each pixel is brightened. The value of the input parameter is the scale by which the image should be brightened.
This method outputs an image that is a composite of the current image and the overlay. The method uses the values in the alpha-channel of the overlay image to determine how pixels should be blended.
Image32 Image32::contrast | ( | double | contrast | ) | const |
This method outputs a new image in which the contract has been changed. The value of the input parameter is the scale by which the contrast of the image should be changed.
Image32 Image32::crop | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2 | ||
) | const |
This method outputs a croppedimage. The values of the input parameters specify the corners of the cropping rectangle.
|
static |
This static method outputs the cross-dissolve of two image. The method generates an image which is the blend of the source and destination, using the blend-weight in the range [0,1] to determine what faction of the source and destination images should be used to generate the final output.
Image32 Image32::edgeDetect3X3 | ( | void | ) | const |
This method outpus a new image highlighting the edges in the input using a 3x3 mask.
|
inline |
Image32 Image32::floydSteinbergDither | ( | int | bits | ) | const |
This method outputs a new image in which each pixel is represented by a fixed number of bits. The final pixel values are obtained by using Floyd-Steinberg dithering for propogating quantization errors. The value of the input parameter is the number of bits that should be used to represent a color component in the output image.
Image32 Image32::funFilter | ( | void | ) | const |
This method outputs the results of a fun-filter.
Pixel32 Image32::gaussianSample | ( | Util::Point2D | p, |
double | variance, | ||
double | radius | ||
) | const |
This method returns the value of the image, sampled at position p using Gaussian-weighted sampling. The variance of the Gaussian and the radius over which the weighted summation is performed are specified by the parameters.
int Image32::height | ( | void | ) | const |
This method returns the height of the image
Image32 Image32::luminance | ( | void | ) | const |
This method outputs the gray-scale image.
Pixel32 Image32::nearestSample | ( | Util::Point2D | p | ) | const |
This method returns the value of the image, sampled at position p using nearest-point sampling.
Pixel32 & Image32::operator() | ( | int | x, |
int | y | ||
) |
This method returns a reference to the indexed pixel. An exception is thrown if the index is out of bounds.
const Pixel32 & Image32::operator() | ( | int | x, |
int | y | ||
) | const |
This method returns a reference to the indexed pixel. An exception is thrown if the index is out of bounds.
The copy assignment operator copies pixel values
The move assignment operator moves pixel ownership from the input to the new object.
Image32 Image32::orderedDither2X2 | ( | int | bits | ) | const |
This method outputs a new image in which each pixel is represented by a fixed number of bits. The final pixel values are obtained by using a 2x2 dithering matrix to determine how values should be quantized. The value of the input parameter is the number of bits that should be used to represent a color component in the output image.
Image32 Image32::quantize | ( | int | bits | ) | const |
This method outputs a new image in which each pixel is represented by a fixed number of bits. The final pixel values are obtained by quantizing. The value of the input parameter is the number of bits that should be used to represent a color component in the output image.
Image32 Image32::randomDither | ( | int | bits | ) | const |
This method outputs a new image in which each pixel is represented by a fixed number of bits. The final pixel values are obtained by adding noise to the pixel color channels and then quantizing. The value of the input parameter is the number of bits that should be used to represent a color component in the output image.
void Image32::read | ( | std::string | fileName | ) |
This method reads in an image from the specified file. It uses the file extension to determine if the file should be read in as a BMP file or as a JPEG file.
Image32 Image32::rotateBilinear | ( | double | angle | ) | const |
This method outputs a rotated image which is obtained using bilinear sampling. The value of the input parameter is the angle of rotation (in degrees).
Image32 Image32::rotateGaussian | ( | double | angle | ) | const |
This method outputs a rotated image which is obtained using Gaussian sampling. The value of the input parameter is the angle of rotation (in degrees).
Image32 Image32::rotateNearest | ( | double | angle | ) | const |
This method outputs a rotated image which is obtained using nearest-point sampling. The value of the input parameter is the angle of rotation (in degrees).
Image32 Image32::saturate | ( | double | saturation | ) | const |
This method outputs a new image in which the saturation of each pixel has been changed. The value of the input parameter is the scale by which the saturation of the pixel should be changed.
Image32 Image32::scaleBilinear | ( | double | scaleFactor | ) | const |
This method outputs a scaled image which is obtained using bilinear sampling. The value of the input parameter is the factor by which the image is to be scaled.
Image32 Image32::scaleGaussian | ( | double | scaleFactor | ) | const |
This method outputs a scaled image which is obtained using Gaussian sampling. The value of the input parameter is the factor by which the image is to be scaled.
Image32 Image32::scaleNearest | ( | double | scaleFactor | ) | const |
This method outputs a scaled image which is obtained using nearest-point sampling. The value of the input parameter is the factor by which the image is to be scaled.
void Image32::setAlpha | ( | const Image32 & | matte | ) |
This method sets the alpha-channel of the current image using the information provided in the matte image. The method returns true if it has been implemented.
void Image32::setSize | ( | int | width, |
int | height | ||
) |
This method sets the dimension of the image.
Image32 Image32::warp | ( | const OrientedLineSegmentPairs & | olsp | ) | const |
This method outputs a warped image using the correspondences defined by the line segment pairs.
int Image32::width | ( | void | ) | const |
This method returns the width of the image
void Image32::write | ( | std::string | fileName | ) | const |
This method writes in an image out to the specified file. It uses the file extension to determine if the file should be written out as a BMP file or as a JPEG file.
|
private |
|
private |
The pixel values
|
private |
The dimensions of the image