QcTextureDetail Namespace
Renders a procedural texture above 16 x 16 (decision E-299): the pattern's 16 x 16 picture is enlarged in steps of two with an edge-aware pixel-art filter (Scale2x on similar colours, so diagonals and round shapes get finer steps instead of blurring), then gains detail that only the higher resolution can show: a fine grain on the surface and a bevel along strong edges (lit at the top and left, shaded at the bottom and right, also towards transparent pixels). The outlines of the enlarged picture follow its coverage alone, so the pixel variation of a thin shape cannot notch or pinch it; tools and weapons take the outline of strokes between the pixels instead (QcTextureOutline, decision E-1000). More...
| Header: | #include <clientcore/textures/QcTextureDetail.h> |
Classes
| struct | Params |
Functions
| QImage | enlarge(const QImage &base, int resolution, const QcTextureDetail::Params ¶ms, quint32 seed) |
| QcTextureDetail::Params | forPattern(QcTextureSpec::Pattern pattern) |
| QcTextureDetail::Params | withOverrides(QcTextureDetail::Params params, const QJsonObject &detail) |
Detailed Description
How much of each a pattern gets is a table per pattern; a texture definition may change it with "detail".
Function Documentation
QImage QcTextureDetail::enlarge(const QImage &base, int resolution, const QcTextureDetail::Params ¶ms, quint32 seed)
Returns base (16 x 16) to resolution (a power of two from 32 to 512) with the detail of params added; seed varies the grain. Deterministic: the same input gives the same image. Partially transparent pixels keep their alpha, the other pixels stay fully opaque or fully transparent.
QcTextureDetail::Params QcTextureDetail::forPattern(QcTextureSpec::Pattern pattern)
Returns the defaults of pattern.
QcTextureDetail::Params QcTextureDetail::withOverrides(QcTextureDetail::Params params, const QJsonObject &detail)
Returns the pattern's defaults params changed by the fields of detail, a texture definition's "detail" object.