qoi.dhover×1143all
#!/usr/bin/env dub
/+ dub.sdl:
    name "images_wired_qoi"
    dependency "sparkles:wired" path="../../../../.."
    dflags "-preview=in" "-preview=dip1000"
    buildType "checked" {
        buildOptions "optimize" "inline" "debugInfo"
    }
+/
/**
 * QOI on the `sparkles:wired` that ships today.
 *
 * The 14-byte header is a plain D struct with `@WireCheck` constraints,
 * read and written by the same schema walk as `png-chunks.d`. Everything
 * after it is hand-written D, marked `GAP`: the op stream (2-bit and 8-bit
 * tags with sub-byte fields, the 8-bit tags taking precedence), the running
 * 64-entry index addressed by a hash of the decoded pixel, runs, and the
 * 8-byte end marker. The op decoder is resumable in the manner of Wuffs: it
 * accepts the input in pieces of any size, keeps a partial op in a scratch
 * buffer, returns `needMore` while the input is open, and reports
 * `truncated` only once the caller says the input is closed. A caller-set
 * pixel budget is checked against the header before anything is allocated.
 *
 * Backs ../index.md (section "QOI"). Run with:
 * `dub run --single qoi.d`
 */
module 
(module) images_wired_qoi

QOI on the sparkles:wired that ships today.

The 14-byte header is a plain D struct with @WireCheck constraints, read and written by the same schema walk as png-chunks.d. Everything after it is hand-written D, marked GAP: the op stream (2-bit and 8-bit tags with sub-byte fields, the 8-bit tags taking precedence), the running 64-entry index addressed by a hash of the decoded pixel, runs, and the 8-byte end marker. The op decoder is resumable in the manner of Wuffs: it accepts the input in pieces of any size, keeps a partial op in a scratch buffer, returns needMore while the input is open, and reports truncated only once the caller says the input is closed. A caller-set pixel budget is checked against the header before anything is allocated.

Backs ../index.md (section "QOI"). Run with: dub run --single qoi.d

images_wired_qoi
;
import
(package) std
std
.
(package) std.algorithm
algorithm
.
(module) std.algorithm.comparison

This is a submodule of std.algorithm. It contains generic comparison algorithms.

Function Name Description
among Checks if a value is among a set of values, e.g. if (v.among(1, 2, 3)) // v is 1, 2 or 3
castSwitch (new A()).castSwitch((A a)=>1,(B b)=>2) returns 1.
clamp clamp(1, 3, 6) returns 3. clamp(4, 3, 6) returns 4.
cmp cmp("abc", "abcd") is -1, cmp("abc", "aba") is 1, and cmp("abc", "abc") is 0.
either Return first parameter p that passes an if (p) test, e.g. either(0, 42, 43) returns 42.
equal Compares ranges for element-by-element equality, e.g. equal([1, 2, 3], [1.0, 2.0, 3.0]) returns true.
isPermutation isPermutation([1, 2], [2, 1]) returns true.
isSameLength isSameLength([1, 2, 3], [4, 5, 6]) returns true.
levenshteinDistance levenshteinDistance("kitten", "sitting") returns 3 by using the Levenshtein distance algorithm.
levenshteinDistanceAndPath levenshteinDistanceAndPath("kitten", "sitting") returns tuple(3, "snnnsni") by using the Levenshtein distance algorithm.
max max(3, 4, 2) returns 4.
min min(3, 4, 2) returns 2.
mismatch mismatch("oh hi", "ohayo") returns tuple(" hi", "ayo").
predSwitch 2.predSwitch(1, "one", 2, "two", 3, "three") returns "two".

Source

std/algorithm/comparison.d

@copyrightAndrei Alexandrescu 2008-.@licenseBoost License 1.0.@authorsAndrei Alexandrescu
comparison
:
(alias template) images_wired_qoi.min = std.algorithm.comparison.min(T...)(T args) if (T.length >= 2 && !is(CommonType!T == void))

Iterates the passed arguments and returns the minimum value.

@paramargs The values to select the minimum from. At least two arguments must be passed, and they must be comparable with <.@returnsThe minimum of the passed-in values. The type of the returned value is the type among the passed arguments that is able to store the smallest value. If at least one of the arguments is NaN, the result is an unspecified value. See minElement for examples on how to cope with NaNs.@seeminElement
min
;
import
(package) std
std
.
(module) std.stdio
Category Symbols
File handles _popen File isFileHandle openNetwork stderr stdin stdout
Reading chunks lines readf readfln readln
Writing toFile write writef writefln writeln
Misc KeepTerminator LockType StdioException

Standard I/O functions that extend core.stdc.stdio. core.stdc.stdio is publically imported when importing std.stdio.

There are three layers of I/O:

  1. The lowest layer is the operating system layer. The two main schemes are Windows and Posix.

  2. C's stdio.h which unifies the two operating system schemes.

  3. std.stdio, this module, unifies the various stdio.h implementations into a high level package for D programs.

Source

std/stdio.d

@copyrightCopyright The D Language Foundation 2007-.@licenseBoost License 1.0.@authorsWalter Bright, Andrei Alexandrescu, Alex Rønne Petersen
stdio
:
(alias template) images_wired_qoi.writefln = std.stdio.writefln(alias fmt, A...)(A args) if (isSomeString!(typeof(fmt)))

Equivalent to writef(fmt, args, '\n').

writefln
;
import
(package) std
std
.
(module) std.traits

Templates which extract information about types and symbols at compile time.

Category Templates
Symbol Name traits fullyQualifiedName mangledName moduleName packageName
Function traits isFunction arity functionAttributes hasFunctionAttributes functionLinkage FunctionTypeOf isSafe isUnsafe isFinal ParameterDefaults ParameterIdentifierTuple ParameterStorageClassTuple Parameters ReturnType SetFunctionAttributes variadicFunctionStyle
Aggregate Type traits BaseClassesTuple BaseTypeTuple classInstanceAlignment EnumMembers FieldNameTuple Fields hasAliasing hasElaborateAssign hasElaborateCopyConstructor hasElaborateDestructor hasElaborateMove hasIndirections hasMember hasStaticMember hasNested hasUnsharedAliasing InterfacesTuple isInnerClass isNested MemberFunctionsTuple RepresentationTypeTuple TemplateArgsOf TemplateOf TransitiveBaseTypeTuple
Type Conversion CommonType AllImplicitConversionTargets ImplicitConversionTargets CopyTypeQualifiers CopyConstness isAssignable isCovariantWith isImplicitlyConvertible isQualifierConvertible
Type Constructors InoutOf ConstOf SharedOf SharedInoutOf SharedConstOf SharedConstInoutOf ImmutableOf QualifierOf
Categories of types allSameType ifTestable isType isAggregateType isArray isAssociativeArray isAutodecodableString isBasicType isBoolean isBuiltinType isCopyable isDynamicArray isEqualityComparable isFloatingPoint isIntegral isNarrowString isConvertibleToString isNumeric isOrderingComparable isPointer isScalarType isSigned isSIMDVector isSomeChar isSomeString isStaticArray isUnsigned
Type behaviours isAbstractClass isAbstractFunction isCallable isDelegate isExpressions isFinalClass isFinalFunction isFunctionPointer isInstanceOf isIterable isMutable isSomeFunction isTypeTuple
General Types ForeachType KeyType Largest mostNegative OriginalType PointerTarget Signed Unconst Unshared Unqual Unsigned ValueType Promoted
Misc lvalueOf rvalueOf Select select
User-Defined Attributes hasUDA getUDAs getSymbolsByUDA

Source

std/traits.d

@copyrightCopyright The D Language Foundation 2005 - 2009.@licenseBoost License 1.0.@authorsWalter Bright, Tomasz Stachowiak (isExpressions), Andrei Alexandrescu, Shin Fujishiro, Robert Clipsham, David Nadlinger, Kenji Hara, Shoichi Kato
traits
:
(alias template) images_wired_qoi.EnumMembers = std.traits.EnumMembers(E) if (is(E == enum))

Retrieves the members of an enumerated type enum E.

Note

An enum can have multiple members which have the same value. If you want to use EnumMembers to e.g. generate switch cases at compile-time, you should use the NoDuplicates template to avoid generating duplicate switch cases.

Note

Returned values are strictly typed with E. Thus, the following code does not work without the explicit cast:

enum E : int { a, b, c }
int[] abc = cast(int[]) [ EnumMembers!E ];

Cast is not necessary if the type of the variable is inferred. See the example below.

@paramE An enumerated type. E may have duplicated values.@returnsStatic tuple composed of the members of the enumerated type E. The members are arranged in the same order as declared in E. The name of the enum can be found by querying the compiler for the name of the identifier, i.e. __traits(identifier, EnumMembers!MyEnum[i]). For enumerations with unique values, to can also be used.
EnumMembers
,
(alias template) images_wired_qoi.OriginalType = std.traits.OriginalType(T)

Strips off all enums from type T.

OriginalType
;
import
(package) sparkles
sparkles
.
(package) sparkles.base
base
.
(module) sparkles.base.expected

This module is implementing the Expected idiom.

See the $(LINK2 http://channel9.msdn.com/Shows/Going+Deep/C-and-Beyond-2012-Andrei-Alexandrescu-Systematic-Error-Handling-in-C, Andrei Alexandrescu’s talk (Systematic Error Handling in C++) and its slides.

Or more recent "Expect the Expected" by Andrei Alexandrescu for further background.

It is also inspired by C++'s proposed std::expected and Rust's Result.

Similar work is expectations by Paul Backus.

Main features

  • lightweight, no other external dependencies

  • works with pure, @safe, @nogc, nothrow, and immutable

  • provides methods: ok, err, consume, expect, expectErr, andThen, orElse, map, mapError, mapOrElse

  • type inference for ease of use with ok and err

  • allows to use same types for T and E

  • allows to define Expected without value (void for T) - can be disabled with custom Hook

  • provides facility to change the Expected behavior by custom Hook implementation using the Design by introspection paradigm.

  • can enforce result check (with a cost)

  • can behave like a normal Exception handled code by changing the used Hook implementation

  • range interface

Description

Actual Expected type is defined as Expected!(T, E, Hook), where:

  • T defines type of the success value

  • E defines type of the error

  • Hook defines behavior of the Expected

Default type for error is string, i.e. Expected!int is the same as Expected!(int, string).

Abort is used as a default hook.

Hooks

Expected has customizable behavior with the help of a third type parameter, Hook. Depending on what methods Hook defines, core operations on the Expected may be verified or completely redefined. If Hook defines no method at all and carries no state, there is no change in default behavior.

This module provides a few predefined hooks (below) that add useful behavior to Expected:

| Abort | Fails every incorrect operation with a call to assert(0). It is the default third parameter, i.e. Expected!short is the same as Expected!(short, string, Abort). | | Throw | Fails every incorrect operation by throwing an exception. | | AsException | With this hook implementation Expected behaves just like regular Exception handled code.

That means when function returns expected value, it returns instance of Expected with a success value. But when it tries to return error, Exception is thrown right away, i.e. Expected fails in constructor. | | RCAbort | Similar to Abort hook but uses reference counted payload instead which enables checking if the caller properly checked result of the Expected. |

The hook's members are looked up statically in a Design by Introspection manner and are all optional. The table below illustrates the members that a hook type may define and their influence over the behavior of the Checked type using it. In the table, hook is an alias for Hook if the type Hook does not introduce any state, or an object of type Hook otherwise.

  • Hook member

Semantics in Expected!(T, E, Hook)

    -
    - `enableDefaultConstructor`
        - If defined, `Expected` would have enabled or disabled default constructor
            based on it's `bool` value. Default constructor is disabled by default.
            `opAssign` for value and error types is generated if default constructor is enabled.

            -
            - `enableCopyConstructor`
                - If defined, `Expected` would have enabled or disabled copy constructor based
                    on it's `bool` value. It is enabled by default. When disabled, it enables automatic
                    check if the result was checked either for value or error.
                    When not checked it calls `hook.onUnchecked` if provided.

                    WARNING: As currently it's not possible to change internal state of `const`
                    or `immutable` object, automatic checking would't work on these. Hopefully with
                    `__mutable` proposal..

                    -
                    - `enableRefCountedPayload`
                        - Set `Expected` instances to use reference counted payload storage. It's usefull
                            when combined with `onUnchecked` to forcibly check that the result was checked for value
                            or error.

                            -
                            - `enableVoidValue`
                                - Defines if `Expected` supports `void` values. It's enabled by default so this
                                    hook can be used to disable it.

                                    -
                                    - `onAccessEmptyValue`
                                        - If value is accessed on unitialized `Expected` or `Expected` with error
                                            value, `hook.onAccessEmptyValue!E(err)` is called. If hook doesn't implement the
                                            handler, `T.init` is returned.

                                            -
                                            - `onAccessEmptyError`
                                                - If error is accessed on unitialized `Expected` or `Expected` with value,
                                                    `hook.onAccessEmptyError()` is called. If hook doesn't implement the handler,
                                                    `E.init` is returned.

                                                    -
                                                    - `onUnchecked`
                                                        - If the result of `Expected` isn't checked, `hook.onUnchecked()` is called to
                                                            handle the error. If hook doesn't implement the handler, assert is thrown.
                                                            Note that `hook.enableCopyConstructor` must be `false` or `hook.enableRefCountedPayload`
                                                            must be `true` for checks to work.

                                                            -
                                                            - `onValueSet`
                                                                - `hook.onValueSet!T(val)` function is called when success value is being set to
                                                                    `Expected`. It can be used for loging purposes, etc.

                                                                    -
                                                                    - `onErrorSet`
                                                                        - `hook.onErrorSet!E(err)` function is called when error value is being set to
                                                                            `Expected`. This hook function is used by `AsException` hook implementation
                                                                            to change `Expected` idiom to normal `Exception` handling behavior.

Vendored from tchaloupka/expected by Tomáš Chaloupka, at commit 0793e8b7dc06dd05b3fa3103e5a99bf0bfd5f638: release 0.4.1 plus the five commits upstream made after it, which no release tags:

  • e35db58c5b454aceffcc2f90fb6aa2a9e4e2e132 makes the advanced usage example work outside the module;

  • 60afab8725bb4c48542884174bb67a68548fe0a0 keeps the source hook in map/mapError and lets map return void;

  • 5f1f2083381fdfcfa22428541be98694087fcd30 makes isVoidValueEnabled read the member it checks;

  • 5ee6c2a531b3d66964795274b1bcbdbd9cb7294f allocates the reference-counted payload of a void Expected;

  • 0793e8b7dc06dd05b3fa3103e5a99bf0bfd5f638 tests that map to void keeps the source hook.

It stops before 0.5.0, which marks Expected @mustuse by making it an explicit template around the struct: that breaks matching Expected!(T, E, H) in is expressions, which Sparkles relies on, and turns every discarded result into an error.

Changed from upstream only where Sparkles' build flags require it: the module name (and the advanced example's imports of it), the ``expected. prefix on its test names, const for in on the extern(C) GC declarations (-preview=in rejects in there), and the Throw hook throwing an error object read through an inout accessor unqualified (base disallows deprecations). No other changes.

Why vendored: it is one module of about 2000 lines under Sparkles' own licence (BSL-1.0). As a dub package it put expected and, through its unittest configuration, silly (which Sparkles does not use) into nearly every one of the repository's 88 dub.selections.json files and into the Nix dub locks. The fixes upstream made after 0.4.1 are untagged, so dub could not take them. Owning the copy keeps it building under Sparkles' flags and conventions.

Examples

Basic usage

auto foo(int i) {
    if (i == 0) return err!int("oops");
    return ok(42 / i);
}

version (D_Exceptions)
{
    auto bar(int i) {
        if (i == 0) throw new Exception("err");
        return i-1;
    }
}

// basic checks
assert(foo(2));
assert(foo(2).hasValue);
assert(!foo(2).hasError);
assert(foo(2).value == 21);

assert(!foo(0));
assert(!foo(0).hasValue);
assert(foo(0).hasError);
assert(foo(0).error == "oops");

// void result
assert(ok()); // no error -> success
assert(!ok().hasError);
// assert(err("foo").hasValue); // doesn't have hasValue and value properties

version (D_Exceptions)
{
    // expected from throwing function
    assert(consume!bar(1) == 0);
    assert(consume!bar(0).error.msg == "err");
}

// orElse
assert(foo(2).orElse!(() => 0) == 21);
assert(foo(0).orElse(100) == 100);

