项目作者: Iltwats

项目描述 :
Image Transformation using C++ and OOPS.
高级语言: C++
项目地址: git://github.com/Iltwats/Image-Transformation.git
创建时间: 2020-08-08T10:15:53Z
项目社区:https://github.com/Iltwats/Image-Transformation

开源协议:

下载


Native Image Transformation

Project will be using an alternative color space that represents colors by human perception of color. The HSL color space uses the Hue, Saturation, and Luminance of the color.

Using C++ I will transform a image into grayscale, illini orange, create spotlight in centre and add a watermark..

This is the original image:

This code will transform this image into these:





How the project works:

For loading and saving PNG files:

  • bool PNG::readFromFile(const std::string & fileName) loads an image based on the provided file name, a text string. The return value shows success or failure. it means a direct reference to the memory is being passed, similar to a pointer.
  • bool PNG::writeToFile(const std::string & fileName) writes the current image to the providedfile name (overwriting existing files).

For retrieving pixel and image information:

  • unsigned int PNG::width() constreturns the width of the image.
  • unsigned int PNG::height() constreturns the height of the image.
  • HSLAPixel & getPixel(unsigned int x, unsigned int y) returns a direct reference to a pixel at the specified location.

Other methods:

  • Methods for creating empty PNGs, resizing an image, etc. You can view uiuc/PNG.h and uiuc/PNG.cpp for complete details.

The output folder is in Result folder and the main image transformation code is in ImageTransform.cpp

Running and Compiling the code

Type the following commands in the terminal:

  1. 1. `make` to build the executable for the code.<br>
  2. 2. `./ImageTransform` to run this executable to generate the output.<br>

If you want to run the tests then:

  1. 1. `make test` to build the test executable files.<br>
  2. 2. `./test ` to run test executable files.<br>