25 [[nodiscard]]
png(file_view view);
27 [[nodiscard]]
png(std::filesystem::path
const& path) :
png(file_view{path}) {}
41 [[nodiscard]]
static pixmap<sfloat_rgba16>
load(std::filesystem::path
const& path);
47 matrix3 _color_to_sRGB = geo::identity();
57 int _compression_method = 0;
58 int _filter_method = 0;
59 int _interlace_method = 0;
64 int _samples_per_pixel = 0;
65 int _bits_per_pixel = 0;
66 int _bytes_per_pixel = 0;
67 int _bytes_per_line = 0;
78 void read_header(std::span<std::byte const> bytes,
std::size_t& offset);
79 void read_chunks(std::span<std::byte const> bytes,
std::size_t& offset);
80 void read_IHDR(std::span<std::byte const> bytes);
81 void read_cHRM(std::span<std::byte const> bytes);
82 void read_gAMA(std::span<std::byte const> bytes);
83 void read_iBIT(std::span<std::byte const> bytes);
84 void read_iCCP(std::span<std::byte const> bytes);
85 void read_sRGB(std::span<std::byte const> bytes);
86 void generate_sRGB_transfer_function()
noexcept;
87 void generate_Rec2100_transfer_function()
noexcept;
88 void generate_gamma_transfer_function(
float gamma)
noexcept;
90 void unfilter_lines(
bstring& image_data)
const;
91 void unfilter_line(std::span<uint8_t> line, std::span<uint8_t const> prev_line)
const;
92 void unfilter_line_sub(std::span<uint8_t> line, std::span<uint8_t const> prev_line)
const noexcept;
93 void unfilter_line_up(std::span<uint8_t> line, std::span<uint8_t const> prev_line)
const noexcept;
94 void unfilter_line_average(std::span<uint8_t> line, std::span<uint8_t const> prev_line)
const noexcept;
95 void unfilter_line_paeth(std::span<uint8_t> line, std::span<uint8_t const> prev_line)
const noexcept;
97 void data_to_image_line(std::span<std::byte const> bytes, std::span<sfloat_rgba16> row)
const noexcept;
98 u16x4 extract_pixel_from_line(std::span<std::byte const> bytes,
int x)
const noexcept;
constexpr T load(T const *src) noexcept
Load a numeric value from memory.
Definition endian.hpp:146