QtCraft API C++ classes QML types Handbook

QcTextureSpec Struct

Data description of a procedurally generated block/item texture. More...

Header: #include <clientcore/textures/QcTextureSpec.h>

Public Types

enum class Pattern { Noise, Speckle, Planks, Bricks, LogSide, …, Patches }

Public Variables

QStringList bitmap
bool detailed
QHash<QChar, QColor> palette
QcTextureSpec::Pattern pattern
double phase
QColor primary
QColor secondary
quint32 seed
std::optional<std::pair<int, int>> tile
int tilesHigh
int tilesWide
double variation

Static Public Members

const int maxBitmapRows
const int maxPaletteEntries
std::optional<QcTextureSpec::Pattern> qcTexturePatternFromName(const QString &name)

Detailed Description

Member Type Documentation

enum class QcTextureSpec::Pattern

What the texture shows; the colours, the seed and the bitmap fill it in.

ConstantValueDescription
QcTextureSpec::Pattern::Noise0the primary colour with pixel variation
QcTextureSpec::Pattern::Speckle1like Noise with scattered pixels in the secondary colour
QcTextureSpec::Pattern::Planks2staggered boards with seams
QcTextureSpec::Pattern::Bricks3bricks (primary) in mortar
QcTextureSpec::Pattern::LogSide4bark of a log
QcTextureSpec::Pattern::LogTop5a log's cut with growth rings
QcTextureSpec::Pattern::Leaves6leaves with gaps
QcTextureSpec::Pattern::Glass7a pane with a frame; keeps transparency
QcTextureSpec::Pattern::GrassSide8soil with a grass rim on top
QcTextureSpec::Pattern::Ore9stone (primary) with clusters of ore (secondary)
QcTextureSpec::Pattern::Water10water with waves, animated
QcTextureSpec::Pattern::Tool11a plain tool on the diagonal: handle and head
QcTextureSpec::Pattern::Lump12a round lump (primary, spots secondary) on a transparent background
QcTextureSpec::Pattern::Pickaxe13tool icon: a pickaxe
QcTextureSpec::Pattern::Axe14tool icon: an axe
QcTextureSpec::Pattern::Shovel15tool icon: a shovel
QcTextureSpec::Pattern::Sword16tool icon: a sword
QcTextureSpec::Pattern::Stick17tool icon: a stick without head
QcTextureSpec::Pattern::Ingot18item icon: an ingot
QcTextureSpec::Pattern::Gem19item icon: a cut gem
QcTextureSpec::Pattern::Sapling20Small plant: a stem in the secondary colour under a leafy crown in the primary colour.
QcTextureSpec::Pattern::Face21Eyes (primary with secondary pupils) and a mouth on a transparent background, for a thin box in front of a head.
QcTextureSpec::Pattern::Furnace22Machine front: a stone face (primary) with a dark fire opening (secondary) and a grate.
QcTextureSpec::Pattern::Torch23Torch stretched over a thin box: a flame (secondary) on top of a stick (primary).
QcTextureSpec::Pattern::TorchItem24Torch as a flat icon on a transparent background.
QcTextureSpec::Pattern::Ladder25Two rails with rungs (primary) on a transparent background.
QcTextureSpec::Pattern::DoorLower26Door halves: vertical boards (primary) in a frame (secondary); the lower one with a handle, the upper one with a window.
QcTextureSpec::Pattern::DoorUpper27the upper half, with the window
QcTextureSpec::Pattern::DoorItem28The whole door as an icon: both halves in a narrow frame, the window above, the handle below, on a transparent background (decision E-831).
QcTextureSpec::Pattern::Trapdoor29Hatch of boards with a frame and two openings.
QcTextureSpec::Pattern::ChestSide30Chest: boards (primary) with darker edges and a lid seam; the front adds a latch (secondary), the top only has the frame.
QcTextureSpec::Pattern::ChestFront31the front with the latch
QcTextureSpec::Pattern::ChestTop32the top with the frame
QcTextureSpec::Pattern::Lava33Molten rock: glowing streaks (secondary) in a darker flow (primary).
QcTextureSpec::Pattern::Fire34Flames on a transparent background (decision E-392): tongues rising from the bottom, the secondary colour in their core, the primary at their edges.
QcTextureSpec::Pattern::Flower35Blossom (primary) with a light centre on a stem with two leaves (secondary).
QcTextureSpec::Pattern::TallGrass36Blades of grass of different heights (primary, tips secondary).
QcTextureSpec::Pattern::Mushroom37Cap (primary, lighter spots) on a pale stem.
QcTextureSpec::Pattern::SugarCane38Three jointed stalks (primary) with a few leaves (secondary).
QcTextureSpec::Pattern::Bottle39Glass bottle with a cork; the contents in the secondary colour (transparent: empty).
QcTextureSpec::Pattern::Bucket40Metal bucket (primary); the contents seen from above in the secondary colour.
QcTextureSpec::Pattern::Lantern41Lamp housing (primary) around a glowing window (secondary) with bars, for a stretched box.
QcTextureSpec::Pattern::Limb42Bare skin of an arm or hand (meant to be tinted): rounded shading towards the edges, soft mottling, at the bottom a knuckle line and fingers (secondary).
QcTextureSpec::Pattern::Sleeve43Sleeve fabric (meant to be tinted): fine weave, rounded shading and folds, a darker cuff with a stitched seam at the bottom.
QcTextureSpec::Pattern::Nugget44Patterns of QcTextureCraftPatterns (storage blocks, crafted items, small plants). A few small grains (primary, highlights secondary) on a transparent background.
QcTextureSpec::Pattern::MetalBlock45Storage block: a solid face (primary) with a bevelled frame and highlights (secondary).
QcTextureSpec::Pattern::Bars46Vertical bars (primary) with two cross bars on a transparent background.
QcTextureSpec::Pattern::Bookshelf47Bookshelf side: planks (primary) holding two rows of coloured book spines.
QcTextureSpec::Pattern::Paper48Sheet of paper (primary) with faint lines (secondary).
QcTextureSpec::Pattern::Book49Book: cover (primary) with pages (secondary) at the edge.
QcTextureSpec::Pattern::Bowl50Wooden bowl (primary) seen from the side; Stew fills it with soup (secondary).
QcTextureSpec::Pattern::Stew51the bowl filled with soup
QcTextureSpec::Pattern::Apple52Round fruit (primary) with a stalk and leaf (secondary).
QcTextureSpec::Pattern::Leather53Hide (primary) with stitches (secondary); Scrap is a ragged small piece of it.
QcTextureSpec::Pattern::Scrap54a ragged small piece of hide
QcTextureSpec::Pattern::String55Coiled thread (primary).
QcTextureSpec::Pattern::Cobweb56Web of threads (primary) on a transparent background.
QcTextureSpec::Pattern::DeadBush57Dry twigs (primary) without leaves.
QcTextureSpec::Pattern::Fern58Fern fronds (primary, tips secondary).
QcTextureSpec::Pattern::FireflyGlass59Glass (primary) with glowing dots (secondary); keeps partial transparency.
QcTextureSpec::Pattern::BarrelSide60Barrel: vertical staves (primary) with metal hoops (secondary); the top shows a lid.
QcTextureSpec::Pattern::BarrelTop61the top with the lid
QcTextureSpec::Pattern::StainedGlass62Tinted glass: a frame (secondary) around a clearly coloured pane (primary); keeps partial transparency.
QcTextureSpec::Pattern::RawChunk63Raw metal (decision E-740): a lumpy chunk (primary, stony spots and rim secondary) on a transparent background, and the block of raw metal: rounded lumps with crevices (secondary) between them.
QcTextureSpec::Pattern::RawBlock64the block of raw metal
QcTextureSpec::Pattern::Chain65Chain links (primary, highlights secondary) on a transparent background, running from top to bottom through the middle four columns; ChainAcross runs from left to right through the middle four rows (decision E-742).
QcTextureSpec::Pattern::ChainAcross66links running from left to right
QcTextureSpec::Pattern::BackpackSide67A leather backpack (decision E-832): sides with a strap and a buckle (secondary), the front with a stitched flap and its buckle, the top with a carrying loop; all with a darker seam at the edges. BackpackItem is its icon: the body with a loop, a lighter flap with its buckle and a pocket, on a transparent background.
QcTextureSpec::Pattern::BackpackFront68the front with the flap
QcTextureSpec::Pattern::BackpackTop69the top with the loop
QcTextureSpec::Pattern::BackpackItem70the icon
QcTextureSpec::Pattern::Hoe71Patterns of QcTextureFarmPatterns (decision E-289): a hoe (tool head like the others) ...
QcTextureSpec::Pattern::Crop72... crop plants on a transparent background: stalks (primary) with ears (secondary), leafy tufts (primary) showing roots or tubers (secondary) at the bottom, a thin stem with leaves ...
QcTextureSpec::Pattern::RootCrop73leafy tufts with roots or tubers
QcTextureSpec::Pattern::Stem74a thin stem with leaves
QcTextureSpec::Pattern::Farmland75... tilled soil with furrows (primary, furrows secondary) ...
QcTextureSpec::Pattern::PumpkinSide76... fruit blocks: a ribbed pumpkin side and its top with the stalk, a striped melon ...
QcTextureSpec::Pattern::PumpkinTop77the pumpkin's top with the stalk
QcTextureSpec::Pattern::MelonSide78the striped melon
QcTextureSpec::Pattern::Wheat79... and food icons: a sheaf of wheat, a loaf, a carrot, a melon slice, a pie.
QcTextureSpec::Pattern::Bread80a loaf
QcTextureSpec::Pattern::Carrot81a carrot
QcTextureSpec::Pattern::MelonSlice82a melon slice
QcTextureSpec::Pattern::Pie83a pie
QcTextureSpec::Pattern::HaySide84... the hay bale: straw running from top to bottom (primary, darker stalks secondary) tied by two bands, its top with cut stalk ends; and flint and steel: a steel striker (secondary) bent around a dark flint chip (primary), an item icon (decision E-393).
QcTextureSpec::Pattern::HayTop85the hay bale's top
QcTextureSpec::Pattern::FlintAndSteel86flint and steel
QcTextureSpec::Pattern::CarvedPumpkin87a pumpkin face
QcTextureSpec::Pattern::Shears88shears
QcTextureSpec::Pattern::Helmet89Patterns of QcTextureArmourPatterns (decision E-235): item icons in the material (primary) with a light upper edge (secondary) ...
QcTextureSpec::Pattern::Chestplate90chestplate icon
QcTextureSpec::Pattern::Leggings91leggings icon
QcTextureSpec::Pattern::Boots92boots icon
QcTextureSpec::Pattern::ArmourPlate93... and what armour looks like on a body: a riveted plate, stitched leather, a helmet front with an opening for the face, a visor with eye slits, polished trim with a ridge.
QcTextureSpec::Pattern::ArmourLeather94stitched leather
QcTextureSpec::Pattern::HelmetFront95helmet front with an opening
QcTextureSpec::Pattern::Visor96visor with eye slits
QcTextureSpec::Pattern::ArmourTrim97polished trim
QcTextureSpec::Pattern::ArmourStand98Icon of an armour stand: a post with bars (primary) on a stone plate (secondary).
QcTextureSpec::Pattern::Emblem99Pixel art from bitmap (QcTextureEmblem): each character picks a colour of palette, any other character (and every pixel the bitmap leaves out) shows woven cloth in the primary colour. For cape emblems and hems (decision E-241).
QcTextureSpec::Pattern::Dust100Patterns of QcTextureSignalPatterns (decision E-333): loose grains of the wire (primary, some secondary) on a transparent background, a lever icon (stick primary, base secondary), a repeater's slab (primary) with a wire and arrow (secondary), a piston's stone side (primary) in a wooden frame (secondary).
QcTextureSpec::Pattern::Lever101lever icon
QcTextureSpec::Pattern::Repeater102repeater slab
QcTextureSpec::Pattern::PistonSide103piston side
QcTextureSpec::Pattern::Hopper104Signal machines (decision E-342): a hopper's riveted iron side (primary, rivets and seams secondary), its rim seen from above around a dark bowl (secondary), its item icon (a funnel), a comparator's slab (primary) with three torch spots and a wire (secondary), an observer's face (primary) with a slit of eyes (secondary), its back with the output spot (secondary), its side with an arrow, and the fronts of dispenser and dropper: a stone face (primary) with a round mouth or a narrow slot (secondary). Rail: two iron rails (primary) on wooden sleepers (secondary), as an item icon; minecart: an open iron tub (primary) with a dark inside and wheels (secondary), as an item icon (decision E-382).
QcTextureSpec::Pattern::HopperTop105hopper rim from above
QcTextureSpec::Pattern::HopperItem106hopper icon
QcTextureSpec::Pattern::Comparator107comparator slab
QcTextureSpec::Pattern::ObserverFace108observer face
QcTextureSpec::Pattern::ObserverBack109observer back
QcTextureSpec::Pattern::ObserverSide110observer side
QcTextureSpec::Pattern::ObserverTop111observer top
QcTextureSpec::Pattern::ObserverBottom112observer bottom
QcTextureSpec::Pattern::Dispenser113dispenser front
QcTextureSpec::Pattern::Dropper114dropper front
QcTextureSpec::Pattern::Rail115rail icon
QcTextureSpec::Pattern::Minecart116minecart icon
QcTextureSpec::Pattern::Bow117Patterns of QcTextureRangedPatterns (decision E-425): a bow (wood primary, string secondary), an arrow (shaft primary, fletching secondary), a feather (vanes primary, quill secondary) and a bone (primary, its knobs shaded by secondary; decision E-426), all icons on the diagonal.
QcTextureSpec::Pattern::BowDrawn1118The bow drawn with an arrow on it, in its three stages (decision E-987): limbs and string as Bow, pulled back further from stage to stage.
QcTextureSpec::Pattern::BowDrawn2119the second stage
QcTextureSpec::Pattern::BowDrawn3120the third stage, fully drawn
QcTextureSpec::Pattern::Arrow121an arrow
QcTextureSpec::Pattern::Feather122a feather
QcTextureSpec::Pattern::Bone123a bone
QcTextureSpec::Pattern::FishingRod124A fishing rod (decision E-503): the rod (primary) on the diagonal, its line (secondary) hanging from the tip with a hook.
QcTextureSpec::Pattern::MossyBricks125Patterns of QcTextureBuildingPatterns (decision E-750): bricks (primary) with moss (secondary) in patches and in the mortar, bricks with mortar (secondary) and two cracks, a chiseled face of nested frames, a smooth face in a thin frame (secondary) and a glazed ornament (secondary on primary) without symmetry, so turned blocks show their facing.
QcTextureSpec::Pattern::CrackedBricks126cracked bricks
QcTextureSpec::Pattern::ChiseledBricks127a chiseled face
QcTextureSpec::Pattern::SmoothStone128a smooth face
QcTextureSpec::Pattern::GlazedTerracotta129a glazed ornament
QcTextureSpec::Pattern::Icon130Pixel art like Emblem, but every pixel the palette does not colour is transparent: item icons from data (signs, compass and clock, decisions E-766, E-769).
QcTextureSpec::Pattern::CakeTop131Patterns of QcTextureKitchenPatterns (decisions E-772 to E-774): the cake's frosted top (primary) with berries, its side (frosting primary over sponge secondary, the upper half clear) and its icon, the campfire's icon (logs primary, their ends secondary, a flame) and a round lily pad with a notch and veins (secondary).
QcTextureSpec::Pattern::CakeSide132the cake's side
QcTextureSpec::Pattern::CakeItem133the cake's icon
QcTextureSpec::Pattern::CampfireItem134the campfire's icon
QcTextureSpec::Pattern::LilyPad135a lily pad
QcTextureSpec::Pattern::ItemFrame136Patterns of QcTexturePaintingPatterns (decision E-791): an item frame (a wooden border in the primary colour around leather in the secondary) and painting motifs drawn over a canvas of tilesWide x tilesHigh blocks: a landscape of hills under a sun, the sea with a sail, an abstract of coloured fields between dark lines, a night with stars over mountains, a sunset over water and rings spreading over a ground; primary and secondary colour and the seed vary each.
QcTextureSpec::Pattern::PaintingLandscape137hills under a sun
QcTextureSpec::Pattern::PaintingSea138the sea with a sail
QcTextureSpec::Pattern::PaintingAbstract139coloured fields between dark lines
QcTextureSpec::Pattern::PaintingNight140stars over mountains
QcTextureSpec::Pattern::PaintingSunset141a sunset over water
QcTextureSpec::Pattern::PaintingRings142rings spreading over a ground
QcTextureSpec::Pattern::Ice143Ice without a frame, tiling without seams (QcTextureBuildingPatterns): a smooth face (primary, its alpha kept, so ice stays translucent and blue ice opaque) with soft diagonal streaks (secondary); packed ice is opaque with fine wandering cracks (secondary).
QcTextureSpec::Pattern::PackedIce144packed ice
QcTextureSpec::Pattern::Slime145Slime (decision E-860): a translucent fill in the primary colour (its alpha kept) with a one-pixel rim in the secondary colour (its alpha kept too); the slime block draws it on its outer cube and, darker and more opaque, on its inner core cube.
QcTextureSpec::Pattern::Reeds146Reeds (decision E-850): thin stalks with long leaves (primary), a few with a brown head (secondary).
QcTextureSpec::Pattern::Patches147A creature's coat (QcTextureCoatPatterns, decision E-880): a few large smooth-edged patches (secondary) on the primary colour, like a Holstein cow; the seed places them.

