Skip to content

Nfty.Core

The whole engine: archives, validation, generation, rendering, Sets, export, sealing, statistics. Depends on Nfty.Ticket and ImageSharp.

183 public types. Each page lists the public and protected members with their signatures and the documentation written beside the code.

Nfty.Core

Type Kind Summary
Parallelism record How wide independent per-item work may run.
Text class Small wording helpers, so a count is worded the same on every surface.

Nfty.Core.Demo

Type Kind Summary
DemoCookBook class The sample CookBook that ships inside nfty: a small collection of layered chests, present in every build and every download, so nobody's first launch is an empty screen.

Nfty.Core.Diagnostics

Type Kind Summary
Perf class A tiny always-available profiler: named scopes, wall time, and managed allocation.
Perf.Scope struct One measured block.
PerfEntry struct One measured scope's running totals.

Nfty.Core.Editing

Type Kind Summary
AbsentChance class Authoring for a recipe's optional layers: how often each one is left out entirely.
AlphaSnap<TPixel> class Snaps every partially transparent pixel at 50%: alpha at or above VoxelReady.Threshold becomes 255, below it becomes 0.
Brush<TPixel> struct Brush settings: stamp diameter in pixels and the pixel it paints.
BrushStroke<TPixel> class Paints the brush's pixel as a filled disc stamped along a path.
ColorMap class Editable single-layer raster storing full-color RGBA, bound to a fixed canvas size — the color-mode counterpart to ValueMap, and the only surface a Custom layer's artwork can be painted on.
CookBookEdits class Splices an edited ingredient back into a loaded cookbook.
DepthFillAll class Sets every solid pixel to one front/back depth, replacing whatever was there.
DepthLook enum What a whole depth map looks like at a glance.
DepthPicture class Turns an ordinary picture into a DepthMap: the way an author who draws depth in any pixel editor hands it to nfty.
DepthPixel struct One pixel's depth: how far it stands in front of, and behind, the paper plane.
DepthSide enum Which side of the paper a depth edit raises or lowers.
DepthStep class Raises or lowers one side of the depth of every solid pixel a gesture touches, by exactly one.
DepthSummary struct A depth map's look, with the shared depth when it is uniform.
DepthSurface class The surface the depth tools edit: one DepthPixel per art pixel, held beside a copy of the art that says which pixels are solid and which share a color.
DrawShape<TPixel> class Fills a rectangle, inscribed ellipse, or upright triangle with one pixel.
EditHistory<TPixel> class Undo/redo stack of reversible edit commands over one surface.
EraseStroke<TPixel> class Erases to transparency — sets alpha to 0, keeping every other channel — along a path.
FloodFill<TPixel> class 4-connected flood fill of the region matching the seed pixel exactly.
Footprint class Which pixels a gesture touches, independent of what it writes there.
GrayPixel struct One pixel of a ValueMap: a single grayscale value plus an alpha.
IEditCommand<TPixel> interface One reversible edit over an IEditSurface<TPixel>.
IEditSurface<TPixel> interface A fixed-size, randomly-addressable raster the edit commands paint on, generic over the pixel it stores: ValueMap supplies GrayPixel, ColorMap supplies Rgba32.
ImageImport class Turning a picture somebody drew elsewhere into something a layer can hold.
IngredientDraft class The whole ingredient being edited: identity, layer kind, colorization, the fixed canvas size, and its variants.
IngredientDraftExporter class Turns an IngredientDraft into the pair the existing IngredientArchive writes: a manifest plus one live image per variant id.
LayerDepth class Depth, as a projection of RecipeManifest.LayerOrder: 1-based, dense, and bottom-first — depth 1 is the layer that paints first, and everything above paints over it.
MoveSelection<TPixel> class Moves a rectangular selection by (dx, dy) on a single flat raster: the source area is cleared to transparent and its pixels are re-stamped at the shifted position.
OpacityLock enum Whether a paint command may write partial alpha.
PictureUnreadableException class A picture could not be read for import.
PixelRect struct An integer pixel rectangle (top-left origin).
RegionEditCommand<TPixel> class Base for edits expressed as "these pixels get these new values".
RuleEdits class Authoring for a recipe's incompatibility rules: add, replace, remove.
ShapeKind enum The shapes the editor can draw.
TargetedHistory<TKey, TPixel> class One undo/redo history across many surfaces: each step remembers WHICH surface it edited, so undoing restores that surface and says which one it was.
ThicknessBucket struct How many solid pixels share one total thickness.
ValueMap class Editable single-layer raster: one grayscale value (0–255) plus one alpha (0–255) per pixel, bound to a fixed canvas size.
VariantDraft class An editable variant: identity + weight + its pixels, in one or both of the two forms a variant can be authored in.
VoxelReady class Makes a book's art voxel-ready: every partially transparent pixel snaps at 50% to solid or clear, through AlphaSnap<TPixel>, so there is one snap rule.
VoxelReadyChange record One variant that making a book voxel-ready would change, and by how much.
VoxelReadyResult class What VoxelReady.Apply() did: the snapped book plus enough to undo it.

Nfty.Core.Formats

Type Kind Summary
ArchiveKind enum Which archive a file holds, as declared by its extension.
ArchivePeek class Reads an archive's own manifest without decoding anything inside it.
Archives class Dispatch over the archive types by extension, so callers that accept "any nfty file" (the CLI's inspect, a GUI open dialog) resolve the kind in one place.
AtomicFile class Replaces a file as one step: the new contents are written to a temp file beside it, then moved over the original, so a failure or a crash leaves either the old file or the new one, never half of one.
CookBookArchive class Reads and writes .cbk archives — a manifest plus one nested .rcp per recipe.
IngredientArchive class Reads and writes .igt archives — a manifest plus one PNG per variant, plus an optional depth map per variant.
Json class The one JsonSerializerOptions every manifest is read and written with.
Kitchen class The Kitchen workspace: a .ktn file that names the folder it sits in.
KitchenArchive class Reads and writes the .ktn workspace file.
KitchenContents record What a Kitchen holds, as PATHS rather than loaded graphs.
KitchenLookup enum Why Kitchen.TryFindIn() did or did not find a workspace.
LoadedCookBook class Owns its recipes, which own their ingredients, which own the variant images — so using var book = CookBookArchive.Read(path) frees the whole tree.
LoadedIngredient class An ingredient manifest paired with its eagerly-decoded variant images.
LoadedRecipe class Owns its ingredients; disposing it disposes them and their images.
MenuProjection class Projects a loaded or peeked CookBook into the image-free MenuBook the roll works on.
PeekedCookBook record A CookBook read as MANIFESTS ALONE: every weight, rule, absent-percent and variant name in the tree, and not one decoded pixel.
PeekedRecipe record One recipe's manifests: its own, and one per ingredient nested inside it.
RecipeArchive class Reads and writes .rcp archives — a manifest plus one nested .igt per ingredient.
RecipeLayers class Resolving a recipe's layerOrder to its ingredients, in one place.
UnsupportedSchemaVersionException class A manifest declares a schema this build cannot read.
Validator class The single place that decides what a legal CookBook is.

Nfty.Core.Generation

Type Kind Summary
AbsentLayer record One layer the roll left out of this asset entirely.
ColorRoll record The resolved color of one layer, for the rich nfty metadata.
GenerateOptions record Everything one generation run needs to know.
GeneratedAsset class One finished asset.
GeneratedSet record A whole generated collection, held in memory.
GenerationProgress struct How far a generation run has got.
Generator class The generation pipeline.
RecipeSpace record One recipe's share of the space.
RuleConflictException class A recipe's incompatibility rules exclude every combination of its variants, so no asset of that type can ever be rolled.
SpaceCertainty enum What a counted space actually tells you: an answer, a bound in a stated direction, or nothing.
SpaceText class How a counted DNA space is written down, for every surface that shows one.
TraitSelection record One layer's contribution as published metadata.
UniqueSpace class Counts the unique DNA space of a cookbook: per recipe, the legal variant combinations (rules honoured) multiplied by each dynamic layer's quantized color buckets.
UniqueSpaceCount record How many distinct DNA a cookbook can produce.
UniqueSpaceExhaustedException class More unique assets were requested than the cookbook can produce.

Nfty.Core.Imaging

Type Kind Summary
ColorName class The one table that turns a rolled color into the word a marketplace shows for it.
Colorizer class Tints a grayscale value-map with a hue and saturation, preserving each pixel's own value or lightness — which is what makes one piece of art yield a whole family of variants.
Compositor class Stacks finished layer images into one asset.
ImageFormats class THE one way nfty decodes a picture.
NumberStamp class Stamps an asset's set number into a corner, for telling loose sprites apart.
Opacity class Whether a pixel — or a whole image, layer or book — carries partial alpha: a level of transparency that is neither fully there nor fully absent.
Palette class The palette a painting front-end offers: Palette.Slots ramp entries that change with the PaletteMode, plus the rules for the swatches a user saves beside them.
PaletteMode enum Which ramp a Palette's ten slots currently offer.
PictureProfile class A picture's embedded ICC profile, read by nfty's own reader, and the one conversion of it to sRGB both front-ends use.
PictureProfileKind enum What an imported picture's embedded color profile means for it.
PixelCompare class Comparing two pictures pixel for pixel.
PreviewLayer struct One reference layer in a stack preview: which ingredient, which of its variants, and the color to draw it in.
StackPreview class Composites several layers at their real depths, so art authored one layer at a time can be lined up against the layers it will actually sit between.
StackRoll class Rolls a whole Recipe into the PreviewLayer stack StackPreview.Render() draws — one deterministic roll from a seed, in generation's own draw order.
StackSplit struct A recipe's reference layers split around the one being edited: what paints under it, and what paints over it.
StampCorner enum Which corner a stamp sits in.
Upscale class Whole-pixel enlargement for export: every source pixel becomes an exact factor-by-factor block, so pixel art stays pixel art.
VariantPreview class Renders one Variant exactly as generation would: colorized from its value-map for Dynamic and Static layers, passed through untouched for Custom.

Nfty.Core.Output

Type Kind Summary
CorruptSetException class An existing Set on disk is not in a shape extend can read — for example a rich nfty/NNNN.json whose standards-pure metadata/NNNN.json sibling is missing.
IAssetModeler interface Turns one finished asset into 3D model files.
LayerColor record One layer's resolved color for the rich nfty metadata (all kinds represented).
LoadedSet class A cooked Set read from disk for browsing: the manifest + per-item metadata and image paths (images are NOT decoded here).
MetadataAttribute record One OpenSea trait.
MetadataTraits class Which traits an asset publishes, and in which SHAPE of metadata.
NftyMetadata record Rich nfty-specific per-item metadata.
OpenSeaMetadata record Standard ERC-721 / OpenSea per-item metadata.
RarityAttribute record One trait with how common it is across the whole collection.
RecipeCount record How many assets one recipe produced.
SetFile record One file a modeler produced for an asset.
SetFiles record ONE mapping between a set number and the name its files carry: images/, metadata/ and models/.
SetItem record One asset in a Set already on disk.
SetItemSelection class Recovers which variant of which layer an asset in a Set was made from.
SetLayout class The parts a cooked Set is made of, named once.
SetManifest record The Set's own record, written to set.json: its name, size, seed, the hash of the book that produced it, the collection-wide rarity table and the per-recipe distribution.
SetModels record set.json's record of the 3D models a cook made.
SetProvenance class Whether the CookBook in front of you is the one a Set on disk was cooked from, and what to say when it is not.
SetReader class Opens a cooked Set — a folder, or a packed .set archive.
SetWriter class Writes a generated collection to disk: the images, both metadata files per asset, and the Set manifest — and reads an existing Set back so extend can add to it.
SetWriter.ExistingSet record What a Set already on disk contributes to an extend run.
WriteProgress struct How far a set write has got.

Nfty.Core.Publish

Type Kind Summary
AtlasTooLargeException class A Menu atlas would be larger than one image can be (a pixel ceiling on a side, or in area), so the write is refused rather than built.
BundleCollection record collection.json as an upload bundle carries it.
BundleItem record One item of an upload bundle, as its metadata file describes it.
BundleReport class The text report for an upload bundle, rendered in Core so inspect and any other surface say the identical thing.
ExportEntry record One file an export will carry, and where it will sit.
ExportOptions record Exactly what leaves the machine.
ExportPlan record Everything an export will contain, worked out without writing anything.
ExportPreset enum A named starting point on ExportOptions, one per reason people actually hand a collection to somebody.
ExportProgress record How far an export has got.
ExportResult record What an export produced.
ExportShape enum Whether an export lands as a folder or as one file.
LoadedBundle class An upload bundle opened for looking at: a marketplace export that left set.json out.
MarketplaceBundle class Recognizes and reads a marketplace upload bundle: images/ and metadata/ (and optionally collection.json) with no set.json.
MarketplaceRules class The rules for the marketplace fields of ExportOptions, stated once.
MenuRenderer class Renders a rolled AssetTicket back into pixels from the .mnu it was rolled against — the read-side counterpart to MenuWriter.
MenuWriteOptions record How MenuWriter packs a CookBook's art into a Menu.
MenuWriteProgress record How far a Menu write has got.
MenuWriter class Writes a CookBook's every weight, rule, colorization and art into a .mnu Menu — the file a runtime host reads to roll and render an asset with no .cbk present.
ModelVoxelSize class The one range a model's voxel size may take, so the CLI, the Rise page and the cook dialog cannot disagree about it.
Seal class The cryptography behind a sealed export: authenticated encryption of a whole Set under a passphrase, plus a header that says what is inside without giving any of it away.
SealCipher record How the payload was encrypted.
SealKdf record How the passphrase was stretched into a key.
SealManifest record The seal.json at the top of a sealed export — plaintext, deliberately.
SealPolicy record What a sealed export permits its recipient to do.
SealedSet class A Set that came out of a seal, carrying the seal's own header alongside it.
SealedSetException class A sealed export could not be opened.
SealedSetReader class Opens a sealed export for looking at.
SetExporter class Publishes a cooked Set: decides what leaves the machine, and in what shape.
SheetGrid record The grid a spritesheet is made of, as a sheet carries it: written into the PNG itself.
SizeText class One wording for a byte count, so every surface that prints a file size prints it alike.
SpriteSheet class Stitches a cooked Set's assets into one image, left to right and top to bottom.
SpriteSheetLayout record How a sheet is laid out: a grid of cells, in the Set's own canvas size.
SpriteSheetProgress record How far a sheet has got.
TokenNaming enum How an export names the files that go to a marketplace.
TokenNamingTokens class The one mapping between TokenNaming and the words the CLI, the export dialog and the manual spell it with, so none of them can name a choice two ways.

Nfty.Core.Publish.Ipfs

Type Kind Summary
IPinningService interface Somewhere a folder can be put on IPFS and kept there: a local Kubo node, or a pinning service.
KuboPinning class A local IPFS node — IPFS Desktop or the Kubo daemon — reached over its HTTP RPC.
MarketplaceUpload class The whole marketplace upload in one call: art first, then metadata that points at it.
PinProgress record How far a folder upload has got.
PinataPinning class Pinata, the hosted pinning service, reached with the author's own API key (a JWT).
PinningException class A pinning service refused, failed or answered with something unusable.
PinningStatus record Whether a pinning service can be talked to right now, and what it said about itself.
UploadProgress record How far an upload has got.
UploadResult record What an upload pinned, and the addresses a contract needs.
UploadStage enum Which step of an upload is running.

Nfty.Core.Stats

Type Kind Summary
BookOdds class One CookBook, resolved down to what pricing an asset against it needs.
CollectionReport class The stats report as data plus a plain-text rendering: the odds a CookBook's weights imply, and the size of the unique-DNA space they admit.
IdentityReport class The inspect report: the tree of a CookBook with each Recipe's, Ingredient's and Variant's id shown alongside its name.
KitchenReport class The inspect listing for a Kitchen: what the workspace folder actually holds, grouped by kind.
RarityCalculator class Computes the odds a cookbook's weights imply.
RarityReport record The odds a cookbook's weights imply, before anything is generated.
RarityText class How a share is written down, for every surface that shows one.
RecipeOdds record One recipe's share of the collection, from the cookbook's weights.
SelectionChance record The chance of one roll producing a particular selection, and what that figure is.
SelectionOdds class How likely one asset's exact selection was, computed from the CookBook that produced it.
SetReport class The inspect report for a cooked Set: what it holds, what made it, and the rarity it actually came out with.
TraitOdds record One variant's odds, both within its recipe and across the whole collection.
TraitRowKind enum What a TraitOdds row describes.
VariantReach record How far one variant's edit reaches: the share of the collection that carries it, and, when the book states a target supply, the expected number of assets.
VoxelReport class Reports whether an archive's artwork can be turned into a voxel model, and where it cannot.
VoxelVariant struct What a single variant's artwork does about transparency.