24 static const char * help =
": install libpng and re-run configure" ;
30 void Gr::PngReader::setup(
int ,
bool ) {
throw Png::Error(
"pngreader not implemented" + std::string(help) ) ; }
39 void Gr::PngInfo::init( std::istream & stream )
41 unsigned char buffer[31] = { 0 } ;
42 stream.get( reinterpret_cast<char*>(buffer) ,
sizeof(buffer) ) ;
43 std::pair<int,int> pair = parse( buffer , stream.gcount() ) ;
48 void Gr::PngInfo::init(
const unsigned char * p ,
size_t n )
50 std::pair<int,int> pair = parse( p , n ) ;
Map tags() const
Returns the text tags from the last decode().
A holder for image data, having eight bits per sample and one or three channels.
Vectors ImageBuffer
An ImageBuffer is used to hold raw image data, typically in more than one chunk.
PngWriter(const ImageData &, Map tags=Map())
Constructor with the raw image data prepared in a ImageData object.
A private pimple-pattern class for Gr::PngWriter.
void decode(ImageData &out, const G::Path &in)
Decodes a png file into an image. Throws on error.
A private pimple-pattern class for Gr::PngReader.
PngReader(int scale=1, bool monochrome_out=false)
Constructor.
void setup(int scale, bool monochrome_out=false)
Sets the decoding scale factor.
static bool available()
Returns true if the png library is available.
A Path object represents a file system path.
Abstract interface for Gr::PngWriter::write().
void write(const G::Path &path)
Writes to file.