nCine/Graphics/PngCodec.h file

Class nCine::PngCodec and the WITH_PNG_ENCODER macro.

Namespaces

namespace nCine
Root namespace of nCine game engine.

Classes

struct nCine::PngImage
An image as PngCodec::Decode() reads and PngCodec::Encode() writes it.
struct nCine::PngRgbaImage
An image as PngCodec::DecodeRgba() reads it, always RGBA, four bytes per pixel.
struct nCine::PngDecodeOptions
How PngCodec reads an image.
class nCine::PngCodec
Reads and writes PNG images.

Enums

enum class PngError : std::uint8_t { None, NotPng, EndsTooSoon, Damaged, TooLarge, UnknownKind, Unsupported, NoPalette }
Why PngCodec couldn't read an image.

Variables

std::int64_t PngDefaultMaxPixels constexpr
Default of PngDecodeOptions::MaxPixels, 16384 × 16384, or 8192 × 8192 with 32-bit addresses.

Defines

#define WITH_PNG_ENCODER
Whether nCine::PngCodec can write images too.

Define documentation

#define WITH_PNG_ENCODER

Whether nCine::PngCodec can write images too.

The game itself never writes a PNG image, only the level editor and the tools do, so the encoder is left out of the builds that don't need it — the console ones above all. It's defined by WITH_EDITOR, a tool that writes images (AssetPacker) defines it on its own.