Member Variable Documentation

QStringList QcTextureSpec::bitmap

Emblem and Icon: the rows of the picture, one character per pixel (QcTextureEmblem). The initialisers of this field and the next keep aggregate initialisations that leave them out free of -Wmissing-field-initializers.

bool QcTextureSpec::detailed

Whether the picture is the base of a texture enlarged above 16 x 16 (QcTextureDetail, decision E-1000): a pattern may then add parts the 16 x 16 icon leaves out because they would be lost or crowded at one pixel, such as a sword's guard. The 16 x 16 picture stays unchanged.

QHash<QChar, QColor> QcTextureSpec::palette

Emblem and Icon: the colour of each character of the bitmap.

QcTextureSpec::Pattern QcTextureSpec::pattern

The pattern.

double QcTextureSpec::phase

Where in its loop an animation frame lies (decision E-878): frame / frames, in [0, 1). The patterns that animate (fire, lava, water) move with it so the last frame leads seamlessly into the first; 0 paints the still texture.

QColor QcTextureSpec::primary

The main colour.

QColor QcTextureSpec::secondary

The second colour (seams, spots, contents).

quint32 QcTextureSpec::seed

Varies the pixels and the placement of details; the same seed gives the same texture.

double QcTextureSpec::variation

How strongly the pixels vary around their colour, 0..1.

Related Non-Members

std::optional<QcTextureSpec::Pattern> qcTexturePatternFromName(const QString &name)

Returns the pattern named name in the content ("planks", "log_side", ...); nothing for an unknown name.