14#include <memory_resource>
15#include <nk/value/value.hpp>
41 std::pmr::memory_resource *mr =
nullptr);
62 std::pmr::memory_resource *mr =
nullptr);
72 std::pmr::memory_resource *mr =
nullptr);
91 std::pmr::memory_resource *mr =
nullptr);
99 std::pmr::memory_resource *mr =
nullptr);
121 std::pmr::memory_resource *mr =
nullptr);
126 std::pmr::memory_resource *mr =
nullptr);
131 std::pmr::memory_resource *mr =
nullptr);
132std::pair<Value, Value>
133readTiffWithMap(std::vector<std::uint8_t> buf, std::uint32_t page,
134 std::pmr::memory_resource *mr =
nullptr);
141std::pair<Value, Value>
142readTiffWithMap(
const std::string &path, std::uint32_t page,
143 std::pmr::memory_resource *mr =
nullptr);
153 std::uint16_t &channels);
161 std::uint16_t &channels);
180 const std::string &compression =
"none",
181 bool appendMode =
false);
191std::vector<std::uint8_t>
193 const std::string &compression =
"none",
194 const std::vector<std::uint8_t> *existing =
nullptr);
Core MATLAB-compatible multidimensional array and scalar value type.
std::uint32_t tiffNumPages(const std::string &path)
Count the number of IFDs (pages) in a TIFF file.
Value imfinfo(const std::string &path, std::pmr::memory_resource *mr=nullptr)
Read image header metadata without decoding pixels (S = imfinfo(path)).
std::vector< std::uint8_t > writeTiffToBytes(const Value &A, const std::string &compression="none", const std::vector< std::uint8_t > *existing=nullptr)
Buffer form — encode A to a TIFF byte vector (the engine entry writes these through the VFS).
Value imfinfoFromBytes(const std::string &bytes, const std::string &filename, std::pmr::memory_resource *mr=nullptr)
imfinfo from already-loaded bytes (the engine entry feeds these from the VFS so it works on the virtu...
void peekTiff(const std::string &path, std::uint32_t &W, std::uint32_t &H, std::uint16_t &bits, std::uint16_t &channels)
Peek a TIFF file's first-IFD metadata without decoding pixels.
void writeTiff(const Value &A, const std::string &path, const std::string &compression="none", bool appendMode=false)
Write A to path as a baseline TIFF.
std::string imwriteToBytes(const Value &A, const std::string &ext, std::pmr::memory_resource *mr=nullptr)
Encode an image to in-memory bytes (companion to imwrite).
void imwrite(const Value &A, const std::string &path, std::pmr::memory_resource *mr=nullptr)
Write an image to disk (imwrite(A, path)).
Value imread(const std::string &path, std::pmr::memory_resource *mr=nullptr)
Read an image from disk (A = imread(path)).
Value readTiff(const std::string &path, std::pmr::memory_resource *mr=nullptr)
Minimal TIFF reader for the formats stb doesn't decode.