QcAppIcon Namespace
The application icon: a grass block with an iron pickaxe on a rounded sky tile, drawn from the game's own procedural textures, so it needs no image files. More...
| Header: | #include <clientcore/icons/QcAppIcon.h> |
Classes
| struct | IconFile |
Functions
| QByteArray | encodeIco(const QList<QImage> &images) |
| QList<int> | icoSizes() |
| QList<QcAppIcon::IconFile> | iconSetFiles() |
| QImage | render(const QImage &top, const QImage &side, const QImage &tool, int size) |
| QcStatus | writeIco(const QcTextureAtlas &atlas, const QString &path) |
| QcStatus | writeIconSet(const QcTextureAtlas &atlas, const QString &directory) |
Detailed Description
Function Documentation
QByteArray QcAppIcon::encodeIco(const QList<QImage> &images)
Returns a Windows .ico file holding images (square, at most 256 pixels): 32-bit BMP entries with an all-opaque mask below 256 pixels, a PNG entry for 256 pixels (as Windows Vista and later read it).
QList<int> QcAppIcon::icoSizes()
Returns the edge lengths of the images in the Windows icon (.ico): 16 to 256 pixels, the sizes Explorer, the taskbar and the title bar pick from at 100 % to 200 % display scaling.
QList<QcAppIcon::IconFile> QcAppIcon::iconSetFiles()
Returns the ten images of a macOS .iconset (16 to 512 points at 1x and 2x).
QImage QcAppIcon::render(const QImage &top, const QImage &side, const QImage &tool, int size)
Returns the square icon of size pixels from the three texture tiles top and side of the block and tool.
QcStatus QcAppIcon::writeIco(const QcTextureAtlas &atlas, const QString &path)
Renders the icon from atlas at every size of icoSizes() and writes it as a Windows .ico file to path (cmake/windows/QtCraft.ico, embedded into the Windows executables); returns the error when it cannot be written.
QcStatus QcAppIcon::writeIconSet(const QcTextureAtlas &atlas, const QString &directory)
Renders the icon from the textures of atlas qtcraft:grass_top, qtcraft:grass_side and qtcraft:iron_pickaxe and writes every image of iconSetFiles() into directory; returns the error when a file cannot be written.