// andThen
assert(foo(2).andThen(foo(6)) == 7);
assert(foo(0).andThen(foo(6)).error == "oops");

// map
assert(foo(2).map!(a => a*2).map!(a => a - 2) == 40);
assert(foo(0).map!(a => a*2).map!(a => a - 2).error == "oops");

// mapError
assert(foo(0).mapError!(e => "OOPS").error == "OOPS");
assert(foo(2).mapError!(e => "OOPS") == 21);

// mapOrElse
assert(foo(2).mapOrElse!(v => v*2, e => 0) == 42);
assert(foo(0).mapOrElse!(v => v*2, e => 0) == 0);

Advanced usage - behavior modification

import exp = sparkles.base.expected;
import sparkles.base.expected : orElse; // UFCS doesn't work with renamed imports
import std.exception : assertThrown;

// define our Expected type using Exception as Error values
// and Throw hook, which throws when empty value or error is accessed
template Expected(T)
{
    alias Expected = exp.Expected!(T, Exception, exp.Throw);
}

// create wrappers for simplified usage of our Expected
auto ok(T)(T val) { return exp.ok!(Exception, exp.Throw)(val); }
auto err(T)(Exception err) { return exp.err!(T, exp.Throw)(err); }

// use it as normal
assert(ok(42) == 42);
assert(err!int(new Exception("foo")).orElse(0) == 0);
assertThrown(ok(42).error);
assertThrown(err!int(new Exception("bar")).value);
@copyrightCopyright © 2019, Tomáš Chaloupka@authorsTomáš Chaloupka, with contributions from Kostiantyn Tokar, Jan Jurzitza, Beyar and Petar Kirov (the upstream history to the vendored commit)@licenseBSL-1.0
expected
:
(alias struct) images_wired_qoi.Expected = sparkles.base.expected.Expected(T, E = string, Hook = Abort) if (!is(E == void) && (isVoidValueEnabled!Hook || !is(T == void)))

``Expected!(T, E) is a type that represents either success or failure.

Type T is used for success value. If T is void, then Expected can only hold error value and is considered a success when there is no error value.

Type E is used for error value. The default type for the error value is string.

Default behavior of Expected can be modified by the Hook template parameter.

@paramT represents type of the expected value@paramE represents type of the error value.@paramHook defines the Expected type behavior
Expected
,
(alias template) images_wired_qoi.err = sparkles.base.expected.err(T = void, Hook = Abort, E)(auto ref E err)

Creates an Expected object from an error value, with type inference.

err
,
(alias template) images_wired_qoi.ok = sparkles.base.expected.ok(E = string, Hook = Abort, T)(auto ref T value)

Creates an Expected object from an expected value, with type inference.

ok
;
import
(package) sparkles
sparkles
.
(package) sparkles.wired
wired
.
(module) sparkles.wired.policy

Format-aware @Wire* policy attributes and their value vocabulary.

This module is the format-agnostic policy layer of sparkles:wired: it defines the marker sentinel AnyFormat, the policy enums (Repr, WireTarget, WireSkip, WireInvalid), and the @Wire* user-defined attributes a type author annotates enum members, fields, and types with. A concrete format backend (e.g. sparkles.wired.json) resolves these against its own format tag.

Each value-carrying attribute is a factory function (WireName, WireCase, WireRepr, WireOptional) returning a format-parameterized *Attr struct — so both @WireName("x") and @WireName!Json("x") work as ordinary compile-time calls. Resolvers detect and read the attributes through the *Attr structs.

See docs/specs/wired/SPEC.md §5 for the normative surface.

policy
:
(alias template) images_wired_qoi.isOneOf = sparkles.wired.policy.isOneOf(values...)

Declarative membership check usable as a WireCheck predicate.

isOneOf
,
(alias struct) images_wired_qoi.WireCheck = sparkles.wired.policy.WireCheck(alias predicate_, string message_ = "", Format_ = AnyFormat)

A field/type refinement, applied after decode conversion and before encode conversion.

WireCheck
,
(alias template) images_wired_qoi.wireCheckFailures = sparkles.wired.policy.wireCheckFailures(F, alias symbol, T)(in T value)

Runs the shared four-protocol check vocabulary at a type or field site. static because symbol may alias a field: without it the instantiation would need an instance of the field's aggregate as its context.

wireCheckFailures
;
import
(package) sparkles
sparkles
.
(package) sparkles.wired
wired
.
(module) sparkles.wired.schema

Compile-time wire-schema reification.

wireSchemaOf!(F, T) lowers the currently supported wired type vocabulary to plain data. Nodes and child edges are flat arenas; recursive re-entry is an explicit NodeKind.reference node whose referenceIndex names an earlier node. Policy values are resolved through sparkles.wired.policy, once, while the arena is built.

fieldPolicies is a compatibility projection of aggregate child snapshots. The builder consumes the declaration-only policy seed, avoiding a policy/schema template cycle.

schema
:
(enum) sparkles.wired.schema.NodeKind

Structural node vocabulary shared by format walkers and derivations.

NodeKind
,
(enum) sparkles.wired.schema.ScalarKind

Scalar distinctions which can affect a format's wire representation.

ScalarKind
,
(struct) sparkles.wired.schema.WireSchema

Flat compile-time schema arena. Node zero is always the root.

edges[node.firstEdge .. node.firstEdge + node.edgeCount] contains child node indices. Annotation ranges use the same extent convention.

WireSchema
,
(alias template) images_wired_qoi.wireSchemaOf = sparkles.wired.schema.wireSchemaOf(F, T)

Complete CTFE schema of T under format F.

wireSchemaOf
;
// --------------------------------------------------------------------------- // A big-endian, fixed-layout walk over the shipped schema (same in all three // programs of this experiment) // --------------------------------------------------------------------------- /// Byte size of the subtree at `index`, or -1 when the schema gives none. /// Takes the schema by value: as an `in` parameter, CTFE fails on DMD and crashes LDC. long
long images_wired_qoi.fixedSize(const(sparkles.wired.schema.WireSchema) schema, ulong index) pure nothrow @safe

Byte size of the subtree at index, or -1 when the schema gives none. Takes the schema by value: as an in parameter, CTFE fails on DMD and crashes LDC.

fixedSize
(const
(struct) sparkles.wired.schema.WireSchema

Flat compile-time schema arena. Node zero is always the root.

edges[node.firstEdge .. node.firstEdge + node.edgeCount] contains child node indices. Annotation ranges use the same extent convention.

WireSchema
(parameter) const(sparkles.wired.schema.WireSchema) schema
schema
,
(alias) object.size_t = ulong
size_t
(parameter) ulong index
index
) @safe pure nothrow
{ const
(local variable) const(sparkles.wired.schema.SchemaNode) node
node
=
(parameter) const(sparkles.wired.schema.WireSchema) schema
schema
.
(field) sparkles.wired.schema.SchemaNode[] sparkles.wired.schema.WireSchema.nodes
nodes
[
(parameter) ulong index
index
];
switch (
(local variable) const(sparkles.wired.schema.SchemaNode) node
node
.
(field) sparkles.wired.schema.NodeKind sparkles.wired.schema.SchemaNode.kind
kind
)
{ case
(enum) sparkles.wired.schema.NodeKind

Structural node vocabulary shared by format walkers and derivations.

NodeKind
.
(enum value) sparkles.wired.schema.NodeKind.scalar = cast(ubyte)0u
scalar
:
return
(local variable) const(sparkles.wired.schema.SchemaNode) node
node
.
(field) sparkles.wired.schema.ScalarKind sparkles.wired.schema.SchemaNode.scalarKind
scalarKind
==
(enum) sparkles.wired.schema.ScalarKind

Scalar distinctions which can affect a format's wire representation.

ScalarKind
.
(enum value) sparkles.wired.schema.ScalarKind.unsignedInteger = 3
unsignedInteger
||
(local variable) const(sparkles.wired.schema.SchemaNode) node
node
.
(field) sparkles.wired.schema.ScalarKind sparkles.wired.schema.SchemaNode.scalarKind
scalarKind
==
(enum) sparkles.wired.schema.ScalarKind

Scalar distinctions which can affect a format's wire representation.

ScalarKind
.
(enum value) sparkles.wired.schema.ScalarKind.signedInteger = 2
signedInteger
||
(local variable) const(sparkles.wired.schema.SchemaNode) node
node
.
(field) sparkles.wired.schema.ScalarKind sparkles.wired.schema.SchemaNode.scalarKind
scalarKind
==
(enum) sparkles.wired.schema.ScalarKind

Scalar distinctions which can affect a format's wire representation.

ScalarKind
.
(enum value) sparkles.wired.schema.ScalarKind.character = 5
character
?
(local variable) const(sparkles.wired.schema.SchemaNode) node
node
.
(field) ushort sparkles.wired.schema.SchemaNode.scalarBits

scalar storage width where it constrains wire values

scalarBits
/ 8 : -1;
case
(enum) sparkles.wired.schema.NodeKind

Structural node vocabulary shared by format walkers and derivations.

NodeKind
.
(enum value) sparkles.wired.schema.NodeKind.enumeration = 1
enumeration
:
return
(local variable) const(sparkles.wired.schema.SchemaNode) node
node
.
(field) ushort sparkles.wired.schema.SchemaNode.scalarBits

scalar storage width where it constrains wire values

scalarBits
?
(local variable) const(sparkles.wired.schema.SchemaNode) node
node
.
(field) ushort sparkles.wired.schema.SchemaNode.scalarBits

scalar storage width where it constrains wire values

scalarBits
/ 8 : -1;
case
(enum) sparkles.wired.schema.NodeKind

Structural node vocabulary shared by format walkers and derivations.

NodeKind
.
(enum value) sparkles.wired.schema.NodeKind.staticArray = 5
staticArray
:
const
(local variable) const(long) element
element
=
long images_wired_qoi.fixedSize(const(sparkles.wired.schema.WireSchema) schema, ulong index) pure nothrow @safe

Byte size of the subtree at index, or -1 when the schema gives none. Takes the schema by value: as an in parameter, CTFE fails on DMD and crashes LDC.

fixedSize
(
(parameter) const(sparkles.wired.schema.WireSchema) schema
schema
,
(parameter) const(sparkles.wired.schema.WireSchema) schema
schema
.
(field) ulong[] sparkles.wired.schema.WireSchema.edges
edges
[
(local variable) const(sparkles.wired.schema.SchemaNode) node
node
.
(field) ulong sparkles.wired.schema.SchemaNode.firstEdge

range in WireSchema.edges

firstEdge
]);
return
(local variable) const(long) element
element
< 0 ? -1 :
(local variable) const(long) element
element
* cast(long)
(local variable) const(sparkles.wired.schema.SchemaNode) node
node
.
(field) ulong sparkles.wired.schema.SchemaNode.staticLength

T[N] length, zero otherwise

staticLength
;
case
(enum) sparkles.wired.schema.NodeKind

Structural node vocabulary shared by format walkers and derivations.

NodeKind
.
(enum value) sparkles.wired.schema.NodeKind.aggregate = 2
aggregate
:
long
(local variable) long total
total
;
foreach (
(parameter) const(ulong) edge
edge
;
(parameter) const(sparkles.wired.schema.WireSchema) schema
schema
.
(field) ulong[] sparkles.wired.schema.WireSchema.edges
edges
[
(local variable) const(sparkles.wired.schema.SchemaNode) node
node
.
(field) ulong sparkles.wired.schema.SchemaNode.firstEdge

range in WireSchema.edges

firstEdge
..
(local variable) const(sparkles.wired.schema.SchemaNode) node
node
.
(field) ulong sparkles.wired.schema.SchemaNode.firstEdge

range in WireSchema.edges

firstEdge
+
(local variable) const(sparkles.wired.schema.SchemaNode) node
node
.
(field) ulong sparkles.wired.schema.SchemaNode.edgeCount

range in WireSchema.edges

edgeCount
])
{ const
(local variable) const(long) field
field
=
long images_wired_qoi.fixedSize(const(sparkles.wired.schema.WireSchema) schema, ulong index) pure nothrow @safe

Byte size of the subtree at index, or -1 when the schema gives none. Takes the schema by value: as an in parameter, CTFE fails on DMD and crashes LDC.

fixedSize
(
(parameter) const(sparkles.wired.schema.WireSchema) schema
schema
,
(local variable) const(ulong) edge
edge
);
if (
(local variable) const(long) field
field
< 0)
return -1;
(local variable) long total
total
+=
(local variable) const(long) field
field
;
} return
(local variable) long total
total
;
default: return -1; // sequences, maps, unions, strings: the schema has no size } } /// Format marker. Its schema hook admits only fixed-size shapes; the byte /// order is a property of the marker, since `SchemaNode` has no such field. struct
(struct) images_wired_qoi.BeFixed

Format marker. Its schema hook admits only fixed-size shapes; the byte order is a property of the marker, since SchemaNode has no such field.

BeFixed
{ template
(template) images_wired_qoi.BeFixed.validateWireSchema(T, alias schema)
validateWireSchema
(T, alias schema)
{ enum bool
(constant) bool images_wired_qoi.BeFixed.validateWireSchema!(images_wired_qoi.QoiHeader, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"])) = true
validateWireSchema
=
long images_wired_qoi.fixedSize(const(sparkles.wired.schema.WireSchema) schema, ulong index) pure nothrow @safe

Byte size of the subtree at index, or -1 when the schema gives none. Takes the schema by value: as an in parameter, CTFE fails on DMD and crashes LDC.

fixedSize
(
(constant) sparkles.wired.schema.WireSchema sparkles.wired.schema.rawWireSchemaOf!(images_wired_qoi.BeFixed, images_wired_qoi.QoiHeader) = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"])

The schema of T under F before the format's validation hook runs.

A format projects its per-type sidecar from this arena, so the hook may consult that projection for every type it reaches without re-entering wireSchemaOf. Keyed by the two types alone: one build per pair.

schema
, 0) >= 0;
} } enum
(enum) images_wired_qoi.BinErrorKind
BinErrorKind
: ubyte
{
(enum value) images_wired_qoi.BinErrorKind.none = cast(ubyte)0u
none
,
(enum value) images_wired_qoi.BinErrorKind.truncated = 1
truncated
,
(enum value) images_wired_qoi.BinErrorKind.notAMember = 2
notAMember
,
(enum value) images_wired_qoi.BinErrorKind.checkFailed = 3
checkFailed
,
(enum value) images_wired_qoi.BinErrorKind.limitExceeded = 4
limitExceeded
,
(enum value) images_wired_qoi.BinErrorKind.badStream = 5
badStream
,
(enum value) images_wired_qoi.BinErrorKind.badEndMarker = 6
badEndMarker
,
(enum value) images_wired_qoi.BinErrorKind.trailingBytes = 7
trailingBytes
,
} struct
(struct) images_wired_qoi.BinError
BinError
{
(enum) images_wired_qoi.BinErrorKind
BinErrorKind
(field) images_wired_qoi.BinErrorKind images_wired_qoi.BinError.kind
kind
;
(alias) object.size_t = ulong
size_t
(field) ulong images_wired_qoi.BinError.offset
offset
;
(alias) object.string = string
string
(field) string images_wired_qoi.BinError.what
what
;
} alias
(alias) images_wired_qoi.BinResult!(images_wired_qoi.QoiHeader) = sparkles.base.expected.Expected!(QoiHeader, BinError, Abort)
BinResult
(T) =
(struct) sparkles.base.expected.Expected!(images_wired_qoi.QoiHeader, images_wired_qoi.BinError, sparkles.base.expected.Abort)

``Expected!(T, E) is a type that represents either success or failure.

Type T is used for success value. If T is void, then Expected can only hold error value and is considered a success when there is no error value.

Type E is used for error value. The default type for the error value is string.

Default behavior of Expected can be modified by the Hook template parameter.

@paramT represents type of the expected value@paramE represents type of the error value.@paramHook defines the Expected type behavior
Expected
!(
(alias) T = images_wired_qoi.QoiHeader
T
,
(struct) images_wired_qoi.BinError
BinError
);
ulong
ulong images_wired_qoi.readBe(in ubyte[] bytes, ulong at, ulong width) pure nothrow @nogc @safe
readBe
(in ubyte[]
(parameter) const(ubyte[]) bytes
bytes
,
(alias) object.size_t = ulong
size_t
(parameter) ulong at
at
,
(alias) object.size_t = ulong
size_t
(parameter) ulong width
width
) @safe pure nothrow @nogc
{ ulong
(local variable) ulong value
value
;
foreach (
(parameter) const(ubyte) b
b
;
(parameter) const(ubyte[]) bytes
bytes
[
(parameter) ulong at
at
..
(parameter) ulong at
at
+
(parameter) ulong width
width
])
(local variable) ulong value
value
= (
(local variable) ulong value
value
<< 8) |
(local variable) const(ubyte) b
b
;
return
(local variable) ulong value
value
;
} /// Reads schema node `index` into `value`, in lockstep with the D type.
(struct) images_wired_qoi.BinError
BinError
images_wired_qoi.BinError images_wired_qoi.readNode!(ubyte, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 5LU)(ref ubyte value, in ubyte[] bytes, ref ulong pos, string path) pure nothrow @nogc @safe

Reads schema node index into value, in lockstep with the D type.

readNode
(V, alias schema, size_t index)(ref
(alias) V = ubyte
V
(parameter) ubyte value
value
, in ubyte[]
(parameter) const(ubyte[]) bytes
bytes
,
ref
(alias) object.size_t = ulong
size_t
(parameter) ulong pos
pos
,
(alias) object.string = string
string
(parameter) string path
path
)
{ enum
(constant) sparkles.wired.schema.SchemaNode images_wired_qoi.readNode!(ubyte, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 5LU).node = SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))
node
=
(constant) sparkles.wired.schema.WireSchema images_wired_qoi.decodeFixed!(images_wired_qoi.QoiHeader).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"])
schema
.
(field) sparkles.wired.schema.SchemaNode[] sparkles.wired.schema.WireSchema.nodes
nodes
[
(constant) ulong images_wired_qoi.index = 5LU
index
];
static if (
(constant) sparkles.wired.schema.SchemaNode images_wired_qoi.readNode!(ubyte, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 5LU).node = SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))
node
.
(field) sparkles.wired.schema.NodeKind sparkles.wired.schema.SchemaNode.kind
kind
==
(enum) sparkles.wired.schema.NodeKind

Structural node vocabulary shared by format walkers and derivations.

NodeKind
.
(enum value) sparkles.wired.schema.NodeKind.aggregate = 2
aggregate
)
{ static foreach (i; 0 .. V.tupleof.length) {{ enum
(constant) ulong images_wired_qoi.readNode!(images_wired_qoi.QoiHeader, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 0LU).child = 1LU
child
=
(constant) sparkles.wired.schema.WireSchema images_wired_qoi.decodeFixed!(images_wired_qoi.QoiHeader).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"])
schema
.
(field) ulong[] sparkles.wired.schema.WireSchema.edges
edges
[
(constant) sparkles.wired.schema.SchemaNode images_wired_qoi.readNode!(images_wired_qoi.QoiHeader, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 0LU).node = SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))
node
.
(field) ulong sparkles.wired.schema.SchemaNode.firstEdge

range in WireSchema.edges

firstEdge
+
(constant) ulong images_wired_qoi.readNode!(images_wired_qoi.QoiHeader, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 0LU).i = 3LU
i
];
const
(local variable) const(string) fieldPath
fieldPath
=
(parameter) string path
path
.
(field) ulong string.length
length
?
(parameter) string path
path
~ "." ~ schema.nodes[child].name :
(constant) sparkles.wired.schema.WireSchema images_wired_qoi.decodeFixed!(images_wired_qoi.QoiHeader).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"])
schema
.
(field) sparkles.wired.schema.SchemaNode[] sparkles.wired.schema.WireSchema.nodes
nodes
[
(constant) ulong images_wired_qoi.readNode!(images_wired_qoi.QoiHeader, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 0LU).child = 1LU
child
].
(field) string sparkles.wired.schema.SchemaNode.name

field key, enum-member name, or union variant name

name
;
const
(local variable) const(ulong) fieldStart
fieldStart
=
(parameter) ulong pos
pos
;
auto
(local variable) images_wired_qoi.BinError e
e
=
(constant) ulong images_wired_qoi.readNode!(images_wired_qoi.QoiHeader, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 0LU).child = 5LU
readNode
!(typeof(
(field) char[4] images_wired_qoi.QoiHeader.magic
V
.tupleof[
(constant) ulong images_wired_qoi.readNode!(images_wired_qoi.QoiHeader, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 0LU).i = 0LU
i
]),
(constant) sparkles.wired.schema.WireSchema images_wired_qoi.decodeFixed!(images_wired_qoi.QoiHeader).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"])
schema
,
(constant) ulong images_wired_qoi.readNode!(images_wired_qoi.QoiHeader, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 0LU).child = 1LU
child
)(
(parameter) images_wired_qoi.QoiHeader value
value
.tupleof[
(constant) ulong images_wired_qoi.readNode!(images_wired_qoi.QoiHeader, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 0LU).i = 0LU
i
],
(parameter) const(ubyte[]) bytes
bytes
,
(parameter) ulong pos
pos
,
(local variable) const(string) fieldPath
fieldPath
);
if (
(local variable) images_wired_qoi.BinError e
e
.
(field) images_wired_qoi.BinErrorKind images_wired_qoi.BinError.kind
kind
!=
(enum) images_wired_qoi.BinErrorKind
BinErrorKind
.
(enum value) images_wired_qoi.BinErrorKind.none = cast(ubyte)0u
none
)
return
(local variable) images_wired_qoi.BinError e
e
;
auto
(local variable) sparkles.wired.policy.WireCheckFailure[] failures
failures
=
(constant) ulong images_wired_qoi.readNode!(images_wired_qoi.QoiHeader, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 0LU).i = 0LU
wireCheckFailures
!(
(struct) images_wired_qoi.BeFixed

Format marker. Its schema hook admits only fixed-size shapes; the byte order is a property of the marker, since SchemaNode has no such field.

BeFixed
,
(alias) V = images_wired_qoi.QoiHeader
V
.tupleof[
(constant) ulong images_wired_qoi.readNode!(images_wired_qoi.QoiHeader, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 0LU).i = 0LU
i
])(
(parameter) images_wired_qoi.QoiHeader value
value
.tupleof[
(constant) ulong images_wired_qoi.readNode!(images_wired_qoi.QoiHeader, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 0LU).i = 0LU
i
]);
if (
(local variable) sparkles.wired.policy.WireCheckFailure[] failures
failures
.
(field) ulong sparkles.wired.policy.WireCheckFailure[].length
length
)
return
(struct) images_wired_qoi.BinError
BinError
(
(enum) images_wired_qoi.BinErrorKind
BinErrorKind
.
(enum value) images_wired_qoi.BinErrorKind.checkFailed = 3
checkFailed
,
(local variable) const(ulong) fieldStart
fieldStart
,
(local variable) const(string) fieldPath
fieldPath
~ ": " ~
(local variable) sparkles.wired.policy.WireCheckFailure[] failures
failures
[0].
(field) string sparkles.wired.policy.WireCheckFailure.reason
reason
);
}} return
(struct) images_wired_qoi.BinError
BinError
.
(constant) images_wired_qoi.BinError images_wired_qoi.BinError.init = BinError(BinErrorKind.none, 0LU, null)
init
;
} else static if (
(constant) sparkles.wired.schema.SchemaNode images_wired_qoi.readNode!(ubyte, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 5LU).node = SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))
node
.
(field) sparkles.wired.schema.NodeKind sparkles.wired.schema.SchemaNode.kind
kind
==
(enum) sparkles.wired.schema.NodeKind

