Porytiles
Loading...
Searching...
No Matches
porytiles::Png Class Referenceabstract

An image in PNG format. More...

#include <png.hpp>

Inheritance diagram for porytiles::Png:
[legend]

Public Member Functions

virtual ~Png ()=default
 
virtual std::size_t Width () const =0
 Gets the width of this Png in pixels.
 
virtual std::size_t Height () const =0
 Gets the height of this Png in pixels.
 
virtual Rgba32 At (std::size_t i) const =0
 Fetches the Rgba32 color value at a given one-dimensional pixel index.
 
virtual Rgba32 At (std::size_t row, std::size_t col) const =0
 Fetches the Rgba32 color value at a given row and column.
 

Detailed Description

An image in PNG format.

Clients who need to operate on PNG images can use this interface to avoid dependencies on any particular PNG library. This interface provides a way for clients to read a PNG's metadata and manipulate its contents.

Definition at line 14 of file png.hpp.

Constructor & Destructor Documentation

◆ ~Png()

virtual porytiles::Png::~Png ( )
virtualdefault

Member Function Documentation

◆ At() [1/2]

virtual Rgba32 porytiles::Png::At ( std::size_t  i) const
pure virtual

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.

Implemented in porytiles::CImgPng.

◆ At() [2/2]

virtual Rgba32 porytiles::Png::At ( std::size_t  row,
std::size_t  col 
) const
pure virtual

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.

Implemented in porytiles::CImgPng.

◆ Height()

virtual std::size_t porytiles::Png::Height ( ) const
pure virtual

Gets the height of this Png in pixels.

Returns
The height of this Png in pixels.

Implemented in porytiles::CImgPng.

◆ Width()

virtual std::size_t porytiles::Png::Width ( ) const
pure virtual

Gets the width of this Png in pixels.

Returns
The width of this Png in pixels.

Implemented in porytiles::CImgPng.


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