#!/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_qoiQOI 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) stdstd.(package) std.algorithmalgorithm.(module) std.algorithm.comparisonThis 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
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.
min;
import (package) stdstd.(module) std.stdioCategory 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:
The lowest layer is the operating system layer. The two main schemes are Windows and Posix.
C's stdio.h which unifies the two operating system schemes.
std.stdio, this module, unifies the various stdio.h implementations into
a high level package for D programs.
Source
std/stdio.d
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) stdstd.(module) std.traitsTemplates 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
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.
EnumMembers, (alias template) images_wired_qoi.OriginalType = std.traits.OriginalType(T)Strips off all enums from type T.
OriginalType;
import (package) sparklessparkles.(package) sparkles.basebase.(module) sparkles.base.expectedThis 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);
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.
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) sparklessparkles.(package) sparkles.wiredwired.(module) sparkles.wired.policyFormat-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) sparklessparkles.(package) sparkles.wiredwired.(module) sparkles.wired.schemaCompile-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.NodeKindStructural node vocabulary shared by format walkers and derivations.
NodeKind, (enum) sparkles.wired.schema.ScalarKindScalar distinctions which can affect a format's wire representation.
ScalarKind, (struct) sparkles.wired.schema.WireSchemaFlat 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 @safeByte 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.WireSchemaFlat 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) schemaschema, (alias) object.size_t = ulongsize_t (parameter) ulong indexindex) @safe pure nothrow
{
const (local variable) const(sparkles.wired.schema.SchemaNode) nodenode = (parameter) const(sparkles.wired.schema.WireSchema) schemaschema.(field) sparkles.wired.schema.SchemaNode[] sparkles.wired.schema.WireSchema.nodesnodes[(parameter) ulong indexindex];
switch ((local variable) const(sparkles.wired.schema.SchemaNode) nodenode.(field) sparkles.wired.schema.NodeKind sparkles.wired.schema.SchemaNode.kindkind)
{
case (enum) sparkles.wired.schema.NodeKindStructural node vocabulary shared by format walkers and derivations.
NodeKind.(enum value) sparkles.wired.schema.NodeKind.scalar = cast(ubyte)0uscalar:
return (local variable) const(sparkles.wired.schema.SchemaNode) nodenode.(field) sparkles.wired.schema.ScalarKind sparkles.wired.schema.SchemaNode.scalarKindscalarKind == (enum) sparkles.wired.schema.ScalarKindScalar distinctions which can affect a format's wire representation.
ScalarKind.(enum value) sparkles.wired.schema.ScalarKind.unsignedInteger = 3unsignedInteger
|| (local variable) const(sparkles.wired.schema.SchemaNode) nodenode.(field) sparkles.wired.schema.ScalarKind sparkles.wired.schema.SchemaNode.scalarKindscalarKind == (enum) sparkles.wired.schema.ScalarKindScalar distinctions which can affect a format's wire representation.
ScalarKind.(enum value) sparkles.wired.schema.ScalarKind.signedInteger = 2signedInteger
|| (local variable) const(sparkles.wired.schema.SchemaNode) nodenode.(field) sparkles.wired.schema.ScalarKind sparkles.wired.schema.SchemaNode.scalarKindscalarKind == (enum) sparkles.wired.schema.ScalarKindScalar distinctions which can affect a format's wire representation.
ScalarKind.(enum value) sparkles.wired.schema.ScalarKind.character = 5character
? (local variable) const(sparkles.wired.schema.SchemaNode) nodenode.(field) ushort sparkles.wired.schema.SchemaNode.scalarBitsscalar storage width where it constrains wire values
scalarBits / 8 : -1;
case (enum) sparkles.wired.schema.NodeKindStructural node vocabulary shared by format walkers and derivations.
NodeKind.(enum value) sparkles.wired.schema.NodeKind.enumeration = 1enumeration:
return (local variable) const(sparkles.wired.schema.SchemaNode) nodenode.(field) ushort sparkles.wired.schema.SchemaNode.scalarBitsscalar storage width where it constrains wire values
scalarBits ? (local variable) const(sparkles.wired.schema.SchemaNode) nodenode.(field) ushort sparkles.wired.schema.SchemaNode.scalarBitsscalar storage width where it constrains wire values
scalarBits / 8 : -1;
case (enum) sparkles.wired.schema.NodeKindStructural node vocabulary shared by format walkers and derivations.
NodeKind.(enum value) sparkles.wired.schema.NodeKind.staticArray = 5staticArray:
const (local variable) const(long) elementelement = long images_wired_qoi.fixedSize(const(sparkles.wired.schema.WireSchema) schema, ulong index) pure nothrow @safeByte 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) schemaschema, (parameter) const(sparkles.wired.schema.WireSchema) schemaschema.(field) ulong[] sparkles.wired.schema.WireSchema.edgesedges[(local variable) const(sparkles.wired.schema.SchemaNode) nodenode.(field) ulong sparkles.wired.schema.SchemaNode.firstEdgerange in WireSchema.edges
firstEdge]);
return (local variable) const(long) elementelement < 0 ? -1 : (local variable) const(long) elementelement * cast(long) (local variable) const(sparkles.wired.schema.SchemaNode) nodenode.(field) ulong sparkles.wired.schema.SchemaNode.staticLengthT[N] length, zero otherwise
staticLength;
case (enum) sparkles.wired.schema.NodeKindStructural node vocabulary shared by format walkers and derivations.
NodeKind.(enum value) sparkles.wired.schema.NodeKind.aggregate = 2aggregate:
long (local variable) long totaltotal;
foreach ((parameter) const(ulong) edgeedge; (parameter) const(sparkles.wired.schema.WireSchema) schemaschema.(field) ulong[] sparkles.wired.schema.WireSchema.edgesedges[(local variable) const(sparkles.wired.schema.SchemaNode) nodenode.(field) ulong sparkles.wired.schema.SchemaNode.firstEdgerange in WireSchema.edges
firstEdge .. (local variable) const(sparkles.wired.schema.SchemaNode) nodenode.(field) ulong sparkles.wired.schema.SchemaNode.firstEdgerange in WireSchema.edges
firstEdge + (local variable) const(sparkles.wired.schema.SchemaNode) nodenode.(field) ulong sparkles.wired.schema.SchemaNode.edgeCountrange in WireSchema.edges
edgeCount])
{
const (local variable) const(long) fieldfield = long images_wired_qoi.fixedSize(const(sparkles.wired.schema.WireSchema) schema, ulong index) pure nothrow @safeByte 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) schemaschema, (local variable) const(ulong) edgeedge);
if ((local variable) const(long) fieldfield < 0)
return -1;
(local variable) long totaltotal += (local variable) const(long) fieldfield;
}
return (local variable) long totaltotal;
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.BeFixedFormat 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"])) = truevalidateWireSchema = long images_wired_qoi.fixedSize(const(sparkles.wired.schema.WireSchema) schema, ulong index) pure nothrow @safeByte 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.BinErrorKindBinErrorKind : ubyte
{
(enum value) images_wired_qoi.BinErrorKind.none = cast(ubyte)0unone,
(enum value) images_wired_qoi.BinErrorKind.truncated = 1truncated,
(enum value) images_wired_qoi.BinErrorKind.notAMember = 2notAMember,
(enum value) images_wired_qoi.BinErrorKind.checkFailed = 3checkFailed,
(enum value) images_wired_qoi.BinErrorKind.limitExceeded = 4limitExceeded,
(enum value) images_wired_qoi.BinErrorKind.badStream = 5badStream,
(enum value) images_wired_qoi.BinErrorKind.badEndMarker = 6badEndMarker,
(enum value) images_wired_qoi.BinErrorKind.trailingBytes = 7trailingBytes,
}
struct (struct) images_wired_qoi.BinErrorBinError
{
(enum) images_wired_qoi.BinErrorKindBinErrorKind (field) images_wired_qoi.BinErrorKind images_wired_qoi.BinError.kindkind;
(alias) object.size_t = ulongsize_t (field) ulong images_wired_qoi.BinError.offsetoffset;
(alias) object.string = stringstring (field) string images_wired_qoi.BinError.whatwhat;
}
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.
Expected!((alias) T = images_wired_qoi.QoiHeaderT, (struct) images_wired_qoi.BinErrorBinError);
ulong ulong images_wired_qoi.readBe(in ubyte[] bytes, ulong at, ulong width) pure nothrow @nogc @safereadBe(in ubyte[] (parameter) const(ubyte[]) bytesbytes, (alias) object.size_t = ulongsize_t (parameter) ulong atat, (alias) object.size_t = ulongsize_t (parameter) ulong widthwidth) @safe pure nothrow @nogc
{
ulong (local variable) ulong valuevalue;
foreach ((parameter) const(ubyte) bb; (parameter) const(ubyte[]) bytesbytes[(parameter) ulong atat .. (parameter) ulong atat + (parameter) ulong widthwidth])
(local variable) ulong valuevalue = ((local variable) ulong valuevalue << 8) | (local variable) const(ubyte) bb;
return (local variable) ulong valuevalue;
}
/// Reads schema node `index` into `value`, in lockstep with the D type.
(struct) images_wired_qoi.BinErrorBinError 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 @safeReads schema node index into value, in lockstep with the D type.
readNode(V, alias schema, size_t index)(ref (alias) V = ubyteV (parameter) ubyte valuevalue, in ubyte[] (parameter) const(ubyte[]) bytesbytes,
ref (alias) object.size_t = ulongsize_t (parameter) ulong pospos, (alias) object.string = stringstring (parameter) string pathpath)
{
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.nodesnodes[(constant) ulong images_wired_qoi.index = 5LUindex];
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.kindkind == (enum) sparkles.wired.schema.NodeKindStructural node vocabulary shared by format walkers and derivations.
NodeKind.(enum value) sparkles.wired.schema.NodeKind.aggregate = 2aggregate)
{
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 = 1LUchild = (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.edgesedges[(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.firstEdgerange 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 = 3LUi];
const (local variable) const(string) fieldPathfieldPath = (parameter) string pathpath.(field) ulong string.lengthlength ? (parameter) string pathpath ~ "." ~ 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.nodesnodes[(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 = 1LUchild].(field) string sparkles.wired.schema.SchemaNode.namefield key, enum-member name, or union variant name
name;
const (local variable) const(ulong) fieldStartfieldStart = (parameter) ulong pospos;
auto (local variable) images_wired_qoi.BinError ee = (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 = 5LUreadNode!(typeof((field) char[4] images_wired_qoi.QoiHeader.magicV.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 = 0LUi]), (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 = 1LUchild)((parameter) images_wired_qoi.QoiHeader valuevalue.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 = 0LUi], (parameter) const(ubyte[]) bytesbytes, (parameter) ulong pospos, (local variable) const(string) fieldPathfieldPath);
if ((local variable) images_wired_qoi.BinError ee.(field) images_wired_qoi.BinErrorKind images_wired_qoi.BinError.kindkind != (enum) images_wired_qoi.BinErrorKindBinErrorKind.(enum value) images_wired_qoi.BinErrorKind.none = cast(ubyte)0unone)
return (local variable) images_wired_qoi.BinError ee;
auto (local variable) sparkles.wired.policy.WireCheckFailure[] failuresfailures = (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 = 0LUwireCheckFailures!((struct) images_wired_qoi.BeFixedFormat 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.QoiHeaderV.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 = 0LUi])((parameter) images_wired_qoi.QoiHeader valuevalue.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 = 0LUi]);
if ((local variable) sparkles.wired.policy.WireCheckFailure[] failuresfailures.(field) ulong sparkles.wired.policy.WireCheckFailure[].lengthlength)
return (struct) images_wired_qoi.BinErrorBinError((enum) images_wired_qoi.BinErrorKindBinErrorKind.(enum value) images_wired_qoi.BinErrorKind.checkFailed = 3checkFailed, (local variable) const(ulong) fieldStartfieldStart, (local variable) const(string) fieldPathfieldPath ~ ": " ~ (local variable) sparkles.wired.policy.WireCheckFailure[] failuresfailures[0].(field) string sparkles.wired.policy.WireCheckFailure.reasonreason);
}}
return (struct) images_wired_qoi.BinErrorBinError.(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.kindkind == (enum) sparkles.wired.schema.NodeKindStructural node vocabulary shared by format walkers and derivations.
NodeKind.(enum value) sparkles.wired.schema.NodeKind.staticArray = 5staticArray)
{
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 = 2LUchild = (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.edgesedges[(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.firstEdgerange in WireSchema.edges
firstEdge];
foreach ((local variable) ulong kk; 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.staticLengthT[N] length, zero otherwise
staticLength)
{
auto (local variable) images_wired_qoi.BinError ee = (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 = 2LUreadNode!(typeof((parameter) char[4] valuevalue[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 = 2LUchild)((parameter) char[4] valuevalue[(local variable) ulong kk], (parameter) const(ubyte[]) bytesbytes, (parameter) ulong pospos, (parameter) string pathpath);
if ((local variable) images_wired_qoi.BinError ee.(field) images_wired_qoi.BinErrorKind images_wired_qoi.BinError.kindkind != (enum) images_wired_qoi.BinErrorKindBinErrorKind.(enum value) images_wired_qoi.BinErrorKind.none = cast(ubyte)0unone)
return (local variable) images_wired_qoi.BinError ee;
}
return (struct) images_wired_qoi.BinErrorBinError.(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.kindkind == (enum) sparkles.wired.schema.NodeKindStructural node vocabulary shared by format walkers and derivations.
NodeKind.(enum value) sparkles.wired.schema.NodeKind.enumeration = 1enumeration)
{
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 valuevalue = cast((alias) V = ubyteV) ulong images_wired_qoi.readBe(in ubyte[] bytes, ulong at, ulong width) pure nothrow @nogc @safereadBe((parameter) const(ubyte[]) bytesbytes, (parameter) ulong pospos, (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.scalarBitsscalar storage width where it constrains wire values
scalarBits / 8);
(parameter) ulong pospos += (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.scalarBitsscalar storage width where it constrains wire values
scalarBits / 8;
return (struct) images_wired_qoi.BinErrorBinError.(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.QoiHeaderT sparkles.base.expected.Expected!(QoiHeader, BinError, Abort) images_wired_qoi.decodeFixed!(images_wired_qoi.QoiHeader)(in ubyte[] bytes, ulong at) pure nothrow @safeDecodes 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[]) bytesbytes, (alias) object.size_t = ulongsize_t (parameter) ulong atat)
{
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.BeFixedFormat 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.QoiHeaderT);
enum (alias) object.size_t = ulongsize_t (constant) ulong images_wired_qoi.decodeFixed!(images_wired_qoi.QoiHeader).size = 14LUsize = long images_wired_qoi.fixedSize(const(sparkles.wired.schema.WireSchema) schema, ulong index) pure nothrow @safeByte 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 atat > (parameter) const(ubyte[]) bytesbytes.(field) ulong const(ubyte[]).lengthlength || (parameter) const(ubyte[]) bytesbytes.(field) ulong const(ubyte[]).lengthlength - (parameter) ulong atat < (constant) ulong images_wired_qoi.decodeFixed!(images_wired_qoi.QoiHeader).size = 14LUsize)
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 @safeCreates 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.QoiHeaderT((struct) images_wired_qoi.BinErrorBinError((enum) images_wired_qoi.BinErrorKindBinErrorKind.(enum value) images_wired_qoi.BinErrorKind.truncated = 1truncated, (parameter) ulong atat, (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.QoiHeaderT (local variable) images_wired_qoi.QoiHeader valuevalue;
(alias) object.size_t = ulongsize_t (local variable) ulong pospos = (parameter) ulong atat;
auto (local variable) images_wired_qoi.BinError ee = 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 @safeReads schema node index into value, in lockstep with the D type.
readNode!((alias) T = images_wired_qoi.QoiHeaderT, (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 valuevalue, (parameter) const(ubyte[]) bytesbytes, (local variable) ulong pospos, "");
if ((local variable) images_wired_qoi.BinError ee.(field) images_wired_qoi.BinErrorKind images_wired_qoi.BinError.kindkind != (enum) images_wired_qoi.BinErrorKindBinErrorKind.(enum value) images_wired_qoi.BinErrorKind.none = cast(ubyte)0unone)
{
(local variable) images_wired_qoi.BinError ee.(field) string images_wired_qoi.BinError.whatwhat = (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 ee.(field) string images_wired_qoi.BinError.whatwhat;
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 @safeCreates 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.QoiHeaderT((local variable) images_wired_qoi.BinError ee);
}
auto (local variable) sparkles.wired.policy.WireCheckFailure[] failuresfailures = 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 @safeRuns 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.BeFixedFormat 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.QoiHeaderT)((local variable) images_wired_qoi.QoiHeader valuevalue);
if ((local variable) sparkles.wired.policy.WireCheckFailure[] failuresfailures.(field) ulong sparkles.wired.policy.WireCheckFailure[].lengthlength)
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 @safeCreates 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.QoiHeaderT((struct) images_wired_qoi.BinErrorBinError((enum) images_wired_qoi.BinErrorKindBinErrorKind.(enum value) images_wired_qoi.BinErrorKind.checkFailed = 3checkFailed, (parameter) ulong atat, (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[] failuresfailures[0].(field) string sparkles.wired.policy.WireCheckFailure.reasonreason));
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 @safeCreates an Expected object from an expected value, with type inference.
ok!(struct) images_wired_qoi.BinErrorBinError((local variable) images_wired_qoi.QoiHeader valuevalue);
}
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 @safewriteNode(V, alias schema, size_t index)(in (alias) V = ubyteV (parameter) const(ubyte) valuevalue, ref ubyte[] (parameter) ubyte[] outputoutput)
{
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.nodesnodes[(constant) ulong images_wired_qoi.index = 5LUindex];
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.kindkind == (enum) sparkles.wired.schema.NodeKindStructural node vocabulary shared by format walkers and derivations.
NodeKind.(enum value) sparkles.wired.schema.NodeKind.aggregate = 2aggregate)
{
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 @safewriteNode!(typeof((field) char[4] images_wired_qoi.QoiHeader.magicV.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 = 0LUi]), (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.firstEdgerange 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 = 3LUi])(
(parameter) const(images_wired_qoi.QoiHeader) valuevalue.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 = 0LUi], (parameter) ubyte[] outputoutput);
}
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.kindkind == (enum) sparkles.wired.schema.NodeKindStructural node vocabulary shared by format walkers and derivations.
NodeKind.(enum value) sparkles.wired.schema.NodeKind.staticArray = 5staticArray)
{
foreach ((local variable) ulong kk; 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.staticLengthT[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 @safewriteNode!(typeof((parameter) const(char[4]) valuevalue[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]) valuevalue[(local variable) ulong kk], (parameter) ubyte[] outputoutput);
}
else
{
const ulong (local variable) const(ulong) rawraw = cast(ulong) (parameter) const(ubyte) valuevalue;
foreach_reverse ((local variable) int kk; 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.scalarBitsscalar storage width where it constrains wire values
scalarBits / 8)
(parameter) ubyte[] outputoutput ~= cast(ubyte)((local variable) const(ulong) rawraw >> (8 * (local variable) int kk));
}
}
/// 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 = stringstring string images_wired_qoi.encodeFixed!(images_wired_qoi.QoiHeader)(in images_wired_qoi.QoiHeader value, ref ubyte[] output) pure nothrow @safeEncodes 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.QoiHeaderT (parameter) const(images_wired_qoi.QoiHeader) valuevalue, ref ubyte[] (parameter) ubyte[] outputoutput)
{
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.BeFixedFormat 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.QoiHeaderT);
static foreach (i; 0 .. T.tupleof.length)
foreach ((parameter) sparkles.wired.policy.WireCheckFailure failurefailure; (constant) ulong images_wired_qoi.encodeFixed!(images_wired_qoi.QoiHeader).i = 0LUwireCheckFailures!((struct) images_wired_qoi.BeFixedFormat 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.QoiHeaderT.tupleof[(constant) ulong images_wired_qoi.encodeFixed!(images_wired_qoi.QoiHeader).i = 0LUi])((parameter) const(images_wired_qoi.QoiHeader) valuevalue.tupleof[(constant) ulong images_wired_qoi.encodeFixed!(images_wired_qoi.QoiHeader).i = 0LUi]))
return (local variable) sparkles.wired.policy.WireCheckFailure failurefailure.(field) string sparkles.wired.policy.WireCheckFailure.reasonreason;
foreach ((parameter) sparkles.wired.policy.WireCheckFailure failurefailure; 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 @safeRuns 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.BeFixedFormat 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.QoiHeaderT)((parameter) const(images_wired_qoi.QoiHeader) valuevalue))
return (local variable) sparkles.wired.policy.WireCheckFailure failurefailure.(field) string sparkles.wired.policy.WireCheckFailure.reasonreason;
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 @safewriteNode!((alias) T = images_wired_qoi.QoiHeaderT, (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) valuevalue, (parameter) ubyte[] outputoutput);
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 QoiHeaderQoiHeader
{
@(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.magicmagic;
uint (field) uint images_wired_qoi.QoiHeader.widthwidth;
uint (field) uint images_wired_qoi.QoiHeader.heightheight;
@(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.channelschannels;
@(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.colorspacecolorspace;
}
// ---------------------------------------------------------------------------
// GAP: everything below is hand-written
// ---------------------------------------------------------------------------
struct (struct) images_wired_qoi.RgbaRgba
{
ubyte (field) ubyte images_wired_qoi.Rgba.rr, (field) ubyte images_wired_qoi.Rgba.gg, (field) ubyte images_wired_qoi.Rgba.bb, (field) ubyte images_wired_qoi.Rgba.aa;
}
/// "index_position = (r * 3 + g * 5 + b * 7 + a * 11) % 64"
(alias) object.size_t = ulongsize_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.RgbaRgba (parameter) images_wired_qoi.Rgba pp) @safe pure nothrow @nogc => ((parameter) images_wired_qoi.Rgba pp.(field) ubyte images_wired_qoi.Rgba.rr * 3 + (parameter) images_wired_qoi.Rgba pp.(field) ubyte images_wired_qoi.Rgba.gg * 5 + (parameter) images_wired_qoi.Rgba pp.(field) ubyte images_wired_qoi.Rgba.bb * 7 + (parameter) images_wired_qoi.Rgba pp.(field) ubyte images_wired_qoi.Rgba.aa * 11) % 64;
enum ubyte (constant) ubyte images_wired_qoi.opIndex = cast(ubyte)0uopIndex = 0x00, (constant) ubyte images_wired_qoi.opDiff = cast(ubyte)64uopDiff = 0x40, (constant) ubyte images_wired_qoi.opLuma = cast(ubyte)128uopLuma = 0x80, (constant) ubyte images_wired_qoi.opRun = cast(ubyte)192uopRun = 0xC0;
enum ubyte (constant) ubyte images_wired_qoi.opRgb = cast(ubyte)254uopRgb = 0xFE, (constant) ubyte images_wired_qoi.opRgba = cast(ubyte)255uopRgba = 0xFF;
immutable ubyte[8] (immutable global) immutable(ubyte[8]) images_wired_qoi.endMarkerendMarker = [0, 0, 0, 0, 0, 0, 0, 1];
enum (enum) images_wired_qoi.StatusStatus { (enum value) images_wired_qoi.Status.ok = 0ok, (enum value) images_wired_qoi.Status.needMore = 1needMore, (enum value) images_wired_qoi.Status.error = 2error }
enum (enum) images_wired_qoi.OpOp { (enum value) images_wired_qoi.Op.rgb = 0rgb, (enum value) images_wired_qoi.Op.rgba = 1rgba, (enum value) images_wired_qoi.Op.index = 2index, (enum value) images_wired_qoi.Op.diff = 3diff, (enum value) images_wired_qoi.Op.luma = 4luma, (enum value) images_wired_qoi.Op.run = 5run }
/// 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.QoiDecoderGAP
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.maxPixelsthe 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.headerheader;
(struct) images_wired_qoi.RgbaRgba[] (field) images_wired_qoi.Rgba[] images_wired_qoi.QoiDecoder.pixelspixels;
(struct) images_wired_qoi.BinErrorBinError (field) images_wired_qoi.BinError images_wired_qoi.QoiDecoder.errorerror;
ulong[EnumMembersEnumMembers!(enum) images_wired_qoi.OpOp.length] (field) ulong[6] images_wired_qoi.QoiDecoder.opCountsopCounts;
(alias) object.size_t = ulongsize_t (field) ulong images_wired_qoi.QoiDecoder.suspensionstimes feed returned needMore
suspensions; /// times `feed` returned `needMore`
private enum (enum) images_wired_qoi.QoiDecoder.PhasePhase { (enum value) images_wired_qoi.QoiDecoder.Phase.header = 0header, (enum value) images_wired_qoi.QoiDecoder.Phase.ops = 1ops, (enum value) images_wired_qoi.QoiDecoder.Phase.end = 2end, (enum value) images_wired_qoi.QoiDecoder.Phase.done = 3done }
private (enum) images_wired_qoi.QoiDecoder.PhasePhase (field) images_wired_qoi.QoiDecoder.Phase images_wired_qoi.QoiDecoder.phasephase;
private ubyte[14] (field) ubyte[14] images_wired_qoi.QoiDecoder.scratchscratch;
private (alias) object.size_t = ulongsize_t (field) ulong images_wired_qoi.QoiDecoder.scratchLengthscratchLength;
private (alias) object.size_t = ulongsize_t (field) ulong images_wired_qoi.QoiDecoder.positionabsolute input position consumed so far
position; /// absolute input position consumed so far
private (alias) object.size_t = ulongsize_t (field) ulong images_wired_qoi.QoiDecoder.writtenwritten;
private (struct) images_wired_qoi.RgbaRgba (field) images_wired_qoi.Rgba images_wired_qoi.QoiDecoder.previousprevious = (struct) images_wired_qoi.RgbaRgba(0, 0, 0, 255);
private (struct) images_wired_qoi.RgbaRgba[64] (field) images_wired_qoi.Rgba[64] images_wired_qoi.QoiDecoder.indexindex;
/// 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) returnReturns 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)[] piecepiece, (alias) object.size_t = ulongsize_t (parameter) ulong needneed) return
{
if ((field) ulong images_wired_qoi.QoiDecoder.scratchLengthscratchLength == 0 && (parameter) const(ubyte)[] piecepiece.(field) ulong const(ubyte)[].lengthlength >= (parameter) ulong needneed)
{
auto (local variable) const(ubyte)[] bytesbytes = (parameter) const(ubyte)[] piecepiece[0 .. (parameter) ulong needneed];
(parameter) const(ubyte)[] piecepiece = (parameter) const(ubyte)[] piecepiece[(parameter) ulong needneed .. $];
(field) ulong images_wired_qoi.QoiDecoder.positionabsolute input position consumed so far
position += (parameter) ulong needneed;
return (local variable) const(ubyte)[] bytesbytes;
}
const (local variable) const(ulong) nn = ulong std.algorithm.comparison.min!(ulong, ulong)(ulong a, ulong b) pure nothrow @nogc @safeIterates 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);
min((parameter) ulong needneed - (field) ulong images_wired_qoi.QoiDecoder.scratchLengthscratchLength, (parameter) const(ubyte)[] piecepiece.(field) ulong const(ubyte)[].lengthlength);
(field) ubyte[14] images_wired_qoi.QoiDecoder.scratchscratch[(field) ulong images_wired_qoi.QoiDecoder.scratchLengthscratchLength .. (field) ulong images_wired_qoi.QoiDecoder.scratchLengthscratchLength + (local variable) const(ulong) nn] = (parameter) const(ubyte)[] piecepiece[0 .. (local variable) const(ulong) nn];
(parameter) const(ubyte)[] piecepiece = (parameter) const(ubyte)[] piecepiece[(local variable) const(ulong) nn .. $];
(field) ulong images_wired_qoi.QoiDecoder.scratchLengthscratchLength += (local variable) const(ulong) nn;
(field) ulong images_wired_qoi.QoiDecoder.positionabsolute input position consumed so far
position += (local variable) const(ulong) nn;
if ((field) ulong images_wired_qoi.QoiDecoder.scratchLengthscratchLength < (parameter) ulong needneed)
return null;
(field) ulong images_wired_qoi.QoiDecoder.scratchLengthscratchLength = 0;
return (field) ubyte[14] images_wired_qoi.QoiDecoder.scratchscratch[0 .. (parameter) ulong needneed];
}
private (enum) images_wired_qoi.StatusStatus images_wired_qoi.Status images_wired_qoi.QoiDecoder.fail(images_wired_qoi.BinErrorKind kind, string what)fail((enum) images_wired_qoi.BinErrorKindBinErrorKind (parameter) images_wired_qoi.BinErrorKind kindkind, (alias) object.string = stringstring (parameter) string whatwhat)
{
(field) images_wired_qoi.BinError images_wired_qoi.QoiDecoder.errorerror = (struct) images_wired_qoi.BinErrorBinError((parameter) images_wired_qoi.BinErrorKind kindkind, (field) ulong images_wired_qoi.QoiDecoder.positionabsolute input position consumed so far
position, (parameter) string whatwhat);
(field) images_wired_qoi.QoiDecoder.Phase images_wired_qoi.QoiDecoder.phasephase = (enum) images_wired_qoi.QoiDecoder.PhasePhase.(enum value) images_wired_qoi.QoiDecoder.Phase.done = 3done;
return (enum) images_wired_qoi.StatusStatus.(enum value) images_wired_qoi.Status.error = 2error;
}
private void void images_wired_qoi.QoiDecoder.emit(images_wired_qoi.Rgba p, ulong count = 1LU)emit((struct) images_wired_qoi.RgbaRgba (parameter) images_wired_qoi.Rgba pp, (alias) object.size_t = ulongsize_t (parameter) ulong countcount = 1)
{
(field) images_wired_qoi.Rgba[] images_wired_qoi.QoiDecoder.pixelspixels[(field) ulong images_wired_qoi.QoiDecoder.writtenwritten .. (field) ulong images_wired_qoi.QoiDecoder.writtenwritten + (parameter) ulong countcount] = (parameter) images_wired_qoi.Rgba pp;
(field) ulong images_wired_qoi.QoiDecoder.writtenwritten += (parameter) ulong countcount;
(field) images_wired_qoi.Rgba images_wired_qoi.QoiDecoder.previousprevious = (parameter) images_wired_qoi.Rgba pp;
}
/// Consumes `piece`; `closed` says no more input will follow.
(enum) images_wired_qoi.StatusStatus 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)[] piecepiece, bool (parameter) bool closedclosed)
{
if ((field) images_wired_qoi.BinError images_wired_qoi.QoiDecoder.errorerror.(field) images_wired_qoi.BinErrorKind images_wired_qoi.BinError.kindkind != (enum) images_wired_qoi.BinErrorKindBinErrorKind.(enum value) images_wired_qoi.BinErrorKind.none = cast(ubyte)0unone)
return (enum) images_wired_qoi.StatusStatus.(enum value) images_wired_qoi.Status.error = 2error; // errors are sticky, as in Wuffs
while (true)
{
final switch ((field) images_wired_qoi.QoiDecoder.Phase images_wired_qoi.QoiDecoder.phasephase)
{
case (enum) images_wired_qoi.QoiDecoder.PhasePhase.(enum value) images_wired_qoi.QoiDecoder.Phase.header = 0header:
auto (local variable) const(ubyte)[] bytesbytes = const(ubyte)[] images_wired_qoi.QoiDecoder.take(ref const(ubyte)[] piece, ulong need) returnReturns need bytes, from the piece directly when they are all there,
else accumulated in scratch across calls; null while incomplete.
take((parameter) const(ubyte)[] piecepiece, 14);
if ((local variable) const(ubyte)[] bytesbytes is null)
return images_wired_qoi.Status images_wired_qoi.QoiDecoder.suspend(bool closed, string what)suspend((parameter) bool closedclosed, "header");
auto (local variable) sparkles.base.expected.Expected!(QoiHeader, BinError, Abort) hh = sparkles.base.expected.Expected!(QoiHeader, BinError, Abort) images_wired_qoi.decodeFixed!(images_wired_qoi.QoiHeader)(in ubyte[] bytes, ulong at) pure nothrow @safeDecodes 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)[] bytesbytes, 0);
if ((local variable) sparkles.base.expected.Expected!(QoiHeader, BinError, Abort) hh.bool sparkles.base.expected.Expected!(images_wired_qoi.QoiHeader, images_wired_qoi.BinError, sparkles.base.expected.Abort).hasError!()() const pure nothrow @nogc @property @safeChecks if Expected has error
hasError)
{
(field) images_wired_qoi.BinError images_wired_qoi.QoiDecoder.errorerror = (local variable) sparkles.base.expected.Expected!(QoiHeader, BinError, Abort) hh.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 @safeReturns 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.phasephase = (enum) images_wired_qoi.QoiDecoder.PhasePhase.(enum value) images_wired_qoi.QoiDecoder.Phase.done = 3done;
return (enum) images_wired_qoi.StatusStatus.(enum value) images_wired_qoi.Status.error = 2error;
}
(field) images_wired_qoi.QoiHeader images_wired_qoi.QoiDecoder.headerheader = (local variable) sparkles.base.expected.Expected!(QoiHeader, BinError, Abort) hh.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 @safeReturns 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) countcount = cast(ulong) (field) images_wired_qoi.QoiHeader images_wired_qoi.QoiDecoder.headerheader.(field) uint images_wired_qoi.QoiHeader.widthwidth * (field) images_wired_qoi.QoiHeader images_wired_qoi.QoiDecoder.headerheader.(field) uint images_wired_qoi.QoiHeader.heightheight;
if ((local variable) const(ulong) countcount == 0)
return images_wired_qoi.Status images_wired_qoi.QoiDecoder.fail(images_wired_qoi.BinErrorKind kind, string what)fail((enum) images_wired_qoi.BinErrorKindBinErrorKind.(enum value) images_wired_qoi.BinErrorKind.checkFailed = 3checkFailed, "width or height is 0");
if ((local variable) const(ulong) countcount > (field) ulong images_wired_qoi.QoiDecoder.maxPixelsthe 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.BinErrorKindBinErrorKind.(enum value) images_wired_qoi.BinErrorKind.limitExceeded = 4limitExceeded, "pixel count above the caller's budget");
(field) images_wired_qoi.Rgba[] images_wired_qoi.QoiDecoder.pixelspixels = new (struct) images_wired_qoi.RgbaRgba[cast((alias) object.size_t = ulongsize_t) (local variable) const(ulong) countcount];
(field) images_wired_qoi.QoiDecoder.Phase images_wired_qoi.QoiDecoder.phasephase = (enum) images_wired_qoi.QoiDecoder.PhasePhase.(enum value) images_wired_qoi.QoiDecoder.Phase.ops = 1ops;
break;
case (enum) images_wired_qoi.QoiDecoder.PhasePhase.(enum value) images_wired_qoi.QoiDecoder.Phase.ops = 1ops:
if ((field) ulong images_wired_qoi.QoiDecoder.writtenwritten == (field) images_wired_qoi.Rgba[] images_wired_qoi.QoiDecoder.pixelspixels.(field) ulong images_wired_qoi.Rgba[].lengthlength)
{
(field) images_wired_qoi.QoiDecoder.Phase images_wired_qoi.QoiDecoder.phasephase = (enum) images_wired_qoi.QoiDecoder.PhasePhase.(enum value) images_wired_qoi.QoiDecoder.Phase.end = 2end;
break;
}
if ((parameter) const(ubyte)[] piecepiece.(field) ulong const(ubyte)[].lengthlength == 0 && (field) ulong images_wired_qoi.QoiDecoder.scratchLengthscratchLength == 0)
return images_wired_qoi.Status images_wired_qoi.QoiDecoder.suspend(bool closed, string what)suspend((parameter) bool closedclosed, "op");
// "The 8-bit tags have precedence over the 2-bit tags."
const (local variable) const(int) tagtag = (field) ulong images_wired_qoi.QoiDecoder.scratchLengthscratchLength ? (field) ubyte[14] images_wired_qoi.QoiDecoder.scratchscratch[0] : (parameter) const(ubyte)[] piecepiece[0];
const (alias) object.size_t = ulongsize_t (local variable) const(ulong) needneed = (local variable) const(int) tagtag == (constant) ubyte images_wired_qoi.opRgba = cast(ubyte)255uopRgba ? 5 : (local variable) const(int) tagtag == (constant) ubyte images_wired_qoi.opRgb = cast(ubyte)254uopRgb ? 4
: ((local variable) const(int) tagtag & 0xC0) == (constant) ubyte images_wired_qoi.opLuma = cast(ubyte)128uopLuma ? 2 : 1;
auto (local variable) const(ubyte)[] opop = const(ubyte)[] images_wired_qoi.QoiDecoder.take(ref const(ubyte)[] piece, ulong need) returnReturns need bytes, from the piece directly when they are all there,
else accumulated in scratch across calls; null while incomplete.
take((parameter) const(ubyte)[] piecepiece, (local variable) const(ulong) needneed);
if ((local variable) const(ubyte)[] opop is null)
return images_wired_qoi.Status images_wired_qoi.QoiDecoder.suspend(bool closed, string what)suspend((parameter) bool closedclosed, "op");
if (!bool images_wired_qoi.QoiDecoder.decodeOp(in ubyte[] op)decodeOp((local variable) const(ubyte)[] opop))
return (enum) images_wired_qoi.StatusStatus.(enum value) images_wired_qoi.Status.error = 2error;
break;
case (enum) images_wired_qoi.QoiDecoder.PhasePhase.(enum value) images_wired_qoi.QoiDecoder.Phase.end = 2end:
auto (local variable) const(ubyte)[] bytesbytes = const(ubyte)[] images_wired_qoi.QoiDecoder.take(ref const(ubyte)[] piece, ulong need) returnReturns need bytes, from the piece directly when they are all there,
else accumulated in scratch across calls; null while incomplete.
take((parameter) const(ubyte)[] piecepiece, 8);
if ((local variable) const(ubyte)[] bytesbytes is null)
return images_wired_qoi.Status images_wired_qoi.QoiDecoder.suspend(bool closed, string what)suspend((parameter) bool closedclosed, "end marker");
if ((local variable) const(ubyte)[] bytesbytes != (immutable global) immutable(ubyte[8]) images_wired_qoi.endMarkerendMarker[])
return images_wired_qoi.Status images_wired_qoi.QoiDecoder.fail(images_wired_qoi.BinErrorKind kind, string what)fail((enum) images_wired_qoi.BinErrorKindBinErrorKind.(enum value) images_wired_qoi.BinErrorKind.badEndMarker = 6badEndMarker, "end marker");
(field) images_wired_qoi.QoiDecoder.Phase images_wired_qoi.QoiDecoder.phasephase = (enum) images_wired_qoi.QoiDecoder.PhasePhase.(enum value) images_wired_qoi.QoiDecoder.Phase.done = 3done;
break;
case (enum) images_wired_qoi.QoiDecoder.PhasePhase.(enum value) images_wired_qoi.QoiDecoder.Phase.done = 3done:
if ((parameter) const(ubyte)[] piecepiece.(field) ulong const(ubyte)[].lengthlength)
return images_wired_qoi.Status images_wired_qoi.QoiDecoder.fail(images_wired_qoi.BinErrorKind kind, string what)fail((enum) images_wired_qoi.BinErrorKindBinErrorKind.(enum value) images_wired_qoi.BinErrorKind.trailingBytes = 7trailingBytes, "bytes after the end marker");
return (enum) images_wired_qoi.StatusStatus.(enum value) images_wired_qoi.Status.ok = 0ok;
}
}
}
private (enum) images_wired_qoi.StatusStatus images_wired_qoi.Status images_wired_qoi.QoiDecoder.suspend(bool closed, string what)suspend(bool (parameter) bool closedclosed, (alias) object.string = stringstring (parameter) string whatwhat)
{
if ((parameter) bool closedclosed)
return images_wired_qoi.Status images_wired_qoi.QoiDecoder.fail(images_wired_qoi.BinErrorKind kind, string what)fail((enum) images_wired_qoi.BinErrorKindBinErrorKind.(enum value) images_wired_qoi.BinErrorKind.truncated = 1truncated, (parameter) string whatwhat);
(field) ulong images_wired_qoi.QoiDecoder.suspensionstimes feed returned needMore
suspensions++;
return (enum) images_wired_qoi.StatusStatus.(enum value) images_wired_qoi.Status.needMore = 1needMore;
}
private bool bool images_wired_qoi.QoiDecoder.decodeOp(in ubyte[] op)decodeOp(in ubyte[] (parameter) const(ubyte[]) opop)
{
(struct) images_wired_qoi.RgbaRgba (local variable) images_wired_qoi.Rgba pp = (field) images_wired_qoi.Rgba images_wired_qoi.QoiDecoder.previousprevious;
const (local variable) const(ubyte) bb = (parameter) const(ubyte[]) opop[0];
if ((local variable) const(ubyte) bb == (constant) ubyte images_wired_qoi.opRgb = cast(ubyte)254uopRgb)
{
(local variable) images_wired_qoi.Rgba pp.(field) ubyte images_wired_qoi.Rgba.rr = (parameter) const(ubyte[]) opop[1]; (local variable) images_wired_qoi.Rgba pp.(field) ubyte images_wired_qoi.Rgba.gg = (parameter) const(ubyte[]) opop[2]; (local variable) images_wired_qoi.Rgba pp.(field) ubyte images_wired_qoi.Rgba.bb = (parameter) const(ubyte[]) opop[3];
(field) ulong[6] images_wired_qoi.QoiDecoder.opCountsopCounts[(enum) images_wired_qoi.OpOp.(enum value) images_wired_qoi.Op.rgb = 0rgb]++;
}
else if ((local variable) const(ubyte) bb == (constant) ubyte images_wired_qoi.opRgba = cast(ubyte)255uopRgba)
{
(local variable) images_wired_qoi.Rgba pp = (struct) images_wired_qoi.RgbaRgba((parameter) const(ubyte[]) opop[1], (parameter) const(ubyte[]) opop[2], (parameter) const(ubyte[]) opop[3], (parameter) const(ubyte[]) opop[4]);
(field) ulong[6] images_wired_qoi.QoiDecoder.opCountsopCounts[(enum) images_wired_qoi.OpOp.(enum value) images_wired_qoi.Op.rgba = 1rgba]++;
}
else if (((local variable) const(ubyte) bb & 0xC0) == (constant) ubyte images_wired_qoi.opIndex = cast(ubyte)0uopIndex)
{
(local variable) images_wired_qoi.Rgba pp = (field) images_wired_qoi.Rgba[64] images_wired_qoi.QoiDecoder.indexindex[(local variable) const(ubyte) bb & 0x3F];
(field) ulong[6] images_wired_qoi.QoiDecoder.opCountsopCounts[(enum) images_wired_qoi.OpOp.(enum value) images_wired_qoi.Op.index = 2index]++;
}
else if (((local variable) const(ubyte) bb & 0xC0) == (constant) ubyte images_wired_qoi.opDiff = cast(ubyte)64uopDiff)
{
// Three 2-bit fields with a bias of 2, wrapping arithmetic.
(local variable) images_wired_qoi.Rgba pp.(field) ubyte images_wired_qoi.Rgba.rr = cast(ubyte)((local variable) images_wired_qoi.Rgba pp.(field) ubyte images_wired_qoi.Rgba.rr + (((local variable) const(ubyte) bb >> 4) & 3) - 2);
(local variable) images_wired_qoi.Rgba pp.(field) ubyte images_wired_qoi.Rgba.gg = cast(ubyte)((local variable) images_wired_qoi.Rgba pp.(field) ubyte images_wired_qoi.Rgba.gg + (((local variable) const(ubyte) bb >> 2) & 3) - 2);
(local variable) images_wired_qoi.Rgba pp.(field) ubyte images_wired_qoi.Rgba.bb = cast(ubyte)((local variable) images_wired_qoi.Rgba pp.(field) ubyte images_wired_qoi.Rgba.bb + ((local variable) const(ubyte) bb & 3) - 2);
(field) ulong[6] images_wired_qoi.QoiDecoder.opCountsopCounts[(enum) images_wired_qoi.OpOp.(enum value) images_wired_qoi.Op.diff = 3diff]++;
}
else if (((local variable) const(ubyte) bb & 0xC0) == (constant) ubyte images_wired_qoi.opLuma = cast(ubyte)128uopLuma)
{
// A 6-bit field (bias 32), then two 4-bit fields (bias 8) relative to it.
const (local variable) const(int) dgdg = ((local variable) const(ubyte) bb & 0x3F) - 32;
(local variable) images_wired_qoi.Rgba pp.(field) ubyte images_wired_qoi.Rgba.rr = cast(ubyte)((local variable) images_wired_qoi.Rgba pp.(field) ubyte images_wired_qoi.Rgba.rr + (local variable) const(int) dgdg - 8 + ((parameter) const(ubyte[]) opop[1] >> 4));
(local variable) images_wired_qoi.Rgba pp.(field) ubyte images_wired_qoi.Rgba.gg = cast(ubyte)((local variable) images_wired_qoi.Rgba pp.(field) ubyte images_wired_qoi.Rgba.gg + (local variable) const(int) dgdg);
(local variable) images_wired_qoi.Rgba pp.(field) ubyte images_wired_qoi.Rgba.bb = cast(ubyte)((local variable) images_wired_qoi.Rgba pp.(field) ubyte images_wired_qoi.Rgba.bb + (local variable) const(int) dgdg - 8 + ((parameter) const(ubyte[]) opop[1] & 0x0F));
(field) ulong[6] images_wired_qoi.QoiDecoder.opCountsopCounts[(enum) images_wired_qoi.OpOp.(enum value) images_wired_qoi.Op.luma = 4luma]++;
}
else
{
const (local variable) const(int) runrun = ((local variable) const(ubyte) bb & 0x3F) + 1; // 1..62; 63 and 64 are the 8-bit tags
(field) ulong[6] images_wired_qoi.QoiDecoder.opCountsopCounts[(enum) images_wired_qoi.OpOp.(enum value) images_wired_qoi.Op.run = 5run]++;
if ((local variable) const(int) runrun > (field) images_wired_qoi.Rgba[] images_wired_qoi.QoiDecoder.pixelspixels.(field) ulong images_wired_qoi.Rgba[].lengthlength - (field) ulong images_wired_qoi.QoiDecoder.writtenwritten)
{
images_wired_qoi.Status images_wired_qoi.QoiDecoder.fail(images_wired_qoi.BinErrorKind kind, string what)fail((enum) images_wired_qoi.BinErrorKindBinErrorKind.(enum value) images_wired_qoi.BinErrorKind.badStream = 5badStream, "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 pp, (local variable) const(int) runrun);
return true; // a run repeats the previous pixel, already indexed
}
(field) images_wired_qoi.Rgba[64] images_wired_qoi.QoiDecoder.indexindex[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 pp)] = (local variable) images_wired_qoi.Rgba pp;
void images_wired_qoi.QoiDecoder.emit(images_wired_qoi.Rgba p, ulong count = 1LU)emit((local variable) images_wired_qoi.Rgba pp);
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) headerheader, in (struct) images_wired_qoi.RgbaRgba[] (parameter) const(images_wired_qoi.Rgba[]) imageimage)
{
ubyte[] (local variable) ubyte[] outputoutput;
const (local variable) const(string) refusedrefused = string images_wired_qoi.encodeFixed!(images_wired_qoi.QoiHeader)(in images_wired_qoi.QoiHeader value, ref ubyte[] output) pure nothrow @safeEncodes 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) headerheader, (local variable) ubyte[] outputoutput);
assert((local variable) const(string) refusedrefused is null, (local variable) const(string) refusedrefused);
(struct) images_wired_qoi.RgbaRgba[64] (local variable) images_wired_qoi.Rgba[64] indexindex;
(struct) images_wired_qoi.RgbaRgba (local variable) images_wired_qoi.Rgba previousprevious = (struct) images_wired_qoi.RgbaRgba(0, 0, 0, 255);
(alias) object.size_t = ulongsize_t (local variable) ulong runrun;
foreach ((parameter) ulong ii, (parameter) const(images_wired_qoi.Rgba) pp; (parameter) const(images_wired_qoi.Rgba[]) imageimage)
{
if ((local variable) const(images_wired_qoi.Rgba) pp == (local variable) images_wired_qoi.Rgba previousprevious)
{
if (++(local variable) ulong runrun == 62 || (local variable) ulong ii + 1 == (parameter) const(images_wired_qoi.Rgba[]) imageimage.(field) ulong const(images_wired_qoi.Rgba[]).lengthlength)
{
(local variable) ubyte[] outputoutput ~= cast(ubyte)((constant) ubyte images_wired_qoi.opRun = cast(ubyte)192uopRun | ((local variable) ulong runrun - 1));
(local variable) ulong runrun = 0;
}
continue;
}
if ((local variable) ulong runrun)
{
(local variable) ubyte[] outputoutput ~= cast(ubyte)((constant) ubyte images_wired_qoi.opRun = cast(ubyte)192uopRun | ((local variable) ulong runrun - 1));
(local variable) ulong runrun = 0;
}
const (local variable) const(ulong) hh = 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) pp);
if ((local variable) images_wired_qoi.Rgba[64] indexindex[(local variable) const(ulong) hh] == (local variable) const(images_wired_qoi.Rgba) pp)
(local variable) ubyte[] outputoutput ~= cast(ubyte)((constant) ubyte images_wired_qoi.opIndex = cast(ubyte)0uopIndex | (local variable) const(ulong) hh);
else
{
(local variable) images_wired_qoi.Rgba[64] indexindex[(local variable) const(ulong) hh] = (local variable) const(images_wired_qoi.Rgba) pp;
const byte (local variable) const(byte) drdr = cast(byte)((local variable) const(images_wired_qoi.Rgba) pp.(field) ubyte images_wired_qoi.Rgba.rr - (local variable) images_wired_qoi.Rgba previousprevious.(field) ubyte images_wired_qoi.Rgba.rr), (local variable) const(byte) dgdg = cast(byte)((local variable) const(images_wired_qoi.Rgba) pp.(field) ubyte images_wired_qoi.Rgba.gg - (local variable) images_wired_qoi.Rgba previousprevious.(field) ubyte images_wired_qoi.Rgba.gg),
(local variable) const(byte) dbdb = cast(byte)((local variable) const(images_wired_qoi.Rgba) pp.(field) ubyte images_wired_qoi.Rgba.bb - (local variable) images_wired_qoi.Rgba previousprevious.(field) ubyte images_wired_qoi.Rgba.bb);
const int (local variable) const(int) drgdrg = (local variable) const(byte) drdr - (local variable) const(byte) dgdg, (local variable) const(int) dbgdbg = (local variable) const(byte) dbdb - (local variable) const(byte) dgdg;
if ((local variable) const(images_wired_qoi.Rgba) pp.(field) ubyte images_wired_qoi.Rgba.aa != (local variable) images_wired_qoi.Rgba previousprevious.(field) ubyte images_wired_qoi.Rgba.aa)
(local variable) ubyte[] outputoutput ~= [(constant) ubyte images_wired_qoi.opRgba = cast(ubyte)255uopRgba, (local variable) const(images_wired_qoi.Rgba) pp.(field) ubyte images_wired_qoi.Rgba.rr, (local variable) const(images_wired_qoi.Rgba) pp.(field) ubyte images_wired_qoi.Rgba.gg, (local variable) const(images_wired_qoi.Rgba) pp.(field) ubyte images_wired_qoi.Rgba.bb, (local variable) const(images_wired_qoi.Rgba) pp.(field) ubyte images_wired_qoi.Rgba.aa];
else if ((local variable) const(byte) drdr >= -2 && (local variable) const(byte) drdr <= 1 && (local variable) const(byte) dgdg >= -2 && (local variable) const(byte) dgdg <= 1 && (local variable) const(byte) dbdb >= -2 && (local variable) const(byte) dbdb <= 1)
(local variable) ubyte[] outputoutput ~= cast(ubyte)((constant) ubyte images_wired_qoi.opDiff = cast(ubyte)64uopDiff | ((local variable) const(byte) drdr + 2) << 4 | ((local variable) const(byte) dgdg + 2) << 2 | ((local variable) const(byte) dbdb + 2));
else if ((local variable) const(byte) dgdg >= -32 && (local variable) const(byte) dgdg <= 31 && (local variable) const(int) drgdrg >= -8 && (local variable) const(int) drgdrg <= 7 && (local variable) const(int) dbgdbg >= -8 && (local variable) const(int) dbgdbg <= 7)
(local variable) ubyte[] outputoutput ~= [cast(ubyte)((constant) ubyte images_wired_qoi.opLuma = cast(ubyte)128uopLuma | ((local variable) const(byte) dgdg + 32)), cast(ubyte)(((local variable) const(int) drgdrg + 8) << 4 | ((local variable) const(int) dbgdbg + 8))];
else
(local variable) ubyte[] outputoutput ~= [(constant) ubyte images_wired_qoi.opRgb = cast(ubyte)254uopRgb, (local variable) const(images_wired_qoi.Rgba) pp.(field) ubyte images_wired_qoi.Rgba.rr, (local variable) const(images_wired_qoi.Rgba) pp.(field) ubyte images_wired_qoi.Rgba.gg, (local variable) const(images_wired_qoi.Rgba) pp.(field) ubyte images_wired_qoi.Rgba.bb];
}
(local variable) images_wired_qoi.Rgba previousprevious = (local variable) const(images_wired_qoi.Rgba) pp;
}
return (local variable) ubyte[] outputoutput ~ (immutable global) immutable(ubyte[8]) images_wired_qoi.endMarkerendMarker[];
}
/// An 8 by 4 RGBA test image that exercises every op.
(struct) images_wired_qoi.RgbaRgba[] images_wired_qoi.Rgba[] images_wired_qoi.testImage()An 8 by 4 RGBA test image that exercises every op.
testImage()
{
(struct) images_wired_qoi.RgbaRgba[] (local variable) images_wired_qoi.Rgba[] imageimage;
foreach ((local variable) int yy; 0 .. 4)
{
const ubyte (local variable) const(ubyte) vv = cast(ubyte) (local variable) int yy;
(local variable) images_wired_qoi.Rgba[] imageimage ~= [
(struct) images_wired_qoi.RgbaRgba(1, 1, 1, 255), // DIFF from black
(struct) images_wired_qoi.RgbaRgba(2, 2, 1, 255), // DIFF
(struct) images_wired_qoi.RgbaRgba(20, 22, 18, 255), // LUMA
(struct) images_wired_qoi.RgbaRgba(200, 30, cast(ubyte)(90 + (local variable) const(ubyte) vv), 255), // RGB
(struct) images_wired_qoi.RgbaRgba(1, 1, 1, 255), // INDEX (seen at x = 0)
(local variable) int yy == 2 ? (struct) images_wired_qoi.RgbaRgba(5, 5, 5, 128) : (struct) images_wired_qoi.RgbaRgba(5, 5, 5, 255), // RGBA on row 2
(struct) images_wired_qoi.RgbaRgba(0, 0, 0, 255), // RUN of two
(struct) images_wired_qoi.RgbaRgba(0, 0, 0, 255),
];
}
return (local variable) images_wired_qoi.Rgba[] imageimage;
}
/// Feeds `bytes` in pieces of `step` (0 means all at once), then closes.
(struct) images_wired_qoi.QoiDecoderGAP
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[]) bytesbytes, (alias) object.size_t = ulongsize_t (parameter) ulong stepstep, ulong (parameter) ulong maxPixelsmaxPixels = 1 << 20)
{
(struct) images_wired_qoi.QoiDecoderGAP
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 dd;
(local variable) images_wired_qoi.QoiDecoder dd.(field) ulong images_wired_qoi.QoiDecoder.maxPixelsthe caller's budget, checked against the header
maxPixels = (parameter) ulong maxPixelsmaxPixels;
const(ubyte)[] (local variable) const(ubyte)[] restrest = (parameter) const(ubyte[]) bytesbytes;
(enum) images_wired_qoi.StatusStatus (local variable) images_wired_qoi.Status statusstatus = (enum) images_wired_qoi.StatusStatus.(enum value) images_wired_qoi.Status.needMore = 1needMore;
while ((local variable) images_wired_qoi.Status statusstatus == (enum) images_wired_qoi.StatusStatus.(enum value) images_wired_qoi.Status.needMore = 1needMore && (local variable) const(ubyte)[] restrest.(field) ulong const(ubyte)[].lengthlength)
{
const (local variable) const(ulong) nn = (parameter) ulong stepstep ? ulong std.algorithm.comparison.min!(ulong, ulong)(ulong a, ulong b) pure nothrow @nogc @safeIterates 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);
min((parameter) ulong stepstep, (local variable) const(ubyte)[] restrest.(field) ulong const(ubyte)[].lengthlength) : (local variable) const(ubyte)[] restrest.(field) ulong const(ubyte)[].lengthlength;
(local variable) images_wired_qoi.Status statusstatus = (local variable) images_wired_qoi.QoiDecoder dd.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)[] restrest[0 .. (local variable) const(ulong) nn], false);
(local variable) const(ubyte)[] restrest = (local variable) const(ubyte)[] restrest[(local variable) const(ulong) nn .. $];
}
if ((local variable) images_wired_qoi.Status statusstatus == (enum) images_wired_qoi.StatusStatus.(enum value) images_wired_qoi.Status.needMore = 1needMore)
(local variable) images_wired_qoi.QoiDecoder dd.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 dd;
}
ulong ulong images_wired_qoi.fnv1a(in images_wired_qoi.Rgba[] pixels) pure nothrow @nogc @safefnv1a(in (struct) images_wired_qoi.RgbaRgba[] (parameter) const(images_wired_qoi.Rgba[]) pixelspixels) @safe pure nothrow @nogc
{
ulong (local variable) ulong hh = 0xcbf2_9ce4_8422_2325;
foreach ((parameter) const(images_wired_qoi.Rgba) pp; (parameter) const(images_wired_qoi.Rgba[]) pixelspixels)
foreach ((parameter) const(ubyte) octetoctet; [(local variable) const(images_wired_qoi.Rgba) pp.(field) ubyte images_wired_qoi.Rgba.rr, (local variable) const(images_wired_qoi.Rgba) pp.(field) ubyte images_wired_qoi.Rgba.gg, (local variable) const(images_wired_qoi.Rgba) pp.(field) ubyte images_wired_qoi.Rgba.bb, (local variable) const(images_wired_qoi.Rgba) pp.(field) ubyte images_wired_qoi.Rgba.aa])
(local variable) ulong hh = ((local variable) ulong hh ^ (local variable) const(ubyte) octetoctet) * 0x100_0000_01b3;
return (local variable) ulong hh;
}
void void images_wired_qoi.report(string label, in ubyte[] bytes, ulong step = 0LU, ulong maxPixels = 1048576LU)report((alias) object.string = stringstring (parameter) string labellabel, in ubyte[] (parameter) const(ubyte[]) bytesbytes, (alias) object.size_t = ulongsize_t (parameter) ulong stepstep = 0, ulong (parameter) ulong maxPixelsmaxPixels = 1 << 20)
{
auto (local variable) images_wired_qoi.QoiDecoder dd = 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[]) bytesbytes, (parameter) ulong stepstep, (parameter) ulong maxPixelsmaxPixels);
if ((local variable) images_wired_qoi.QoiDecoder dd.(field) images_wired_qoi.BinError images_wired_qoi.QoiDecoder.errorerror.(field) images_wired_qoi.BinErrorKind images_wired_qoi.BinError.kindkind != (enum) images_wired_qoi.BinErrorKindBinErrorKind.(enum value) images_wired_qoi.BinErrorKind.none = cast(ubyte)0unone)
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) @safeEquivalent to writef(fmt, args, '\n').
writefln("qoi: %s: %s at offset %s (%s)", (parameter) string labellabel, (local variable) images_wired_qoi.QoiDecoder dd.(field) images_wired_qoi.BinError images_wired_qoi.QoiDecoder.errorerror.(field) images_wired_qoi.BinErrorKind images_wired_qoi.BinError.kindkind, (local variable) images_wired_qoi.QoiDecoder dd.(field) images_wired_qoi.BinError images_wired_qoi.QoiDecoder.errorerror.(field) ulong images_wired_qoi.BinError.offsetoffset, (local variable) images_wired_qoi.QoiDecoder dd.(field) images_wired_qoi.BinError images_wired_qoi.QoiDecoder.errorerror.(field) string images_wired_qoi.BinError.whatwhat);
else
void std.stdio.writefln!(char, string)(in char[] fmt, string __param_1) @safeEquivalent to writef(fmt, args, '\n').
writefln("qoi: %s: ok", (parameter) string labellabel);
}
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.BeFixedFormat 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) @safeEquivalent 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 @safeByte 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.nodesnodes.(field) ulong sparkles.wired.schema.SchemaNode[].lengthlength);
const (local variable) const(images_wired_qoi.Rgba[]) imageimage = 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) headerheader = (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[]) bytesbytes = 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) headerheader, (local variable) const(images_wired_qoi.Rgba[]) imageimage);
void std.stdio.writefln!(char, ulong, ulong, ulong)(in char[] fmt, ulong __param_1, ulong __param_2, ulong __param_3) @safeEquivalent 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[]) imageimage.(field) ulong const(images_wired_qoi.Rgba[]).lengthlength, (local variable) const(ubyte[]) bytesbytes.(field) ulong const(ubyte[]).lengthlength, (local variable) const(ubyte[]) bytesbytes.(field) ulong const(ubyte[]).lengthlength - 22);
foreach ((parameter) int stepstep; [0, 1, 3, 7])
{
auto (local variable) images_wired_qoi.QoiDecoder dd = 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[]) bytesbytes, (local variable) int stepstep);
assert((local variable) images_wired_qoi.QoiDecoder dd.(field) images_wired_qoi.BinError images_wired_qoi.QoiDecoder.errorerror.(field) images_wired_qoi.BinErrorKind images_wired_qoi.BinError.kindkind == (enum) images_wired_qoi.BinErrorKindBinErrorKind.(enum value) images_wired_qoi.BinErrorKind.none = cast(ubyte)0unone);
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) @safeEquivalent 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 stepstep ? (local variable) int stepstep : (local variable) const(ubyte[]) bytesbytes.(field) ulong const(ubyte[]).lengthlength, (local variable) images_wired_qoi.QoiDecoder dd.(field) images_wired_qoi.QoiHeader images_wired_qoi.QoiDecoder.headerheader.(field) uint images_wired_qoi.QoiHeader.widthwidth, (local variable) images_wired_qoi.QoiDecoder dd.(field) images_wired_qoi.QoiHeader images_wired_qoi.QoiDecoder.headerheader.(field) uint images_wired_qoi.QoiHeader.heightheight, (local variable) images_wired_qoi.QoiDecoder dd.(field) images_wired_qoi.QoiHeader images_wired_qoi.QoiDecoder.headerheader.(field) ubyte images_wired_qoi.QoiHeader.channelschannels,
(local variable) images_wired_qoi.QoiDecoder dd.(field) ulong[6] images_wired_qoi.QoiDecoder.opCountsopCounts[(enum) images_wired_qoi.OpOp.(enum value) images_wired_qoi.Op.rgb = 0rgb], (local variable) images_wired_qoi.QoiDecoder dd.(field) ulong[6] images_wired_qoi.QoiDecoder.opCountsopCounts[(enum) images_wired_qoi.OpOp.(enum value) images_wired_qoi.Op.rgba = 1rgba], (local variable) images_wired_qoi.QoiDecoder dd.(field) ulong[6] images_wired_qoi.QoiDecoder.opCountsopCounts[(enum) images_wired_qoi.OpOp.(enum value) images_wired_qoi.Op.index = 2index], (local variable) images_wired_qoi.QoiDecoder dd.(field) ulong[6] images_wired_qoi.QoiDecoder.opCountsopCounts[(enum) images_wired_qoi.OpOp.(enum value) images_wired_qoi.Op.diff = 3diff],
(local variable) images_wired_qoi.QoiDecoder dd.(field) ulong[6] images_wired_qoi.QoiDecoder.opCountsopCounts[(enum) images_wired_qoi.OpOp.(enum value) images_wired_qoi.Op.luma = 4luma], (local variable) images_wired_qoi.QoiDecoder dd.(field) ulong[6] images_wired_qoi.QoiDecoder.opCountsopCounts[(enum) images_wired_qoi.OpOp.(enum value) images_wired_qoi.Op.run = 5run], (local variable) images_wired_qoi.QoiDecoder dd.(field) ulong images_wired_qoi.QoiDecoder.suspensionstimes feed returned needMore
suspensions, ulong images_wired_qoi.fnv1a(in images_wired_qoi.Rgba[] pixels) pure nothrow @nogc @safefnv1a((local variable) images_wired_qoi.QoiDecoder dd.(field) images_wired_qoi.Rgba[] images_wired_qoi.QoiDecoder.pixelspixels),
(local variable) images_wired_qoi.QoiDecoder dd.(field) images_wired_qoi.Rgba[] images_wired_qoi.QoiDecoder.pixelspixels == (local variable) const(images_wired_qoi.Rgba[]) imageimage);
}
ubyte[] (local variable) ubyte[] againagain;
string images_wired_qoi.encodeFixed!(images_wired_qoi.QoiHeader)(in images_wired_qoi.QoiHeader value, ref ubyte[] output) pure nothrow @safeEncodes 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 @safeDecodes 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[]) bytesbytes, 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 @safeReturns 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[] againagain);
void std.stdio.writefln!(char, ulong, bool)(in char[] fmt, ulong __param_1, bool __param_2) @safeEquivalent to writef(fmt, args, '\n').
writefln("qoi: round trip: header re-encoded to %s bytes, identical: %s", (local variable) ubyte[] againagain.(field) ulong ubyte[].lengthlength, (local variable) ubyte[] againagain == (local variable) const(ubyte[]) bytesbytes[0 .. 14]);
auto (local variable) ubyte[] badMagicbadMagic = (local variable) const(ubyte[]) bytesbytes.ubyte[] object.dup!ubyte(const(ubyte)[] a) pure nothrow @property @safedup;
(local variable) ubyte[] badMagicbadMagic[0] = 'Q';
void images_wired_qoi.report(string label, in ubyte[] bytes, ulong step = 0LU, ulong maxPixels = 1048576LU)report("magic Qoif", (local variable) ubyte[] badMagicbadMagic);
auto (local variable) ubyte[] badChannelsbadChannels = (local variable) const(ubyte[]) bytesbytes.ubyte[] object.dup!ubyte(const(ubyte)[] a) pure nothrow @property @safedup;
(local variable) ubyte[] badChannelsbadChannels[12] = 5;
void images_wired_qoi.report(string label, in ubyte[] bytes, ulong step = 0LU, ulong maxPixels = 1048576LU)report("channels 5", (local variable) ubyte[] badChannelsbadChannels);
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[]) bytesbytes, 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[]) bytesbytes[0 .. 14 + 20], 1);
auto (local variable) ubyte[] badEndbadEnd = (local variable) const(ubyte[]) bytesbytes.ubyte[] object.dup!ubyte(const(ubyte)[] a) pure nothrow @property @safedup;
(local variable) ubyte[] badEndbadEnd[$ - 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[] badEndbadEnd);
auto (local variable) ubyte[] longRunlongRun = (local variable) const(ubyte[]) bytesbytes[0 .. 14] ~ cast(ubyte)((constant) ubyte images_wired_qoi.opRun = cast(ubyte)192uopRun | 61) ~ (immutable global) immutable(ubyte[8]) images_wired_qoi.endMarkerendMarker[];
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[] longRunlongRun);
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[]) bytesbytes ~ cast(ubyte) 0);
}