#include <PNG.hpp>
Definition at line 52 of file PNG.hpp.
Public Types | |
| typedef std::auto_ptr< std::string > | string_ptr |
| Typedef of string pointer using auto_ptr. | |
Static Public Member Functions | |
| std::string | png (const Bitmap &b) |
| Get a string representing the contents of a PNG file using a Bitmap. | |
| string_ptr | png (const ColorMap &c, int osr=1, int osc=1) |
| Get a string representing the contents of a PNG file using an indexed color map. | |
| string_ptr | png (const InterpolatedColorMap &c, int osr=1, int osc=1) |
| Get a string representing the contents of a PNG file using an indexed color map. | |
| int | cost_indexed (const Bitmap &b) |
| Get the byte cost of an indexed PNG Returns -1 if the bitmap doesn't have an Indexed/InterpolatedColorMap. | |
| int | cost_indexed (int rows, int cols, int numcol) |
| Get the byte cost of an indexed PNG with numcol colors. | |
| int | cost_constant (const Bitmap &b) |
| Get the byte cost of a non-indexed PNG. | |
| int | cost_constant (int rows, int cols) |
| Get the byte cost of a non-indexed PNG. | |
Static Protected Member Functions | |
| int | cost_idat (int stream) |
| Get the cost for IDAT chunks for a stream of this length. | |
| string_ptr | ihdr_full (int width, int height) |
| IHDR Chunk for full color maps. | |
| string_ptr | ihdr_indexed (int width, int height) |
| IHDR Chunk for indexed color maps. | |
| string_ptr | srgb () |
| sRGB Chunk for telling the PNG renderer to keep the colors pretty | |
| string_ptr | phys () |
| pHYs Chunk for telling the PNG renderer pixel width/height | |
| string_ptr | plte (const InterpolatedColorMap &c) |
| PLTE Chunk for listing the indexed colors. | |
| string_ptr | idat (const InterpolatedColorMap &c, int osr, int osc) |
| IDAT Chunk for an indexed color map. | |
| string_ptr | idat (const ColorMap &c, int osr, int osc) |
| IDAT Chunk for a full color map. | |
| string_ptr | split (const std::string &str) |
| Split up IDAT Chunk to multiple chunks if too large. | |
| string_ptr | prefix (const std::string &str) |
| Add the IDAT prefix bytes for the zlib stream. | |
| string_ptr | huff (const std::string &str) |
| Add the segment bits for the huffman format (non compressed). | |
| string_ptr | data (const ColorMap &c, int osr, int osc) |
| Get the color data for a full color map. | |
| string_ptr | data (const InterpolatedColorMap &c, int osr, int osc) |
| Get the color data for an indexed color map. | |
| unsigned int | alder (const string_ptr &str) |
| Get the alder32 checksum for a string. | |
| string_ptr | iend () |
| IEND Chunk required at end of PNG. | |
| string_ptr | chunk (const std::string &title, const std::string &text) |
| Add chunk bits (length, checksum) before and after chunk bytes. | |
| string_ptr | itos (int i) |
| Integer to string of 4 bytes. | |
| string_ptr | ctos (const Color &color) |
| Color to string of 3 bytes. | |
| char | btoc (int b) |
| Byte to single character. | |
Static Protected Attributes | |
| const std::string | header |
| PNG file format header bytes. | |
|
|
Typedef of string pointer using auto_ptr.
Definition at line 56 of file PNG.hpp. Referenced by chunk(), ctos(), data(), huff(), idat(), iend(), ihdr_full(), ihdr_indexed(), itos(), phys(), plte(), prefix(), split(), and srgb(). |
|
|
Get the alder32 checksum for a string.
Definition at line 346 of file PNG.cpp. References Adler32::getValue(), and Adler32::update(). Referenced by idat(). |
|
|
Byte to single character.
Definition at line 392 of file PNG.cpp. Referenced by ctos(), data(), huff(), ihdr_full(), ihdr_indexed(), itos(), phys(), prefix(), and srgb(). |
|
||||||||||||
|
Add chunk bits (length, checksum) before and after chunk bytes.
Definition at line 358 of file PNG.cpp. References CRC32::getValue(), itos(), string_ptr, and CRC32::update(). Referenced by iend(), ihdr_full(), ihdr_indexed(), phys(), plte(), split(), and srgb(). |
|
||||||||||||
|
Get the byte cost of a non-indexed PNG.
Definition at line 122 of file PNG.cpp. References cost_idat(). |
|
|
Get the byte cost of a non-indexed PNG.
Definition at line 107 of file PNG.cpp. References Bitmap::getCM(), ColorMap::getCols(), InterpolatedColorMap::getCols(), Bitmap::getICM(), ColorMap::getRows(), InterpolatedColorMap::getRows(), Bitmap::osc, and Bitmap::osr. |
|
|
Get the cost for IDAT chunks for a stream of this length.
Definition at line 132 of file PNG.cpp. Referenced by cost_constant(), and cost_indexed(). |
|
||||||||||||||||
|
Get the byte cost of an indexed PNG with numcol colors.
Definition at line 96 of file PNG.cpp. References cost_idat(). |
|
|
Get the byte cost of an indexed PNG Returns -1 if the bitmap doesn't have an Indexed/InterpolatedColorMap.
Definition at line 86 of file PNG.cpp. References InterpolatedColorMap::getCols(), Bitmap::getICM(), InterpolatedColorMap::getRows(), Bitmap::osc, and Bitmap::osr. |
|
|
Color to string of 3 bytes.
Definition at line 381 of file PNG.cpp. References btoc(), Color::getRGB(), and string_ptr. |
|
||||||||||||||||
|
Get the color data for an indexed color map.
Definition at line 323 of file PNG.cpp. References btoc(), InterpolatedColorMap::getCols(), InterpolatedColorMap::getIndex(), InterpolatedColorMap::getRows(), and string_ptr. |
|
||||||||||||||||
|
Get the color data for a full color map.
Definition at line 301 of file PNG.cpp. References btoc(), ctos(), ColorMap::get(), ColorMap::getCols(), ColorMap::getRows(), and string_ptr. Referenced by idat(). |
|
|
Add the segment bits for the huffman format (non compressed).
Definition at line 272 of file PNG.cpp. References btoc(), and string_ptr. Referenced by idat(). |
|
||||||||||||||||
|
IDAT Chunk for a full color map.
Definition at line 220 of file PNG.cpp. References alder(), data(), huff(), itos(), prefix(), split(), and string_ptr. |
|
||||||||||||||||
|
IDAT Chunk for an indexed color map.
Definition at line 209 of file PNG.cpp. References alder(), data(), huff(), itos(), prefix(), split(), and string_ptr. |
|
|
IEND Chunk required at end of PNG.
Definition at line 353 of file PNG.cpp. References chunk(), and string_ptr. |
|
||||||||||||
|
IHDR Chunk for full color maps.
Definition at line 143 of file PNG.cpp. References btoc(), chunk(), itos(), and string_ptr. |
|
||||||||||||
|
IHDR Chunk for indexed color maps.
Definition at line 156 of file PNG.cpp. References btoc(), chunk(), itos(), and string_ptr. |
|
|
Integer to string of 4 bytes.
Definition at line 371 of file PNG.cpp. References btoc(), and string_ptr. Referenced by chunk(), idat(), ihdr_full(), ihdr_indexed(), and phys(). |
|
|
pHYs Chunk for telling the PNG renderer pixel width/height
Definition at line 177 of file PNG.cpp. References btoc(), chunk(), itos(), and string_ptr. |
|
|
PLTE Chunk for listing the indexed colors.
Definition at line 186 of file PNG.cpp. References chunk(), ctos(), Palette::getColor(), InterpolatedColorMap::getPalette(), and string_ptr. |
|
||||||||||||||||
|
Get a string representing the contents of a PNG file using an indexed color map.
|
|
||||||||||||||||
|
Get a string representing the contents of a PNG file using an indexed color map.
|
|
|
Get a string representing the contents of a PNG file using a Bitmap. This is a helper function to call the others. |
|
|
Add the IDAT prefix bytes for the zlib stream.
Definition at line 253 of file PNG.cpp. References btoc(), log, and string_ptr. Referenced by idat(). |
|
|
Split up IDAT Chunk to multiple chunks if too large.
Definition at line 231 of file PNG.cpp. References chunk(), and string_ptr. Referenced by idat(). |
|
|
sRGB Chunk for telling the PNG renderer to keep the colors pretty
Definition at line 170 of file PNG.cpp. References btoc(), chunk(), and string_ptr. |
|
|
PNG file format header bytes.
|
1.3.9.1