Structural node vocabulary shared by format walkers and derivations.

NodeKind
.
(enum value) sparkles.wired.schema.NodeKind.staticArray = 5
staticArray
)
{ enum
(constant) ulong images_wired_qoi.readNode!(char[4], WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 1LU).child = 2LU
child
=
(constant) sparkles.wired.schema.WireSchema images_wired_qoi.decodeFixed!(images_wired_qoi.QoiHeader).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"])
schema
.
(field) ulong[] sparkles.wired.schema.WireSchema.edges
edges
[
(constant) sparkles.wired.schema.SchemaNode images_wired_qoi.readNode!(char[4], WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 1LU).node = SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))
node
.
(field) ulong sparkles.wired.schema.SchemaNode.firstEdge

range in WireSchema.edges

firstEdge
];
foreach (
(local variable) ulong k
k
; 0 ..
(constant) sparkles.wired.schema.SchemaNode images_wired_qoi.readNode!(char[4], WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 1LU).node = SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))
node
.
(field) ulong sparkles.wired.schema.SchemaNode.staticLength

T[N] length, zero otherwise

staticLength
)
{ auto
(local variable) images_wired_qoi.BinError e
e
=
(constant) ulong images_wired_qoi.readNode!(char[4], WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 1LU).child = 2LU
readNode
!(typeof(
(parameter) char[4] value
value
[0]),
(constant) sparkles.wired.schema.WireSchema images_wired_qoi.decodeFixed!(images_wired_qoi.QoiHeader).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"])
schema
,
(constant) ulong images_wired_qoi.readNode!(char[4], WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 1LU).child = 2LU
child
)(
(parameter) char[4] value
value
[
(local variable) ulong k
k
],
(parameter) const(ubyte[]) bytes
bytes
,
(parameter) ulong pos
pos
,
(parameter) string path
path
);
if (
(local variable) images_wired_qoi.BinError e
e
.
(field) images_wired_qoi.BinErrorKind images_wired_qoi.BinError.kind
kind
!=
(enum) images_wired_qoi.BinErrorKind
BinErrorKind
.
(enum value) images_wired_qoi.BinErrorKind.none = cast(ubyte)0u
none
)
return
(local variable) images_wired_qoi.BinError e
e
;
} return
(struct) images_wired_qoi.BinError
BinError
.
(constant) images_wired_qoi.BinError images_wired_qoi.BinError.init = BinError(BinErrorKind.none, 0LU, null)
init
;
} else static if (
(constant) sparkles.wired.schema.SchemaNode images_wired_qoi.readNode!(ubyte, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 5LU).node = SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))
node
.
(field) sparkles.wired.schema.NodeKind sparkles.wired.schema.SchemaNode.kind
kind
==
(enum) sparkles.wired.schema.NodeKind

Structural node vocabulary shared by format walkers and derivations.

NodeKind
.
(enum value) sparkles.wired.schema.NodeKind.enumeration = 1
enumeration
)
{ const raw = cast(OriginalType!V) readBe(bytes, pos, node.scalarBits / 8); static foreach (member; EnumMembers!V) if (raw == member) { value = member; pos += node.scalarBits / 8; return BinError.init; } return BinError(BinErrorKind.notAMember, pos, path); } else {
(parameter) ubyte value
value
= cast(
(alias) V = ubyte
V
)
ulong images_wired_qoi.readBe(in ubyte[] bytes, ulong at, ulong width) pure nothrow @nogc @safe
readBe
(
(parameter) const(ubyte[]) bytes
bytes
,
(parameter) ulong pos
pos
,
(constant) sparkles.wired.schema.SchemaNode images_wired_qoi.readNode!(ubyte, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 5LU).node = SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))
node
.
(field) ushort sparkles.wired.schema.SchemaNode.scalarBits

scalar storage width where it constrains wire values

scalarBits
/ 8);
(parameter) ulong pos
pos
+=
(constant) sparkles.wired.schema.SchemaNode images_wired_qoi.readNode!(ubyte, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 5LU).node = SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))
node
.
(field) ushort sparkles.wired.schema.SchemaNode.scalarBits

scalar storage width where it constrains wire values

scalarBits
/ 8;
return
(struct) images_wired_qoi.BinError
BinError
.
(constant) images_wired_qoi.BinError images_wired_qoi.BinError.init = BinError(BinErrorKind.none, 0LU, null)
init
;
} } /// Decodes a fixed record at `at`: one bounds check, the schema walk with /// field checks, then the type-level `@WireCheck`s.
(alias) images_wired_qoi.BinResult!(images_wired_qoi.QoiHeader) = sparkles.base.expected.Expected!(QoiHeader, BinError, Abort)
BinResult
!
(alias) T = images_wired_qoi.QoiHeader
T
sparkles.base.expected.Expected!(QoiHeader, BinError, Abort) images_wired_qoi.decodeFixed!(images_wired_qoi.QoiHeader)(in ubyte[] bytes, ulong at) pure nothrow @safe

Decodes a fixed record at at: one bounds check, the schema walk with field checks, then the type-level @WireChecks.

decodeFixed
(T)(in ubyte[]
(parameter) const(ubyte[]) bytes
bytes
,
(alias) object.size_t = ulong
size_t
(parameter) ulong at
at
)
{ enum
(constant) sparkles.wired.schema.WireSchema images_wired_qoi.decodeFixed!(images_wired_qoi.QoiHeader).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"])
schema
=
(template instance) sparkles.wired.schema.wireSchemaOf!(images_wired_qoi.BeFixed, images_wired_qoi.QoiHeader)
wireSchemaOf
!(
(struct) images_wired_qoi.BeFixed

Format marker. Its schema hook admits only fixed-size shapes; the byte order is a property of the marker, since SchemaNode has no such field.

BeFixed
,
(alias) T = images_wired_qoi.QoiHeader
T
);
enum
(alias) object.size_t = ulong
size_t
(constant) ulong images_wired_qoi.decodeFixed!(images_wired_qoi.QoiHeader).size = 14LU
size
=
long images_wired_qoi.fixedSize(const(sparkles.wired.schema.WireSchema) schema, ulong index) pure nothrow @safe

Byte size of the subtree at index, or -1 when the schema gives none. Takes the schema by value: as an in parameter, CTFE fails on DMD and crashes LDC.

fixedSize
(
(constant) sparkles.wired.schema.WireSchema images_wired_qoi.decodeFixed!(images_wired_qoi.QoiHeader).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"])
schema
, 0);
if (
(parameter) ulong at
at
>
(parameter) const(ubyte[]) bytes
bytes
.
(field) ulong const(ubyte[]).length
length
||
(parameter) const(ubyte[]) bytes
bytes
.
(field) ulong const(ubyte[]).length
length
-
(parameter) ulong at
at
<
(constant) ulong images_wired_qoi.decodeFixed!(images_wired_qoi.QoiHeader).size = 14LU
size
)
return
sparkles.base.expected.Expected!(QoiHeader, BinError, Abort) sparkles.base.expected.err!(images_wired_qoi.QoiHeader, sparkles.base.expected.Abort, images_wired_qoi.BinError)(images_wired_qoi.BinError err) pure nothrow @nogc @safe

Creates an Expected object from an error value, with type inference.

Examples

// implicit void value type
{
    auto res = err("foo");
    static assert(is(typeof(res) == Expected!(void, string)));
    assert(!res);
    assert(res.error == "foo");
}

// bool
{
    auto res = err!int("42");
    static assert(is(typeof(res) == Expected!(int, string)));
    assert(!res);
    assert(res.error == "42");
}

// other error type
{
    auto res = err!bool(42);
    static assert(is(typeof(res) == Expected!(bool, int)));
    assert(!res);
    assert(res.error == 42);
}
err
!
(alias) T = images_wired_qoi.QoiHeader
T
(
(struct) images_wired_qoi.BinError
BinError
(
(enum) images_wired_qoi.BinErrorKind
BinErrorKind
.
(enum value) images_wired_qoi.BinErrorKind.truncated = 1
truncated
,
(parameter) ulong at
at
,
(struct) images_wired_qoi.QoiHeader

"magic bytes "qoif"", then big-endian width and height, then two informative bytes.

T
.
(constant) string images_wired_qoi.QoiHeader.stringof = "QoiHeader"
stringof
));
(alias) T = images_wired_qoi.QoiHeader
T
(local variable) images_wired_qoi.QoiHeader value
value
;
(alias) object.size_t = ulong
size_t
(local variable) ulong pos
pos
=
(parameter) ulong at
at
;
auto
(local variable) images_wired_qoi.BinError e
e
=
images_wired_qoi.BinError images_wired_qoi.readNode!(images_wired_qoi.QoiHeader, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 0LU)(ref images_wired_qoi.QoiHeader value, in ubyte[] bytes, ref ulong pos, string path) pure nothrow @safe

Reads schema node index into value, in lockstep with the D type.

readNode
!(
(alias) T = images_wired_qoi.QoiHeader
T
,
(constant) sparkles.wired.schema.WireSchema images_wired_qoi.decodeFixed!(images_wired_qoi.QoiHeader).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"])
schema
, 0)(
(local variable) images_wired_qoi.QoiHeader value
value
,
(parameter) const(ubyte[]) bytes
bytes
,
(local variable) ulong pos
pos
, "");
if (
(local variable) images_wired_qoi.BinError e
e
.
(field) images_wired_qoi.BinErrorKind images_wired_qoi.BinError.kind
kind
!=
(enum) images_wired_qoi.BinErrorKind
BinErrorKind
.
(enum value) images_wired_qoi.BinErrorKind.none = cast(ubyte)0u
none
)
{
(local variable) images_wired_qoi.BinError e
e
.
(field) string images_wired_qoi.BinError.what
what
=
(struct) images_wired_qoi.QoiHeader

"magic bytes "qoif"", then big-endian width and height, then two informative bytes.

T
.
(constant) string images_wired_qoi.QoiHeader.stringof = "QoiHeader"
stringof
~ "." ~
(local variable) images_wired_qoi.BinError e
e
.
(field) string images_wired_qoi.BinError.what
what
;
return
sparkles.base.expected.Expected!(QoiHeader, BinError, Abort) sparkles.base.expected.err!(images_wired_qoi.QoiHeader, sparkles.base.expected.Abort, images_wired_qoi.BinError)(ref images_wired_qoi.BinError err) pure nothrow @nogc @safe

Creates an Expected object from an error value, with type inference.

Examples

// implicit void value type
{
    auto res = err("foo");
    static assert(is(typeof(res) == Expected!(void, string)));
    assert(!res);
    assert(res.error == "foo");
}

// bool
{
    auto res = err!int("42");
    static assert(is(typeof(res) == Expected!(int, string)));
    assert(!res);
    assert(res.error == "42");
}

// other error type
{
    auto res = err!bool(42);
    static assert(is(typeof(res) == Expected!(bool, int)));
    assert(!res);
    assert(res.error == 42);
}
err
!
(alias) T = images_wired_qoi.QoiHeader
T
(
(local variable) images_wired_qoi.BinError e
e
);
} auto
(local variable) sparkles.wired.policy.WireCheckFailure[] failures
failures
=
sparkles.wired.policy.WireCheckFailure[] sparkles.wired.policy.wireCheckFailures!(images_wired_qoi.BeFixed, images_wired_qoi.QoiHeader, images_wired_qoi.QoiHeader)(in images_wired_qoi.QoiHeader value) pure nothrow @nogc @safe

Runs the shared four-protocol check vocabulary at a type or field site. static because symbol may alias a field: without it the instantiation would need an instance of the field's aggregate as its context.

wireCheckFailures
!(
(struct) images_wired_qoi.BeFixed

Format marker. Its schema hook admits only fixed-size shapes; the byte order is a property of the marker, since SchemaNode has no such field.

BeFixed
,
(alias) T = images_wired_qoi.QoiHeader
T
)(
(local variable) images_wired_qoi.QoiHeader value
value
);
if (
(local variable) sparkles.wired.policy.WireCheckFailure[] failures
failures
.
(field) ulong sparkles.wired.policy.WireCheckFailure[].length
length
)
return
sparkles.base.expected.Expected!(QoiHeader, BinError, Abort) sparkles.base.expected.err!(images_wired_qoi.QoiHeader, sparkles.base.expected.Abort, images_wired_qoi.BinError)(images_wired_qoi.BinError err) pure nothrow @nogc @safe

Creates an Expected object from an error value, with type inference.

Examples

// implicit void value type
{
    auto res = err("foo");
    static assert(is(typeof(res) == Expected!(void, string)));
    assert(!res);
    assert(res.error == "foo");
}

// bool
{
    auto res = err!int("42");
    static assert(is(typeof(res) == Expected!(int, string)));
    assert(!res);
    assert(res.error == "42");
}

// other error type
{
    auto res = err!bool(42);
    static assert(is(typeof(res) == Expected!(bool, int)));
    assert(!res);
    assert(res.error == 42);
}
err
!
(alias) T = images_wired_qoi.QoiHeader
T
(
(struct) images_wired_qoi.BinError
BinError
(
(enum) images_wired_qoi.BinErrorKind
BinErrorKind
.
(enum value) images_wired_qoi.BinErrorKind.checkFailed = 3
checkFailed
,
(parameter) ulong at
at
,
(struct) images_wired_qoi.QoiHeader

"magic bytes "qoif"", then big-endian width and height, then two informative bytes.

T
.
(constant) string images_wired_qoi.QoiHeader.stringof = "QoiHeader"
stringof
~ ": " ~
(local variable) sparkles.wired.policy.WireCheckFailure[] failures
failures
[0].
(field) string sparkles.wired.policy.WireCheckFailure.reason
reason
));
return
sparkles.base.expected.Expected!(QoiHeader, BinError, Abort) sparkles.base.expected.ok!(images_wired_qoi.BinError, sparkles.base.expected.Abort, images_wired_qoi.QoiHeader)(ref images_wired_qoi.QoiHeader value) pure nothrow @nogc @safe

Creates an Expected object from an expected value, with type inference.

ok
!
(struct) images_wired_qoi.BinError
BinError
(
(local variable) images_wired_qoi.QoiHeader value
value
);
} void
void images_wired_qoi.writeNode!(ubyte, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 5LU)(in ubyte value, ref ubyte[] output) pure nothrow @safe
writeNode
(V, alias schema, size_t index)(in
(alias) V = ubyte
V
(parameter) const(ubyte) value
value
, ref ubyte[]
(parameter) ubyte[] output
output
)
{ enum
(constant) sparkles.wired.schema.SchemaNode images_wired_qoi.writeNode!(ubyte, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 5LU).node = SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))
node
=
(constant) sparkles.wired.schema.WireSchema images_wired_qoi.encodeFixed!(images_wired_qoi.QoiHeader).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"])
schema
.
(field) sparkles.wired.schema.SchemaNode[] sparkles.wired.schema.WireSchema.nodes
nodes
[
(constant) ulong images_wired_qoi.index = 5LU
index
];
static if (
(constant) sparkles.wired.schema.SchemaNode images_wired_qoi.writeNode!(ubyte, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 5LU).node = SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))
node
.
(field) sparkles.wired.schema.NodeKind sparkles.wired.schema.SchemaNode.kind
kind
==
(enum) sparkles.wired.schema.NodeKind

Structural node vocabulary shared by format walkers and derivations.

NodeKind
.
(enum value) sparkles.wired.schema.NodeKind.aggregate = 2
aggregate
)
{ static foreach (i; 0 .. V.tupleof.length)
void images_wired_qoi.writeNode!(char[4], WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 1LU)(in char[4] value, ref ubyte[] output) pure nothrow @safe
writeNode
!(typeof(
(field) char[4] images_wired_qoi.QoiHeader.magic
V
.tupleof[
(constant) ulong images_wired_qoi.writeNode!(images_wired_qoi.QoiHeader, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 0LU).i = 0LU
i
]),
(constant) sparkles.wired.schema.WireSchema images_wired_qoi.encodeFixed!(images_wired_qoi.QoiHeader).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"])
schema
,
(constant) sparkles.wired.schema.WireSchema images_wired_qoi.encodeFixed!(images_wired_qoi.QoiHeader).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"])
schema
.
(constant) sparkles.wired.schema.WireSchema images_wired_qoi.encodeFixed!(images_wired_qoi.QoiHeader).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"])
edges
[
(constant) sparkles.wired.schema.SchemaNode images_wired_qoi.writeNode!(images_wired_qoi.QoiHeader, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 0LU).node = SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))
node
.
(field) ulong sparkles.wired.schema.SchemaNode.firstEdge

range in WireSchema.edges

firstEdge
+
(constant) ulong images_wired_qoi.writeNode!(images_wired_qoi.QoiHeader, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 0LU).i = 3LU
i
])(
(parameter) const(images_wired_qoi.QoiHeader) value
value
.tupleof[
(constant) ulong images_wired_qoi.writeNode!(images_wired_qoi.QoiHeader, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 0LU).i = 0LU
i
],
(parameter) ubyte[] output
output
);
} else static if (
(constant) sparkles.wired.schema.SchemaNode images_wired_qoi.writeNode!(ubyte, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 5LU).node = SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))
node
.
(field) sparkles.wired.schema.NodeKind sparkles.wired.schema.SchemaNode.kind
kind
==
(enum) sparkles.wired.schema.NodeKind

Structural node vocabulary shared by format walkers and derivations.

NodeKind
.
(enum value) sparkles.wired.schema.NodeKind.staticArray = 5
staticArray
)
{ foreach (
(local variable) ulong k
k
; 0 ..
(constant) sparkles.wired.schema.SchemaNode images_wired_qoi.writeNode!(char[4], WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 1LU).node = SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))
node
.
(field) ulong sparkles.wired.schema.SchemaNode.staticLength

T[N] length, zero otherwise

staticLength
)
void images_wired_qoi.writeNode!(const(char), WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 2LU)(in char value, ref ubyte[] output) pure nothrow @safe
writeNode
!(typeof(
(parameter) const(char[4]) value
value
[0]),
(constant) sparkles.wired.schema.WireSchema images_wired_qoi.encodeFixed!(images_wired_qoi.QoiHeader).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"])
schema
,
(constant) sparkles.wired.schema.WireSchema images_wired_qoi.encodeFixed!(images_wired_qoi.QoiHeader).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"])
schema
.
(constant) sparkles.wired.schema.WireSchema images_wired_qoi.encodeFixed!(images_wired_qoi.QoiHeader).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"])
edges
[
(constant) sparkles.wired.schema.SchemaNode images_wired_qoi.writeNode!(char[4], WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 1LU).node = SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))
node
.
(constant) sparkles.wired.schema.SchemaNode images_wired_qoi.writeNode!(char[4], WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 1LU).node = SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))
firstEdge
])(
(parameter) const(char[4]) value
value
[
(local variable) ulong k
k
],
(parameter) ubyte[] output
output
);
} else { const ulong
(local variable) const(ulong) raw
raw
= cast(ulong)
(parameter) const(ubyte) value
value
;
foreach_reverse (
(local variable) int k
k
; 0 ..
(constant) sparkles.wired.schema.SchemaNode images_wired_qoi.writeNode!(ubyte, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 5LU).node = SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))
node
.
(field) ushort sparkles.wired.schema.SchemaNode.scalarBits

scalar storage width where it constrains wire values

scalarBits
/ 8)
(parameter) ubyte[] output
output
~= cast(ubyte)(
(local variable) const(ulong) raw
raw
>> (8 *
(local variable) int k
k
));
} } /// Encodes a fixed record after its checks pass, as expressiveness §6.4 /// requires of encode. Returns the first failure's reason, or null.
(alias) object.string = string
string
string images_wired_qoi.encodeFixed!(images_wired_qoi.QoiHeader)(in images_wired_qoi.QoiHeader value, ref ubyte[] output) pure nothrow @safe

Encodes a fixed record after its checks pass, as expressiveness §6.4 requires of encode. Returns the first failure's reason, or null.

encodeFixed
(T)(in
(alias) T = images_wired_qoi.QoiHeader
T
(parameter) const(images_wired_qoi.QoiHeader) value
value
, ref ubyte[]
(parameter) ubyte[] output
output
)
{ enum
(constant) sparkles.wired.schema.WireSchema images_wired_qoi.encodeFixed!(images_wired_qoi.QoiHeader).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"])
schema
=
(template instance) sparkles.wired.schema.wireSchemaOf!(images_wired_qoi.BeFixed, images_wired_qoi.QoiHeader)
wireSchemaOf
!(
(struct) images_wired_qoi.BeFixed

Format marker. Its schema hook admits only fixed-size shapes; the byte order is a property of the marker, since SchemaNode has no such field.

BeFixed
,
(alias) T = images_wired_qoi.QoiHeader
T
);
static foreach (i; 0 .. T.tupleof.length) foreach (
(parameter) sparkles.wired.policy.WireCheckFailure failure
failure
;
(constant) ulong images_wired_qoi.encodeFixed!(images_wired_qoi.QoiHeader).i = 0LU
wireCheckFailures
!(
(struct) images_wired_qoi.BeFixed

Format marker. Its schema hook admits only fixed-size shapes; the byte order is a property of the marker, since SchemaNode has no such field.

BeFixed
,
(alias) T = images_wired_qoi.QoiHeader
T
.tupleof[
(constant) ulong images_wired_qoi.encodeFixed!(images_wired_qoi.QoiHeader).i = 0LU
i
])(
(parameter) const(images_wired_qoi.QoiHeader) value
value
.tupleof[
(constant) ulong images_wired_qoi.encodeFixed!(images_wired_qoi.QoiHeader).i = 0LU
i
]))
return
(local variable) sparkles.wired.policy.WireCheckFailure failure
failure
.
(field) string sparkles.wired.policy.WireCheckFailure.reason
reason
;
foreach (
(parameter) sparkles.wired.policy.WireCheckFailure failure
failure
;
sparkles.wired.policy.WireCheckFailure[] sparkles.wired.policy.wireCheckFailures!(images_wired_qoi.BeFixed, images_wired_qoi.QoiHeader, images_wired_qoi.QoiHeader)(in images_wired_qoi.QoiHeader value) pure nothrow @nogc @safe

Runs the shared four-protocol check vocabulary at a type or field site. static because symbol may alias a field: without it the instantiation would need an instance of the field's aggregate as its context.

wireCheckFailures
!(
(struct) images_wired_qoi.BeFixed

Format marker. Its schema hook admits only fixed-size shapes; the byte order is a property of the marker, since SchemaNode has no such field.

BeFixed
,
(alias) T = images_wired_qoi.QoiHeader
T
)(
(parameter) const(images_wired_qoi.QoiHeader) value
value
))
return
(local variable) sparkles.wired.policy.WireCheckFailure failure
failure
.
(field) string sparkles.wired.policy.WireCheckFailure.reason
reason
;
void images_wired_qoi.writeNode!(images_wired_qoi.QoiHeader, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"]), 0LU)(in images_wired_qoi.QoiHeader value, ref ubyte[] output) pure nothrow @safe
writeNode
!(
(alias) T = images_wired_qoi.QoiHeader
T
,
(constant) sparkles.wired.schema.WireSchema images_wired_qoi.encodeFixed!(images_wired_qoi.QoiHeader).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"])
schema
, 0)(
(parameter) const(images_wired_qoi.QoiHeader) value
value
,
(parameter) ubyte[] output
output
);
return null; } // --------------------------------------------------------------------------- // The QOI header (qoiformat.org specification 1.0) // --------------------------------------------------------------------------- /// "magic bytes "qoif"", then big-endian width and height, then two /// informative bytes. struct
images_wired_qoi.QoiHeader QoiHeader
QoiHeader
{ @
(template instance) images_wired_qoi.QoiHeader.WireCheck!((m) => m == "qoif", "magic is not qoif", sparkles.metadata.wire.AnyFormat)
WireCheck
!(m => m == "qoif", "magic is not qoif") char[4]
(field) char[4] images_wired_qoi.QoiHeader.magic
magic
;
uint
(field) uint images_wired_qoi.QoiHeader.width
width
;
uint
(field) uint images_wired_qoi.QoiHeader.height
height
;
@
(template instance) sparkles.wired.policy.WireCheck!(isOneOf, "channels must be 3 or 4", sparkles.metadata.wire.AnyFormat)
WireCheck
!(
(template) sparkles.wired.policy.isOneOf!(3, 4)

Declarative membership check usable as a WireCheck predicate.

isOneOf
!(3, 4), "channels must be 3 or 4") ubyte
(field) ubyte images_wired_qoi.QoiHeader.channels
channels
;
@
(template instance) sparkles.wired.policy.WireCheck!(isOneOf, "colorspace must be 0 or 1", sparkles.metadata.wire.AnyFormat)
WireCheck
!(
(template) sparkles.wired.policy.isOneOf!(0, 1)

Declarative membership check usable as a WireCheck predicate.

isOneOf
!(0, 1), "colorspace must be 0 or 1") ubyte
(field) ubyte images_wired_qoi.QoiHeader.colorspace
colorspace
;
} // --------------------------------------------------------------------------- // GAP: everything below is hand-written // --------------------------------------------------------------------------- struct
(struct) images_wired_qoi.Rgba
Rgba
{ ubyte
(field) ubyte images_wired_qoi.Rgba.r
r
,
(field) ubyte images_wired_qoi.Rgba.g
g
,
(field) ubyte images_wired_qoi.Rgba.b
b
,
(field) ubyte images_wired_qoi.Rgba.a
a
;
} /// "index_position = (r * 3 + g * 5 + b * 7 + a * 11) % 64"
(alias) object.size_t = ulong
size_t
ulong images_wired_qoi.hashOf(images_wired_qoi.Rgba p) pure nothrow @nogc @safe

"index_position = (r * 3 + g * 5 + b * 7 + a * 11) % 64"

hashOf
(
(struct) images_wired_qoi.Rgba
Rgba
(parameter) images_wired_qoi.Rgba p
p
) @safe pure nothrow @nogc => (
(parameter) images_wired_qoi.Rgba p
p
.
(field) ubyte images_wired_qoi.Rgba.r
r
* 3 +
(parameter) images_wired_qoi.Rgba p
p
.
(field) ubyte images_wired_qoi.Rgba.g
g
* 5 +
(parameter) images_wired_qoi.Rgba p
p
.
(field) ubyte images_wired_qoi.Rgba.b
b
* 7 +
(parameter) images_wired_qoi.Rgba p
p
.
(field) ubyte images_wired_qoi.Rgba.a
a
* 11) % 64;
enum ubyte
(constant) ubyte images_wired_qoi.opIndex = cast(ubyte)0u
opIndex
= 0x00,
(constant) ubyte images_wired_qoi.opDiff = cast(ubyte)64u
opDiff
= 0x40,
(constant) ubyte images_wired_qoi.opLuma = cast(ubyte)128u
opLuma
= 0x80,
(constant) ubyte images_wired_qoi.opRun = cast(ubyte)192u
opRun
= 0xC0;
enum ubyte
(constant) ubyte images_wired_qoi.opRgb = cast(ubyte)254u
opRgb
= 0xFE,
(constant) ubyte images_wired_qoi.opRgba = cast(ubyte)255u
opRgba
= 0xFF;
immutable ubyte[8]
(immutable global) immutable(ubyte[8]) images_wired_qoi.endMarker
endMarker
= [0, 0, 0, 0, 0, 0, 0, 1];
enum
(enum) images_wired_qoi.Status
Status
{
(enum value) images_wired_qoi.Status.ok = 0
ok
,
(enum value) images_wired_qoi.Status.needMore = 1
needMore
,
(enum value) images_wired_qoi.Status.error = 2
error
}
enum
(enum) images_wired_qoi.Op
Op
{
(enum value) images_wired_qoi.Op.rgb = 0
rgb
,
(enum value) images_wired_qoi.Op.rgba = 1
rgba
,
(enum value) images_wired_qoi.Op.index = 2
index
,
(enum value) images_wired_qoi.Op.diff = 3
diff
,
(enum value) images_wired_qoi.Op.luma = 4
luma
,
(enum value) images_wired_qoi.Op.run = 5
run
}
/// GAP: a resumable decoder. Its whole state is this struct; `feed` may be /// called with any split of the input. struct
(struct) images_wired_qoi.QoiDecoder

GAP

a resumable decoder. Its whole state is this struct; feed may be called with any split of the input.

QoiDecoder
{ ulong
(field) ulong images_wired_qoi.QoiDecoder.maxPixels

the caller's budget, checked against the header

maxPixels
; /// the caller's budget, checked against the header
(struct) images_wired_qoi.QoiHeader

"magic bytes "qoif"", then big-endian width and height, then two informative bytes.

QoiHeader
(field) images_wired_qoi.QoiHeader images_wired_qoi.QoiDecoder.header
header
;
(struct) images_wired_qoi.Rgba
Rgba
[]
(field) images_wired_qoi.Rgba[] images_wired_qoi.QoiDecoder.pixels
pixels
;
(struct) images_wired_qoi.BinError
BinError
(field) images_wired_qoi.BinError images_wired_qoi.QoiDecoder.error
error
;
ulong[
EnumMembers
EnumMembers
!
(enum) images_wired_qoi.Op
Op
.length]
(field) ulong[6] images_wired_qoi.QoiDecoder.opCounts
opCounts
;
(alias) object.size_t = ulong
size_t
(field) ulong images_wired_qoi.QoiDecoder.suspensions

times feed returned needMore

suspensions
; /// times `feed` returned `needMore`
private enum
(enum) images_wired_qoi.QoiDecoder.Phase
Phase
{
(enum value) images_wired_qoi.QoiDecoder.Phase.header = 0
header
,
(enum value) images_wired_qoi.QoiDecoder.Phase.ops = 1
ops
,
(enum value) images_wired_qoi.QoiDecoder.Phase.end = 2
end
,
(enum value) images_wired_qoi.QoiDecoder.Phase.done = 3
done
}
private
(enum) images_wired_qoi.QoiDecoder.Phase
Phase
(field) images_wired_qoi.QoiDecoder.Phase images_wired_qoi.QoiDecoder.phase
phase
;
private ubyte[14]
(field) ubyte[14] images_wired_qoi.QoiDecoder.scratch
scratch
;
private
(alias) object.size_t = ulong
size_t
(field) ulong images_wired_qoi.QoiDecoder.scratchLength
scratchLength
;
private
(alias) object.size_t = ulong
size_t
(field) ulong images_wired_qoi.QoiDecoder.position

absolute input position consumed so far

position
; /// absolute input position consumed so far
private
(alias) object.size_t = ulong
size_t
(field) ulong images_wired_qoi.QoiDecoder.written
written
;
private
(struct) images_wired_qoi.Rgba
Rgba
(field) images_wired_qoi.Rgba images_wired_qoi.QoiDecoder.previous
previous
=
(struct) images_wired_qoi.Rgba
Rgba
(0, 0, 0, 255);
private
(struct) images_wired_qoi.Rgba
Rgba
[64]
(field) images_wired_qoi.Rgba[64] images_wired_qoi.QoiDecoder.index
index
;
/// Returns `need` bytes, from the piece directly when they are all there, /// else accumulated in `scratch` across calls; null while incomplete. private const(ubyte)[]
const(ubyte)[] images_wired_qoi.QoiDecoder.take(ref const(ubyte)[] piece, ulong need) return

Returns need bytes, from the piece directly when they are all there, else accumulated in scratch across calls; null while incomplete.

take
(ref const(ubyte)[]
(parameter) const(ubyte)[] piece
piece
,
(alias) object.size_t = ulong
size_t
(parameter) ulong need
need
) return
{ if (
(field) ulong images_wired_qoi.QoiDecoder.scratchLength
scratchLength
== 0 &&
(parameter) const(ubyte)[] piece
piece
.
(field) ulong const(ubyte)[].length
length
>=
(parameter) ulong need
need
)
{ auto
(local variable) const(ubyte)[] bytes
bytes
=
(parameter) const(ubyte)[] piece
piece
[0 ..
(parameter) ulong need
need
];
(parameter) const(ubyte)[] piece
piece
=
(parameter) const(ubyte)[] piece
piece
[
(parameter) ulong need
need
.. $];
(field) ulong images_wired_qoi.QoiDecoder.position

absolute input position consumed so far

position
+=
(parameter) ulong need
need
;
return
(local variable) const(ubyte)[] bytes
bytes
;
} const
(local variable) const(ulong) n
n
=
ulong std.algorithm.comparison.min!(ulong, ulong)(ulong a, ulong b) pure nothrow @nogc @safe

Iterates the passed arguments and returns the minimum value.

Examples

int a = 5;
short b = 6;
double c = 2;
auto d = min(a, b);
static assert(is(typeof(d) == int));
assert(d == 5);
auto e = min(a, b, c);
static assert(is(typeof(e) == double));
assert(e == 2);
ulong f = 0xffff_ffff_ffff;
const uint g = min(f, 0xffff_0000);
assert(g == 0xffff_0000);
dchar h = 100;
uint i = 101;
static assert(is(typeof(min(h, i)) == dchar));
static assert(is(typeof(min(i, h)) == uint));
assert(min(h, i) == 100);

With arguments of mixed signedness, the return type is the one that can store the lowest values.

int a = -10;
uint f = 10;
static assert(is(typeof(min(a, f)) == int));
assert(min(a, f) == -10);

User-defined types that support comparison with < are supported.

import std.datetime;
assert(min(Date(2012, 12, 21), Date(1982, 1, 4)) == Date(1982, 1, 4));
assert(min(Date(1982, 1, 4), Date(2012, 12, 21)) == Date(1982, 1, 4));
assert(min(Date(1982, 1, 4), Date.min) == Date.min);
assert(min(Date.min, Date(1982, 1, 4)) == Date.min);
assert(min(Date(1982, 1, 4), Date.max) == Date(1982, 1, 4));
assert(min(Date.max, Date(1982, 1, 4)) == Date(1982, 1, 4));
assert(min(Date.min, Date.max) == Date.min);
assert(min(Date.max, Date.min) == Date.min);
@paramargs The values to select the minimum from. At least two arguments must be passed, and they must be comparable with <.@returnsThe minimum of the passed-in values. The type of the returned value is the type among the passed arguments that is able to store the smallest value. If at least one of the arguments is NaN, the result is an unspecified value. See minElement for examples on how to cope with NaNs.@seeminElement
min
(
(parameter) ulong need
need
-
(field) ulong images_wired_qoi.QoiDecoder.scratchLength
scratchLength
,
(parameter) const(ubyte)[] piece
piece
.
(field) ulong const(ubyte)[].length
length
);
(field) ubyte[14] images_wired_qoi.QoiDecoder.scratch
scratch
[
(field) ulong images_wired_qoi.QoiDecoder.scratchLength
scratchLength
..
(field) ulong images_wired_qoi.QoiDecoder.scratchLength
scratchLength
+
(local variable) const(ulong) n
n
] =
(parameter) const(ubyte)[] piece
piece
[0 ..
(local variable) const(ulong) n
n
];
(parameter) const(ubyte)[] piece
piece
=
(parameter) const(ubyte)[] piece
piece
[
(local variable) const(ulong) n
n
.. $];
(field) ulong images_wired_qoi.QoiDecoder.scratchLength
scratchLength
+=
(local variable) const(ulong) n
n
;
(field) ulong images_wired_qoi.QoiDecoder.position

absolute input position consumed so far

position
+=
(local variable) const(ulong) n
n
;
if (
(field) ulong images_wired_qoi.QoiDecoder.scratchLength
scratchLength
<
(parameter) ulong need
need
)
return null;
(field) ulong images_wired_qoi.QoiDecoder.scratchLength
scratchLength
= 0;
return
(field) ubyte[14] images_wired_qoi.QoiDecoder.scratch
scratch
[0 ..
(parameter) ulong need
need
];
} private
(enum) images_wired_qoi.Status
Status
images_wired_qoi.Status images_wired_qoi.QoiDecoder.fail(images_wired_qoi.BinErrorKind kind, string what)
fail
(
(enum) images_wired_qoi.BinErrorKind
BinErrorKind
(parameter) images_wired_qoi.BinErrorKind kind
kind
,
(alias) object.string = string
string
(parameter) string what
what
)
{
(field) images_wired_qoi.BinError images_wired_qoi.QoiDecoder.error
error
=
(struct) images_wired_qoi.BinError
BinError
(
(parameter) images_wired_qoi.BinErrorKind kind
kind
,
(field) ulong images_wired_qoi.QoiDecoder.position

absolute input position consumed so far

position
,
(parameter) string what
what
);
(field) images_wired_qoi.QoiDecoder.Phase images_wired_qoi.QoiDecoder.phase
phase
=
(enum) images_wired_qoi.QoiDecoder.Phase
Phase
.
(enum value) images_wired_qoi.QoiDecoder.Phase.done = 3
done
;
return
(enum) images_wired_qoi.Status
Status
.
(enum value) images_wired_qoi.Status.error = 2
error
;
} private void
void images_wired_qoi.QoiDecoder.emit(images_wired_qoi.Rgba p, ulong count = 1LU)
emit
(
(struct) images_wired_qoi.Rgba
Rgba
(parameter) images_wired_qoi.Rgba p
p
,
(alias) object.size_t = ulong
size_t
(parameter) ulong count
count
= 1)
{
(field) images_wired_qoi.Rgba[] images_wired_qoi.QoiDecoder.pixels
pixels
[
(field) ulong images_wired_qoi.QoiDecoder.written
written
..
(field) ulong images_wired_qoi.QoiDecoder.written
written
+
(parameter) ulong count
count
] =
(parameter) images_wired_qoi.Rgba p
p
;
(field) ulong images_wired_qoi.QoiDecoder.written
written
+=
(parameter) ulong count
count
;
(field) images_wired_qoi.Rgba images_wired_qoi.QoiDecoder.previous
previous
=
(parameter) images_wired_qoi.Rgba p
p
;
} /// Consumes `piece`; `closed` says no more input will follow.
(enum) images_wired_qoi.Status
Status
images_wired_qoi.Status images_wired_qoi.QoiDecoder.feed(const(ubyte)[] piece, bool closed)

Consumes piece; closed says no more input will follow.

feed
(const(ubyte)[]
(parameter) const(ubyte)[] piece
piece
, bool
(parameter) bool closed
closed
)
{ if (
(field) images_wired_qoi.BinError images_wired_qoi.QoiDecoder.error
error
.
(field) images_wired_qoi.BinErrorKind images_wired_qoi.BinError.kind
kind
!=
(enum) images_wired_qoi.BinErrorKind
BinErrorKind
.
(enum value) images_wired_qoi.BinErrorKind.none = cast(ubyte)0u
none
)
return
(enum) images_wired_qoi.Status
Status
.
(enum value) images_wired_qoi.Status.error = 2
error
; // errors are sticky, as in Wuffs
while (true) { final switch (
(field) images_wired_qoi.QoiDecoder.Phase images_wired_qoi.QoiDecoder.phase
phase
)
{ case
(enum) images_wired_qoi.QoiDecoder.Phase
Phase
.
(enum value) images_wired_qoi.QoiDecoder.Phase.header = 0
header
:
auto
(local variable) const(ubyte)[] bytes
bytes
=
const(ubyte)[] images_wired_qoi.QoiDecoder.take(ref const(ubyte)[] piece, ulong need) return

Returns need bytes, from the piece directly when they are all there, else accumulated in scratch across calls; null while incomplete.

take
(
(parameter) const(ubyte)[] piece
piece
, 14);
if (
(local variable) const(ubyte)[] bytes
bytes
is null)
return
images_wired_qoi.Status images_wired_qoi.QoiDecoder.suspend(bool closed, string what)
suspend
(
(parameter) bool closed
closed
, "header");
auto
(local variable) sparkles.base.expected.Expected!(QoiHeader, BinError, Abort) h
h
=
sparkles.base.expected.Expected!(QoiHeader, BinError, Abort) images_wired_qoi.decodeFixed!(images_wired_qoi.QoiHeader)(in ubyte[] bytes, ulong at) pure nothrow @safe

Decodes a fixed record at at: one bounds check, the schema walk with field checks, then the type-level @WireChecks.

decodeFixed
!
(struct) images_wired_qoi.QoiHeader

"magic bytes "qoif"", then big-endian width and height, then two informative bytes.

QoiHeader
(
(local variable) const(ubyte)[] bytes
bytes
, 0);
if (
(local variable) sparkles.base.expected.Expected!(QoiHeader, BinError, Abort) h
h
.
bool sparkles.base.expected.Expected!(images_wired_qoi.QoiHeader, images_wired_qoi.BinError, sparkles.base.expected.Abort).hasError!()() const pure nothrow @nogc @property @safe

Checks if Expected has error

hasError
)
{
(field) images_wired_qoi.BinError images_wired_qoi.QoiDecoder.error
error
=
(local variable) sparkles.base.expected.Expected!(QoiHeader, BinError, Abort) h
h
.
inout(images_wired_qoi.BinError) sparkles.base.expected.Expected!(images_wired_qoi.QoiHeader, images_wired_qoi.BinError, sparkles.base.expected.Abort).error() inout pure nothrow @nogc @property ref @safe

Returns the error value. May only be called when hasValue returns false.

If there is no error value, it calls hook's onAccessEmptyError.

It returns E.init when hook doesn't provide onAccessEmptyError.

Note

Error is returned by reference only when hook provides onAccessEmptyError. Otherwise the E.init fallback forces it to be returned by value (a copy).

error
;
(field) images_wired_qoi.QoiDecoder.Phase images_wired_qoi.QoiDecoder.phase
phase
=
(enum) images_wired_qoi.QoiDecoder.Phase
Phase
.
(enum value) images_wired_qoi.QoiDecoder.Phase.done = 3
done
;
return
(enum) images_wired_qoi.Status
Status
.
(enum value) images_wired_qoi.Status.error = 2
error
;
}
(field) images_wired_qoi.QoiHeader images_wired_qoi.QoiDecoder.header
header
=
(local variable) sparkles.base.expected.Expected!(QoiHeader, BinError, Abort) h
h
.
inout(images_wired_qoi.QoiHeader) sparkles.base.expected.Expected!(images_wired_qoi.QoiHeader, images_wired_qoi.BinError, sparkles.base.expected.Abort).value!()() inout pure nothrow @nogc @property ref @safe

Returns the expected value if there is one.

With default Abort hook, it asserts when there is no value. It calls hook's onAccessEmptyValue otherwise.

It returns T.init when hook doesn't provide onAccessEmptyValue.

Note

Value is returned by reference only when hook provides onAccessEmptyValue. Otherwise the T.init fallback forces it to be returned by value (a copy).

value
;
const ulong
(local variable) const(ulong) count
count
= cast(ulong)
(field) images_wired_qoi.QoiHeader images_wired_qoi.QoiDecoder.header
header
.
(field) uint images_wired_qoi.QoiHeader.width
width
*
(field) images_wired_qoi.QoiHeader images_wired_qoi.QoiDecoder.header
header
.
(field) uint images_wired_qoi.QoiHeader.height
height
;
if (
(local variable) const(ulong) count
count
== 0)
return
images_wired_qoi.Status images_wired_qoi.QoiDecoder.fail(images_wired_qoi.BinErrorKind kind, string what)
fail
(
(enum) images_wired_qoi.BinErrorKind
BinErrorKind
.
(enum value) images_wired_qoi.BinErrorKind.checkFailed = 3
checkFailed
, "width or height is 0");
if (
(local variable) const(ulong) count
count
>
(field) ulong images_wired_qoi.QoiDecoder.maxPixels

the caller's budget, checked against the header

maxPixels
)
return
images_wired_qoi.Status images_wired_qoi.QoiDecoder.fail(images_wired_qoi.BinErrorKind kind, string what)
fail
(
(enum) images_wired_qoi.BinErrorKind
BinErrorKind
.
(enum value) images_wired_qoi.BinErrorKind.limitExceeded = 4
limitExceeded
, "pixel count above the caller's budget");
(field) images_wired_qoi.Rgba[] images_wired_qoi.QoiDecoder.pixels
pixels
= new
(struct) images_wired_qoi.Rgba
Rgba
[cast(
(alias) object.size_t = ulong
size_t
)
(local variable) const(ulong) count
count
];
(field) images_wired_qoi.QoiDecoder.Phase images_wired_qoi.QoiDecoder.phase
phase
=
(enum) images_wired_qoi.QoiDecoder.Phase
Phase
.
(enum value) images_wired_qoi.QoiDecoder.Phase.ops = 1
ops
;
break; case
(enum) images_wired_qoi.QoiDecoder.Phase
Phase
.
(enum value) images_wired_qoi.QoiDecoder.Phase.ops = 1
ops
:
if (
(field) ulong images_wired_qoi.QoiDecoder.written
written
==
(field) images_wired_qoi.Rgba[] images_wired_qoi.QoiDecoder.pixels
pixels
.
(field) ulong images_wired_qoi.Rgba[].length
length
)
{
(field) images_wired_qoi.QoiDecoder.Phase images_wired_qoi.QoiDecoder.phase
phase
=
(enum) images_wired_qoi.QoiDecoder.Phase
Phase
.
(enum value) images_wired_qoi.QoiDecoder.Phase.end = 2
end
;
break; } if (
(parameter) const(ubyte)[] piece
piece
.
(field) ulong const(ubyte)[].length
length
== 0 &&
(field) ulong images_wired_qoi.QoiDecoder.scratchLength
scratchLength
== 0)
return
images_wired_qoi.Status images_wired_qoi.QoiDecoder.suspend(bool closed, string what)
suspend
(
(parameter) bool closed
closed
, "op");
// "The 8-bit tags have precedence over the 2-bit tags." const
(local variable) const(int) tag
tag
=
(field) ulong images_wired_qoi.QoiDecoder.scratchLength
scratchLength
?
(field) ubyte[14] images_wired_qoi.QoiDecoder.scratch
scratch
[0] :
(parameter) const(ubyte)[] piece
piece
[0];
const
(alias) object.size_t = ulong
size_t
(local variable) const(ulong) need
need
=
(local variable) const(int) tag
tag
==
(constant) ubyte images_wired_qoi.opRgba = cast(ubyte)255u
opRgba
? 5 :
(local variable) const(int) tag
tag
==
(constant) ubyte images_wired_qoi.opRgb = cast(ubyte)254u
opRgb
? 4
: (
(local variable) const(int) tag
tag
& 0xC0) ==
(constant) ubyte images_wired_qoi.opLuma = cast(ubyte)128u
opLuma
? 2 : 1;
auto
(local variable) const(ubyte)[] op
op
=
const(ubyte)[] images_wired_qoi.QoiDecoder.take(ref const(ubyte)[] piece, ulong need) return

Returns need bytes, from the piece directly when they are all there, else accumulated in scratch across calls; null while incomplete.

take
(
(parameter) const(ubyte)[] piece
piece
,
(local variable) const(ulong) need
need
);
if (
(local variable) const(ubyte)[] op
op
is null)
return
images_wired_qoi.Status images_wired_qoi.QoiDecoder.suspend(bool closed, string what)
suspend
(
(parameter) bool closed
closed
, "op");
if (!
bool images_wired_qoi.QoiDecoder.decodeOp(in ubyte[] op)
decodeOp
(
(local variable) const(ubyte)[] op
op
))
return
(enum) images_wired_qoi.Status
Status
.
(enum value) images_wired_qoi.Status.error = 2
error
;
break; case
(enum) images_wired_qoi.QoiDecoder.Phase
Phase
.
(enum value) images_wired_qoi.QoiDecoder.Phase.end = 2
end
:
auto
(local variable) const(ubyte)[] bytes
bytes
=
const(ubyte)[] images_wired_qoi.QoiDecoder.take(ref const(ubyte)[] piece, ulong need) return

Returns need bytes, from the piece directly when they are all there, else accumulated in scratch across calls; null while incomplete.

take
(
(parameter) const(ubyte)[] piece
piece
, 8);
if (
(local variable) const(ubyte)[] bytes
bytes
is null)
return
images_wired_qoi.Status images_wired_qoi.QoiDecoder.suspend(bool closed, string what)
suspend
(
(parameter) bool closed
closed
, "end marker");
if (
(local variable) const(ubyte)[] bytes
bytes
!=
(immutable global) immutable(ubyte[8]) images_wired_qoi.endMarker
endMarker
[])
return
images_wired_qoi.Status images_wired_qoi.QoiDecoder.fail(images_wired_qoi.BinErrorKind kind, string what)
fail
(
(enum) images_wired_qoi.BinErrorKind
BinErrorKind
.
(enum value) images_wired_qoi.BinErrorKind.badEndMarker = 6
badEndMarker
, "end marker");
(field) images_wired_qoi.QoiDecoder.Phase images_wired_qoi.QoiDecoder.phase
phase
=
(enum) images_wired_qoi.QoiDecoder.Phase
Phase
.
(enum value) images_wired_qoi.QoiDecoder.Phase.done = 3
done
;
break; case
(enum) images_wired_qoi.QoiDecoder.Phase
Phase
.
(enum value) images_wired_qoi.QoiDecoder.Phase.done = 3
done
:
if (
(parameter) const(ubyte)[] piece
piece
.
(field) ulong const(ubyte)[].length
length
)
return
images_wired_qoi.Status images_wired_qoi.QoiDecoder.fail(images_wired_qoi.BinErrorKind kind, string what)
fail
(
(enum) images_wired_qoi.BinErrorKind
BinErrorKind
.
(enum value) images_wired_qoi.BinErrorKind.trailingBytes = 7
trailingBytes
, "bytes after the end marker");
return
(enum) images_wired_qoi.Status
Status
.
(enum value) images_wired_qoi.Status.ok = 0
ok
;
} } } private
(enum) images_wired_qoi.Status
Status
images_wired_qoi.Status images_wired_qoi.QoiDecoder.suspend(bool closed, string what)
suspend
(bool
(parameter) bool closed
closed
,
(alias) object.string = string
string
(parameter) string what
what
)
{ if (
(parameter) bool closed
closed
)
return
images_wired_qoi.Status images_wired_qoi.QoiDecoder.fail(images_wired_qoi.BinErrorKind kind, string what)
fail
(
(enum) images_wired_qoi.BinErrorKind
BinErrorKind
.
(enum value) images_wired_qoi.BinErrorKind.truncated = 1
truncated
,
(parameter) string what
what
);
(field) ulong images_wired_qoi.QoiDecoder.suspensions

times feed returned needMore

suspensions
++;
return
(enum) images_wired_qoi.Status
Status
.
(enum value) images_wired_qoi.Status.needMore = 1
needMore
;
} private bool
bool images_wired_qoi.QoiDecoder.decodeOp(in ubyte[] op)
decodeOp
(in ubyte[]
(parameter) const(ubyte[]) op
op
)
{
(struct) images_wired_qoi.Rgba
Rgba
(local variable) images_wired_qoi.Rgba p
p
=
(field) images_wired_qoi.Rgba images_wired_qoi.QoiDecoder.previous
previous
;
const
(local variable) const(ubyte) b
b
=
(parameter) const(ubyte[]) op
op
[0];
if (
(local variable) const(ubyte) b
b
==
(constant) ubyte images_wired_qoi.opRgb = cast(ubyte)254u
opRgb
)
{
(local variable) images_wired_qoi.Rgba p
p
.
(field) ubyte images_wired_qoi.Rgba.r
r
=
(parameter) const(ubyte[]) op
op
[1];
(local variable) images_wired_qoi.Rgba p
p
.
(field) ubyte images_wired_qoi.Rgba.g
g
=
(parameter) const(ubyte[]) op
op
[2];
(local variable) images_wired_qoi.Rgba p
p
.
(field) ubyte images_wired_qoi.Rgba.b
b
=
(parameter) const(ubyte[]) op
op
[3];
(field) ulong[6] images_wired_qoi.QoiDecoder.opCounts
opCounts
[
(enum) images_wired_qoi.Op
Op
.
(enum value) images_wired_qoi.Op.rgb = 0
rgb
]++;
} else if (
(local variable) const(ubyte) b
b
==
(constant) ubyte images_wired_qoi.opRgba = cast(ubyte)255u
opRgba
)
{
(local variable) images_wired_qoi.Rgba p
p
=
(struct) images_wired_qoi.Rgba
Rgba
(
(parameter) const(ubyte[]) op
op
[1],
(parameter) const(ubyte[]) op
op
[2],
(parameter) const(ubyte[]) op
op
[3],
(parameter) const(ubyte[]) op
op
[4]);
(field) ulong[6] images_wired_qoi.QoiDecoder.opCounts
opCounts
[
(enum) images_wired_qoi.Op
Op
.
(enum value) images_wired_qoi.Op.rgba = 1
rgba
]++;
} else if ((
(local variable) const(ubyte) b
b
& 0xC0) ==
(constant) ubyte images_wired_qoi.opIndex = cast(ubyte)0u
opIndex
)
{
(local variable) images_wired_qoi.Rgba p
p
=
(field) images_wired_qoi.Rgba[64] images_wired_qoi.QoiDecoder.index
index
[
(local variable) const(ubyte) b
b
& 0x3F];
(field) ulong[6] images_wired_qoi.QoiDecoder.opCounts
opCounts
[
(enum) images_wired_qoi.Op
Op
.
(enum value) images_wired_qoi.Op.index = 2
index
]++;
} else if ((
(local variable) const(ubyte) b
b
& 0xC0) ==
(constant) ubyte images_wired_qoi.opDiff = cast(ubyte)64u
opDiff
)
{ // Three 2-bit fields with a bias of 2, wrapping arithmetic.
(local variable) images_wired_qoi.Rgba p
p
.
(field) ubyte images_wired_qoi.Rgba.r
r
= cast(ubyte)(
(local variable) images_wired_qoi.Rgba p
p
.
(field) ubyte images_wired_qoi.Rgba.r
r
+ ((
(local variable) const(ubyte) b
b
>> 4) & 3) - 2);
(local variable) images_wired_qoi.Rgba p
p
.
(field) ubyte images_wired_qoi.Rgba.g
g
= cast(ubyte)(
(local variable) images_wired_qoi.Rgba p
p
.
(field) ubyte images_wired_qoi.Rgba.g
g
+ ((
(local variable) const(ubyte) b
b
>> 2) & 3) - 2);
(local variable) images_wired_qoi.Rgba p
p
.
(field) ubyte images_wired_qoi.Rgba.b
b
= cast(ubyte)(
(local variable) images_wired_qoi.Rgba p
p
.
(field) ubyte images_wired_qoi.Rgba.b
b
+ (
(local variable) const(ubyte) b
b
& 3) - 2);
(field) ulong[6] images_wired_qoi.QoiDecoder.opCounts
opCounts
[
(enum) images_wired_qoi.Op
Op
.
(enum value) images_wired_qoi.Op.diff = 3
diff
]++;
} else if ((
(local variable) const(ubyte) b
b
& 0xC0) ==
(constant) ubyte images_wired_qoi.opLuma = cast(ubyte)128u
opLuma
)
{ // A 6-bit field (bias 32), then two 4-bit fields (bias 8) relative to it. const
(local variable) const(int) dg
dg
= (
(local variable) const(ubyte) b
b
& 0x3F) - 32;
(local variable) images_wired_qoi.Rgba p
p
.
(field) ubyte images_wired_qoi.Rgba.r
r
= cast(ubyte)(
(local variable) images_wired_qoi.Rgba p
p
.
(field) ubyte images_wired_qoi.Rgba.r
r
+
(local variable) const(int) dg
dg
- 8 + (
(parameter) const(ubyte[]) op
op
[1] >> 4));
(local variable) images_wired_qoi.Rgba p
p
.
(field) ubyte images_wired_qoi.Rgba.g
g
= cast(ubyte)(
(local variable) images_wired_qoi.Rgba p
p
.
(field) ubyte images_wired_qoi.Rgba.g
g
+
(local variable) const(int) dg
dg
);
(local variable) images_wired_qoi.Rgba p
p
.
(field) ubyte images_wired_qoi.Rgba.b
b
= cast(ubyte)(
(local variable) images_wired_qoi.Rgba p
p
.
(field) ubyte images_wired_qoi.Rgba.b
b
+
(local variable) const(int) dg
dg
- 8 + (
(parameter) const(ubyte[]) op
op
[1] & 0x0F));
(field) ulong[6] images_wired_qoi.QoiDecoder.opCounts
opCounts
[
(enum) images_wired_qoi.Op
Op
.
(enum value) images_wired_qoi.Op.luma = 4
luma
]++;
} else { const
(local variable) const(int) run
run
= (
(local variable) const(ubyte) b
b
& 0x3F) + 1; // 1..62; 63 and 64 are the 8-bit tags
(field) ulong[6] images_wired_qoi.QoiDecoder.opCounts
opCounts
[
(enum) images_wired_qoi.Op
Op
.
(enum value) images_wired_qoi.Op.run = 5
run
]++;
if (
(local variable) const(int) run
run
>
(field) images_wired_qoi.Rgba[] images_wired_qoi.QoiDecoder.pixels
pixels
.
(field) ulong images_wired_qoi.Rgba[].length
length
-
(field) ulong images_wired_qoi.QoiDecoder.written
written
)
{
images_wired_qoi.Status images_wired_qoi.QoiDecoder.fail(images_wired_qoi.BinErrorKind kind, string what)
fail
(
(enum) images_wired_qoi.BinErrorKind
BinErrorKind
.
(enum value) images_wired_qoi.BinErrorKind.badStream = 5
badStream
, "run past the last pixel");
return false; }
void images_wired_qoi.QoiDecoder.emit(images_wired_qoi.Rgba p, ulong count = 1LU)
emit
(
(local variable) images_wired_qoi.Rgba p
p
,
(local variable) const(int) run
run
);
return true; // a run repeats the previous pixel, already indexed }
(field) images_wired_qoi.Rgba[64] images_wired_qoi.QoiDecoder.index
index
[
ulong images_wired_qoi.hashOf(images_wired_qoi.Rgba p) pure nothrow @nogc @safe

"index_position = (r * 3 + g * 5 + b * 7 + a * 11) % 64"

hashOf
(
(local variable) images_wired_qoi.Rgba p
p
)] =
(local variable) images_wired_qoi.Rgba p
p
;
void images_wired_qoi.QoiDecoder.emit(images_wired_qoi.Rgba p, ulong count = 1LU)
emit
(
(local variable) images_wired_qoi.Rgba p
p
);
return true; } } /// GAP: the encoder, following the reference `qoi.h` op choice. ubyte[]
ubyte[] images_wired_qoi.encodeQoi(in images_wired_qoi.QoiHeader header, in images_wired_qoi.Rgba[] image)

GAP

the encoder, following the reference qoi.h op choice.

encodeQoi
(in
(struct) images_wired_qoi.QoiHeader

"magic bytes "qoif"", then big-endian width and height, then two informative bytes.

QoiHeader
(parameter) const(images_wired_qoi.QoiHeader) header
header
, in
(struct) images_wired_qoi.Rgba
Rgba
[]
(parameter) const(images_wired_qoi.Rgba[]) image
image
)
{ ubyte[]
(local variable) ubyte[] output
output
;
const
(local variable) const(string) refused
refused
=
string images_wired_qoi.encodeFixed!(images_wired_qoi.QoiHeader)(in images_wired_qoi.QoiHeader value, ref ubyte[] output) pure nothrow @safe

Encodes a fixed record after its checks pass, as expressiveness §6.4 requires of encode. Returns the first failure's reason, or null.

encodeFixed
(
(parameter) const(images_wired_qoi.QoiHeader) header
header
,
(local variable) ubyte[] output
output
);
assert(
(local variable) const(string) refused
refused
is null,
(local variable) const(string) refused
refused
);
(struct) images_wired_qoi.Rgba
Rgba
[64]
(local variable) images_wired_qoi.Rgba[64] index
index
;
(struct) images_wired_qoi.Rgba
Rgba
(local variable) images_wired_qoi.Rgba previous
previous
=
(struct) images_wired_qoi.Rgba
Rgba
(0, 0, 0, 255);
(alias) object.size_t = ulong
size_t
(local variable) ulong run
run
;
foreach (
(parameter) ulong i
i
,
(parameter) const(images_wired_qoi.Rgba) p
p
;
(parameter) const(images_wired_qoi.Rgba[]) image
image
)
{ if (
(local variable) const(images_wired_qoi.Rgba) p
p
==
(local variable) images_wired_qoi.Rgba previous
previous
)
{ if (++
(local variable) ulong run
run
== 62 ||
(local variable) ulong i
i
+ 1 ==
(parameter) const(images_wired_qoi.Rgba[]) image
image
.
(field) ulong const(images_wired_qoi.Rgba[]).length
length
)
{
(local variable) ubyte[] output
output
~= cast(ubyte)(
(constant) ubyte images_wired_qoi.opRun = cast(ubyte)192u
opRun
| (
(local variable) ulong run
run
- 1));
(local variable) ulong run
run
= 0;
} continue; } if (
(local variable) ulong run
run
)
{
(local variable) ubyte[] output
output
~= cast(ubyte)(
(constant) ubyte images_wired_qoi.opRun = cast(ubyte)192u
opRun
| (
(local variable) ulong run
run
- 1));
(local variable) ulong run
run
= 0;
} const
(local variable) const(ulong) h
h
=
ulong images_wired_qoi.hashOf(images_wired_qoi.Rgba p) pure nothrow @nogc @safe

"index_position = (r * 3 + g * 5 + b * 7 + a * 11) % 64"

hashOf
(
(local variable) const(images_wired_qoi.Rgba) p
p
);
if (
(local variable) images_wired_qoi.Rgba[64] index
index
[
(local variable) const(ulong) h
h
] ==
(local variable) const(images_wired_qoi.Rgba) p
p
)
(local variable) ubyte[] output
output
~= cast(ubyte)(
(constant) ubyte images_wired_qoi.opIndex = cast(ubyte)0u
opIndex
|
(local variable) const(ulong) h
h
);
else {
(local variable) images_wired_qoi.Rgba[64] index
index
[
(local variable) const(ulong) h
h
] =
(local variable) const(images_wired_qoi.Rgba) p
p
;
const byte
(local variable) const(byte) dr
dr
= cast(byte)(
(local variable) const(images_wired_qoi.Rgba) p
p
.
(field) ubyte images_wired_qoi.Rgba.r
r
-
(local variable) images_wired_qoi.Rgba previous
previous
.
(field) ubyte images_wired_qoi.Rgba.r
r
),
(local variable) const(byte) dg
dg
= cast(byte)(
(local variable) const(images_wired_qoi.Rgba) p
p
.
(field) ubyte images_wired_qoi.Rgba.g
g
-
(local variable) images_wired_qoi.Rgba previous
previous
.
(field) ubyte images_wired_qoi.Rgba.g
g
),
(local variable) const(byte) db
db
= cast(byte)(
(local variable) const(images_wired_qoi.Rgba) p
p
.
(field) ubyte images_wired_qoi.Rgba.b
b
-
(local variable) images_wired_qoi.Rgba previous
previous
.
(field) ubyte images_wired_qoi.Rgba.b
b
);
const int
(local variable) const(int) drg
drg
=
(local variable) const(byte) dr
dr
-
(local variable) const(byte) dg
dg
,
(local variable) const(int) dbg
dbg
=
(local variable) const(byte) db
db
-
(local variable) const(byte) dg
dg
;
if (
(local variable) const(images_wired_qoi.Rgba) p
p
.
(field) ubyte images_wired_qoi.Rgba.a
a
!=
(local variable) images_wired_qoi.Rgba previous
previous
.
(field) ubyte images_wired_qoi.Rgba.a
a
)
(local variable) ubyte[] output
output
~= [
(constant) ubyte images_wired_qoi.opRgba = cast(ubyte)255u
opRgba
,
(local variable) const(images_wired_qoi.Rgba) p
p
.
(field) ubyte images_wired_qoi.Rgba.r
r
,
(local variable) const(images_wired_qoi.Rgba) p
p
.
(field) ubyte images_wired_qoi.Rgba.g
g
,
(local variable) const(images_wired_qoi.Rgba) p
p
.
(field) ubyte images_wired_qoi.Rgba.b
b
,
(local variable) const(images_wired_qoi.Rgba) p
p
.
(field) ubyte images_wired_qoi.Rgba.a
a
];
else if (
(local variable) const(byte) dr
dr
>= -2 &&
(local variable) const(byte) dr
dr
<= 1 &&
(local variable) const(byte) dg
dg
>= -2 &&
(local variable) const(byte) dg
dg
<= 1 &&
(local variable) const(byte) db
db
>= -2 &&
(local variable) const(byte) db
db
<= 1)
(local variable) ubyte[] output
output
~= cast(ubyte)(
(constant) ubyte images_wired_qoi.opDiff = cast(ubyte)64u
opDiff
| (
(local variable) const(byte) dr
dr
+ 2) << 4 | (
(local variable) const(byte) dg
dg
+ 2) << 2 | (
(local variable) const(byte) db
db
+ 2));
else if (
(local variable) const(byte) dg
dg
>= -32 &&
(local variable) const(byte) dg
dg
<= 31 &&
(local variable) const(int) drg
drg
>= -8 &&
(local variable) const(int) drg
drg
<= 7 &&
(local variable) const(int) dbg
dbg
>= -8 &&
(local variable) const(int) dbg
dbg
<= 7)
(local variable) ubyte[] output
output
~= [cast(ubyte)(
(constant) ubyte images_wired_qoi.opLuma = cast(ubyte)128u
opLuma
| (
(local variable) const(byte) dg
dg
+ 32)), cast(ubyte)((
(local variable) const(int) drg
drg
+ 8) << 4 | (
(local variable) const(int) dbg
dbg
+ 8))];
else
(local variable) ubyte[] output
output
~= [
(constant) ubyte images_wired_qoi.opRgb = cast(ubyte)254u
opRgb
,
(local variable) const(images_wired_qoi.Rgba) p
p
.
(field) ubyte images_wired_qoi.Rgba.r
r
,
(local variable) const(images_wired_qoi.Rgba) p
p
.
(field) ubyte images_wired_qoi.Rgba.g
g
,
(local variable) const(images_wired_qoi.Rgba) p
p
.
(field) ubyte images_wired_qoi.Rgba.b
b
];
}
(local variable) images_wired_qoi.Rgba previous
previous
=
(local variable) const(images_wired_qoi.Rgba) p
p
;
} return
(local variable) ubyte[] output
output
~
(immutable global) immutable(ubyte[8]) images_wired_qoi.endMarker
endMarker
[];
} /// An 8 by 4 RGBA test image that exercises every op.
(struct) images_wired_qoi.Rgba
Rgba
[]
images_wired_qoi.Rgba[] images_wired_qoi.testImage()

An 8 by 4 RGBA test image that exercises every op.

testImage
()
{
(struct) images_wired_qoi.Rgba
Rgba
[]
(local variable) images_wired_qoi.Rgba[] image
image
;
foreach (
(local variable) int y
y
; 0 .. 4)
{ const ubyte
(local variable) const(ubyte) v
v
= cast(ubyte)
(local variable) int y
y
;
(local variable) images_wired_qoi.Rgba[] image
image
~= [
(struct) images_wired_qoi.Rgba
Rgba
(1, 1, 1, 255), // DIFF from black
(struct) images_wired_qoi.Rgba
Rgba
(2, 2, 1, 255), // DIFF
(struct) images_wired_qoi.Rgba
Rgba
(20, 22, 18, 255), // LUMA
(struct) images_wired_qoi.Rgba
Rgba
(200, 30, cast(ubyte)(90 +
(local variable) const(ubyte) v
v
), 255), // RGB
(struct) images_wired_qoi.Rgba
Rgba
(1, 1, 1, 255), // INDEX (seen at x = 0)
(local variable) int y
y
== 2 ?
(struct) images_wired_qoi.Rgba
Rgba
(5, 5, 5, 128) :
(struct) images_wired_qoi.Rgba
Rgba
(5, 5, 5, 255), // RGBA on row 2
(struct) images_wired_qoi.Rgba
Rgba
(0, 0, 0, 255), // RUN of two
(struct) images_wired_qoi.Rgba
Rgba
(0, 0, 0, 255),
]; } return
(local variable) images_wired_qoi.Rgba[] image
image
;
} /// Feeds `bytes` in pieces of `step` (0 means all at once), then closes.
(struct) images_wired_qoi.QoiDecoder

GAP

a resumable decoder. Its whole state is this struct; feed may be called with any split of the input.

QoiDecoder
images_wired_qoi.QoiDecoder images_wired_qoi.decodeInPieces(in ubyte[] bytes, ulong step, ulong maxPixels = 1048576LU)

Feeds bytes in pieces of step (0 means all at once), then closes.

decodeInPieces
(in ubyte[]
(parameter) const(ubyte[]) bytes
bytes
,
(alias) object.size_t = ulong
size_t
(parameter) ulong step
step
, ulong
(parameter) ulong maxPixels
maxPixels
= 1 << 20)
{
(struct) images_wired_qoi.QoiDecoder

GAP

a resumable decoder. Its whole state is this struct; feed may be called with any split of the input.

QoiDecoder
(local variable) images_wired_qoi.QoiDecoder d
d
;
(local variable) images_wired_qoi.QoiDecoder d
d
.
(field) ulong images_wired_qoi.QoiDecoder.maxPixels

the caller's budget, checked against the header

maxPixels
=
(parameter) ulong maxPixels
maxPixels
;
const(ubyte)[]
(local variable) const(ubyte)[] rest
rest
=
(parameter) const(ubyte[]) bytes
bytes
;
(enum) images_wired_qoi.Status
Status
(local variable) images_wired_qoi.Status status
status
=
(enum) images_wired_qoi.Status
Status
.
(enum value) images_wired_qoi.Status.needMore = 1
needMore
;
while (
(local variable) images_wired_qoi.Status status
status
==
(enum) images_wired_qoi.Status
Status
.
(enum value) images_wired_qoi.Status.needMore = 1
needMore
&&
(local variable) const(ubyte)[] rest
rest
.
(field) ulong const(ubyte)[].length
length
)
{ const
(local variable) const(ulong) n
n
=
(parameter) ulong step
step
?
ulong std.algorithm.comparison.min!(ulong, ulong)(ulong a, ulong b) pure nothrow @nogc @safe

Iterates the passed arguments and returns the minimum value.

Examples

int a = 5;
short b = 6;
double c = 2;
auto d = min(a, b);
static assert(is(typeof(d) == int));
assert(d == 5);
auto e = min(a, b, c);
static assert(is(typeof(e) == double));
assert(e == 2);
ulong f = 0xffff_ffff_ffff;
const uint g = min(f, 0xffff_0000);
assert(g == 0xffff_0000);
dchar h = 100;
uint i = 101;
static assert(is(typeof(min(h, i)) == dchar));
static assert(is(typeof(min(i, h)) == uint));
assert(min(h, i) == 100);

With arguments of mixed signedness, the return type is the one that can store the lowest values.

int a = -10;
uint f = 10;
static assert(is(typeof(min(a, f)) == int));
assert(min(a, f) == -10);

User-defined types that support comparison with < are supported.

import std.datetime;
assert(min(Date(2012, 12, 21), Date(1982, 1, 4)) == Date(1982, 1, 4));
assert(min(Date(1982, 1, 4), Date(2012, 12, 21)) == Date(1982, 1, 4));
assert(min(Date(1982, 1, 4), Date.min) == Date.min);
assert(min(Date.min, Date(1982, 1, 4)) == Date.min);
assert(min(Date(1982, 1, 4), Date.max) == Date(1982, 1, 4));
assert(min(Date.max, Date(1982, 1, 4)) == Date(1982, 1, 4));
assert(min(Date.min, Date.max) == Date.min);
assert(min(Date.max, Date.min) == Date.min);
@paramargs The values to select the minimum from. At least two arguments must be passed, and they must be comparable with <.@returnsThe minimum of the passed-in values. The type of the returned value is the type among the passed arguments that is able to store the smallest value. If at least one of the arguments is NaN, the result is an unspecified value. See minElement for examples on how to cope with NaNs.@seeminElement
min
(
(parameter) ulong step
step
,
(local variable) const(ubyte)[] rest
rest
.
(field) ulong const(ubyte)[].length
length
) :
(local variable) const(ubyte)[] rest
rest
.
(field) ulong const(ubyte)[].length
length
;
(local variable) images_wired_qoi.Status status
status
=
(local variable) images_wired_qoi.QoiDecoder d
d
.
images_wired_qoi.Status images_wired_qoi.QoiDecoder.feed(const(ubyte)[] piece, bool closed)

Consumes piece; closed says no more input will follow.

feed
(
(local variable) const(ubyte)[] rest
rest
[0 ..
(local variable) const(ulong) n
n
], false);
(local variable) const(ubyte)[] rest
rest
=
(local variable) const(ubyte)[] rest
rest
[
(local variable) const(ulong) n
n
.. $];
} if (
(local variable) images_wired_qoi.Status status
status
==
(enum) images_wired_qoi.Status
Status
.
(enum value) images_wired_qoi.Status.needMore = 1
needMore
)
(local variable) images_wired_qoi.QoiDecoder d
d
.
images_wired_qoi.Status images_wired_qoi.QoiDecoder.feed(const(ubyte)[] piece, bool closed)

Consumes piece; closed says no more input will follow.

feed
(null, true);
return
(local variable) images_wired_qoi.QoiDecoder d
d
;
} ulong
ulong images_wired_qoi.fnv1a(in images_wired_qoi.Rgba[] pixels) pure nothrow @nogc @safe
fnv1a
(in
(struct) images_wired_qoi.Rgba
Rgba
[]
(parameter) const(images_wired_qoi.Rgba[]) pixels
pixels
) @safe pure nothrow @nogc
{ ulong
(local variable) ulong h
h
= 0xcbf2_9ce4_8422_2325;
foreach (
(parameter) const(images_wired_qoi.Rgba) p
p
;
(parameter) const(images_wired_qoi.Rgba[]) pixels
pixels
)
foreach (
(parameter) const(ubyte) octet
octet
; [
(local variable) const(images_wired_qoi.Rgba) p
p
.
(field) ubyte images_wired_qoi.Rgba.r
r
,
(local variable) const(images_wired_qoi.Rgba) p
p
.
(field) ubyte images_wired_qoi.Rgba.g
g
,
(local variable) const(images_wired_qoi.Rgba) p
p
.
(field) ubyte images_wired_qoi.Rgba.b
b
,
(local variable) const(images_wired_qoi.Rgba) p
p
.
(field) ubyte images_wired_qoi.Rgba.a
a
])
(local variable) ulong h
h
= (
(local variable) ulong h
h
^
(local variable) const(ubyte) octet
octet
) * 0x100_0000_01b3;
return
(local variable) ulong h
h
;
} void
void images_wired_qoi.report(string label, in ubyte[] bytes, ulong step = 0LU, ulong maxPixels = 1048576LU)
report
(
(alias) object.string = string
string
(parameter) string label
label
, in ubyte[]
(parameter) const(ubyte[]) bytes
bytes
,
(alias) object.size_t = ulong
size_t
(parameter) ulong step
step
= 0, ulong
(parameter) ulong maxPixels
maxPixels
= 1 << 20)
{ auto
(local variable) images_wired_qoi.QoiDecoder d
d
=
images_wired_qoi.QoiDecoder images_wired_qoi.decodeInPieces(in ubyte[] bytes, ulong step, ulong maxPixels = 1048576LU)

Feeds bytes in pieces of step (0 means all at once), then closes.

decodeInPieces
(
(parameter) const(ubyte[]) bytes
bytes
,
(parameter) ulong step
step
,
(parameter) ulong maxPixels
maxPixels
);
if (
(local variable) images_wired_qoi.QoiDecoder d
d
.
(field) images_wired_qoi.BinError images_wired_qoi.QoiDecoder.error
error
.
(field) images_wired_qoi.BinErrorKind images_wired_qoi.BinError.kind
kind
!=
(enum) images_wired_qoi.BinErrorKind
BinErrorKind
.
(enum value) images_wired_qoi.BinErrorKind.none = cast(ubyte)0u
none
)
void std.stdio.writefln!(char, string, images_wired_qoi.BinErrorKind, ulong, string)(in char[] fmt, string __param_1, images_wired_qoi.BinErrorKind __param_2, ulong __param_3, string __param_4) @safe

Equivalent to writef(fmt, args, '\n').

writefln
("qoi: %s: %s at offset %s (%s)",
(parameter) string label
label
,
(local variable) images_wired_qoi.QoiDecoder d
d
.
(field) images_wired_qoi.BinError images_wired_qoi.QoiDecoder.error
error
.
(field) images_wired_qoi.BinErrorKind images_wired_qoi.BinError.kind
kind
,
(local variable) images_wired_qoi.QoiDecoder d
d
.
(field) images_wired_qoi.BinError images_wired_qoi.QoiDecoder.error
error
.
(field) ulong images_wired_qoi.BinError.offset
offset
,
(local variable) images_wired_qoi.QoiDecoder d
d
.
(field) images_wired_qoi.BinError images_wired_qoi.QoiDecoder.error
error
.
(field) string images_wired_qoi.BinError.what
what
);
else
void std.stdio.writefln!(char, string)(in char[] fmt, string __param_1) @safe

Equivalent to writef(fmt, args, '\n').

writefln
("qoi: %s: ok",
(parameter) string label
label
);
} void
void D main()
main
()
{ enum
(constant) sparkles.wired.schema.WireSchema images_wired_qoi.main.schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"])
schema
=
(template instance) sparkles.wired.schema.wireSchemaOf!(images_wired_qoi.BeFixed, images_wired_qoi.QoiHeader)
wireSchemaOf
!(
(struct) images_wired_qoi.BeFixed

Format marker. Its schema hook admits only fixed-size shapes; the byte order is a property of the marker, since SchemaNode has no such field.

BeFixed
,
(struct) images_wired_qoi.QoiHeader

"magic bytes "qoif"", then big-endian width and height, then two informative bytes.

QoiHeader
);
void std.stdio.writefln!(char, long, ulong)(in char[] fmt, long __param_1, ulong __param_2) @safe

Equivalent to writef(fmt, args, '\n').

writefln
("qoi: schema: header %s bytes, %s nodes",
long images_wired_qoi.fixedSize(const(sparkles.wired.schema.WireSchema) schema, ulong index) pure nothrow @safe

Byte size of the subtree at index, or -1 when the schema gives none. Takes the schema by value: as an in parameter, CTFE fails on DMD and crashes LDC.

fixedSize
(
(constant) sparkles.wired.schema.WireSchema images_wired_qoi.main.schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"])
schema
, 0),
(constant) sparkles.wired.schema.WireSchema images_wired_qoi.main.schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "QoiHeader", "", null, false, false, 0LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "magic", null, true, false, 5LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("magic", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("width", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "height", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("height", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "channels", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("channels", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colorspace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("colorspace", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 4LU, 5LU, 6LU, 2LU], [SchemaAnnotation("WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)", "WireCheck!((m) => m == \"qoif\", \"magic is not qoif\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)", "WireCheck!(isOneOf, \"channels must be 3 or 4\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)", "WireCheck!(isOneOf, \"colorspace must be 0 or 1\", AnyFormat)")], ["magic", "width", "height", "channels", "colorspace"])
schema
.
(field) sparkles.wired.schema.SchemaNode[] sparkles.wired.schema.WireSchema.nodes
nodes
.
(field) ulong sparkles.wired.schema.SchemaNode[].length
length
);
const
(local variable) const(images_wired_qoi.Rgba[]) image
image
=
images_wired_qoi.Rgba[] images_wired_qoi.testImage()

An 8 by 4 RGBA test image that exercises every op.

testImage
();
const
(local variable) const(images_wired_qoi.QoiHeader) header
header
=
(struct) images_wired_qoi.QoiHeader

"magic bytes "qoif"", then big-endian width and height, then two informative bytes.

QoiHeader
("qoif", 8, 4, 4, 0);
const
(local variable) const(ubyte[]) bytes
bytes
=
ubyte[] images_wired_qoi.encodeQoi(in images_wired_qoi.QoiHeader header, in images_wired_qoi.Rgba[] image)

GAP

the encoder, following the reference qoi.h op choice.

encodeQoi
(
(local variable) const(images_wired_qoi.QoiHeader) header
header
,
(local variable) const(images_wired_qoi.Rgba[]) image
image
);
void std.stdio.writefln!(char, ulong, ulong, ulong)(in char[] fmt, ulong __param_1, ulong __param_2, ulong __param_3) @safe

Equivalent to writef(fmt, args, '\n').

writefln
("qoi: encoded %s pixels into %s bytes (14 header + %s ops + 8 end)",
(local variable) const(images_wired_qoi.Rgba[]) image
image
.
(field) ulong const(images_wired_qoi.Rgba[]).length
length
,
(local variable) const(ubyte[]) bytes
bytes
.
(field) ulong const(ubyte[]).length
length
,
(local variable) const(ubyte[]) bytes
bytes
.
(field) ulong const(ubyte[]).length
length
- 22);
foreach (
(parameter) int step
step
; [0, 1, 3, 7])
{ auto
(local variable) images_wired_qoi.QoiDecoder d
d
=
images_wired_qoi.QoiDecoder images_wired_qoi.decodeInPieces(in ubyte[] bytes, ulong step, ulong maxPixels = 1048576LU)

Feeds bytes in pieces of step (0 means all at once), then closes.

decodeInPieces
(
(local variable) const(ubyte[]) bytes
bytes
,
(local variable) int step
step
);
assert(
(local variable) images_wired_qoi.QoiDecoder d
d
.
(field) images_wired_qoi.BinError images_wired_qoi.QoiDecoder.error
error
.
(field) images_wired_qoi.BinErrorKind images_wired_qoi.BinError.kind
kind
==
(enum) images_wired_qoi.BinErrorKind
BinErrorKind
.
(enum value) images_wired_qoi.BinErrorKind.none = cast(ubyte)0u
none
);
void std.stdio.writefln!(char, ulong, uint, uint, ubyte, ulong, ulong, ulong, ulong, ulong, ulong, ulong, ulong, bool)(in char[] fmt, ulong __param_1, uint __param_2, uint __param_3, ubyte __param_4, ulong __param_5, ulong __param_6, ulong __param_7, ulong __param_8, ulong __param_9, ulong __param_10, ulong __param_11, ulong __param_12, bool __param_13) @safe

Equivalent to writef(fmt, args, '\n').

writefln
("qoi: pieces of %s: %sx%s ch %s, ops rgb %s rgba %s index %s diff %s luma %s run %s, suspensions %s, pixel hash %016x, round trip %s",
(local variable) int step
step
?
(local variable) int step
step
:
(local variable) const(ubyte[]) bytes
bytes
.
(field) ulong const(ubyte[]).length
length
,
(local variable) images_wired_qoi.QoiDecoder d
d
.
(field) images_wired_qoi.QoiHeader images_wired_qoi.QoiDecoder.header
header
.
(field) uint images_wired_qoi.QoiHeader.width
width
,
(local variable) images_wired_qoi.QoiDecoder d
d
.
(field) images_wired_qoi.QoiHeader images_wired_qoi.QoiDecoder.header
header
.
(field) uint images_wired_qoi.QoiHeader.height
height
,
(local variable) images_wired_qoi.QoiDecoder d
d
.
(field) images_wired_qoi.QoiHeader images_wired_qoi.QoiDecoder.header
header
.
(field) ubyte images_wired_qoi.QoiHeader.channels
channels
,
(local variable) images_wired_qoi.QoiDecoder d
d
.
(field) ulong[6] images_wired_qoi.QoiDecoder.opCounts
opCounts
[
(enum) images_wired_qoi.Op
Op
.
(enum value) images_wired_qoi.Op.rgb = 0
rgb
],
(local variable) images_wired_qoi.QoiDecoder d
d
.
(field) ulong[6] images_wired_qoi.QoiDecoder.opCounts
opCounts
[
(enum) images_wired_qoi.Op
Op
.
(enum value) images_wired_qoi.Op.rgba = 1
rgba
],
(local variable) images_wired_qoi.QoiDecoder d
d
.
(field) ulong[6] images_wired_qoi.QoiDecoder.opCounts
opCounts
[
(enum) images_wired_qoi.Op
Op
.
(enum value) images_wired_qoi.Op.index = 2
index
],
(local variable) images_wired_qoi.QoiDecoder d
d
.
(field) ulong[6] images_wired_qoi.QoiDecoder.opCounts
opCounts
[
(enum) images_wired_qoi.Op
Op
.
(enum value) images_wired_qoi.Op.diff = 3
diff
],
(local variable) images_wired_qoi.QoiDecoder d
d
.
(field) ulong[6] images_wired_qoi.QoiDecoder.opCounts
opCounts
[
(enum) images_wired_qoi.Op
Op
.
(enum value) images_wired_qoi.Op.luma = 4
luma
],
(local variable) images_wired_qoi.QoiDecoder d
d
.
(field) ulong[6] images_wired_qoi.QoiDecoder.opCounts
opCounts
[
(enum) images_wired_qoi.Op
Op
.
(enum value) images_wired_qoi.Op.run = 5
run
],
(local variable) images_wired_qoi.QoiDecoder d
d
.
(field) ulong images_wired_qoi.QoiDecoder.suspensions

times feed returned needMore

suspensions
,
ulong images_wired_qoi.fnv1a(in images_wired_qoi.Rgba[] pixels) pure nothrow @nogc @safe
fnv1a
(
(local variable) images_wired_qoi.QoiDecoder d
d
.
(field) images_wired_qoi.Rgba[] images_wired_qoi.QoiDecoder.pixels
pixels
),
(local variable) images_wired_qoi.QoiDecoder d
d
.
(field) images_wired_qoi.Rgba[] images_wired_qoi.QoiDecoder.pixels
pixels
==
(local variable) const(images_wired_qoi.Rgba[]) image
image
);
} ubyte[]
(local variable) ubyte[] again
again
;
string images_wired_qoi.encodeFixed!(images_wired_qoi.QoiHeader)(in images_wired_qoi.QoiHeader value, ref ubyte[] output) pure nothrow @safe

Encodes a fixed record after its checks pass, as expressiveness §6.4 requires of encode. Returns the first failure's reason, or null.

encodeFixed
(
sparkles.base.expected.Expected!(QoiHeader, BinError, Abort) images_wired_qoi.decodeFixed!(images_wired_qoi.QoiHeader)(in ubyte[] bytes, ulong at) pure nothrow @safe

Decodes a fixed record at at: one bounds check, the schema walk with field checks, then the type-level @WireChecks.

decodeFixed
!
(struct) images_wired_qoi.QoiHeader

"magic bytes "qoif"", then big-endian width and height, then two informative bytes.

QoiHeader
(
(local variable) const(ubyte[]) bytes
bytes
, 0).
inout(images_wired_qoi.QoiHeader) sparkles.base.expected.Expected!(images_wired_qoi.QoiHeader, images_wired_qoi.BinError, sparkles.base.expected.Abort).value!()() inout pure nothrow @nogc @property ref @safe

Returns the expected value if there is one.

With default Abort hook, it asserts when there is no value. It calls hook's onAccessEmptyValue otherwise.

It returns T.init when hook doesn't provide onAccessEmptyValue.

Note

Value is returned by reference only when hook provides onAccessEmptyValue. Otherwise the T.init fallback forces it to be returned by value (a copy).

value
,
(local variable) ubyte[] again
again
);
void std.stdio.writefln!(char, ulong, bool)(in char[] fmt, ulong __param_1, bool __param_2) @safe

Equivalent to writef(fmt, args, '\n').

writefln
("qoi: round trip: header re-encoded to %s bytes, identical: %s",
(local variable) ubyte[] again
again
.
(field) ulong ubyte[].length
length
,
(local variable) ubyte[] again
again
==
(local variable) const(ubyte[]) bytes
bytes
[0 .. 14]);
auto
(local variable) ubyte[] badMagic
badMagic
=
(local variable) const(ubyte[]) bytes
bytes
.
ubyte[] object.dup!ubyte(const(ubyte)[] a) pure nothrow @property @safe
dup
;
(local variable) ubyte[] badMagic
badMagic
[0] = 'Q';
void images_wired_qoi.report(string label, in ubyte[] bytes, ulong step = 0LU, ulong maxPixels = 1048576LU)
report
("magic Qoif",
(local variable) ubyte[] badMagic
badMagic
);
auto
(local variable) ubyte[] badChannels
badChannels
=
(local variable) const(ubyte[]) bytes
bytes
.
ubyte[] object.dup!ubyte(const(ubyte)[] a) pure nothrow @property @safe
dup
;
(local variable) ubyte[] badChannels
badChannels
[12] = 5;
void images_wired_qoi.report(string label, in ubyte[] bytes, ulong step = 0LU, ulong maxPixels = 1048576LU)
report
("channels 5",
(local variable) ubyte[] badChannels
badChannels
);
void images_wired_qoi.report(string label, in ubyte[] bytes, ulong step = 0LU, ulong maxPixels = 1048576LU)
report
("budget of 16 pixels",
(local variable) const(ubyte[]) bytes
bytes
, 0, 16);
void images_wired_qoi.report(string label, in ubyte[] bytes, ulong step = 0LU, ulong maxPixels = 1048576LU)
report
("cut after 20 op bytes, fed in pieces of 1",
(local variable) const(ubyte[]) bytes
bytes
[0 .. 14 + 20], 1);
auto
(local variable) ubyte[] badEnd
badEnd
=
(local variable) const(ubyte[]) bytes
bytes
.
ubyte[] object.dup!ubyte(const(ubyte)[] a) pure nothrow @property @safe
dup
;
(local variable) ubyte[] badEnd
badEnd
[$ - 1] = 0;
void images_wired_qoi.report(string label, in ubyte[] bytes, ulong step = 0LU, ulong maxPixels = 1048576LU)
report
("end marker ends in 0x00",
(local variable) ubyte[] badEnd
badEnd
);
auto
(local variable) ubyte[] longRun
longRun
=
(local variable) const(ubyte[]) bytes
bytes
[0 .. 14] ~ cast(ubyte)(
(constant) ubyte images_wired_qoi.opRun = cast(ubyte)192u
opRun
| 61) ~
(immutable global) immutable(ubyte[8]) images_wired_qoi.endMarker
endMarker
[];
void images_wired_qoi.report(string label, in ubyte[] bytes, ulong step = 0LU, ulong maxPixels = 1048576LU)
report
("one run of 62 for 32 pixels",
(local variable) ubyte[] longRun
longRun
);
void images_wired_qoi.report(string label, in ubyte[] bytes, ulong step = 0LU, ulong maxPixels = 1048576LU)
report
("bytes after the end marker",
(local variable) const(ubyte[]) bytes
bytes
~ cast(ubyte) 0);
}