|
resonance 1.0.1
|
Generator of the credits avatar header. More...
Functions | |
| std::optional< std::vector< std::uint8_t > > | fetchAvatar (const std::string &user, int size, const std::string &magick) |
| Fetch a GitHub avatar over HTTPS and convert it to RGBA texels with ImageMagick. | |
| std::string | composeCreditsHeader (const std::string &text, int size, const std::optional< std::vector< std::uint8_t > > &texels) |
| Compose the credits avatar header. | |
Generator of the credits avatar header.
| std::optional< std::vector< std::uint8_t > > Tools::CreditsAvatar::fetchAvatar | ( | const std::string & | user, |
| int | size, | ||
| const std::string & | magick ) |
Fetch a GitHub avatar over HTTPS and convert it to RGBA texels with ImageMagick.
Alpha is on the GS scale, where 0x80 is opaque. Each failure logs a warning and returns no texels.
| user | GitHub user name. |
| size | Width and height of the texture in pixels. |
| magick | ImageMagick command, or empty when ImageMagick is not installed. |
| std::string Tools::CreditsAvatar::composeCreditsHeader | ( | const std::string & | text, |
| int | size, | ||
| const std::optional< std::vector< std::uint8_t > > & | texels ) |
Compose the credits avatar header.
The header defines RESONANCE_CREDITS_TEXT, RESONANCE_CREDITS_AVATAR_SIZE, and RESONANCE_CREDITS_HAS_AVATAR. With texels, RESONANCE_CREDITS_HAS_AVATAR is 1 and the header also defines the texel array kCreditsAvatarTexels. Without texels, RESONANCE_CREDITS_HAS_AVATAR is 0 and the credit has no picture.
| text | Credit text. |
| size | Width and height of the texture in pixels. |
| texels | RGBA texels, or nothing for a credit without a picture. |