libfacade 1.1
A library for manipulating PNG images with payloads.
|
A Windows icon file. More...
#include <ico.hpp>
Public Types | |
enum | EntryType { ENTRY_BMP = 0 , ENTRY_PNG } |
A simple enumeration to differentiate between PNG sections and bitmap sections. More... | |
using | Entry = std::pair< IconDirEntry, std::vector< std::uint8_t > > |
A C++ representation of a bitmap entry within the icon file. | |
Public Member Functions | |
Icon () | |
Icon (const void *ptr, std::size_t size) | |
Icon (const std::vector< std::uint8_t > &vec) | |
Icon (const std::string &filename) | |
Icon (const Icon &other) | |
Icon & | operator= (const Icon &other) |
Entry & | operator[] (std::size_t index) |
Syntactic sugar to get an entry within the icon file. | |
const Entry & | operator[] (std::size_t index) const |
Syntactic sugar to get a const entry within the icon file. | |
std::size_t | size (void) const |
Return the number of bitmap entries within the icon file. | |
void | parse (const void *ptr, std::size_t size) |
Parse the given pointer and size as an icon file. | |
void | parse (const std::vector< std::uint8_t > &vec) |
Parse the given byte vector as an icon file. | |
void | parse (const std::string &filename) |
Parse the given file as an icon file. | |
Entry & | get_entry (std::size_t index) |
Get a bitmap entry within the icon file. | |
const Entry & | get_entry (std::size_t index) const |
Get a const bitmap entry within the icon file. | |
void | set_entry (std::size_t index, const Entry &data) |
Set the given entry at the given index in the icon file's bitmap directory. | |
void | set_entry (std::size_t index, const IconDirEntry &entry, const std::vector< std::uint8_t > &data) |
Set the given entry object and image data at the given index in the icon file's bitmap directory. | |
EntryType | entry_type (std::size_t index) const |
Return the type of bitmap the given directory bitmap is. Possible values are Icon::EntryType::ENTRY_BMP and Icon::EntryType::ENTRY_PNG. | |
std::vector< std::uint8_t > | to_file () const |
Convert this icon object to its file representation. | |
void | save (const std::string &filename) const |
Convert this icon object to a file and save it to disk. | |
void | resize (std::size_t size) |
Resize the number of entries this icon object can hold. | |
Entry & | insert_entry (std::size_t index, const Entry &entry) |
Insert and return the given bitmap entry at the given index. | |
Entry & | insert_entry (std::size_t index, const IconDirEntry &entry, const std::vector< std::uint8_t > &data) |
Insert and return the given entry header and bitmap data at the given index. | |
Entry & | append_entry (const Entry &entry) |
Append a bitmap entry pair to the end of this icon's bitmap directory. | |
Entry & | append_entry (const IconDirEntry &entry, const std::vector< std::uint8_t > &data) |
Append an entry header and bitmap data to the end of the icon's bitmap directory. | |
void | remove_entry (std::size_t index) |
Remove the bitmap entry at the given index. | |
A Windows icon file.
using facade::ico::Icon::Entry = std::pair<IconDirEntry, std::vector<std::uint8_t> > |
A C++ representation of a bitmap entry within the icon file.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Icon::Entry & Icon::append_entry | ( | const Entry & | entry | ) |
Append a bitmap entry pair to the end of this icon's bitmap directory.
Icon::Entry & Icon::append_entry | ( | const IconDirEntry & | entry, |
const std::vector< std::uint8_t > & | data | ||
) |
Append an entry header and bitmap data to the end of the icon's bitmap directory.
Icon::EntryType Icon::entry_type | ( | std::size_t | index | ) | const |
Return the type of bitmap the given directory bitmap is. Possible values are Icon::EntryType::ENTRY_BMP and Icon::EntryType::ENTRY_PNG.
exception::OutOfBounds |
Icon::Entry & Icon::get_entry | ( | std::size_t | index | ) |
Get a bitmap entry within the icon file.
exception::OutOfBounds |
const Icon::Entry & Icon::get_entry | ( | std::size_t | index | ) | const |
Get a const bitmap entry within the icon file.
exception::OutOfBounds |
Icon::Entry & Icon::insert_entry | ( | std::size_t | index, |
const Entry & | entry | ||
) |
Insert and return the given bitmap entry at the given index.
exception::OutOfBounds |
Icon::Entry & Icon::insert_entry | ( | std::size_t | index, |
const IconDirEntry & | entry, | ||
const std::vector< std::uint8_t > & | data | ||
) |
Insert and return the given entry header and bitmap data at the given index.
exception::OutOfBounds |
|
inline |
Syntactic sugar to get an entry within the icon file.
|
inline |
Syntactic sugar to get a const entry within the icon file.
void Icon::parse | ( | const std::string & | filename | ) |
Parse the given file as an icon file.
void Icon::parse | ( | const std::vector< std::uint8_t > & | vec | ) |
Parse the given byte vector as an icon file.
void Icon::parse | ( | const void * | ptr, |
std::size_t | size | ||
) |
Parse the given pointer and size as an icon file.
void Icon::remove_entry | ( | std::size_t | index | ) |
Remove the bitmap entry at the given index.
exception::OutOfBounds |
void Icon::resize | ( | std::size_t | size | ) |
Resize the number of entries this icon object can hold.
void Icon::save | ( | const std::string & | filename | ) | const |
Convert this icon object to a file and save it to disk.
void Icon::set_entry | ( | std::size_t | index, |
const Entry & | data | ||
) |
Set the given entry at the given index in the icon file's bitmap directory.
exception::OutOfBounds |
void Icon::set_entry | ( | std::size_t | index, |
const IconDirEntry & | entry, | ||
const std::vector< std::uint8_t > & | data | ||
) |
Set the given entry object and image data at the given index in the icon file's bitmap directory.
exception::OutOfBounds |
std::size_t Icon::size | ( | void | ) | const |
Return the number of bitmap entries within the icon file.
std::vector< std::uint8_t > Icon::to_file | ( | void | ) | const |
Convert this icon object to its file representation.
exception::NoIconData |