TicketLayer¶
Namespace Nfty.Ticket in assembly Nfty.Ticket.
What one layer contributed to a rolled asset.
Constructors¶
TicketLayer(string, string, double?, double?, ColorModel?, LayerKind, int, int)¶
public TicketLayer(string IngredientId, string VariantId, double? Hue, double? Sat, ColorModel? Model, LayerKind Kind, int HueQuantize, int SatQuantize);
Parameters
IngredientId(string) - The layer.VariantId(string) - The variant rolled.Hue(double?) - The rolled hue in degrees, or null for a Custom layer.Sat(double?) - The rolled saturation as a 0..1 fraction, or null for a Custom layer.Model(ColorModel?) - The color space, or null for a Custom layer. Carried so a ticket can be verified standalone; NOT part of the DNA hash (Dna.Computehashes the ingredient id, variant id and quantized hue/saturation only), so this field is not authoritative — a renderer takes the color model from the Menu, where it is fixed per(recipeId, ingredientId)and cannot legitimately vary per asset.Kind(LayerKind) - Dynamic, Static or Custom. Carried so a ticket can be verified standalone; NOT part of the DNA hash, so this field is not authoritative — the same boundary asModelabove.HueQuantize(int) - The layer's hue bucket width, carried so the DNA can be recomputed from the ticket alone. Not authoritative:Plating.Platerefuses a ticket whose quantize differs from the Menu's.SatQuantize(int) - The layer's saturation bucket width, likewise.
Properties¶
Hue¶
The rolled hue in degrees, or null for a Custom layer.
HueQuantize¶
The layer's hue bucket width, carried so the DNA can be recomputed from the ticket alone. Not authoritative: Plating.Plate refuses a ticket whose quantize differs from the Menu's.
IngredientId¶
The layer.
Kind¶
Dynamic, Static or Custom. Carried so a ticket can be verified standalone; NOT part of the DNA hash, so this field is not authoritative — the same boundary as Model above.
Model¶
The color space, or null for a Custom layer. Carried so a ticket can be verified standalone; NOT part of the DNA hash (Dna.Compute hashes the ingredient id, variant id and quantized hue/saturation only), so this field is not authoritative — a renderer takes the color model from the Menu, where it is fixed per (recipeId, ingredientId) and cannot legitimately vary per asset.
Sat¶
The rolled saturation as a 0..1 fraction, or null for a Custom layer.
SatQuantize¶
The layer's saturation bucket width, likewise.
VariantId¶
The variant rolled.