In development. It changes without notice.
Topic
Brand Lookup & Logo Atlas
From the address or the name in a login to the service's logo.
A domain or a name is brought to one form, hashed, and looked up in an atlas generated from the logos' sources and kept in flash. It draws nothing: the vault asks it which brand a login has, and Brand Logos draws it.
- See also
- Brand Logos
Files | |
| file | src/ |
| Domain→brand-logo registry: canonicalization, hashing, and lookup. | |
Classes | |
| struct | kleidos:: |
| One brand-atlas record. Kept exactly 16 bytes for compact flash storage. More about kleidos:: | |
Enumerations | |
| enum class | kleidos:: |
| Pixel encoding family of a stored brand asset. More about kleidos:: | |
| enum class | kleidos:: |
Requested rendering style; Auto picks the best available family. More about kleidos:: | |
| enum class | kleidos:: |
| Logical render size in logical pixels (square). More about kleidos:: | |
Functions | |
| uint8_t | kleidos:: |
| Pixel side length in pixels for a Size value. | |
| uint32_t | kleidos:: |
| FNV-1a 32-bit hash of a NUL-terminated string. | |
| bool | kleidos:: |
Canonicalize a domain/out. | |
| uint32_t | kleidos:: |
| Canonicalize then hash a domain/ | |
| bool | kleidos:: |
| True if the registry has an asset for the given domain/ | |
| const BrandEntry * | kleidos:: |
| Resolve the best BrandEntry for a domain/ | |
Color payload layouts | |
A color entry (AssetFamily:: | |
| constexpr uint8_t | kleidos:: |
| constexpr uint8_t | kleidos:: |
| Byte RLE of the RGB565 bytes, then byte RLE of the packed A4 nibbles. | |
| constexpr uint8_t | kleidos:: |
| [n-1][n palette colors][byte RLE of index << 4 | a4, one byte per pixel], n <= 16. | |
| constexpr uint8_t | kleidos:: |
| constexpr uint8_t | kleidos:: |
Enumeration Type Documentation
AssetFamily #
Size #
Style #
Function Documentation
canonicalizeDomain() #
Canonicalize a domain/out.
The canonical form is the host alone, in lower case: leading spaces, the scheme (https://, or a bare //), any user info before an @, the port, the path, the query, the fragment, trailing dots and a leading www. are dropped.
- Parameters
-
Name Direction Meaning domainOrService in Input domain or service name. out out Output buffer for the canonical form. outLen in Capacity of outincluding NUL.
- Return values
-
Value Meaning true Canonical form was written to out.false No host was found, or it would overflow out;outholds an empty or partial string then.
findBrand() #
Resolve the best BrandEntry for a domain/
Looks up the canonical host first, then its registrable root (login.example.co.uk falls back to example.co.uk), at the exact size asked for and in a family the style accepts.
- Parameters
-
Name Direction Meaning domainOrService in Domain or service name. size in Requested logical size. style in Requested rendering style.
- Returns
- Pointer to the best matching entry, or nullptr if none.
fnv1a32() #
FNV-1a 32-bit hash of a NUL-terminated string.
Hashes the bytes as given, with no canonicalization; a null text hashes as the empty string (the offset basis).
- Parameters
-
Name Direction Meaning text in NUL-terminated input string, or null.
- Returns
- 32-bit FNV-1a hash.
hasBrand() #
True if the registry has an asset for the given domain/
- Parameters
-
Name Direction Meaning domainOrService in Domain or service name to look up.
- Return values
-
Value Meaning true At least one brand size is registered for the canonical form. false No entry matches the canonical form.
hashDomain() #
Canonicalize then hash a domain/
- Parameters
-
Name Direction Meaning domainOrService in Input domain or service name.
- Returns
- 32-bit FNV-1a hash of the canonical form.
sizePixels() #
Variable Documentation
kColorCodecIndexed #
[n-1][n palette colors][byte RLE of one index per pixel], then byte RLE of the packed A4 nibbles, n <= 256.
kColorCodecMask #
Flags bits that name the layout.
kColorCodecRle16 #
RLE of 16-bit RGB565 values (decodeRle()'s control byte, two bytes a value), then byte RLE of the packed A4 nibbles.