PFImage

A class that provides the ability to work with color images in PF (portable floatmap image) format. NB: The format is raw binary. Support of this format is EXPERIMENTAL (!!!).

Note: This class supports indexing and assigning values ​​to specific pixels via 1D or 2D indexing, and provides PF file loading/saving capabilities. According to the accepted convention, in the original description of the format inside the Netpbm package, the extension of these files should be *.pfm.

Typical usage:

// create empty PF image
auto img = new PFImage; 
// load from file 					
img.load(`Lenna.pfm`);   					
// set pixel at (10; 10) as white
img[10, 10] = new RGBColor(255, 255, 255); 	
// get 11th pixel
img[10].writeln;							
// save to file
img.save(`Lenna2.pfm`);						

// new PF image, size is 10x10, all pixels black
auto img2 = new PFImage(10, 10, new RGBColor(0, 0, 0)); 
// increase two times
img2[10] = img2[10] * 2; 
// select byte order for saving (by default, little-endian, i.e BYTE_ORDER.LITTLE_ENDIAN)
img2.setOrder(BYTE_ORDER.BIG_ENDIAN);									
// save as pfm file
img2.save(`test.pfm`);

Members

Functions

loader
void loader()
Undocumented in source. Be warned that the author may not have intended to support it.
saver
void saver()
Undocumented in source. Be warned that the author may not have intended to support it.

Mixins

__anonymous
mixin addConstructor!(PixMapFormat.PF_RGB_BINARY)
Undocumented in source.

Inherited Members

From PixMapFile

_file
File _file;
Undocumented in source.
_header
PixMapFormat _header;
Undocumented in source.
loader
void loader()
Undocumented in source.
saver
void saver()
Undocumented in source.
load
void load(string filename)

Basic file loading procedure

save
void save(string filename)

Basic file saving procedure

isBinaryFormat
bool isBinaryFormat()

Is raw format ?

isTextFormat
bool isTextFormat()

Is text format ?

image
PixMapImage image()

Get image object as PixMapImage object

image
void image(PixMapImage image)

Set image object as PixMapImage object

Meta