#include <identicon.h>
|
static float | bytesToColor (QByteArray bytes) |
| Converts a series of IDENTICON_COLOR_BYTES bytes to a value in the range 0.0..1.0. More...
|
|
Definition at line 25 of file identicon.h.
◆ Identicon()
Identicon::Identicon |
( |
const QByteArray & |
data | ) |
|
◆ bytesToColor()
float Identicon::bytesToColor |
( |
QByteArray |
bytes | ) |
|
|
static |
Converts a series of IDENTICON_COLOR_BYTES bytes to a value in the range 0.0..1.0.
- Parameters
-
bytes | Bytes to convert to a color |
- Returns
- Value in the range of 0.0..1.0
Definition at line 95 of file identicon.cpp.
◆ toImage()
QImage Identicon::toImage |
( |
int |
scaleFactor = 1 | ) |
|
Writes the Identicon to a QImage.
- Parameters
-
scaleFactor | the image will be a square with scaleFactor * IDENTICON_ROWS pixels, must be >= 1 |
- Returns
- a QImage with the identicon
Definition at line 121 of file identicon.cpp.
◆ ACTIVE_COLS
Width from the center to the outside, for 5 columns it's 3, 6 -> 3, 7 -> 4
Definition at line 38 of file identicon.h.
◆ COLORS
Number of colors to use for the identicon
Definition at line 37 of file identicon.h.
◆ colors
QColor Identicon::colors[COLORS] |
|
private |
◆ HASH_MIN_LEN
Initial value:Min length of the hash in bytes, 7 bytes control the color, the rest controls the pixel placement
Definition at line 39 of file identicon.h.
◆ IDENTICON_COLOR_BYTES
Identicon::IDENTICON_COLOR_BYTES = 6 |
|
staticconstexpr |
Specifies how many bytes should define the foreground color must be smaller than 8, else there'll be overflows
Definition at line 34 of file identicon.h.
◆ IDENTICON_ROWS
Identicon::IDENTICON_ROWS = 5 |
|
staticconstexpr |
Specifies how many rows of blocks the identicon should have
Definition at line 33 of file identicon.h.
◆ identiconColors
The documentation for this class was generated from the following files: