Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand Image class capability #33

Closed
RippeR37 opened this issue Apr 9, 2015 · 1 comment
Closed

Expand Image class capability #33

RippeR37 opened this issue Apr 9, 2015 · 1 comment
Assignees
Labels
Milestone

Comments

@RippeR37
Copy link
Owner

RippeR37 commented Apr 9, 2015

Implement new features, such as:

  • loading multiple image file formats:
    • BMP
    • TGA
    • JPEG
    • PNG (Be aware that PNG files can have corrupted sRGB profile and this could lead to incorect behaviour of saving such images or they can be displayed incorrectly!)
  • saving images to files using formats:
    • BMP
    • TGA
    • JPEG
    • PNG
  • saving screenshots from applications (both at the end of rendering frame or exactly now)
    • whole-screen screenshots
    • user-defined-rectangle screenshot
  • better API to work with Images
    • get/set method for accessing pixels
    • ?
  • implement some algorithms to work with images such as:
    • transform to grayscale
    • invert colors
    • cropping (if cropped image is out of image's boundaries, it's move to fit with smaller size)
    • invert(flip) horizontaly/verticaly
    • rotate (90deg clock-wise, 90deg counter-clock-wise, 180deg)
    • etc.
  • and maybe more

Be aware that images loaded in Image class manually (with custom loader or as copy of existing array) has to have 4-byte alignment in each row. Please refer to implementation of unsigned int Image::getAlignedRowSize(unsigned int width, unsigned int bits) method which returns size (in bytes) of aligned to 4bytes image's row. This method have public static modifier which allows you to use it in your own module based your own data to calculate proper row size.

@RippeR37 RippeR37 self-assigned this Apr 9, 2015
@RippeR37 RippeR37 added this to the Version 0.2 milestone Apr 9, 2015
@RippeR37
Copy link
Owner Author

RippeR37 commented Apr 9, 2015

e9f6140 commit changes:

  • switched to exceptions for error handling in Images and Textures (to avoid creation of useless objects)
  • implemented load(width, height, bits, data pointer) method to load image from existing array.
  • changed default storage format for images and textures from BGR to RGB
  • implemented swapComponents(...) static method that swaps red and blue channels in image data (BGR<->RGB swap). Used internally on BMP and TGA files.

RippeR37 added a commit that referenced this issue Apr 9, 2015
…Image's class functionality. Fixed small bug in textures preventing from using alpha channel from automatically loaded images. Small minor fixes.
RippeR37 added a commit that referenced this issue Apr 9, 2015
RippeR37 added a commit that referenced this issue Apr 9, 2015
…separate image file types loaders with actuall Image class. This also allows to use user-defined image loader to work with whole library (i.e. image/texture classes).
RippeR37 added a commit that referenced this issue Apr 10, 2015
…lems with padding/alignment by forcing it to all images loaded from files where it doesn't occur normally. This includes adding padding to TGA, JPEG and PNG formats when loaded, and stripping padding when saving image to files when needed. Implemented saving images to BMP files.
RippeR37 added a commit that referenced this issue Apr 11, 2015
…itignore` file to skip lastImage file created by `Image example`.
RippeR37 added a commit that referenced this issue Apr 12, 2015
…d in Image data. Fixed implementation in getPixel() method to support padding/4-byte alignment.
RippeR37 added a commit that referenced this issue Apr 12, 2015
… when new image was loaded in some specific cases. Implemented method to get size of image's row aligned to 4 bytes to ease usage and and creating new (custom) modules by users.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant