libfacade 1.1
A library for manipulating PNG images with payloads.
Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations | Functions
facade::png Namespace Reference

Classes

class  AlphaGrayscalePixel
 A grayscale pixel with alpha channel. More...
 
class  AlphaTrueColorPixel
 An RGB pixel with alpha channel. More...
 
class  ChunkPtr
 The chunk class responsible for parsing the raw data of a PNG file. More...
 
class  ChunkTag
 The string tag identifying a given facade::png::ChunkVec or facade::png::ChunkPtr. More...
 
class  ChunkVec
 A vector-based version of a given PNG chunk. More...
 
class  End
 The end chunk for a given PNG file. More...
 
class  GrayscalePixel
 A grayscale pixel object, based on the facade::png::Sample class. More...
 
class  Header
 A PNG header object. More...
 
class  Image
 A class for loading and manipulating PNG images. More...
 
class  PalettePixel
 A paletted pixel object. More...
 
class  PixelSpan
 A span of data representing the underlying bits or bytes of a pixel. More...
 
class  Sample
 A sample of data for a given pixel. More...
 
class  Scanline
 A wrapper object for ScanlineVariant. More...
 
class  ScanlineBase
 The base scanline class containing a row of facade::png::PixelSpan of the given pixel type. More...
 
class  Text
 A tEXt chunk object. More...
 
class  TrueColorPixel
 An RGB pixel object. More...
 
class  ZText
 A compressed text chunk. More...
 

Typedefs

using Sample1Bit = Sample< std::uint8_t, 1 >
 
using Sample2Bit = Sample< std::uint8_t, 2 >
 
using Sample4Bit = Sample< std::uint8_t, 4 >
 
using Sample8Bit = Sample< std::uint8_t >
 
using Sample16Bit = Sample< std::uint16_t >
 
using GrayscalePixel1Bit = GrayscalePixel< std::uint8_t, 1 >
 A facade::png::GrayscalePixel with a 1-bit facade::png::Sample value.
 
using GrayscalePixel2Bit = GrayscalePixel< std::uint8_t, 2 >
 A facade::png::GrayscalePixel with a 2-bit facade::png::Sample value.
 
using GrayscalePixel4Bit = GrayscalePixel< std::uint8_t, 4 >
 A facade::png::GrayscalePixel with a 4-bit facade::png::Sample value.
 
using GrayscalePixel8Bit = GrayscalePixel< std::uint8_t >
 A facade::png::GrayscalePixel with an 8-bit facade::png::Sample value.
 
using GrayscalePixel16Bit = GrayscalePixel< std::uint16_t >
 A facade::png::GrayscalePixel with a 16-bit facade::png::Sample value.
 
using TrueColorPixel8Bit = TrueColorPixel< Sample8Bit >
 A facade::png::TrueColorPixel with an 8-bit facade::png::Sample value.
 
using TrueColorPixel16Bit = TrueColorPixel< Sample16Bit >
 A facade::png::TrueColorPixel with a 16-bit facade::png::Sample value.
 
using PalettePixel1Bit = PalettePixel< 1 >
 A facade::png::PalettePixel object with a 1-bit facade::png::Sample value.
 
using PalettePixel2Bit = PalettePixel< 2 >
 A facade::png::PalettePixel object with a 2-bit facade::png::Sample value.
 
using PalettePixel4Bit = PalettePixel< 4 >
 A facade::png::PalettePixel object with a 4-bit facade::png::Sample value.
 
using PalettePixel8Bit = PalettePixel< 8 >
 A facade::png::PalettePixel object with an 8-bit facade::png::Sample value.
 
using AlphaGrayscalePixel8Bit = AlphaGrayscalePixel< std::uint8_t >
 An facade::png::AlphaGrayscalePixel with an 8-bit facade::png::Sample size.
 
using AlphaGrayscalePixel16Bit = AlphaGrayscalePixel< std::uint16_t >
 An facade::png::AlphaGrayscalePixel with a 16-bit facade::png::Sample size.
 
using AlphaTrueColorPixel8Bit = AlphaTrueColorPixel< Sample8Bit >
 An facade::png::AlphaTrueColorPixel with an 8-bit facade::png::Sample size.
 
using AlphaTrueColorPixel16Bit = AlphaTrueColorPixel< Sample16Bit >
 An facade::png::AlphaTrueColorPixel with a 16-bit facade::png::Sample size.
 
using Pixel = std::variant< GrayscalePixel1Bit, GrayscalePixel2Bit, GrayscalePixel4Bit, GrayscalePixel8Bit, GrayscalePixel16Bit, TrueColorPixel8Bit, TrueColorPixel16Bit, PalettePixel1Bit, PalettePixel2Bit, PalettePixel4Bit, PalettePixel8Bit, AlphaGrayscalePixel8Bit, AlphaGrayscalePixel16Bit, AlphaTrueColorPixel8Bit, AlphaTrueColorPixel16Bit >
 The variant type corresponding to all known pixel types for PNG images.
 
template<typename PixelType >
using PixelRow = std::vector< PixelSpan< PixelType > >
 A vector of a facade::png::PixelSpan of the given pixel type.
 
using GrayscaleScanline1Bit = ScanlineBase< GrayscalePixel1Bit >
 A 1-bit grayscale scanline, using facade::png::GrayscalePixel1Bit as a pixel base.
 
using GrayscaleScanline2Bit = ScanlineBase< GrayscalePixel2Bit >
 A 2-bit grayscale scanline, using facade::png::GrayscalePixel2Bit as a pixel base.
 
using GrayscaleScanline4Bit = ScanlineBase< GrayscalePixel4Bit >
 A 4-bit grayscale scanline, using facade::png::GrayscalePixel4Bit as a pixel base.
 
using GrayscaleScanline8Bit = ScanlineBase< GrayscalePixel8Bit >
 An 8-bit grayscale scanline, using facade::png::GrayscalePixel8Bit as a pixel base.
 
using GrayscaleScanline16Bit = ScanlineBase< GrayscalePixel16Bit >
 A 16-bit grayscale scanline, using facade::png::GrayscalePixel16Bit as a pixel base.
 
using TrueColorScanline8Bit = ScanlineBase< TrueColorPixel8Bit >
 An 8-bit RGB scanline, using facade::png::TrueColorPixel8Bit as a pixel base.
 
using TrueColorScanline16Bit = ScanlineBase< TrueColorPixel16Bit >
 A 16-bit RGB scanline, using facade::png::TrueColorPixel16Bit as a pixel base.
 
using PaletteScanline1Bit = ScanlineBase< PalettePixel1Bit >
 A 1-bit palette scanline, using facade::png::PalettePixel1Bit as a pixel base.
 
using PaletteScanline2Bit = ScanlineBase< PalettePixel2Bit >
 A 2-bit palette scanline, using facade::png::PalettePixel2Bit as a pixel base.
 
using PaletteScanline4Bit = ScanlineBase< PalettePixel4Bit >
 A 4-bit palette scanline, using facade::png::PalettePixel4Bit as a pixel base.
 
using PaletteScanline8Bit = ScanlineBase< PalettePixel8Bit >
 An 8-bit palette scanline, using facade::png::PalettePixel8Bit as a pixel base.
 
using AlphaGrayscaleScanline8Bit = ScanlineBase< AlphaGrayscalePixel8Bit >
 An 8-bit grayscale scanline with alpha channel, using facade::png::AlphaGrayscalePixel8Bit as a pixel base.
 
using AlphaGrayscaleScanline16Bit = ScanlineBase< AlphaGrayscalePixel16Bit >
 A 16-bit grayscale scanline with alpha channel, using facade::png::AlphaGrayscalePixel16Bit as a pixel base.
 
using AlphaTrueColorScanline8Bit = ScanlineBase< AlphaTrueColorPixel8Bit >
 An 8-bit RGB scanline with alpha channel, using facade::png::AlphaTrueColorPixel8Bit as a pixel base.
 
using AlphaTrueColorScanline16Bit = ScanlineBase< AlphaTrueColorPixel16Bit >
 A 16-bit RGB scanline with alpha channel, using facade::png::AlphaTrueColorPixel16Bit a pixel base.
 
using ScanlineVariant = std::variant< GrayscaleScanline1Bit, GrayscaleScanline2Bit, GrayscaleScanline4Bit, GrayscaleScanline8Bit, GrayscaleScanline16Bit, TrueColorScanline8Bit, TrueColorScanline16Bit, PaletteScanline1Bit, PaletteScanline2Bit, PaletteScanline4Bit, PaletteScanline8Bit, AlphaGrayscaleScanline8Bit, AlphaGrayscaleScanline16Bit, AlphaTrueColorScanline8Bit, AlphaTrueColorScanline16Bit >
 A variant type containing all accepted scanline types.
 

Enumerations

enum  ColorType {
  GRAYSCALE = 0 , TRUE_COLOR = 2 , PALETTE = 3 , ALPHA_GRAYSCALE = 4 ,
  ALPHA_TRUE_COLOR = 6
}
 The color type represented in the PNG file. More...
 
enum  PixelEnum {
  GRAYSCALE_PIXEL_1BIT = 0 , GRAYSCALE_PIXEL_2BIT , GRAYSCALE_PIXEL_4BIT , GRAYSCALE_PIXEL_8BIT ,
  GRAYSCALE_PIXEL_16BIT , TRUE_COLOR_PIXEL_8BIT , TRUE_COLOR_PIXEL_16BIT , PALETTE_PIXEL_1BIT ,
  PALETTE_PIXEL_2BIT , PALETTE_PIXEL_4BIT , PALETTE_PIXEL_8BIT , ALPHA_GRAYSCALE_PIXEL_8BIT ,
  ALPHA_GRAYSCALE_PIXEL_16BIT , ALPHA_TRUE_COLOR_PIXEL_8BIT , ALPHA_TRUE_COLOR_PIXEL_16BIT
}
 An enum representing all available pixel types. More...
 
enum  FilterType {
  NONE = 0 , SUB , UP , AVERAGE ,
  PAETH
}
 The filter type to use for a given scanline. More...
 

Functions

template<typename PixelType >
EXPORT std::vector< std::uint8_t > pixels_to_raw (const PixelRow< PixelType > &pixels)
 Convert a row of facade::png::PixelSpan of the given pixel type into a vector of bytes.
 

Typedef Documentation

◆ AlphaGrayscalePixel16Bit

◆ AlphaGrayscalePixel8Bit

◆ AlphaGrayscaleScanline16Bit

A 16-bit grayscale scanline with alpha channel, using facade::png::AlphaGrayscalePixel16Bit as a pixel base.

◆ AlphaGrayscaleScanline8Bit

An 8-bit grayscale scanline with alpha channel, using facade::png::AlphaGrayscalePixel8Bit as a pixel base.

◆ AlphaTrueColorPixel16Bit

◆ AlphaTrueColorPixel8Bit

◆ AlphaTrueColorScanline16Bit

A 16-bit RGB scanline with alpha channel, using facade::png::AlphaTrueColorPixel16Bit a pixel base.

◆ AlphaTrueColorScanline8Bit

An 8-bit RGB scanline with alpha channel, using facade::png::AlphaTrueColorPixel8Bit as a pixel base.

◆ GrayscalePixel16Bit

using facade::png::GrayscalePixel16Bit = typedef GrayscalePixel<std::uint16_t>

◆ GrayscalePixel1Bit

using facade::png::GrayscalePixel1Bit = typedef GrayscalePixel<std::uint8_t, 1>

◆ GrayscalePixel2Bit

using facade::png::GrayscalePixel2Bit = typedef GrayscalePixel<std::uint8_t, 2>

◆ GrayscalePixel4Bit

using facade::png::GrayscalePixel4Bit = typedef GrayscalePixel<std::uint8_t, 4>

◆ GrayscalePixel8Bit

using facade::png::GrayscalePixel8Bit = typedef GrayscalePixel<std::uint8_t>

◆ GrayscaleScanline16Bit

A 16-bit grayscale scanline, using facade::png::GrayscalePixel16Bit as a pixel base.

◆ GrayscaleScanline1Bit

A 1-bit grayscale scanline, using facade::png::GrayscalePixel1Bit as a pixel base.

◆ GrayscaleScanline2Bit

A 2-bit grayscale scanline, using facade::png::GrayscalePixel2Bit as a pixel base.

◆ GrayscaleScanline4Bit

A 4-bit grayscale scanline, using facade::png::GrayscalePixel4Bit as a pixel base.

◆ GrayscaleScanline8Bit

An 8-bit grayscale scanline, using facade::png::GrayscalePixel8Bit as a pixel base.

◆ PalettePixel1Bit

A facade::png::PalettePixel object with a 1-bit facade::png::Sample value.

◆ PalettePixel2Bit

A facade::png::PalettePixel object with a 2-bit facade::png::Sample value.

◆ PalettePixel4Bit

A facade::png::PalettePixel object with a 4-bit facade::png::Sample value.

◆ PalettePixel8Bit

A facade::png::PalettePixel object with an 8-bit facade::png::Sample value.

◆ PaletteScanline1Bit

A 1-bit palette scanline, using facade::png::PalettePixel1Bit as a pixel base.

◆ PaletteScanline2Bit

A 2-bit palette scanline, using facade::png::PalettePixel2Bit as a pixel base.

◆ PaletteScanline4Bit

A 4-bit palette scanline, using facade::png::PalettePixel4Bit as a pixel base.

◆ PaletteScanline8Bit

An 8-bit palette scanline, using facade::png::PalettePixel8Bit as a pixel base.

◆ Pixel

The variant type corresponding to all known pixel types for PNG images.

◆ PixelRow

template<typename PixelType >
using facade::png::PixelRow = typedef std::vector<PixelSpan<PixelType> >

A vector of a facade::png::PixelSpan of the given pixel type.

Template Parameters
PixelTypeThe base type of pixel to make this vector.

◆ Sample16Bit

using facade::png::Sample16Bit = typedef Sample<std::uint16_t>

◆ Sample1Bit

using facade::png::Sample1Bit = typedef Sample<std::uint8_t, 1>

◆ Sample2Bit

using facade::png::Sample2Bit = typedef Sample<std::uint8_t, 2>

◆ Sample4Bit

using facade::png::Sample4Bit = typedef Sample<std::uint8_t, 4>

◆ Sample8Bit

using facade::png::Sample8Bit = typedef Sample<std::uint8_t>

◆ ScanlineVariant

A variant type containing all accepted scanline types.

This is primarily to make building a new class on top of the variant easier.

◆ TrueColorPixel16Bit

◆ TrueColorPixel8Bit

◆ TrueColorScanline16Bit

A 16-bit RGB scanline, using facade::png::TrueColorPixel16Bit as a pixel base.

◆ TrueColorScanline8Bit

An 8-bit RGB scanline, using facade::png::TrueColorPixel8Bit as a pixel base.

Enumeration Type Documentation

◆ ColorType

The color type represented in the PNG file.

Enumerator
GRAYSCALE 
TRUE_COLOR 
PALETTE 
ALPHA_GRAYSCALE 
ALPHA_TRUE_COLOR 

◆ FilterType

The filter type to use for a given scanline.

Enumerator
NONE 
SUB 
UP 
AVERAGE 
PAETH 

◆ PixelEnum

An enum representing all available pixel types.

This enum corresponds to the indexes in variants such as facade::png::Pixel.

Enumerator
GRAYSCALE_PIXEL_1BIT 
GRAYSCALE_PIXEL_2BIT 
GRAYSCALE_PIXEL_4BIT 
GRAYSCALE_PIXEL_8BIT 
GRAYSCALE_PIXEL_16BIT 
TRUE_COLOR_PIXEL_8BIT 
TRUE_COLOR_PIXEL_16BIT 
PALETTE_PIXEL_1BIT 
PALETTE_PIXEL_2BIT 
PALETTE_PIXEL_4BIT 
PALETTE_PIXEL_8BIT 
ALPHA_GRAYSCALE_PIXEL_8BIT 
ALPHA_GRAYSCALE_PIXEL_16BIT 
ALPHA_TRUE_COLOR_PIXEL_8BIT 
ALPHA_TRUE_COLOR_PIXEL_16BIT 

Function Documentation

◆ pixels_to_raw()

template<typename PixelType >
EXPORT std::vector< std::uint8_t > facade::png::pixels_to_raw ( const PixelRow< PixelType > &  pixels)

Convert a row of facade::png::PixelSpan of the given pixel type into a vector of bytes.

Template Parameters
PixelTypeThe pixel type of the row of span objects.
Parameters
pixelsThe pixel data to convert to bytes.