Static Public Member Functions | Static Public Attributes | Static Protected Attributes | List of all members
FilePng Class Reference

For reading and writing images in PNG format. More...

#include <FilePng.h>

Collaboration diagram for FilePng:
Collaboration graph
[legend]

Static Public Member Functions

template<class T >
static void readOld (T &image, const std::string &path, int png_transforms=0)
 Syntax for recognising png files. More...
 
static void read (ImageFrame &image, const std::string &path, int png_transforms=0)
 
static void write (const ImageFrame &image, const std::string &path)
 Writes image to a png file. More...
 

Static Public Attributes

static FileInfo fileInfo
 Syntax for recognising image files.
 
static short int compressionLevel = 5
 Default compression level for png_set_compression_level(png_ptr, ...);.
 

Static Protected Attributes

static FileInfoinitFileInfo
 

Detailed Description

For reading and writing images in PNG format.

A lighter alternative for Magick++ which supports tens of image formats. Portable Network Graphics (PNG) format is a widely adapted, flexible image format for gray level and color images. It supports lossless compression and alpha channels.

Member Function Documentation

◆ read()

void read ( ImageFrame image,
const std::string &  path,
int  png_transforms = 0 
)
static

Main action

Read comments

Copy to drain::Image

◆ readOld()

void readOld ( T &  image,
const std::string &  path,
int  png_transforms = 0 
)
static

Syntax for recognising png files.

Reads a png file to Image or Channel . Converts indexed (palette) images to RGB or RGBA. Scales data to 8 or 16 bits, according to template class. Floating point images will be scaled as 16 bit integral (unsigned short int).

In addition to reading to Image, supports reading to ImageFrame if type and geometry match.

Template Parameters
T- Image or ImageFrame

Main action

Read comments

Copy to drain::Image

◆ write()

void write ( const ImageFrame image,
const std::string &  path 
)
static

Writes image to a png file.

Writes drain::Image to a png image file applying G,GA, RGB or RGBA color model. Writes in 8 or 16 bits, according to template class. Floating point images will be scaled as 16 bit integral (unsigned short int).

Parameters
image- image
pathPrefix-

Writes drain::Image to a png image file applying G,GA, RGB or RGBA color model. Writes in 8 or 16 bits, according to template class. Floating point images will be scaled as 16 bit integral (unsigned short int).

? png_set_traverseFrame(png_ptr, 0,PNG_FILTER_HEURISTIC_DEFAULT);

WARNING: for channels/views: getProperties instead?

NEW:


The documentation for this class was generated from the following files: