Porytiles
Loading...
Searching...
No Matches
porytiles::CImgPng Class Referencefinal

Implementation of Png using the CImg image processing library. More...

#include <cimg_png.hpp>

Inheritance diagram for porytiles::CImgPng:
[legend]
Collaboration diagram for porytiles::CImgPng:
[legend]

Public Member Functions

 CImgPng (const cimg_library::CImg< std::uint8_t > &image)
 
std::size_t Width () const override
 Gets the width of this Png in pixels.
 
std::size_t Height () const override
 Gets the height of this Png in pixels.
 
Rgba32 At (std::size_t i) const override
 Fetches the Rgba32 color value at a given one-dimensional pixel index.
 
Rgba32 At (std::size_t row, std::size_t col) const override
 Fetches the Rgba32 color value at a given row and column.
 
- Public Member Functions inherited from porytiles::Png
virtual ~Png ()=default
 

Detailed Description

Implementation of Png using the CImg image processing library.

Definition at line 12 of file cimg_png.hpp.

Constructor & Destructor Documentation

◆ CImgPng()

porytiles::CImgPng::CImgPng ( const cimg_library::CImg< std::uint8_t > &  image)
explicit

Definition at line 10 of file cimg_png.cpp.

Member Function Documentation

◆ At() [1/2]

Rgba32 porytiles::CImgPng::At ( std::size_t  i) const
overridevirtual

Fetches the Rgba32 color value at a given one-dimensional pixel index.

The one-dimensional index assumes the Png as an array of pixels, where the length of the array is the Png's width times height.

Parameters
iThe one-dimensional pixel index.
Returns
The Rgba32 at the given pixel index.

Implements porytiles::Png.

Definition at line 25 of file cimg_png.cpp.

◆ At() [2/2]

Rgba32 porytiles::CImgPng::At ( std::size_t  row,
std::size_t  col 
) const
overridevirtual

Fetches the Rgba32 color value at a given row and column.

Parameters
rowThe pixel row.
colThe pixel column.
Returns
The Rgba32 at the given row and column.

Implements porytiles::Png.

Definition at line 29 of file cimg_png.cpp.

◆ Height()

std::size_t porytiles::CImgPng::Height ( ) const
overridevirtual

Gets the height of this Png in pixels.

Returns
The height of this Png in pixels.

Implements porytiles::Png.

Definition at line 21 of file cimg_png.cpp.

◆ Width()

std::size_t porytiles::CImgPng::Width ( ) const
overridevirtual

Gets the width of this Png in pixels.

Returns
The width of this Png in pixels.

Implements porytiles::Png.

Definition at line 17 of file cimg_png.cpp.


The documentation for this class was generated from the following files: