#!/usr/bin/env dub
/+ dub.sdl:
name "images_wired_png_chunks"
dependency "sparkles:wired" path="../../../../.."
dflags "-preview=in" "-preview=dip1000"
buildType "checked" {
buildOptions "optimize" "inline" "debugInfo"
}
+/
/**
* PNG chunk framing on the `sparkles:wired` that ships today.
*
* The fixed-layout records (the chunk header, `IHDR`, `cICP`, `acTL`,
* `fcTL`) are plain D structs with `@WireCheck` constraints. A small walker
* reads and writes them by following `wireSchemaOf!(BeFixed, T)` node by
* node, as a binary backend would: the schema supplies kinds, widths and
* array lengths; the format marker supplies the byte order, because a
* `SchemaNode` has none.
*
* Everything the schema cannot say is hand-written D, marked `GAP`: the
* signature, the length-prefixed chunk body, CRC-32 over type and data, the
* chunk-ordering rules, `PLTE`/`tRNS` presence and length that depend on
* the colour type, the `IDAT` run that forms one zlib stream and its
* expected inflated size, and APNG sequence numbers.
*
* Backs ../index.md (section "PNG"). Run with:
* `dub run --single png-chunks.d`
*/
module (module) images_wired_png_chunksPNG chunk framing on the sparkles:wired that ships today.
The fixed-layout records (the chunk header, IHDR, cICP, acTL,
fcTL) are plain D structs with @WireCheck constraints. A small walker
reads and writes them by following wireSchemaOf!(BeFixed, T) node by
node, as a binary backend would: the schema supplies kinds, widths and
array lengths; the format marker supplies the byte order, because a
SchemaNode has none.
Everything the schema cannot say is hand-written D, marked GAP: the
signature, the length-prefixed chunk body, CRC-32 over type and data, the
chunk-ordering rules, PLTE/tRNS presence and length that depend on
the colour type, the IDAT run that forms one zlib stream and its
expected inflated size, and APNG sequence numbers.
Backs ../index.md (section "PNG"). Run with:
dub run --single png-chunks.d
images_wired_png_chunks;
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_png_chunks.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_png_chunks.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_png_chunks.OriginalType = std.traits.OriginalType(T)Strips off all enums from type T.
OriginalType;
import (package) stdstd.(module) std.zlibCompress/decompress data using the zlib library.
Examples
If you have a small buffer you can use compress and
uncompress directly.
import std.zlib;
auto src =
"the quick brown fox jumps over the lazy dog\r
the quick brown fox jumps over the lazy dog\r";
ubyte[] dst;
ubyte[] result;
dst = compress(src);
result = cast(ubyte[]) uncompress(dst);
assert(result == src);
When the data to be compressed doesn't fit in one buffer, use
Compress and UnCompress.
import std.zlib;
import std.stdio;
import std.conv : to;
import std.algorithm.iteration : map;
UnCompress decmp = new UnCompress;
foreach (chunk; stdin.byChunk(4096).map!(x => decmp.uncompress(x)))
{
chunk.to!string.write;
}
References
Source
std/zlib.d
zlib : (alias) images_wired_png_chunks.compress = ubyte[] std.zlib.compress(const(void)[] srcbuf, int level)Compress data
compress, (class) std.zlib.UnCompressUsed when the data to be decompressed is not all in one buffer.
UnCompress;
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_png_chunks.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_png_chunks.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_png_chunks.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_png_chunks.isBetween = sparkles.wired.policy.isBetween(alias lower, alias upper)Declarative inclusive-bound check usable as a WireCheck predicate.
isBetween, (alias template) images_wired_png_chunks.isOneOf = sparkles.wired.policy.isOneOf(values...)Declarative membership check usable as a WireCheck predicate.
isOneOf, (alias struct) images_wired_png_chunks.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_png_chunks.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_png_chunks.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_png_chunks.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_png_chunks.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_png_chunks.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_png_chunks.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_png_chunks.BeFixed.validateWireSchema(T, alias schema)validateWireSchema(T, alias schema)
{
enum bool (constant) bool images_wired_png_chunks.BeFixed.validateWireSchema!(images_wired_png_chunks.Cicp, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Cicp", "", null, false, false, 0LU, 4LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colourPrimaries", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("colourPrimaries", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "transferFunction", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("transferFunction", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "matrixCoefficients", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("matrixCoefficients", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "videoFullRange", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("videoFullRange", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU, 4LU], [SchemaAnnotation("WireCheck!(isOneOf, \"matrix coefficients must be 0 for RGB\", AnyFormat)", "WireCheck!(isOneOf, \"matrix coefficients must be 0 for RGB\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"\", AnyFormat)", "WireCheck!(isOneOf, \"\", AnyFormat)")], ["colourPrimaries", "transferFunction", "matrixCoefficients", "videoFullRange"])) = truevalidateWireSchema = long images_wired_png_chunks.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_png_chunks.BeFixed, images_wired_png_chunks.Cicp) = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Cicp", "", null, false, false, 0LU, 4LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colourPrimaries", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("colourPrimaries", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "transferFunction", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("transferFunction", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "matrixCoefficients", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("matrixCoefficients", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "videoFullRange", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("videoFullRange", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU, 4LU], [SchemaAnnotation("WireCheck!(isOneOf, \"matrix coefficients must be 0 for RGB\", AnyFormat)", "WireCheck!(isOneOf, \"matrix coefficients must be 0 for RGB\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"\", AnyFormat)", "WireCheck!(isOneOf, \"\", AnyFormat)")], ["colourPrimaries", "transferFunction", "matrixCoefficients", "videoFullRange"])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_png_chunks.BinErrorKindBinErrorKind : ubyte
{
(enum value) images_wired_png_chunks.BinErrorKind.none = cast(ubyte)0unone,
(enum value) images_wired_png_chunks.BinErrorKind.truncated = 1truncated,
(enum value) images_wired_png_chunks.BinErrorKind.notAMember = 2notAMember,
(enum value) images_wired_png_chunks.BinErrorKind.checkFailed = 3checkFailed,
(enum value) images_wired_png_chunks.BinErrorKind.badSignature = 4badSignature,
(enum value) images_wired_png_chunks.BinErrorKind.badCrc = 5badCrc,
(enum value) images_wired_png_chunks.BinErrorKind.badOrder = 6badOrder,
(enum value) images_wired_png_chunks.BinErrorKind.badLength = 7badLength,
(enum value) images_wired_png_chunks.BinErrorKind.missingChunk = 8missingChunk,
(enum value) images_wired_png_chunks.BinErrorKind.badSequence = 9badSequence,
(enum value) images_wired_png_chunks.BinErrorKind.badStream = 10badStream,
}
struct (struct) images_wired_png_chunks.BinErrorBinError
{
(enum) images_wired_png_chunks.BinErrorKindBinErrorKind (field) images_wired_png_chunks.BinErrorKind images_wired_png_chunks.BinError.kindkind;
(alias) object.size_t = ulongsize_t (field) ulong images_wired_png_chunks.BinError.offsetoffset;
(alias) object.string = stringstring (field) string images_wired_png_chunks.BinError.whatwhat;
}
alias (alias) images_wired_png_chunks.BinResult!(images_wired_png_chunks.Cicp) = sparkles.base.expected.Expected!(Cicp, BinError, Abort)BinResult(T) = (struct) sparkles.base.expected.Expected!(images_wired_png_chunks.Cicp, images_wired_png_chunks.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_png_chunks.CicpT, (struct) images_wired_png_chunks.BinErrorBinError);
ulong ulong images_wired_png_chunks.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_png_chunks.BinErrorBinError images_wired_png_chunks.BinError images_wired_png_chunks.readNode!(uint, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Actl", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 1LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "numFrames", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("numFrames", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "numPlays", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("numPlays", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU], [SchemaAnnotation("WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)", "WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)")], ["numFrames", "numPlays"]), 2LU)(ref uint 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 = uintV (parameter) uint 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_png_chunks.readNode!(uint, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Actl", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 1LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "numFrames", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("numFrames", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "numPlays", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("numPlays", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU], [SchemaAnnotation("WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)", "WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)")], ["numFrames", "numPlays"]), 2LU).node = SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "numPlays", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("numPlays", null, false, false, false, WireSkip.never, WireInvalid.reject, 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_png_chunks.decodeFixed!(images_wired_png_chunks.Actl).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Actl", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 1LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "numFrames", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("numFrames", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "numPlays", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("numPlays", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU], [SchemaAnnotation("WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)", "WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)")], ["numFrames", "numPlays"])schema.(field) sparkles.wired.schema.SchemaNode[] sparkles.wired.schema.WireSchema.nodesnodes[(constant) ulong images_wired_png_chunks.index = 2LUindex];
static if ((constant) sparkles.wired.schema.SchemaNode images_wired_png_chunks.readNode!(uint, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Actl", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 1LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "numFrames", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("numFrames", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "numPlays", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("numPlays", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU], [SchemaAnnotation("WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)", "WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)")], ["numFrames", "numPlays"]), 2LU).node = SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "numPlays", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("numPlays", null, false, false, false, WireSkip.never, WireInvalid.reject, 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_png_chunks.readNode!(images_wired_png_chunks.ChunkHeader, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"]), 0LU).child = 1LUchild = (constant) sparkles.wired.schema.WireSchema images_wired_png_chunks.decodeFixed!(images_wired_png_chunks.Actl).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Actl", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 1LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "numFrames", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("numFrames", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "numPlays", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("numPlays", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU], [SchemaAnnotation("WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)", "WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)")], ["numFrames", "numPlays"])schema.(field) ulong[] sparkles.wired.schema.WireSchema.edgesedges[(constant) sparkles.wired.schema.SchemaNode images_wired_png_chunks.readNode!(images_wired_png_chunks.Actl, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Actl", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 1LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "numFrames", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("numFrames", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "numPlays", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("numPlays", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU], [SchemaAnnotation("WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)", "WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)")], ["numFrames", "numPlays"]), 0LU).node = SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Actl", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 1LU, 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_png_chunks.readNode!(images_wired_png_chunks.Actl, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Actl", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 1LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "numFrames", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("numFrames", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "numPlays", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("numPlays", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU], [SchemaAnnotation("WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)", "WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)")], ["numFrames", "numPlays"]), 0LU).i = 1LUi];
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_png_chunks.decodeFixed!(images_wired_png_chunks.ChunkHeader).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"])schema.(field) sparkles.wired.schema.SchemaNode[] sparkles.wired.schema.WireSchema.nodesnodes[(constant) ulong images_wired_png_chunks.readNode!(images_wired_png_chunks.ChunkHeader, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"]), 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_png_chunks.BinError ee = (constant) ulong images_wired_png_chunks.readNode!(images_wired_png_chunks.Actl, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Actl", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 1LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "numFrames", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("numFrames", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "numPlays", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("numPlays", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU], [SchemaAnnotation("WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)", "WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)")], ["numFrames", "numPlays"]), 0LU).child = 2LUreadNode!(typeof((field) uint images_wired_png_chunks.ChunkHeader.lengthV.tupleof[(constant) ulong images_wired_png_chunks.readNode!(images_wired_png_chunks.ChunkHeader, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"]), 0LU).i = 0LUi]), (constant) sparkles.wired.schema.WireSchema images_wired_png_chunks.decodeFixed!(images_wired_png_chunks.ChunkHeader).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"])schema, (constant) ulong images_wired_png_chunks.readNode!(images_wired_png_chunks.ChunkHeader, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"]), 0LU).child = 1LUchild)((parameter) images_wired_png_chunks.ChunkHeader valuevalue.tupleof[(constant) ulong images_wired_png_chunks.readNode!(images_wired_png_chunks.ChunkHeader, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"]), 0LU).i = 0LUi], (parameter) const(ubyte[]) bytesbytes, (parameter) ulong pospos, (local variable) const(string) fieldPathfieldPath);
if ((local variable) images_wired_png_chunks.BinError ee.(field) images_wired_png_chunks.BinErrorKind images_wired_png_chunks.BinError.kindkind != (enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.none = cast(ubyte)0unone)
return (local variable) images_wired_png_chunks.BinError ee;
auto (local variable) sparkles.wired.policy.WireCheckFailure[] failuresfailures = (constant) ulong images_wired_png_chunks.readNode!(images_wired_png_chunks.ChunkHeader, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"]), 0LU).i = 0LUwireCheckFailures!((struct) images_wired_png_chunks.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_png_chunks.ChunkHeaderV.tupleof[(constant) ulong images_wired_png_chunks.readNode!(images_wired_png_chunks.ChunkHeader, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"]), 0LU).i = 0LUi])((parameter) images_wired_png_chunks.ChunkHeader valuevalue.tupleof[(constant) ulong images_wired_png_chunks.readNode!(images_wired_png_chunks.ChunkHeader, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"]), 0LU).i = 0LUi]);
if ((local variable) sparkles.wired.policy.WireCheckFailure[] failuresfailures.(field) ulong sparkles.wired.policy.WireCheckFailure[].lengthlength)
return (struct) images_wired_png_chunks.BinErrorBinError((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.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_png_chunks.BinErrorBinError.(constant) images_wired_png_chunks.BinError images_wired_png_chunks.BinError.init = BinError(BinErrorKind.none, 0LU, null)init;
}
else static if ((constant) sparkles.wired.schema.SchemaNode images_wired_png_chunks.readNode!(uint, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Actl", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 1LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "numFrames", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("numFrames", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "numPlays", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("numPlays", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU], [SchemaAnnotation("WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)", "WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)")], ["numFrames", "numPlays"]), 2LU).node = SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "numPlays", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("numPlays", null, false, false, false, WireSkip.never, WireInvalid.reject, 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_png_chunks.readNode!(char[4], WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"]), 2LU).child = 3LUchild = (constant) sparkles.wired.schema.WireSchema images_wired_png_chunks.decodeFixed!(images_wired_png_chunks.ChunkHeader).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"])schema.(field) ulong[] sparkles.wired.schema.WireSchema.edgesedges[(constant) sparkles.wired.schema.SchemaNode images_wired_png_chunks.readNode!(char[4], WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"]), 2LU).node = SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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_png_chunks.readNode!(char[4], WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"]), 2LU).node = SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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_png_chunks.BinError ee = (constant) ulong images_wired_png_chunks.readNode!(char[4], WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"]), 2LU).child = 3LUreadNode!(typeof((parameter) char[4] valuevalue[0]), (constant) sparkles.wired.schema.WireSchema images_wired_png_chunks.decodeFixed!(images_wired_png_chunks.ChunkHeader).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"])schema, (constant) ulong images_wired_png_chunks.readNode!(char[4], WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"]), 2LU).child = 3LUchild)((parameter) char[4] valuevalue[(local variable) ulong kk], (parameter) const(ubyte[]) bytesbytes, (parameter) ulong pospos, (parameter) string pathpath);
if ((local variable) images_wired_png_chunks.BinError ee.(field) images_wired_png_chunks.BinErrorKind images_wired_png_chunks.BinError.kindkind != (enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.none = cast(ubyte)0unone)
return (local variable) images_wired_png_chunks.BinError ee;
}
return (struct) images_wired_png_chunks.BinErrorBinError.(constant) images_wired_png_chunks.BinError images_wired_png_chunks.BinError.init = BinError(BinErrorKind.none, 0LU, null)init;
}
else static if ((constant) sparkles.wired.schema.SchemaNode images_wired_png_chunks.readNode!(uint, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Actl", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 1LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "numFrames", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("numFrames", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "numPlays", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("numPlays", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU], [SchemaAnnotation("WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)", "WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)")], ["numFrames", "numPlays"]), 2LU).node = SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "numPlays", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("numPlays", null, false, false, false, WireSkip.never, WireInvalid.reject, 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 (local variable) const(ubyte) rawraw = cast((alias) std.traits.OriginalType!(images_wired_png_chunks.ColorType) = ubyteStrips off all enums from type T.
Examples
enum E : real { a = 0 } // NOTE: explicit initialization to 0 required during Enum init deprecation cycle
enum F : E { a = E.a }
alias G = const(F);
static assert(is(OriginalType!E == real));
static assert(is(OriginalType!F == real));
static assert(is(OriginalType!G == const real));
OriginalType!(alias) V = images_wired_png_chunks.ColorTypeV) ulong images_wired_png_chunks.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_png_chunks.readNode!(images_wired_png_chunks.ColorType, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Ihdr", "", null, false, false, 0LU, 7LU, 18446744073709551615LU, 0LU, 6LU, 1LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, 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, 1LU, 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", "bitDepth", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("bitDepth", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.enumeration, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ColorType", "colorType", null, true, false, 7LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy("colorType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "greyscale", "0", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy("greyscale", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "truecolor", "2", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy("truecolor", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "indexed", "3", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy("indexed", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "greyscaleAlpha", "4", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy("greyscaleAlpha", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "truecolorAlpha", "6", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy("truecolorAlpha", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "compression", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 3LU, 1LU, PolicySnapshot(FieldPolicy("compression", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "filter", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 4LU, 1LU, PolicySnapshot(FieldPolicy("filter", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "interlace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 5LU, 1LU, PolicySnapshot(FieldPolicy("interlace", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU, 4LU, 10LU, 11LU, 12LU, 5LU, 6LU, 7LU, 8LU, 9LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"\", AnyFormat)", "WireCheck!(isOneOf, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"\", AnyFormat)", "WireCheck!(isOneOf, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"\", AnyFormat)", "WireCheck!(isOneOf, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"\", AnyFormat)", "WireCheck!(isOneOf, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(depthAllowed, \"bit depth not allowed for colour type\", AnyFormat)", "WireCheck!(depthAllowed, \"bit depth not allowed for colour type\", AnyFormat)")], ["width", "height", "bitDepth", "colorType", "greyscale", "truecolor", "indexed", "greyscaleAlpha", "truecolorAlpha", "compression", "filter", "interlace"]), 4LU).node = SchemaNode(NodeKind.enumeration, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ColorType", "colorType", null, true, false, 7LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy("colorType", null, false, false, false, WireSkip.never, WireInvalid.reject, 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);
static foreach (member; EnumMembers!V)
if ((local variable) const(ubyte) rawraw == (enum value) images_wired_png_chunks.ColorType.greyscale = cast(ubyte)0umember)
{
(parameter) images_wired_png_chunks.ColorType valuevalue = (enum value) images_wired_png_chunks.ColorType.greyscale = cast(ubyte)0umember;
(parameter) ulong pospos += (constant) sparkles.wired.schema.SchemaNode images_wired_png_chunks.readNode!(images_wired_png_chunks.ColorType, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Ihdr", "", null, false, false, 0LU, 7LU, 18446744073709551615LU, 0LU, 6LU, 1LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, 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, 1LU, 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", "bitDepth", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("bitDepth", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.enumeration, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ColorType", "colorType", null, true, false, 7LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy("colorType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "greyscale", "0", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy("greyscale", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "truecolor", "2", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy("truecolor", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "indexed", "3", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy("indexed", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "greyscaleAlpha", "4", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy("greyscaleAlpha", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "truecolorAlpha", "6", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy("truecolorAlpha", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "compression", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 3LU, 1LU, PolicySnapshot(FieldPolicy("compression", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "filter", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 4LU, 1LU, PolicySnapshot(FieldPolicy("filter", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "interlace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 5LU, 1LU, PolicySnapshot(FieldPolicy("interlace", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU, 4LU, 10LU, 11LU, 12LU, 5LU, 6LU, 7LU, 8LU, 9LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"\", AnyFormat)", "WireCheck!(isOneOf, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"\", AnyFormat)", "WireCheck!(isOneOf, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"\", AnyFormat)", "WireCheck!(isOneOf, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"\", AnyFormat)", "WireCheck!(isOneOf, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(depthAllowed, \"bit depth not allowed for colour type\", AnyFormat)", "WireCheck!(depthAllowed, \"bit depth not allowed for colour type\", AnyFormat)")], ["width", "height", "bitDepth", "colorType", "greyscale", "truecolor", "indexed", "greyscaleAlpha", "truecolorAlpha", "compression", "filter", "interlace"]), 4LU).node = SchemaNode(NodeKind.enumeration, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ColorType", "colorType", null, true, false, 7LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy("colorType", null, false, false, false, WireSkip.never, WireInvalid.reject, 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_png_chunks.BinErrorBinError.(constant) images_wired_png_chunks.BinError images_wired_png_chunks.BinError.init = BinError(BinErrorKind.none, 0LU, null)init;
}
return (struct) images_wired_png_chunks.BinErrorBinError((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.notAMember = 2notAMember, (parameter) ulong pospos, (parameter) string pathpath);
}
else
{
(parameter) uint valuevalue = cast((alias) V = uintV) ulong images_wired_png_chunks.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_png_chunks.readNode!(uint, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Actl", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 1LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "numFrames", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("numFrames", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "numPlays", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("numPlays", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU], [SchemaAnnotation("WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)", "WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)")], ["numFrames", "numPlays"]), 2LU).node = SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "numPlays", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("numPlays", null, false, false, false, WireSkip.never, WireInvalid.reject, 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_png_chunks.readNode!(uint, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Actl", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 1LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "numFrames", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("numFrames", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "numPlays", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("numPlays", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU], [SchemaAnnotation("WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)", "WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)")], ["numFrames", "numPlays"]), 2LU).node = SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "numPlays", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("numPlays", null, false, false, false, WireSkip.never, WireInvalid.reject, 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_png_chunks.BinErrorBinError.(constant) images_wired_png_chunks.BinError images_wired_png_chunks.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_png_chunks.BinResult!(images_wired_png_chunks.Fctl) = sparkles.base.expected.Expected!(Fctl, BinError, Abort)BinResult!(alias) T = images_wired_png_chunks.FctlT sparkles.base.expected.Expected!(Fctl, BinError, Abort) images_wired_png_chunks.decodeFixed!(images_wired_png_chunks.Fctl)(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_png_chunks.decodeFixed!(images_wired_png_chunks.Fctl).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Fctl", "", null, false, false, 0LU, 9LU, 18446744073709551615LU, 0LU, 0LU, 1LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "sequenceNumber", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("sequenceNumber", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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, 0LU, 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, 0LU, 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)32u, NullAwareKind.none, "uint", "xOffset", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("xOffset", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "yOffset", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("yOffset", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)16u, NullAwareKind.none, "ushort", "delayNum", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("delayNum", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)16u, NullAwareKind.none, "ushort", "delayDen", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("delayDen", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.enumeration, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "DisposeOp", "disposeOp", null, true, false, 9LU, 3LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("disposeOp", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "none", "0", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("none", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "background", "1", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("background", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "previous", "2", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("previous", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.enumeration, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "BlendOp", "blendOp", null, true, false, 12LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("blendOp", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "source", "0", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("source", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "over", "1", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("over", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU, 4LU, 5LU, 6LU, 7LU, 8LU, 12LU, 9LU, 10LU, 11LU, 13LU, 14LU], [SchemaAnnotation("WireCheck!((f) => f.width > 0 && (f.height > 0), \"frame width and height must be > 0\", AnyFormat)", "WireCheck!((f) => f.width > 0 && (f.height > 0), \"frame width and height must be > 0\", AnyFormat)")], ["sequenceNumber", "width", "height", "xOffset", "yOffset", "delayNum", "delayDen", "disposeOp", "none", "background", "previous", "blendOp", "source", "over"])schema = (template instance) sparkles.wired.schema.wireSchemaOf!(images_wired_png_chunks.BeFixed, images_wired_png_chunks.Fctl)wireSchemaOf!((struct) images_wired_png_chunks.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_png_chunks.ActlT);
enum (alias) object.size_t = ulongsize_t (constant) ulong images_wired_png_chunks.decodeFixed!(images_wired_png_chunks.Fctl).size = 26LUsize = long images_wired_png_chunks.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_png_chunks.decodeFixed!(images_wired_png_chunks.Fctl).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Fctl", "", null, false, false, 0LU, 9LU, 18446744073709551615LU, 0LU, 0LU, 1LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "sequenceNumber", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("sequenceNumber", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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, 0LU, 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, 0LU, 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)32u, NullAwareKind.none, "uint", "xOffset", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("xOffset", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "yOffset", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("yOffset", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)16u, NullAwareKind.none, "ushort", "delayNum", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("delayNum", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)16u, NullAwareKind.none, "ushort", "delayDen", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("delayDen", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.enumeration, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "DisposeOp", "disposeOp", null, true, false, 9LU, 3LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("disposeOp", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "none", "0", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("none", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "background", "1", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("background", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "previous", "2", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("previous", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.enumeration, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "BlendOp", "blendOp", null, true, false, 12LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("blendOp", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "source", "0", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("source", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "over", "1", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("over", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU, 4LU, 5LU, 6LU, 7LU, 8LU, 12LU, 9LU, 10LU, 11LU, 13LU, 14LU], [SchemaAnnotation("WireCheck!((f) => f.width > 0 && (f.height > 0), \"frame width and height must be > 0\", AnyFormat)", "WireCheck!((f) => f.width > 0 && (f.height > 0), \"frame width and height must be > 0\", AnyFormat)")], ["sequenceNumber", "width", "height", "xOffset", "yOffset", "delayNum", "delayDen", "disposeOp", "none", "background", "previous", "blendOp", "source", "over"])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_png_chunks.decodeFixed!(images_wired_png_chunks.Fctl).size = 26LUsize)
return sparkles.base.expected.Expected!(Fctl, BinError, Abort) sparkles.base.expected.err!(images_wired_png_chunks.Fctl, sparkles.base.expected.Abort, images_wired_png_chunks.BinError)(images_wired_png_chunks.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_png_chunks.FctlT((struct) images_wired_png_chunks.BinErrorBinError((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.truncated = 1truncated, (parameter) ulong atat, (struct) images_wired_png_chunks.Fctl§11.3.6.2. The frame-region rule needs IHDR, so it cannot be a check here.
T.(constant) string images_wired_png_chunks.Fctl.stringof = "Fctl"stringof));
(alias) T = images_wired_png_chunks.FctlT (local variable) images_wired_png_chunks.Fctl valuevalue;
(alias) object.size_t = ulongsize_t (local variable) ulong pospos = (parameter) ulong atat;
auto (local variable) images_wired_png_chunks.BinError ee = images_wired_png_chunks.BinError images_wired_png_chunks.readNode!(images_wired_png_chunks.Fctl, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Fctl", "", null, false, false, 0LU, 9LU, 18446744073709551615LU, 0LU, 0LU, 1LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "sequenceNumber", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("sequenceNumber", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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, 0LU, 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, 0LU, 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)32u, NullAwareKind.none, "uint", "xOffset", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("xOffset", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "yOffset", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("yOffset", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)16u, NullAwareKind.none, "ushort", "delayNum", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("delayNum", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)16u, NullAwareKind.none, "ushort", "delayDen", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("delayDen", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.enumeration, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "DisposeOp", "disposeOp", null, true, false, 9LU, 3LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("disposeOp", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "none", "0", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("none", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "background", "1", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("background", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "previous", "2", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("previous", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.enumeration, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "BlendOp", "blendOp", null, true, false, 12LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("blendOp", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "source", "0", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("source", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "over", "1", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("over", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU, 4LU, 5LU, 6LU, 7LU, 8LU, 12LU, 9LU, 10LU, 11LU, 13LU, 14LU], [SchemaAnnotation("WireCheck!((f) => f.width > 0 && (f.height > 0), \"frame width and height must be > 0\", AnyFormat)", "WireCheck!((f) => f.width > 0 && (f.height > 0), \"frame width and height must be > 0\", AnyFormat)")], ["sequenceNumber", "width", "height", "xOffset", "yOffset", "delayNum", "delayDen", "disposeOp", "none", "background", "previous", "blendOp", "source", "over"]), 0LU)(ref images_wired_png_chunks.Fctl 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_png_chunks.FctlT, (constant) sparkles.wired.schema.WireSchema images_wired_png_chunks.decodeFixed!(images_wired_png_chunks.Fctl).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Fctl", "", null, false, false, 0LU, 9LU, 18446744073709551615LU, 0LU, 0LU, 1LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "sequenceNumber", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("sequenceNumber", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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, 0LU, 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, 0LU, 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)32u, NullAwareKind.none, "uint", "xOffset", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("xOffset", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "yOffset", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("yOffset", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)16u, NullAwareKind.none, "ushort", "delayNum", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("delayNum", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)16u, NullAwareKind.none, "ushort", "delayDen", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("delayDen", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.enumeration, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "DisposeOp", "disposeOp", null, true, false, 9LU, 3LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("disposeOp", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "none", "0", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("none", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "background", "1", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("background", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "previous", "2", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("previous", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.enumeration, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "BlendOp", "blendOp", null, true, false, 12LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("blendOp", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "source", "0", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("source", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "over", "1", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("over", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU, 4LU, 5LU, 6LU, 7LU, 8LU, 12LU, 9LU, 10LU, 11LU, 13LU, 14LU], [SchemaAnnotation("WireCheck!((f) => f.width > 0 && (f.height > 0), \"frame width and height must be > 0\", AnyFormat)", "WireCheck!((f) => f.width > 0 && (f.height > 0), \"frame width and height must be > 0\", AnyFormat)")], ["sequenceNumber", "width", "height", "xOffset", "yOffset", "delayNum", "delayDen", "disposeOp", "none", "background", "previous", "blendOp", "source", "over"])schema, 0)((local variable) images_wired_png_chunks.Fctl valuevalue, (parameter) const(ubyte[]) bytesbytes, (local variable) ulong pospos, "");
if ((local variable) images_wired_png_chunks.BinError ee.(field) images_wired_png_chunks.BinErrorKind images_wired_png_chunks.BinError.kindkind != (enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.none = cast(ubyte)0unone)
{
(local variable) images_wired_png_chunks.BinError ee.(field) string images_wired_png_chunks.BinError.whatwhat = (struct) images_wired_png_chunks.Fctl§11.3.6.2. The frame-region rule needs IHDR, so it cannot be a check here.
T.(constant) string images_wired_png_chunks.Fctl.stringof = "Fctl"stringof ~ "." ~ (local variable) images_wired_png_chunks.BinError ee.(field) string images_wired_png_chunks.BinError.whatwhat;
return sparkles.base.expected.Expected!(Fctl, BinError, Abort) sparkles.base.expected.err!(images_wired_png_chunks.Fctl, sparkles.base.expected.Abort, images_wired_png_chunks.BinError)(ref images_wired_png_chunks.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_png_chunks.FctlT((local variable) images_wired_png_chunks.BinError ee);
}
auto (local variable) sparkles.wired.policy.WireCheckFailure[] failuresfailures = sparkles.wired.policy.WireCheckFailure[] sparkles.wired.policy.wireCheckFailures!(images_wired_png_chunks.BeFixed, images_wired_png_chunks.Fctl, images_wired_png_chunks.Fctl)(in images_wired_png_chunks.Fctl value) pure nothrow @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_png_chunks.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_png_chunks.FctlT)((local variable) images_wired_png_chunks.Fctl valuevalue);
if ((local variable) sparkles.wired.policy.WireCheckFailure[] failuresfailures.(field) ulong sparkles.wired.policy.WireCheckFailure[].lengthlength)
return sparkles.base.expected.Expected!(Fctl, BinError, Abort) sparkles.base.expected.err!(images_wired_png_chunks.Fctl, sparkles.base.expected.Abort, images_wired_png_chunks.BinError)(images_wired_png_chunks.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_png_chunks.FctlT((struct) images_wired_png_chunks.BinErrorBinError((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.checkFailed = 3checkFailed, (parameter) ulong atat, (struct) images_wired_png_chunks.Fctl§11.3.6.2. The frame-region rule needs IHDR, so it cannot be a check here.
T.(constant) string images_wired_png_chunks.Fctl.stringof = "Fctl"stringof ~ ": " ~ (local variable) sparkles.wired.policy.WireCheckFailure[] failuresfailures[0].(field) string sparkles.wired.policy.WireCheckFailure.reasonreason));
return sparkles.base.expected.Expected!(Fctl, BinError, Abort) sparkles.base.expected.ok!(images_wired_png_chunks.BinError, sparkles.base.expected.Abort, images_wired_png_chunks.Fctl)(ref images_wired_png_chunks.Fctl value) pure nothrow @nogc @safeCreates an Expected object from an expected value, with type inference.
ok!(struct) images_wired_png_chunks.BinErrorBinError((local variable) images_wired_png_chunks.Fctl valuevalue);
}
void void images_wired_png_chunks.writeNode!(uint, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Actl", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 1LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "numFrames", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("numFrames", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "numPlays", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("numPlays", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU], [SchemaAnnotation("WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)", "WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)")], ["numFrames", "numPlays"]), 2LU)(in uint value, ref ubyte[] output) pure nothrow @safewriteNode(V, alias schema, size_t index)(in (alias) V = uintV (parameter) const(uint) valuevalue, ref ubyte[] (parameter) ubyte[] outputoutput)
{
enum (constant) sparkles.wired.schema.SchemaNode images_wired_png_chunks.writeNode!(uint, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Actl", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 1LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "numFrames", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("numFrames", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "numPlays", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("numPlays", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU], [SchemaAnnotation("WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)", "WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)")], ["numFrames", "numPlays"]), 2LU).node = SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "numPlays", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("numPlays", null, false, false, false, WireSkip.never, WireInvalid.reject, 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_png_chunks.encodeFixed!(images_wired_png_chunks.Actl).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Actl", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 1LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "numFrames", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("numFrames", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "numPlays", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("numPlays", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU], [SchemaAnnotation("WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)", "WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)")], ["numFrames", "numPlays"])schema.(field) sparkles.wired.schema.SchemaNode[] sparkles.wired.schema.WireSchema.nodesnodes[(constant) ulong images_wired_png_chunks.index = 2LUindex];
static if ((constant) sparkles.wired.schema.SchemaNode images_wired_png_chunks.writeNode!(uint, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Actl", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 1LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "numFrames", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("numFrames", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "numPlays", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("numPlays", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU], [SchemaAnnotation("WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)", "WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)")], ["numFrames", "numPlays"]), 2LU).node = SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "numPlays", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("numPlays", null, false, false, false, WireSkip.never, WireInvalid.reject, 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_png_chunks.writeNode!(uint, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"]), 1LU)(in uint value, ref ubyte[] output) pure nothrow @safewriteNode!(typeof((field) uint images_wired_png_chunks.ChunkHeader.lengthV.tupleof[(constant) ulong images_wired_png_chunks.writeNode!(images_wired_png_chunks.ChunkHeader, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"]), 0LU).i = 0LUi]), (constant) sparkles.wired.schema.WireSchema images_wired_png_chunks.encodeFixed!(images_wired_png_chunks.ChunkHeader).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"])schema, (constant) sparkles.wired.schema.WireSchema images_wired_png_chunks.encodeFixed!(images_wired_png_chunks.ChunkHeader).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"])schema.(constant) sparkles.wired.schema.WireSchema images_wired_png_chunks.encodeFixed!(images_wired_png_chunks.Actl).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Actl", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 1LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "numFrames", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("numFrames", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "numPlays", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("numPlays", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU], [SchemaAnnotation("WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)", "WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)")], ["numFrames", "numPlays"])edges[(constant) sparkles.wired.schema.SchemaNode images_wired_png_chunks.writeNode!(images_wired_png_chunks.Actl, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Actl", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 1LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "numFrames", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("numFrames", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "numPlays", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("numPlays", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU], [SchemaAnnotation("WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)", "WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)")], ["numFrames", "numPlays"]), 0LU).node = SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Actl", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 1LU, 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_png_chunks.writeNode!(images_wired_png_chunks.Actl, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Actl", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 1LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "numFrames", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("numFrames", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "numPlays", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("numPlays", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU], [SchemaAnnotation("WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)", "WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)")], ["numFrames", "numPlays"]), 0LU).i = 1LUi])(
(parameter) const(images_wired_png_chunks.ChunkHeader) valuevalue.tupleof[(constant) ulong images_wired_png_chunks.writeNode!(images_wired_png_chunks.ChunkHeader, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"]), 0LU).i = 0LUi], (parameter) ubyte[] outputoutput);
}
else static if ((constant) sparkles.wired.schema.SchemaNode images_wired_png_chunks.writeNode!(uint, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Actl", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 1LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "numFrames", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("numFrames", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "numPlays", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("numPlays", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU], [SchemaAnnotation("WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)", "WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)")], ["numFrames", "numPlays"]), 2LU).node = SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "numPlays", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("numPlays", null, false, false, false, WireSkip.never, WireInvalid.reject, 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_png_chunks.writeNode!(char[4], WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"]), 2LU).node = SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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_png_chunks.writeNode!(const(char), WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"]), 3LU)(in char value, ref ubyte[] output) pure nothrow @safewriteNode!(typeof((parameter) const(char[4]) valuevalue[0]), (constant) sparkles.wired.schema.WireSchema images_wired_png_chunks.encodeFixed!(images_wired_png_chunks.ChunkHeader).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"])schema, (constant) sparkles.wired.schema.WireSchema images_wired_png_chunks.encodeFixed!(images_wired_png_chunks.ChunkHeader).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"])schema.(constant) sparkles.wired.schema.WireSchema images_wired_png_chunks.encodeFixed!(images_wired_png_chunks.ChunkHeader).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"])edges[(constant) sparkles.wired.schema.SchemaNode images_wired_png_chunks.writeNode!(char[4], WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"]), 2LU).node = SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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_png_chunks.writeNode!(char[4], WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"]), 2LU).node = SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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(uint) valuevalue;
foreach_reverse ((local variable) int kk; 0 .. (constant) sparkles.wired.schema.SchemaNode images_wired_png_chunks.writeNode!(uint, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Actl", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 1LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "numFrames", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("numFrames", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "numPlays", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("numPlays", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU], [SchemaAnnotation("WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)", "WireCheck!(isBetween, \"num_frames must not be 0\", AnyFormat)")], ["numFrames", "numPlays"]), 2LU).node = SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "numPlays", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("numPlays", null, false, false, false, WireSkip.never, WireInvalid.reject, 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_png_chunks.encodeFixed!(images_wired_png_chunks.Fctl)(in images_wired_png_chunks.Fctl 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_png_chunks.FctlT (parameter) const(images_wired_png_chunks.Fctl) valuevalue, ref ubyte[] (parameter) ubyte[] outputoutput)
{
enum (constant) sparkles.wired.schema.WireSchema images_wired_png_chunks.encodeFixed!(images_wired_png_chunks.Fctl).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Fctl", "", null, false, false, 0LU, 9LU, 18446744073709551615LU, 0LU, 0LU, 1LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "sequenceNumber", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("sequenceNumber", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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, 0LU, 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, 0LU, 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)32u, NullAwareKind.none, "uint", "xOffset", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("xOffset", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "yOffset", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("yOffset", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)16u, NullAwareKind.none, "ushort", "delayNum", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("delayNum", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)16u, NullAwareKind.none, "ushort", "delayDen", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("delayDen", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.enumeration, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "DisposeOp", "disposeOp", null, true, false, 9LU, 3LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("disposeOp", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "none", "0", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("none", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "background", "1", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("background", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "previous", "2", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("previous", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.enumeration, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "BlendOp", "blendOp", null, true, false, 12LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("blendOp", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "source", "0", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("source", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "over", "1", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("over", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU, 4LU, 5LU, 6LU, 7LU, 8LU, 12LU, 9LU, 10LU, 11LU, 13LU, 14LU], [SchemaAnnotation("WireCheck!((f) => f.width > 0 && (f.height > 0), \"frame width and height must be > 0\", AnyFormat)", "WireCheck!((f) => f.width > 0 && (f.height > 0), \"frame width and height must be > 0\", AnyFormat)")], ["sequenceNumber", "width", "height", "xOffset", "yOffset", "delayNum", "delayDen", "disposeOp", "none", "background", "previous", "blendOp", "source", "over"])schema = (template instance) sparkles.wired.schema.wireSchemaOf!(images_wired_png_chunks.BeFixed, images_wired_png_chunks.Fctl)wireSchemaOf!((struct) images_wired_png_chunks.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_png_chunks.ActlT);
static foreach (i; 0 .. T.tupleof.length)
foreach ((parameter) sparkles.wired.policy.WireCheckFailure failurefailure; (constant) ulong images_wired_png_chunks.encodeFixed!(images_wired_png_chunks.Fctl).i = 0LUwireCheckFailures!((struct) images_wired_png_chunks.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_png_chunks.FctlT.tupleof[(constant) ulong images_wired_png_chunks.encodeFixed!(images_wired_png_chunks.Fctl).i = 0LUi])((parameter) const(images_wired_png_chunks.Fctl) valuevalue.tupleof[(constant) ulong images_wired_png_chunks.encodeFixed!(images_wired_png_chunks.Fctl).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_png_chunks.BeFixed, images_wired_png_chunks.Fctl, images_wired_png_chunks.Fctl)(in images_wired_png_chunks.Fctl value) pure nothrow @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_png_chunks.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_png_chunks.FctlT)((parameter) const(images_wired_png_chunks.Fctl) valuevalue))
return (local variable) sparkles.wired.policy.WireCheckFailure failurefailure.(field) string sparkles.wired.policy.WireCheckFailure.reasonreason;
void images_wired_png_chunks.writeNode!(images_wired_png_chunks.Fctl, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Fctl", "", null, false, false, 0LU, 9LU, 18446744073709551615LU, 0LU, 0LU, 1LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "sequenceNumber", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("sequenceNumber", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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, 0LU, 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, 0LU, 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)32u, NullAwareKind.none, "uint", "xOffset", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("xOffset", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "yOffset", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("yOffset", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)16u, NullAwareKind.none, "ushort", "delayNum", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("delayNum", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)16u, NullAwareKind.none, "ushort", "delayDen", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("delayDen", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.enumeration, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "DisposeOp", "disposeOp", null, true, false, 9LU, 3LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("disposeOp", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "none", "0", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("none", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "background", "1", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("background", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "previous", "2", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("previous", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.enumeration, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "BlendOp", "blendOp", null, true, false, 12LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("blendOp", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "source", "0", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("source", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "over", "1", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("over", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU, 4LU, 5LU, 6LU, 7LU, 8LU, 12LU, 9LU, 10LU, 11LU, 13LU, 14LU], [SchemaAnnotation("WireCheck!((f) => f.width > 0 && (f.height > 0), \"frame width and height must be > 0\", AnyFormat)", "WireCheck!((f) => f.width > 0 && (f.height > 0), \"frame width and height must be > 0\", AnyFormat)")], ["sequenceNumber", "width", "height", "xOffset", "yOffset", "delayNum", "delayDen", "disposeOp", "none", "background", "previous", "blendOp", "source", "over"]), 0LU)(in images_wired_png_chunks.Fctl value, ref ubyte[] output) pure nothrow @safewriteNode!((alias) T = images_wired_png_chunks.FctlT, (constant) sparkles.wired.schema.WireSchema images_wired_png_chunks.encodeFixed!(images_wired_png_chunks.Fctl).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Fctl", "", null, false, false, 0LU, 9LU, 18446744073709551615LU, 0LU, 0LU, 1LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "sequenceNumber", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("sequenceNumber", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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, 0LU, 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, 0LU, 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)32u, NullAwareKind.none, "uint", "xOffset", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("xOffset", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "yOffset", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("yOffset", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)16u, NullAwareKind.none, "ushort", "delayNum", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("delayNum", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)16u, NullAwareKind.none, "ushort", "delayDen", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("delayDen", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.enumeration, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "DisposeOp", "disposeOp", null, true, false, 9LU, 3LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("disposeOp", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "none", "0", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("none", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "background", "1", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("background", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "previous", "2", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("previous", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.enumeration, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "BlendOp", "blendOp", null, true, false, 12LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("blendOp", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "source", "0", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("source", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "over", "1", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("over", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU, 4LU, 5LU, 6LU, 7LU, 8LU, 12LU, 9LU, 10LU, 11LU, 13LU, 14LU], [SchemaAnnotation("WireCheck!((f) => f.width > 0 && (f.height > 0), \"frame width and height must be > 0\", AnyFormat)", "WireCheck!((f) => f.width > 0 && (f.height > 0), \"frame width and height must be > 0\", AnyFormat)")], ["sequenceNumber", "width", "height", "xOffset", "yOffset", "delayNum", "delayDen", "disposeOp", "none", "background", "previous", "blendOp", "source", "over"])schema, 0)((parameter) const(images_wired_png_chunks.Fctl) valuevalue, (parameter) ubyte[] outputoutput);
return null;
}
// ---------------------------------------------------------------------------
// PNG descriptions (W3C PNG Third Edition)
// ---------------------------------------------------------------------------
enum (enum) images_wired_png_chunks.ColorTypeColorType : ubyte
{
(enum value) images_wired_png_chunks.ColorType.greyscale = cast(ubyte)0ugreyscale = 0,
(enum value) images_wired_png_chunks.ColorType.truecolor = cast(ubyte)2utruecolor = 2,
(enum value) images_wired_png_chunks.ColorType.indexed = cast(ubyte)3uindexed = 3,
(enum value) images_wired_png_chunks.ColorType.greyscaleAlpha = cast(ubyte)4ugreyscaleAlpha = 4,
(enum value) images_wired_png_chunks.ColorType.truecolorAlpha = cast(ubyte)6utruecolorAlpha = 6,
}
/// Table 12 (§11.2.1): allowed bit depths per colour type.
bool bool images_wired_png_chunks.depthAllowed(in images_wired_png_chunks.Ihdr h) pure nothrow @nogc @safeTable 12 (§11.2.1): allowed bit depths per colour type.
depthAllowed(in (struct) images_wired_png_chunks.Ihdr§11.2.1. A PNG four-byte unsigned integer is at most 2^31 - 1 (§7.1).
Ihdr (parameter) const(images_wired_png_chunks.Ihdr) hh) @safe pure nothrow @nogc
{
final switch ((parameter) const(images_wired_png_chunks.Ihdr) hh.(field) images_wired_png_chunks.ColorType images_wired_png_chunks.Ihdr.colorTypecolorType)
{
case (enum) images_wired_png_chunks.ColorTypeColorType.(enum value) images_wired_png_chunks.ColorType.greyscale = cast(ubyte)0ugreyscale:
return true;
case (enum) images_wired_png_chunks.ColorTypeColorType.(enum value) images_wired_png_chunks.ColorType.indexed = cast(ubyte)3uindexed:
return (parameter) const(images_wired_png_chunks.Ihdr) hh.(field) ubyte images_wired_png_chunks.Ihdr.bitDepthbitDepth <= 8;
case (enum) images_wired_png_chunks.ColorTypeColorType.(enum value) images_wired_png_chunks.ColorType.truecolor = cast(ubyte)2utruecolor, (enum) images_wired_png_chunks.ColorTypeColorType.(enum value) images_wired_png_chunks.ColorType.greyscaleAlpha = cast(ubyte)4ugreyscaleAlpha, (enum) images_wired_png_chunks.ColorTypeColorType.(enum value) images_wired_png_chunks.ColorType.truecolorAlpha = cast(ubyte)6utruecolorAlpha:
return (parameter) const(images_wired_png_chunks.Ihdr) hh.(field) ubyte images_wired_png_chunks.Ihdr.bitDepthbitDepth >= 8;
}
}
/// §11.2.1. A PNG four-byte unsigned integer is at most 2^31 - 1 (§7.1).
@(template instance) sparkles.wired.policy.WireCheck!(depthAllowed, "bit depth not allowed for colour type", sparkles.metadata.wire.AnyFormat)WireCheck!(bool images_wired_png_chunks.depthAllowed(in images_wired_png_chunks.Ihdr h) pure nothrow @nogc @safeTable 12 (§11.2.1): allowed bit depths per colour type.
depthAllowed, "bit depth not allowed for colour type")
struct (struct) images_wired_png_chunks.Ihdr§11.2.1. A PNG four-byte unsigned integer is at most 2^31 - 1 (§7.1).
Ihdr
{
@(template instance) sparkles.wired.policy.WireCheck!(isBetween, "", sparkles.metadata.wire.AnyFormat)WireCheck!((template) sparkles.wired.policy.isBetween!(1u, 2147483647u)Declarative inclusive-bound check usable as a WireCheck predicate.
isBetween!(1u, 0x7FFF_FFFFu)) uint (field) uint images_wired_png_chunks.Ihdr.widthwidth;
@(template instance) sparkles.wired.policy.WireCheck!(isBetween, "", sparkles.metadata.wire.AnyFormat)WireCheck!((template) sparkles.wired.policy.isBetween!(1u, 2147483647u)Declarative inclusive-bound check usable as a WireCheck predicate.
isBetween!(1u, 0x7FFF_FFFFu)) uint (field) uint images_wired_png_chunks.Ihdr.heightheight;
@(template instance) sparkles.wired.policy.WireCheck!(isOneOf, "", sparkles.metadata.wire.AnyFormat)WireCheck!((template) sparkles.wired.policy.isOneOf!(1, 2, 4, 8, 16)Declarative membership check usable as a WireCheck predicate.
isOneOf!(1, 2, 4, 8, 16)) ubyte (field) ubyte images_wired_png_chunks.Ihdr.bitDepthbitDepth;
(enum) images_wired_png_chunks.ColorTypeColorType (field) images_wired_png_chunks.ColorType images_wired_png_chunks.Ihdr.colorTypecolorType;
@(template instance) sparkles.wired.policy.WireCheck!(isOneOf, "", sparkles.metadata.wire.AnyFormat)WireCheck!((template) sparkles.wired.policy.isOneOf!0Declarative membership check usable as a WireCheck predicate.
isOneOf!(0)) ubyte (field) ubyte images_wired_png_chunks.Ihdr.compressioncompression;
@(template instance) sparkles.wired.policy.WireCheck!(isOneOf, "", sparkles.metadata.wire.AnyFormat)WireCheck!((template) sparkles.wired.policy.isOneOf!0Declarative membership check usable as a WireCheck predicate.
isOneOf!(0)) ubyte (field) ubyte images_wired_png_chunks.Ihdr.filterfilter;
@(template instance) sparkles.wired.policy.WireCheck!(isOneOf, "", sparkles.metadata.wire.AnyFormat)WireCheck!((template) sparkles.wired.policy.isOneOf!(0, 1)Declarative membership check usable as a WireCheck predicate.
isOneOf!(0, 1)) ubyte (field) ubyte images_wired_png_chunks.Ihdr.interlaceinterlace;
}
bool bool images_wired_png_chunks.isChunkType(in char[4] t) pure nothrow @nogc @safeisChunkType(in char[4] (parameter) const(char[4]) tt) @safe pure nothrow @nogc
{
foreach ((parameter) const(char) cc; (parameter) const(char[4]) tt)
if (!(((local variable) const(char) cc >= 'A' && (local variable) const(char) cc <= 'Z') || ((local variable) const(char) cc >= 'a' && (local variable) const(char) cc <= 'z')))
return false;
return true;
}
/// §5.3: the part of a chunk the schema can describe.
struct images_wired_png_chunks.ChunkHeader ChunkHeaderChunkHeader
{
@(template instance) sparkles.wired.policy.WireCheck!(isBetween, "", sparkles.metadata.wire.AnyFormat)WireCheck!((template) sparkles.wired.policy.isBetween!(0u, 2147483647u)Declarative inclusive-bound check usable as a WireCheck predicate.
isBetween!(0u, 0x7FFF_FFFFu)) uint (field) uint images_wired_png_chunks.ChunkHeader.lengthlength;
@(template instance) sparkles.wired.policy.WireCheck!(isChunkType, "chunk type byte is not a letter", sparkles.metadata.wire.AnyFormat)WireCheck!(bool images_wired_png_chunks.isChunkType(in char[4] t) pure nothrow @nogc @safeisChunkType, "chunk type byte is not a letter") char[4] (field) char[4] images_wired_png_chunks.ChunkHeader.typetype;
}
/// §11.3.2.6.
struct (struct) images_wired_png_chunks.Cicp§11.3.2.6.
Cicp
{
ubyte (field) ubyte images_wired_png_chunks.Cicp.colourPrimariescolourPrimaries;
ubyte (field) ubyte images_wired_png_chunks.Cicp.transferFunctiontransferFunction;
@(template instance) sparkles.wired.policy.WireCheck!(isOneOf, "matrix coefficients must be 0 for RGB", sparkles.metadata.wire.AnyFormat)WireCheck!((template) sparkles.wired.policy.isOneOf!0Declarative membership check usable as a WireCheck predicate.
isOneOf!(0), "matrix coefficients must be 0 for RGB") ubyte (field) ubyte images_wired_png_chunks.Cicp.matrixCoefficientsmatrixCoefficients;
@(template instance) sparkles.wired.policy.WireCheck!(isOneOf, "", sparkles.metadata.wire.AnyFormat)WireCheck!((template) sparkles.wired.policy.isOneOf!(0, 1)Declarative membership check usable as a WireCheck predicate.
isOneOf!(0, 1)) ubyte (field) ubyte images_wired_png_chunks.Cicp.videoFullRangevideoFullRange;
}
/// §11.3.6.1: "0 is not a valid value".
struct (struct) images_wired_png_chunks.Actl§11.3.6.1: "0 is not a valid value".
Actl
{
@(template instance) sparkles.wired.policy.WireCheck!(isBetween, "num_frames must not be 0", sparkles.metadata.wire.AnyFormat)WireCheck!((template) sparkles.wired.policy.isBetween!(1u, 2147483647u)Declarative inclusive-bound check usable as a WireCheck predicate.
isBetween!(1u, 0x7FFF_FFFFu), "num_frames must not be 0") uint (field) uint images_wired_png_chunks.Actl.numFramesnumFrames;
uint (field) uint images_wired_png_chunks.Actl.numPlaysnumPlays;
}
enum (enum) images_wired_png_chunks.DisposeOpDisposeOp : ubyte { (enum value) images_wired_png_chunks.DisposeOp.none = cast(ubyte)0unone = 0, (enum value) images_wired_png_chunks.DisposeOp.background = cast(ubyte)1ubackground = 1, (enum value) images_wired_png_chunks.DisposeOp.previous = cast(ubyte)2uprevious = 2 }
enum (enum) images_wired_png_chunks.BlendOpBlendOp : ubyte { (enum value) images_wired_png_chunks.BlendOp.source = cast(ubyte)0usource = 0, (enum value) images_wired_png_chunks.BlendOp.over = cast(ubyte)1uover = 1 }
/// §11.3.6.2. The frame-region rule needs IHDR, so it cannot be a check here.
@(template instance) sparkles.wired.policy.WireCheck!((f) => f.width > 0 && (f.height > 0), "frame width and height must be > 0", sparkles.metadata.wire.AnyFormat)WireCheck!(f => f.width > 0 && f.height > 0, "frame width and height must be > 0")
struct (struct) images_wired_png_chunks.Fctl§11.3.6.2. The frame-region rule needs IHDR, so it cannot be a check here.
Fctl
{
uint (field) uint images_wired_png_chunks.Fctl.sequenceNumbersequenceNumber;
uint (field) uint images_wired_png_chunks.Fctl.widthwidth;
uint (field) uint images_wired_png_chunks.Fctl.heightheight;
uint (field) uint images_wired_png_chunks.Fctl.xOffsetxOffset;
uint (field) uint images_wired_png_chunks.Fctl.yOffsetyOffset;
ushort (field) ushort images_wired_png_chunks.Fctl.delayNumdelayNum;
ushort (field) ushort images_wired_png_chunks.Fctl.delayDendelayDen;
(enum) images_wired_png_chunks.DisposeOpDisposeOp (field) images_wired_png_chunks.DisposeOp images_wired_png_chunks.Fctl.disposeOpdisposeOp;
(enum) images_wired_png_chunks.BlendOpBlendOp (field) images_wired_png_chunks.BlendOp images_wired_png_chunks.Fctl.blendOpblendOp;
}
// ---------------------------------------------------------------------------
// GAP: everything below is hand-written
// ---------------------------------------------------------------------------
immutable ubyte[8] (immutable global) immutable(ubyte[8]) images_wired_png_chunks.pngSignaturepngSignature = [0x89, 'P', 'N', 'G', 0x0D, 0x0A, 0x1A, 0x0A];
/// GAP: CRC-32 of §5.5 (reflected, initialised to all ones, inverted), over
/// two ranges: the chunk type and the chunk data.
uint uint images_wired_png_chunks.crc32(in ubyte[] a, in ubyte[] b) pure nothrow @nogc @safeGAP
CRC-32 of §5.5 (reflected, initialised to all ones, inverted), over
two ranges: the chunk type and the chunk data.
crc32(in ubyte[] (parameter) const(ubyte[]) aa, in ubyte[] (parameter) const(ubyte[]) bb) @safe pure nothrow @nogc
{
uint (local variable) uint crccrc = 0xFFFF_FFFF;
const(ubyte)[][2] (local variable) const(ubyte)[][2] partsparts = [(parameter) const(ubyte[]) aa, (parameter) const(ubyte[]) bb];
foreach ((parameter) const(ubyte)[] partpart; (local variable) const(ubyte)[][2] partsparts)
foreach ((parameter) const(ubyte) octetoctet; (local variable) const(ubyte)[] partpart)
{
(local variable) uint crccrc ^= (local variable) const(ubyte) octetoctet;
foreach ((local variable) int __; 0 .. 8)
(local variable) uint crccrc = ((local variable) uint crccrc >> 1) ^ (0xEDB8_8320 & -((local variable) uint crccrc & 1));
}
return ~(local variable) uint crccrc;
}
struct (struct) images_wired_png_chunks.ChunkChunk
{
(struct) images_wired_png_chunks.ChunkHeader§5.3: the part of a chunk the schema can describe.
ChunkHeader (field) images_wired_png_chunks.ChunkHeader images_wired_png_chunks.Chunk.headerheader;
(alias) object.size_t = ulongsize_t (field) ulong images_wired_png_chunks.Chunk.startoffset of the length field
start; /// offset of the length field
const(ubyte)[] (field) const(ubyte)[] images_wired_png_chunks.Chunk.databorrowed from the input
data; /// borrowed from the input
}
/// GAP: a length-prefixed body and a trailing CRC over type and data.
(alias) images_wired_png_chunks.BinResult!(images_wired_png_chunks.Chunk) = sparkles.base.expected.Expected!(Chunk, BinError, Abort)BinResult!(struct) images_wired_png_chunks.ChunkChunk sparkles.base.expected.Expected!(Chunk, BinError, Abort) images_wired_png_chunks.readChunk(return scope const(ubyte)[] bytes, ulong at)GAP
a length-prefixed body and a trailing CRC over type and data.
readChunk(return scope const(ubyte)[] (parameter) const(ubyte)[] bytesbytes, (alias) object.size_t = ulongsize_t (parameter) ulong atat)
{
auto (local variable) sparkles.base.expected.Expected!(ChunkHeader, BinError, Abort) headerheader = sparkles.base.expected.Expected!(ChunkHeader, BinError, Abort) images_wired_png_chunks.decodeFixed!(images_wired_png_chunks.ChunkHeader)(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_png_chunks.ChunkHeader§5.3: the part of a chunk the schema can describe.
ChunkHeader((parameter) const(ubyte)[] bytesbytes, (parameter) ulong atat);
if ((local variable) sparkles.base.expected.Expected!(ChunkHeader, BinError, Abort) headerheader.bool sparkles.base.expected.Expected!(images_wired_png_chunks.ChunkHeader, images_wired_png_chunks.BinError, sparkles.base.expected.Abort).hasError!()() const pure nothrow @nogc @property @safeChecks if Expected has error
hasError)
return sparkles.base.expected.Expected!(Chunk, BinError, Abort) sparkles.base.expected.err!(images_wired_png_chunks.Chunk, sparkles.base.expected.Abort, images_wired_png_chunks.BinError)(ref images_wired_png_chunks.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!(struct) images_wired_png_chunks.ChunkChunk((local variable) sparkles.base.expected.Expected!(ChunkHeader, BinError, Abort) headerheader.inout(images_wired_png_chunks.BinError) sparkles.base.expected.Expected!(images_wired_png_chunks.ChunkHeader, images_wired_png_chunks.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);
const (local variable) const(ulong) dataStartdataStart = (parameter) ulong atat + 8;
const ulong (local variable) const(ulong) endend = cast(ulong) (local variable) const(ulong) dataStartdataStart + (local variable) sparkles.base.expected.Expected!(ChunkHeader, BinError, Abort) headerheader.inout(images_wired_png_chunks.ChunkHeader) sparkles.base.expected.Expected!(images_wired_png_chunks.ChunkHeader, images_wired_png_chunks.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.(field) uint images_wired_png_chunks.ChunkHeader.lengthlength + 4;
if ((local variable) const(ulong) endend > (parameter) const(ubyte)[] bytesbytes.(field) ulong const(ubyte)[].lengthlength)
return sparkles.base.expected.Expected!(Chunk, BinError, Abort) sparkles.base.expected.err!(images_wired_png_chunks.Chunk, sparkles.base.expected.Abort, images_wired_png_chunks.BinError)(images_wired_png_chunks.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!(struct) images_wired_png_chunks.ChunkChunk((struct) images_wired_png_chunks.BinErrorBinError((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.truncated = 1truncated, (parameter) ulong atat, (local variable) sparkles.base.expected.Expected!(ChunkHeader, BinError, Abort) headerheader.inout(images_wired_png_chunks.ChunkHeader) sparkles.base.expected.Expected!(images_wired_png_chunks.ChunkHeader, images_wired_png_chunks.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.(field) char[4] images_wired_png_chunks.ChunkHeader.typetype.string object.idup!char(char[] a) pure nothrow @property @safeProvide the .idup array property, which creates an immutable duplicate.
idup));
auto (local variable) const(ubyte)[] datadata = (parameter) const(ubyte)[] bytesbytes[(local variable) const(ulong) dataStartdataStart .. (local variable) const(ulong) dataStartdataStart + (local variable) sparkles.base.expected.Expected!(ChunkHeader, BinError, Abort) headerheader.inout(images_wired_png_chunks.ChunkHeader) sparkles.base.expected.Expected!(images_wired_png_chunks.ChunkHeader, images_wired_png_chunks.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.(field) uint images_wired_png_chunks.ChunkHeader.lengthlength];
const (local variable) const(uint) storedstored = cast(uint) ulong images_wired_png_chunks.readBe(in ubyte[] bytes, ulong at, ulong width) pure nothrow @nogc @safereadBe((parameter) const(ubyte)[] bytesbytes, (local variable) const(ulong) dataStartdataStart + (local variable) sparkles.base.expected.Expected!(ChunkHeader, BinError, Abort) headerheader.inout(images_wired_png_chunks.ChunkHeader) sparkles.base.expected.Expected!(images_wired_png_chunks.ChunkHeader, images_wired_png_chunks.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.(field) uint images_wired_png_chunks.ChunkHeader.lengthlength, 4);
if ((local variable) const(uint) storedstored != uint images_wired_png_chunks.crc32(in ubyte[] a, in ubyte[] b) pure nothrow @nogc @safeGAP
CRC-32 of §5.5 (reflected, initialised to all ones, inverted), over
two ranges: the chunk type and the chunk data.
crc32((parameter) const(ubyte)[] bytesbytes[(parameter) ulong atat + 4 .. (parameter) ulong atat + 8], (local variable) const(ubyte)[] datadata))
return sparkles.base.expected.Expected!(Chunk, BinError, Abort) sparkles.base.expected.err!(images_wired_png_chunks.Chunk, sparkles.base.expected.Abort, images_wired_png_chunks.BinError)(images_wired_png_chunks.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!(struct) images_wired_png_chunks.ChunkChunk((struct) images_wired_png_chunks.BinErrorBinError((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.badCrc = 5badCrc, (parameter) ulong atat, (local variable) sparkles.base.expected.Expected!(ChunkHeader, BinError, Abort) headerheader.inout(images_wired_png_chunks.ChunkHeader) sparkles.base.expected.Expected!(images_wired_png_chunks.ChunkHeader, images_wired_png_chunks.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.(field) char[4] images_wired_png_chunks.ChunkHeader.typetype.string object.idup!char(char[] a) pure nothrow @property @safeProvide the .idup array property, which creates an immutable duplicate.
idup));
return sparkles.base.expected.Expected!(Chunk, BinError, Abort) sparkles.base.expected.ok!(images_wired_png_chunks.BinError, sparkles.base.expected.Abort, images_wired_png_chunks.Chunk)(images_wired_png_chunks.Chunk value) pure nothrow @nogc @safeCreates an Expected object from an expected value, with type inference.
ok!(struct) images_wired_png_chunks.BinErrorBinError((struct) images_wired_png_chunks.ChunkChunk((local variable) sparkles.base.expected.Expected!(ChunkHeader, BinError, Abort) headerheader.inout(images_wired_png_chunks.ChunkHeader) sparkles.base.expected.Expected!(images_wired_png_chunks.ChunkHeader, images_wired_png_chunks.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, (parameter) ulong atat, (local variable) const(ubyte)[] datadata));
}
/// GAP: bytes per row plus the filter byte, times rows (§7.2, §9.2), for a
/// non-interlaced image: the output-size contract Wuffs calls `workbuf_len`.
ulong ulong images_wired_png_chunks.expectedInflated(uint width, uint height, in images_wired_png_chunks.Ihdr h) pure nothrow @nogc @safeGAP
bytes per row plus the filter byte, times rows (§7.2, §9.2), for a
non-interlaced image: the output-size contract Wuffs calls workbuf_len.
expectedInflated(uint (parameter) uint widthwidth, uint (parameter) uint heightheight, in (struct) images_wired_png_chunks.Ihdr§11.2.1. A PNG four-byte unsigned integer is at most 2^31 - 1 (§7.1).
Ihdr (parameter) const(images_wired_png_chunks.Ihdr) hh) @safe pure nothrow @nogc
{
static immutable ubyte[7] (immutable global) immutable(ubyte[7]) images_wired_png_chunks.expectedInflated.samplessamples = [1, 0, 3, 1, 2, 0, 4];
const ulong (local variable) const(ulong) bitsPerPixelbitsPerPixel = (immutable global) immutable(ubyte[7]) images_wired_png_chunks.expectedInflated.samplessamples[(parameter) const(images_wired_png_chunks.Ihdr) hh.(field) images_wired_png_chunks.ColorType images_wired_png_chunks.Ihdr.colorTypecolorType] * (parameter) const(images_wired_png_chunks.Ihdr) hh.(field) ubyte images_wired_png_chunks.Ihdr.bitDepthbitDepth;
return (parameter) uint heightheight * (1 + ((parameter) uint widthwidth * (local variable) const(ulong) bitsPerPixelbitsPerPixel + 7) / 8);
}
struct (struct) images_wired_png_chunks.SummarySummary
{
(struct) images_wired_png_chunks.Ihdr§11.2.1. A PNG four-byte unsigned integer is at most 2^31 - 1 (§7.1).
Ihdr (field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdrihdr;
(alias) object.size_t = ulongsize_t (field) ulong images_wired_png_chunks.Summary.chunkschunks;
(alias) object.size_t = ulongsize_t (field) ulong images_wired_png_chunks.Summary.idatChunksidatChunks;
(alias) object.size_t = ulongsize_t (field) ulong images_wired_png_chunks.Summary.paletteEntriespaletteEntries;
ulong (field) ulong images_wired_png_chunks.Summary.inflatedImageinflatedImage;
ulong (field) ulong images_wired_png_chunks.Summary.inflatedFramesinflatedFrames;
(struct) images_wired_png_chunks.Cicp§11.3.2.6.
Cicp (field) images_wired_png_chunks.Cicp images_wired_png_chunks.Summary.cicpcicp;
(struct) images_wired_png_chunks.Actl§11.3.6.1: "0 is not a valid value".
Actl (field) images_wired_png_chunks.Actl images_wired_png_chunks.Summary.actlactl;
(alias) object.size_t = ulongsize_t (field) ulong images_wired_png_chunks.Summary.framesframes;
}
/// GAP: the walk, the ordering rules of §5.6 Table 7, the colour-type
/// dependencies of §11.2.2 and §11.3.1.1, the IDAT run of §10.2, APNG
/// sequence numbers of §11.3.6.
(alias) images_wired_png_chunks.BinResult!(images_wired_png_chunks.Summary) = sparkles.base.expected.Expected!(Summary, BinError, Abort)BinResult!(struct) images_wired_png_chunks.SummarySummary sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng(in ubyte[] bytes)GAP
the walk, the ordering rules of §5.6 Table 7, the colour-type
dependencies of §11.2.2 and §11.3.1.1, the IDAT run of §10.2, APNG
sequence numbers of §11.3.6.
parsePng(in ubyte[] (parameter) const(ubyte[]) bytesbytes)
{
alias (alias template) images_wired_png_chunks.parsePng.fail = images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)fail = (kind, offset, what) => err!Summary(BinError(kind, offset, what));
alias (alias) images_wired_png_chunks.parsePng.relocate = sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L391_C11(images_wired_png_chunks.BinError e, ulong chunkAt) pure nothrow @nogc @saferelocate = ((struct) images_wired_png_chunks.BinErrorBinError (parameter) images_wired_png_chunks.BinError ee, (alias) object.size_t = ulongsize_t (parameter) ulong chunkAtchunkAt) =>
sparkles.base.expected.Expected!(Summary, BinError, Abort) sparkles.base.expected.err!(images_wired_png_chunks.Summary, sparkles.base.expected.Abort, images_wired_png_chunks.BinError)(images_wired_png_chunks.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!(struct) images_wired_png_chunks.SummarySummary((struct) images_wired_png_chunks.BinErrorBinError((parameter) images_wired_png_chunks.BinError ee.(field) images_wired_png_chunks.BinErrorKind images_wired_png_chunks.BinError.kindkind, (parameter) ulong chunkAtchunkAt + 8 + (parameter) images_wired_png_chunks.BinError ee.(field) ulong images_wired_png_chunks.BinError.offsetoffset, (parameter) images_wired_png_chunks.BinError ee.(field) string images_wired_png_chunks.BinError.whatwhat));
if ((parameter) const(ubyte[]) bytesbytes.(field) ulong const(ubyte[]).lengthlength < 8 || (parameter) const(ubyte[]) bytesbytes[0 .. 8] != (immutable global) immutable(ubyte[8]) images_wired_png_chunks.pngSignaturepngSignature[])
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, int offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.badSignature = 4badSignature, 0, "signature");
(struct) images_wired_png_chunks.SummarySummary (local variable) images_wired_png_chunks.Summary ss;
bool (local variable) bool sawPltesawPlte, (local variable) bool sawTrnssawTrns, (local variable) bool sawCicpsawCicp, (local variable) bool sawActlsawActl, (local variable) bool sawIdatsawIdat, (local variable) bool idatClosedidatClosed, (local variable) bool sawIendsawIend;
uint (local variable) uint nextSequencenextSequence;
auto (local variable) std.zlib.UnCompress imageimage = new (class) std.zlib.UnCompressUsed when the data to be decompressed is not all in one buffer.
UnCompress;
(class) std.zlib.UnCompressUsed when the data to be decompressed is not all in one buffer.
UnCompress (local variable) std.zlib.UnCompress frameframe;
(struct) images_wired_png_chunks.Fctl§11.3.6.2. The frame-region rule needs IHDR, so it cannot be a check here.
Fctl (local variable) images_wired_png_chunks.Fctl frameControlframeControl;
(alias) object.size_t = ulongsize_t (local variable) ulong pospos = 8;
while ((local variable) ulong pospos < (parameter) const(ubyte[]) bytesbytes.(field) ulong const(ubyte[]).lengthlength)
{
auto (local variable) sparkles.base.expected.Expected!(Chunk, BinError, Abort) cc = sparkles.base.expected.Expected!(Chunk, BinError, Abort) images_wired_png_chunks.readChunk(return scope const(ubyte)[] bytes, ulong at)GAP
a length-prefixed body and a trailing CRC over type and data.
readChunk((parameter) const(ubyte[]) bytesbytes, (local variable) ulong pospos);
if ((local variable) sparkles.base.expected.Expected!(Chunk, BinError, Abort) cc.bool sparkles.base.expected.Expected!(images_wired_png_chunks.Chunk, images_wired_png_chunks.BinError, sparkles.base.expected.Abort).hasError!()() const pure nothrow @nogc @property @safeChecks if Expected has error
hasError)
return sparkles.base.expected.Expected!(Summary, BinError, Abort) sparkles.base.expected.err!(images_wired_png_chunks.Summary, sparkles.base.expected.Abort, images_wired_png_chunks.BinError)(ref images_wired_png_chunks.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!(struct) images_wired_png_chunks.SummarySummary((local variable) sparkles.base.expected.Expected!(Chunk, BinError, Abort) cc.inout(images_wired_png_chunks.BinError) sparkles.base.expected.Expected!(images_wired_png_chunks.Chunk, images_wired_png_chunks.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);
const (local variable) const(images_wired_png_chunks.Chunk) chunkchunk = (local variable) sparkles.base.expected.Expected!(Chunk, BinError, Abort) cc.inout(images_wired_png_chunks.Chunk) sparkles.base.expected.Expected!(images_wired_png_chunks.Chunk, images_wired_png_chunks.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 (local variable) const(char[4]) typetype = (local variable) const(images_wired_png_chunks.Chunk) chunkchunk.(field) images_wired_png_chunks.ChunkHeader images_wired_png_chunks.Chunk.headerheader.(field) char[4] images_wired_png_chunks.ChunkHeader.typetype;
const (local variable) const(ulong) atat = (local variable) const(images_wired_png_chunks.Chunk) chunkchunk.(field) ulong images_wired_png_chunks.Chunk.startoffset of the length field
start;
(local variable) images_wired_png_chunks.Summary ss.(field) ulong images_wired_png_chunks.Summary.chunkschunks++;
if ((local variable) bool sawIendsawIend)
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, const(ulong) offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.badOrder = 6badOrder, (local variable) const(ulong) atat, "chunk after IEND");
if ((local variable) images_wired_png_chunks.Summary ss.(field) ulong images_wired_png_chunks.Summary.chunkschunks == 1 && (local variable) const(char[4]) typetype != "IHDR")
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, const(ulong) offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.badOrder = 6badOrder, (local variable) const(ulong) atat, "IHDR must be first");
if ((local variable) bool sawIdatsawIdat && (local variable) const(char[4]) typetype != "IDAT")
(local variable) bool idatClosedidatClosed = true;
switch ((local variable) const(char[4]) typetype[])
{
case "IHDR":
if ((local variable) images_wired_png_chunks.Summary ss.(field) ulong images_wired_png_chunks.Summary.chunkschunks != 1)
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, const(ulong) offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.badOrder = 6badOrder, (local variable) const(ulong) atat, "second IHDR");
if ((local variable) const(images_wired_png_chunks.Chunk) chunkchunk.(field) const(ubyte)[] images_wired_png_chunks.Chunk.databorrowed from the input
data.(field) ulong const(ubyte[]).lengthlength != 13)
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, const(ulong) offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.badLength = 7badLength, (local variable) const(ulong) atat, "IHDR");
auto (local variable) sparkles.base.expected.Expected!(Ihdr, BinError, Abort) hh = sparkles.base.expected.Expected!(Ihdr, BinError, Abort) images_wired_png_chunks.decodeFixed!(images_wired_png_chunks.Ihdr)(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_png_chunks.Ihdr§11.2.1. A PNG four-byte unsigned integer is at most 2^31 - 1 (§7.1).
Ihdr((local variable) const(images_wired_png_chunks.Chunk) chunkchunk.(field) const(ubyte)[] images_wired_png_chunks.Chunk.databorrowed from the input
data, 0);
if ((local variable) sparkles.base.expected.Expected!(Ihdr, BinError, Abort) hh.bool sparkles.base.expected.Expected!(images_wired_png_chunks.Ihdr, images_wired_png_chunks.BinError, sparkles.base.expected.Abort).hasError!()() const pure nothrow @nogc @property @safeChecks if Expected has error
hasError)
return relocate((local variable) sparkles.base.expected.Expected!(Ihdr, BinError, Abort) hh.inout(images_wired_png_chunks.BinError) sparkles.base.expected.Expected!(images_wired_png_chunks.Ihdr, images_wired_png_chunks.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, (local variable) const(ulong) atat);
(local variable) images_wired_png_chunks.Summary ss.(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdrihdr = (local variable) sparkles.base.expected.Expected!(Ihdr, BinError, Abort) hh.inout(images_wired_png_chunks.Ihdr) sparkles.base.expected.Expected!(images_wired_png_chunks.Ihdr, images_wired_png_chunks.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;
break;
case "PLTE":
if ((local variable) bool sawPltesawPlte || (local variable) bool sawIdatsawIdat)
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, const(ulong) offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.badOrder = 6badOrder, (local variable) const(ulong) atat, "PLTE must be once, before IDAT");
if ((local variable) images_wired_png_chunks.Summary ss.(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdrihdr.(field) images_wired_png_chunks.ColorType images_wired_png_chunks.Ihdr.colorTypecolorType == (enum) images_wired_png_chunks.ColorTypeColorType.(enum value) images_wired_png_chunks.ColorType.greyscale = cast(ubyte)0ugreyscale || (local variable) images_wired_png_chunks.Summary ss.(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdrihdr.(field) images_wired_png_chunks.ColorType images_wired_png_chunks.Ihdr.colorTypecolorType == (enum) images_wired_png_chunks.ColorTypeColorType.(enum value) images_wired_png_chunks.ColorType.greyscaleAlpha = cast(ubyte)4ugreyscaleAlpha)
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, const(ulong) offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.badOrder = 6badOrder, (local variable) const(ulong) atat, "PLTE forbidden for this colour type");
if ((local variable) const(images_wired_png_chunks.Chunk) chunkchunk.(field) const(ubyte)[] images_wired_png_chunks.Chunk.databorrowed from the input
data.(field) ulong const(ubyte[]).lengthlength == 0 || (local variable) const(images_wired_png_chunks.Chunk) chunkchunk.(field) const(ubyte)[] images_wired_png_chunks.Chunk.databorrowed from the input
data.(field) ulong const(ubyte[]).lengthlength % 3 || (local variable) const(images_wired_png_chunks.Chunk) chunkchunk.(field) const(ubyte)[] images_wired_png_chunks.Chunk.databorrowed from the input
data.(field) ulong const(ubyte[]).lengthlength / 3 > 256
|| ((local variable) images_wired_png_chunks.Summary ss.(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdrihdr.(field) images_wired_png_chunks.ColorType images_wired_png_chunks.Ihdr.colorTypecolorType == (enum) images_wired_png_chunks.ColorTypeColorType.(enum value) images_wired_png_chunks.ColorType.indexed = cast(ubyte)3uindexed && (local variable) const(images_wired_png_chunks.Chunk) chunkchunk.(field) const(ubyte)[] images_wired_png_chunks.Chunk.databorrowed from the input
data.(field) ulong const(ubyte[]).lengthlength / 3 > (1 << (local variable) images_wired_png_chunks.Summary ss.(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdrihdr.(field) ubyte images_wired_png_chunks.Ihdr.bitDepthbitDepth)))
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, const(ulong) offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.badLength = 7badLength, (local variable) const(ulong) atat, "PLTE");
(local variable) bool sawPltesawPlte = true;
(local variable) images_wired_png_chunks.Summary ss.(field) ulong images_wired_png_chunks.Summary.paletteEntriespaletteEntries = (local variable) const(images_wired_png_chunks.Chunk) chunkchunk.(field) const(ubyte)[] images_wired_png_chunks.Chunk.databorrowed from the input
data.(field) ulong const(ubyte[]).lengthlength / 3;
break;
case "tRNS":
if ((local variable) bool sawTrnssawTrns || (local variable) bool sawIdatsawIdat)
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, const(ulong) offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.badOrder = 6badOrder, (local variable) const(ulong) atat, "tRNS must be once, before IDAT");
final switch ((local variable) images_wired_png_chunks.Summary ss.(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdrihdr.(field) images_wired_png_chunks.ColorType images_wired_png_chunks.Ihdr.colorTypecolorType)
{
case (enum) images_wired_png_chunks.ColorTypeColorType.(enum value) images_wired_png_chunks.ColorType.greyscale = cast(ubyte)0ugreyscale:
if ((local variable) const(images_wired_png_chunks.Chunk) chunkchunk.(field) const(ubyte)[] images_wired_png_chunks.Chunk.databorrowed from the input
data.(field) ulong const(ubyte[]).lengthlength != 2)
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, const(ulong) offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.badLength = 7badLength, (local variable) const(ulong) atat, "tRNS");
break;
case (enum) images_wired_png_chunks.ColorTypeColorType.(enum value) images_wired_png_chunks.ColorType.truecolor = cast(ubyte)2utruecolor:
if ((local variable) const(images_wired_png_chunks.Chunk) chunkchunk.(field) const(ubyte)[] images_wired_png_chunks.Chunk.databorrowed from the input
data.(field) ulong const(ubyte[]).lengthlength != 6)
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, const(ulong) offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.badLength = 7badLength, (local variable) const(ulong) atat, "tRNS");
break;
case (enum) images_wired_png_chunks.ColorTypeColorType.(enum value) images_wired_png_chunks.ColorType.indexed = cast(ubyte)3uindexed:
if (!(local variable) bool sawPltesawPlte)
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, const(ulong) offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.badOrder = 6badOrder, (local variable) const(ulong) atat, "tRNS before PLTE");
if ((local variable) const(images_wired_png_chunks.Chunk) chunkchunk.(field) const(ubyte)[] images_wired_png_chunks.Chunk.databorrowed from the input
data.(field) ulong const(ubyte[]).lengthlength > (local variable) images_wired_png_chunks.Summary ss.(field) ulong images_wired_png_chunks.Summary.paletteEntriespaletteEntries)
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, const(ulong) offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.badLength = 7badLength, (local variable) const(ulong) atat, "tRNS longer than PLTE");
break;
case (enum) images_wired_png_chunks.ColorTypeColorType.(enum value) images_wired_png_chunks.ColorType.greyscaleAlpha = cast(ubyte)4ugreyscaleAlpha, (enum) images_wired_png_chunks.ColorTypeColorType.(enum value) images_wired_png_chunks.ColorType.truecolorAlpha = cast(ubyte)6utruecolorAlpha:
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, const(ulong) offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.badOrder = 6badOrder, (local variable) const(ulong) atat, "tRNS forbidden for this colour type");
}
(local variable) bool sawTrnssawTrns = true;
break;
case "cICP":
if ((local variable) bool sawCicpsawCicp || (local variable) bool sawPltesawPlte || (local variable) bool sawIdatsawIdat)
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, const(ulong) offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.badOrder = 6badOrder, (local variable) const(ulong) atat, "cICP must be once, before PLTE and IDAT");
if ((local variable) const(images_wired_png_chunks.Chunk) chunkchunk.(field) const(ubyte)[] images_wired_png_chunks.Chunk.databorrowed from the input
data.(field) ulong const(ubyte[]).lengthlength != 4)
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, const(ulong) offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.badLength = 7badLength, (local variable) const(ulong) atat, "cICP");
auto (local variable) sparkles.base.expected.Expected!(Cicp, BinError, Abort) vv = sparkles.base.expected.Expected!(Cicp, BinError, Abort) images_wired_png_chunks.decodeFixed!(images_wired_png_chunks.Cicp)(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_png_chunks.Cicp§11.3.2.6.
Cicp((local variable) const(images_wired_png_chunks.Chunk) chunkchunk.(field) const(ubyte)[] images_wired_png_chunks.Chunk.databorrowed from the input
data, 0);
if ((local variable) sparkles.base.expected.Expected!(Cicp, BinError, Abort) vv.bool sparkles.base.expected.Expected!(images_wired_png_chunks.Cicp, images_wired_png_chunks.BinError, sparkles.base.expected.Abort).hasError!()() const pure nothrow @nogc @property @safeChecks if Expected has error
hasError)
return relocate((local variable) sparkles.base.expected.Expected!(Cicp, BinError, Abort) vv.inout(images_wired_png_chunks.BinError) sparkles.base.expected.Expected!(images_wired_png_chunks.Cicp, images_wired_png_chunks.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, (local variable) const(ulong) atat);
(local variable) images_wired_png_chunks.Summary ss.(field) images_wired_png_chunks.Cicp images_wired_png_chunks.Summary.cicpcicp = (local variable) sparkles.base.expected.Expected!(Cicp, BinError, Abort) vv.inout(images_wired_png_chunks.Cicp) sparkles.base.expected.Expected!(images_wired_png_chunks.Cicp, images_wired_png_chunks.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) bool sawCicpsawCicp = true;
break;
case "acTL":
if ((local variable) bool sawActlsawActl || (local variable) bool sawIdatsawIdat)
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, const(ulong) offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.badOrder = 6badOrder, (local variable) const(ulong) atat, "acTL must be once, before IDAT");
if ((local variable) const(images_wired_png_chunks.Chunk) chunkchunk.(field) const(ubyte)[] images_wired_png_chunks.Chunk.databorrowed from the input
data.(field) ulong const(ubyte[]).lengthlength != 8)
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, const(ulong) offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.badLength = 7badLength, (local variable) const(ulong) atat, "acTL");
auto (local variable) sparkles.base.expected.Expected!(Actl, BinError, Abort) vv = sparkles.base.expected.Expected!(Actl, BinError, Abort) images_wired_png_chunks.decodeFixed!(images_wired_png_chunks.Actl)(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_png_chunks.Actl§11.3.6.1: "0 is not a valid value".
Actl((local variable) const(images_wired_png_chunks.Chunk) chunkchunk.(field) const(ubyte)[] images_wired_png_chunks.Chunk.databorrowed from the input
data, 0);
if ((local variable) sparkles.base.expected.Expected!(Actl, BinError, Abort) vv.bool sparkles.base.expected.Expected!(images_wired_png_chunks.Actl, images_wired_png_chunks.BinError, sparkles.base.expected.Abort).hasError!()() const pure nothrow @nogc @property @safeChecks if Expected has error
hasError)
return relocate((local variable) sparkles.base.expected.Expected!(Actl, BinError, Abort) vv.inout(images_wired_png_chunks.BinError) sparkles.base.expected.Expected!(images_wired_png_chunks.Actl, images_wired_png_chunks.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, (local variable) const(ulong) atat);
(local variable) images_wired_png_chunks.Summary ss.(field) images_wired_png_chunks.Actl images_wired_png_chunks.Summary.actlactl = (local variable) sparkles.base.expected.Expected!(Actl, BinError, Abort) vv.inout(images_wired_png_chunks.Actl) sparkles.base.expected.Expected!(images_wired_png_chunks.Actl, images_wired_png_chunks.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) bool sawActlsawActl = true;
break;
case "fcTL":
if ((local variable) const(images_wired_png_chunks.Chunk) chunkchunk.(field) const(ubyte)[] images_wired_png_chunks.Chunk.databorrowed from the input
data.(field) ulong const(ubyte[]).lengthlength != 26)
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, const(ulong) offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.badLength = 7badLength, (local variable) const(ulong) atat, "fcTL");
auto (local variable) sparkles.base.expected.Expected!(Fctl, BinError, Abort) vv = sparkles.base.expected.Expected!(Fctl, BinError, Abort) images_wired_png_chunks.decodeFixed!(images_wired_png_chunks.Fctl)(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_png_chunks.Fctl§11.3.6.2. The frame-region rule needs IHDR, so it cannot be a check here.
Fctl((local variable) const(images_wired_png_chunks.Chunk) chunkchunk.(field) const(ubyte)[] images_wired_png_chunks.Chunk.databorrowed from the input
data, 0);
if ((local variable) sparkles.base.expected.Expected!(Fctl, BinError, Abort) vv.bool sparkles.base.expected.Expected!(images_wired_png_chunks.Fctl, images_wired_png_chunks.BinError, sparkles.base.expected.Abort).hasError!()() const pure nothrow @nogc @property @safeChecks if Expected has error
hasError)
return relocate((local variable) sparkles.base.expected.Expected!(Fctl, BinError, Abort) vv.inout(images_wired_png_chunks.BinError) sparkles.base.expected.Expected!(images_wired_png_chunks.Fctl, images_wired_png_chunks.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, (local variable) const(ulong) atat);
if ((local variable) sparkles.base.expected.Expected!(Fctl, BinError, Abort) vv.inout(images_wired_png_chunks.Fctl) sparkles.base.expected.Expected!(images_wired_png_chunks.Fctl, images_wired_png_chunks.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.(field) uint images_wired_png_chunks.Fctl.sequenceNumbersequenceNumber != (local variable) uint nextSequencenextSequence++)
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, const(ulong) offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.badSequence = 9badSequence, (local variable) const(ulong) atat, "fcTL sequence_number");
// A cross-chunk check: the frame region lies inside IHDR's canvas.
if (cast(ulong) (local variable) sparkles.base.expected.Expected!(Fctl, BinError, Abort) vv.inout(images_wired_png_chunks.Fctl) sparkles.base.expected.Expected!(images_wired_png_chunks.Fctl, images_wired_png_chunks.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.(field) uint images_wired_png_chunks.Fctl.xOffsetxOffset + (local variable) sparkles.base.expected.Expected!(Fctl, BinError, Abort) vv.inout(images_wired_png_chunks.Fctl) sparkles.base.expected.Expected!(images_wired_png_chunks.Fctl, images_wired_png_chunks.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.(field) uint images_wired_png_chunks.Fctl.widthwidth > (local variable) images_wired_png_chunks.Summary ss.(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdrihdr.(field) uint images_wired_png_chunks.Ihdr.widthwidth
|| cast(ulong) (local variable) sparkles.base.expected.Expected!(Fctl, BinError, Abort) vv.inout(images_wired_png_chunks.Fctl) sparkles.base.expected.Expected!(images_wired_png_chunks.Fctl, images_wired_png_chunks.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.(field) uint images_wired_png_chunks.Fctl.yOffsetyOffset + (local variable) sparkles.base.expected.Expected!(Fctl, BinError, Abort) vv.inout(images_wired_png_chunks.Fctl) sparkles.base.expected.Expected!(images_wired_png_chunks.Fctl, images_wired_png_chunks.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.(field) uint images_wired_png_chunks.Fctl.heightheight > (local variable) images_wired_png_chunks.Summary ss.(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdrihdr.(field) uint images_wired_png_chunks.Ihdr.heightheight)
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, const(ulong) offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.checkFailed = 3checkFailed, (local variable) const(ulong) atat, "fcTL region outside IHDR");
if ((local variable) images_wired_png_chunks.Summary ss.(field) ulong images_wired_png_chunks.Summary.framesframes > 0 && !(local variable) bool sawIdatsawIdat)
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, const(ulong) offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.badOrder = 6badOrder, (local variable) const(ulong) atat, "only one fcTL may precede IDAT");
if ((local variable) std.zlib.UnCompress frameframe !is null)
(local variable) images_wired_png_chunks.Summary ss.(field) ulong images_wired_png_chunks.Summary.inflatedFramesinflatedFrames += (local variable) std.zlib.UnCompress frameframe.void[] std.zlib.UnCompress.flush()Decompress and return any remaining data.
The returned data should be appended to that returned by uncompress().
The UnCompress object cannot be used further.
flush().(field) ulong void[].lengthlength;
(local variable) std.zlib.UnCompress frameframe = (local variable) bool sawIdatsawIdat ? new (class) std.zlib.UnCompressUsed when the data to be decompressed is not all in one buffer.
UnCompress : null;
(local variable) images_wired_png_chunks.Fctl frameControlframeControl = (local variable) sparkles.base.expected.Expected!(Fctl, BinError, Abort) vv.inout(images_wired_png_chunks.Fctl) sparkles.base.expected.Expected!(images_wired_png_chunks.Fctl, images_wired_png_chunks.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) images_wired_png_chunks.Summary ss.(field) ulong images_wired_png_chunks.Summary.framesframes++;
break;
case "IDAT":
if ((local variable) bool idatClosedidatClosed)
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, const(ulong) offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.badOrder = 6badOrder, (local variable) const(ulong) atat, "IDAT chunks must be consecutive");
if ((local variable) images_wired_png_chunks.Summary ss.(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdrihdr.(field) images_wired_png_chunks.ColorType images_wired_png_chunks.Ihdr.colorTypecolorType == (enum) images_wired_png_chunks.ColorTypeColorType.(enum value) images_wired_png_chunks.ColorType.indexed = cast(ubyte)3uindexed && !(local variable) bool sawPltesawPlte)
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, const(ulong) offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.missingChunk = 8missingChunk, (local variable) const(ulong) atat, "PLTE required for indexed colour");
(local variable) bool sawIdatsawIdat = true;
(local variable) images_wired_png_chunks.Summary ss.(field) ulong images_wired_png_chunks.Summary.idatChunksidatChunks++;
// One zlib stream across every IDAT (§10.2): each body goes to the
// same inflater, nothing is concatenated in memory.
(local variable) images_wired_png_chunks.Summary ss.(field) ulong images_wired_png_chunks.Summary.inflatedImageinflatedImage += (local variable) std.zlib.UnCompress imageimage.const(void)[] std.zlib.UnCompress.uncompress(const(void)[] buf)Decompress the data in buf and return the decompressed data.
The buffers returned from successive calls to this should be concatenated
together.
uncompress((local variable) const(images_wired_png_chunks.Chunk) chunkchunk.(field) const(ubyte)[] images_wired_png_chunks.Chunk.databorrowed from the input
data).(field) ulong const(void)[].lengthlength;
break;
case "fdAT":
if (!(local variable) bool sawIdatsawIdat || (local variable) std.zlib.UnCompress frameframe is null)
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, const(ulong) offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.badOrder = 6badOrder, (local variable) const(ulong) atat, "fdAT before IDAT or without fcTL");
if ((local variable) const(images_wired_png_chunks.Chunk) chunkchunk.(field) const(ubyte)[] images_wired_png_chunks.Chunk.databorrowed from the input
data.(field) ulong const(ubyte[]).lengthlength < 4)
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, const(ulong) offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.badLength = 7badLength, (local variable) const(ulong) atat, "fdAT");
if (ulong images_wired_png_chunks.readBe(in ubyte[] bytes, ulong at, ulong width) pure nothrow @nogc @safereadBe((local variable) const(images_wired_png_chunks.Chunk) chunkchunk.(field) const(ubyte)[] images_wired_png_chunks.Chunk.databorrowed from the input
data, 0, 4) != (local variable) uint nextSequencenextSequence++)
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, const(ulong) offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.badSequence = 9badSequence, (local variable) const(ulong) atat, "fdAT sequence_number");
(local variable) images_wired_png_chunks.Summary ss.(field) ulong images_wired_png_chunks.Summary.inflatedFramesinflatedFrames += (local variable) std.zlib.UnCompress frameframe.const(void)[] std.zlib.UnCompress.uncompress(const(void)[] buf)Decompress the data in buf and return the decompressed data.
The buffers returned from successive calls to this should be concatenated
together.
uncompress((local variable) const(images_wired_png_chunks.Chunk) chunkchunk.(field) const(ubyte)[] images_wired_png_chunks.Chunk.databorrowed from the input
data[4 .. $]).(field) ulong const(void)[].lengthlength;
break;
case "IEND":
if ((local variable) const(images_wired_png_chunks.Chunk) chunkchunk.(field) const(ubyte)[] images_wired_png_chunks.Chunk.databorrowed from the input
data.(field) ulong const(ubyte[]).lengthlength != 0)
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, const(ulong) offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.badLength = 7badLength, (local variable) const(ulong) atat, "IEND");
(local variable) bool sawIendsawIend = true;
break;
default:
if (((local variable) const(char[4]) typetype[0] & 0x20) == 0)
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, const(ulong) offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.missingChunk = 8missingChunk, (local variable) const(ulong) atat, "unknown critical chunk");
break; // unknown ancillary chunks are skipped
}
(local variable) ulong pospos += 12 + (local variable) const(images_wired_png_chunks.Chunk) chunkchunk.(field) const(ubyte)[] images_wired_png_chunks.Chunk.databorrowed from the input
data.(field) ulong const(ubyte[]).lengthlength;
}
if (!(local variable) bool sawIendsawIend)
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, ulong offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.missingChunk = 8missingChunk, (local variable) ulong pospos, "IEND");
if (!(local variable) bool sawIdatsawIdat)
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, ulong offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.missingChunk = 8missingChunk, (local variable) ulong pospos, "IDAT");
(local variable) images_wired_png_chunks.Summary ss.(field) ulong images_wired_png_chunks.Summary.inflatedImageinflatedImage += (local variable) std.zlib.UnCompress imageimage.void[] std.zlib.UnCompress.flush()Decompress and return any remaining data.
The returned data should be appended to that returned by uncompress().
The UnCompress object cannot be used further.
flush().(field) ulong void[].lengthlength;
if ((local variable) std.zlib.UnCompress frameframe !is null)
(local variable) images_wired_png_chunks.Summary ss.(field) ulong images_wired_png_chunks.Summary.inflatedFramesinflatedFrames += (local variable) std.zlib.UnCompress frameframe.void[] std.zlib.UnCompress.flush()Decompress and return any remaining data.
The returned data should be appended to that returned by uncompress().
The UnCompress object cannot be used further.
flush().(field) ulong void[].lengthlength;
if ((local variable) images_wired_png_chunks.Summary ss.(field) ulong images_wired_png_chunks.Summary.inflatedImageinflatedImage != ulong images_wired_png_chunks.expectedInflated(uint width, uint height, in images_wired_png_chunks.Ihdr h) pure nothrow @nogc @safeGAP
bytes per row plus the filter byte, times rows (§7.2, §9.2), for a
non-interlaced image: the output-size contract Wuffs calls workbuf_len.
expectedInflated((local variable) images_wired_png_chunks.Summary ss.(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdrihdr.(field) uint images_wired_png_chunks.Ihdr.widthwidth, (local variable) images_wired_png_chunks.Summary ss.(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdrihdr.(field) uint images_wired_png_chunks.Ihdr.heightheight, (local variable) images_wired_png_chunks.Summary ss.(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdrihdr))
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, ulong offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.badStream = 10badStream, (local variable) ulong pospos, "IDAT stream size differs from IHDR");
if ((local variable) bool sawActlsawActl && (local variable) images_wired_png_chunks.Summary ss.(field) images_wired_png_chunks.Actl images_wired_png_chunks.Summary.actlactl.(field) uint images_wired_png_chunks.Actl.numFramesnumFrames != (local variable) images_wired_png_chunks.Summary ss.(field) ulong images_wired_png_chunks.Summary.framesframes)
return sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng.__lambda_L390_C11(__T2, __T3, __T4)(kind, offset, what)(images_wired_png_chunks.BinErrorKind kind, ulong offset, string what) pure nothrow @nogc @safefail((enum) images_wired_png_chunks.BinErrorKindBinErrorKind.(enum value) images_wired_png_chunks.BinErrorKind.checkFailed = 3checkFailed, (local variable) ulong pospos, "acTL num_frames differs from the fcTL count");
return sparkles.base.expected.Expected!(Summary, BinError, Abort) sparkles.base.expected.ok!(images_wired_png_chunks.BinError, sparkles.base.expected.Abort, images_wired_png_chunks.Summary)(ref images_wired_png_chunks.Summary value) pure nothrow @nogc @safeCreates an Expected object from an expected value, with type inference.
ok!(struct) images_wired_png_chunks.BinErrorBinError((local variable) images_wired_png_chunks.Summary ss);
}
// ---------------------------------------------------------------------------
// Building inputs in memory
// ---------------------------------------------------------------------------
/// GAP on encode: the length prefix and the CRC are computed by hand.
void void images_wired_png_chunks.putChunk(ref ubyte[] output, string type, in ubyte[] data)GAP on encode: the length prefix and the CRC are computed by hand.
putChunk(ref ubyte[] (parameter) ubyte[] outputoutput, (alias) object.string = stringstring (parameter) string typetype, in ubyte[] (parameter) const(ubyte[]) datadata)
{
(struct) images_wired_png_chunks.ChunkHeader§5.3: the part of a chunk the schema can describe.
ChunkHeader (local variable) images_wired_png_chunks.ChunkHeader headerheader;
(local variable) images_wired_png_chunks.ChunkHeader headerheader.(field) uint images_wired_png_chunks.ChunkHeader.lengthlength = cast(uint) (parameter) const(ubyte[]) datadata.(field) ulong const(ubyte[]).lengthlength;
(local variable) images_wired_png_chunks.ChunkHeader headerheader.(field) char[4] images_wired_png_chunks.ChunkHeader.typetype = (parameter) string typetype[0 .. 4];
const (local variable) const(string) refusedrefused = string images_wired_png_chunks.encodeFixed!(images_wired_png_chunks.ChunkHeader)(in images_wired_png_chunks.ChunkHeader 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((local variable) images_wired_png_chunks.ChunkHeader headerheader, (parameter) ubyte[] outputoutput);
assert((local variable) const(string) refusedrefused is null, (local variable) const(string) refusedrefused);
(parameter) ubyte[] outputoutput ~= (parameter) const(ubyte[]) datadata;
const (local variable) const(uint) crccrc = uint images_wired_png_chunks.crc32(in ubyte[] a, in ubyte[] b) pure nothrow @nogc @safeGAP
CRC-32 of §5.5 (reflected, initialised to all ones, inverted), over
two ranges: the chunk type and the chunk data.
crc32(cast(const(ubyte)[]) (parameter) string typetype, (parameter) const(ubyte[]) datadata);
foreach_reverse ((local variable) int kk; 0 .. 4)
(parameter) ubyte[] outputoutput ~= cast(ubyte)((local variable) const(uint) crccrc >> (8 * (local variable) int kk));
}
ubyte[] ubyte[] images_wired_png_chunks.fixedBytes!(images_wired_png_chunks.Ihdr)(in images_wired_png_chunks.Ihdr value) pure nothrow @safefixedBytes(T)(in (alias) T = images_wired_png_chunks.IhdrT (parameter) const(images_wired_png_chunks.Ihdr) valuevalue)
{
ubyte[] (local variable) ubyte[] outputoutput;
const (local variable) const(string) refusedrefused = string images_wired_png_chunks.encodeFixed!(images_wired_png_chunks.Ihdr)(in images_wired_png_chunks.Ihdr 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_png_chunks.Ihdr) valuevalue, (local variable) ubyte[] outputoutput);
assert((local variable) const(string) refusedrefused is null, (local variable) const(string) refusedrefused);
return (local variable) ubyte[] outputoutput;
}
ubyte[] ubyte[] images_wired_png_chunks.be32(uint v)be32(uint (parameter) uint vv) => [cast(ubyte)((parameter) uint vv >> 24), cast(ubyte)((parameter) uint vv >> 16), cast(ubyte)((parameter) uint vv >> 8), cast(ubyte) (parameter) uint vv];
enum (enum) images_wired_png_chunks.VariantVariant
{
(enum value) images_wired_png_chunks.Variant.valid = 0valid,
(enum value) images_wired_png_chunks.Variant.badCrc = 1badCrc,
(enum value) images_wired_png_chunks.Variant.badDepth = 2badDepth,
(enum value) images_wired_png_chunks.Variant.trnsBeforePlte = 3trnsBeforePlte,
(enum value) images_wired_png_chunks.Variant.splitIdat = 4splitIdat,
(enum value) images_wired_png_chunks.Variant.sequenceGap = 5sequenceGap,
(enum value) images_wired_png_chunks.Variant.frameOutside = 6frameOutside,
(enum value) images_wired_png_chunks.Variant.cicpMatrix = 7cicpMatrix,
(enum value) images_wired_png_chunks.Variant.truncated = 8truncated,
}
ubyte[] ubyte[] images_wired_png_chunks.buildPng(images_wired_png_chunks.Variant variant)buildPng((enum) images_wired_png_chunks.VariantVariant (parameter) images_wired_png_chunks.Variant variantvariant)
{
ubyte[] (local variable) ubyte[] pngpng = (immutable global) immutable(ubyte[8]) images_wired_png_chunks.pngSignaturepngSignature.ubyte[] object.dup!ubyte(const(ubyte)[] a) pure nothrow @property @safedup;
const (local variable) const(images_wired_png_chunks.Ihdr) ihdrihdr = (struct) images_wired_png_chunks.Ihdr§11.2.1. A PNG four-byte unsigned integer is at most 2^31 - 1 (§7.1).
Ihdr(4, 2, (parameter) images_wired_png_chunks.Variant variantvariant == (enum) images_wired_png_chunks.VariantVariant.(enum value) images_wired_png_chunks.Variant.badDepth = 2badDepth ? 16 : 8, (enum) images_wired_png_chunks.ColorTypeColorType.(enum value) images_wired_png_chunks.ColorType.indexed = cast(ubyte)3uindexed, 0, 0, 0);
ubyte[] (local variable) ubyte[] ihdrBytesihdrBytes;
// encodeFixed refuses depth 16 with indexed colour, so that variant
// writes the record without its checks.
if (string images_wired_png_chunks.encodeFixed!(images_wired_png_chunks.Ihdr)(in images_wired_png_chunks.Ihdr 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((local variable) const(images_wired_png_chunks.Ihdr) ihdrihdr, (local variable) ubyte[] ihdrBytesihdrBytes) !is null)
void images_wired_png_chunks.writeNode!(images_wired_png_chunks.Ihdr, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Ihdr", "", null, false, false, 0LU, 7LU, 18446744073709551615LU, 0LU, 6LU, 1LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, 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, 1LU, 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", "bitDepth", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("bitDepth", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.enumeration, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ColorType", "colorType", null, true, false, 7LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy("colorType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "greyscale", "0", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy("greyscale", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "truecolor", "2", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy("truecolor", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "indexed", "3", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy("indexed", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "greyscaleAlpha", "4", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy("greyscaleAlpha", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "truecolorAlpha", "6", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy("truecolorAlpha", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "compression", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 3LU, 1LU, PolicySnapshot(FieldPolicy("compression", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "filter", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 4LU, 1LU, PolicySnapshot(FieldPolicy("filter", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "interlace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 5LU, 1LU, PolicySnapshot(FieldPolicy("interlace", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU, 4LU, 10LU, 11LU, 12LU, 5LU, 6LU, 7LU, 8LU, 9LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"\", AnyFormat)", "WireCheck!(isOneOf, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"\", AnyFormat)", "WireCheck!(isOneOf, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"\", AnyFormat)", "WireCheck!(isOneOf, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"\", AnyFormat)", "WireCheck!(isOneOf, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(depthAllowed, \"bit depth not allowed for colour type\", AnyFormat)", "WireCheck!(depthAllowed, \"bit depth not allowed for colour type\", AnyFormat)")], ["width", "height", "bitDepth", "colorType", "greyscale", "truecolor", "indexed", "greyscaleAlpha", "truecolorAlpha", "compression", "filter", "interlace"]), 0LU)(in images_wired_png_chunks.Ihdr value, ref ubyte[] output) pure nothrow @safewriteNode!((struct) images_wired_png_chunks.Ihdr§11.2.1. A PNG four-byte unsigned integer is at most 2^31 - 1 (§7.1).
Ihdr, (constant) sparkles.wired.schema.WireSchema sparkles.wired.schema.wireSchemaOf!(images_wired_png_chunks.BeFixed, images_wired_png_chunks.Ihdr) = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Ihdr", "", null, false, false, 0LU, 7LU, 18446744073709551615LU, 0LU, 6LU, 1LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "width", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, 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, 1LU, 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", "bitDepth", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 2LU, 1LU, PolicySnapshot(FieldPolicy("bitDepth", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.enumeration, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ColorType", "colorType", null, true, false, 7LU, 5LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy("colorType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "greyscale", "0", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy("greyscale", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "truecolor", "2", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy("truecolor", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "indexed", "3", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy("indexed", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "greyscaleAlpha", "4", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy("greyscaleAlpha", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte", "truecolorAlpha", "6", true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 3LU, 0LU, PolicySnapshot(FieldPolicy("truecolorAlpha", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "compression", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 3LU, 1LU, PolicySnapshot(FieldPolicy("compression", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "filter", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 4LU, 1LU, PolicySnapshot(FieldPolicy("filter", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "interlace", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 5LU, 1LU, PolicySnapshot(FieldPolicy("interlace", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU, 4LU, 10LU, 11LU, 12LU, 5LU, 6LU, 7LU, 8LU, 9LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"\", AnyFormat)", "WireCheck!(isOneOf, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"\", AnyFormat)", "WireCheck!(isOneOf, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"\", AnyFormat)", "WireCheck!(isOneOf, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"\", AnyFormat)", "WireCheck!(isOneOf, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(depthAllowed, \"bit depth not allowed for colour type\", AnyFormat)", "WireCheck!(depthAllowed, \"bit depth not allowed for colour type\", AnyFormat)")], ["width", "height", "bitDepth", "colorType", "greyscale", "truecolor", "indexed", "greyscaleAlpha", "truecolorAlpha", "compression", "filter", "interlace"])Complete CTFE schema of T under format F.
wireSchemaOf!((struct) images_wired_png_chunks.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_png_chunks.Ihdr§11.2.1. A PNG four-byte unsigned integer is at most 2^31 - 1 (§7.1).
Ihdr), 0)((local variable) const(images_wired_png_chunks.Ihdr) ihdrihdr, (local variable) ubyte[] ihdrBytesihdrBytes);
void images_wired_png_chunks.putChunk(ref ubyte[] output, string type, in ubyte[] data)GAP on encode: the length prefix and the CRC are computed by hand.
putChunk((local variable) ubyte[] pngpng, "IHDR", (local variable) ubyte[] ihdrBytesihdrBytes);
if ((parameter) images_wired_png_chunks.Variant variantvariant == (enum) images_wired_png_chunks.VariantVariant.(enum value) images_wired_png_chunks.Variant.cicpMatrix = 7cicpMatrix)
{
ubyte[] (local variable) ubyte[] cicpBytescicpBytes; // matrix 1 fails a field check, so skip encode's checks
void images_wired_png_chunks.writeNode!(images_wired_png_chunks.Cicp, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Cicp", "", null, false, false, 0LU, 4LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colourPrimaries", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("colourPrimaries", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "transferFunction", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("transferFunction", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "matrixCoefficients", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("matrixCoefficients", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "videoFullRange", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("videoFullRange", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU, 4LU], [SchemaAnnotation("WireCheck!(isOneOf, \"matrix coefficients must be 0 for RGB\", AnyFormat)", "WireCheck!(isOneOf, \"matrix coefficients must be 0 for RGB\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"\", AnyFormat)", "WireCheck!(isOneOf, \"\", AnyFormat)")], ["colourPrimaries", "transferFunction", "matrixCoefficients", "videoFullRange"]), 0LU)(in images_wired_png_chunks.Cicp value, ref ubyte[] output) pure nothrow @safewriteNode!((struct) images_wired_png_chunks.Cicp§11.3.2.6.
Cicp, (constant) sparkles.wired.schema.WireSchema sparkles.wired.schema.wireSchemaOf!(images_wired_png_chunks.BeFixed, images_wired_png_chunks.Cicp) = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "Cicp", "", null, false, false, 0LU, 4LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "colourPrimaries", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("colourPrimaries", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "transferFunction", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("transferFunction", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "matrixCoefficients", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("matrixCoefficients", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, 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", "videoFullRange", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("videoFullRange", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU, 4LU], [SchemaAnnotation("WireCheck!(isOneOf, \"matrix coefficients must be 0 for RGB\", AnyFormat)", "WireCheck!(isOneOf, \"matrix coefficients must be 0 for RGB\", AnyFormat)"), SchemaAnnotation("WireCheck!(isOneOf, \"\", AnyFormat)", "WireCheck!(isOneOf, \"\", AnyFormat)")], ["colourPrimaries", "transferFunction", "matrixCoefficients", "videoFullRange"])Complete CTFE schema of T under format F.
wireSchemaOf!((struct) images_wired_png_chunks.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_png_chunks.Cicp§11.3.2.6.
Cicp), 0)((struct) images_wired_png_chunks.Cicp§11.3.2.6.
Cicp(1, 13, 1, 1), (local variable) ubyte[] cicpBytescicpBytes);
void images_wired_png_chunks.putChunk(ref ubyte[] output, string type, in ubyte[] data)GAP on encode: the length prefix and the CRC are computed by hand.
putChunk((local variable) ubyte[] pngpng, "cICP", (local variable) ubyte[] cicpBytescicpBytes);
}
else
void images_wired_png_chunks.putChunk(ref ubyte[] output, string type, in ubyte[] data)GAP on encode: the length prefix and the CRC are computed by hand.
putChunk((local variable) ubyte[] pngpng, "cICP", ubyte[] images_wired_png_chunks.fixedBytes!(images_wired_png_chunks.Cicp)(in images_wired_png_chunks.Cicp value) pure nothrow @safefixedBytes((struct) images_wired_png_chunks.Cicp§11.3.2.6.
Cicp(1, 13, 0, 1)));
void images_wired_png_chunks.putChunk(ref ubyte[] output, string type, in ubyte[] data)GAP on encode: the length prefix and the CRC are computed by hand.
putChunk((local variable) ubyte[] pngpng, "acTL", ubyte[] images_wired_png_chunks.fixedBytes!(images_wired_png_chunks.Actl)(in images_wired_png_chunks.Actl value) pure nothrow @safefixedBytes((struct) images_wired_png_chunks.Actl§11.3.6.1: "0 is not a valid value".
Actl(2, 0)));
const ubyte[] (local variable) const(ubyte[]) palettepalette = [255, 0, 0, 0, 255, 0, 0, 0, 255];
const ubyte[] (local variable) const(ubyte[]) trnstrns = [0];
if ((parameter) images_wired_png_chunks.Variant variantvariant == (enum) images_wired_png_chunks.VariantVariant.(enum value) images_wired_png_chunks.Variant.trnsBeforePlte = 3trnsBeforePlte)
void images_wired_png_chunks.putChunk(ref ubyte[] output, string type, in ubyte[] data)GAP on encode: the length prefix and the CRC are computed by hand.
putChunk((local variable) ubyte[] pngpng, "tRNS", (local variable) const(ubyte[]) trnstrns);
void images_wired_png_chunks.putChunk(ref ubyte[] output, string type, in ubyte[] data)GAP on encode: the length prefix and the CRC are computed by hand.
putChunk((local variable) ubyte[] pngpng, "PLTE", (local variable) const(ubyte[]) palettepalette);
if ((parameter) images_wired_png_chunks.Variant variantvariant != (enum) images_wired_png_chunks.VariantVariant.(enum value) images_wired_png_chunks.Variant.trnsBeforePlte = 3trnsBeforePlte)
void images_wired_png_chunks.putChunk(ref ubyte[] output, string type, in ubyte[] data)GAP on encode: the length prefix and the CRC are computed by hand.
putChunk((local variable) ubyte[] pngpng, "tRNS", (local variable) const(ubyte[]) trnstrns);
void images_wired_png_chunks.putChunk(ref ubyte[] output, string type, in ubyte[] data)GAP on encode: the length prefix and the CRC are computed by hand.
putChunk((local variable) ubyte[] pngpng, "fcTL", ubyte[] images_wired_png_chunks.fixedBytes!(images_wired_png_chunks.Fctl)(in images_wired_png_chunks.Fctl value) pure nothrow @safefixedBytes((struct) images_wired_png_chunks.Fctl§11.3.6.2. The frame-region rule needs IHDR, so it cannot be a check here.
Fctl(0, 4, 2, 0, 0, 1, 10, (enum) images_wired_png_chunks.DisposeOpDisposeOp.(enum value) images_wired_png_chunks.DisposeOp.none = cast(ubyte)0unone, (enum) images_wired_png_chunks.BlendOpBlendOp.(enum value) images_wired_png_chunks.BlendOp.source = cast(ubyte)0usource)));
// Two rows of filter byte 0 plus four palette indices: one zlib stream
// split across two IDAT chunks.
const ubyte[] (local variable) const(ubyte[]) rowsrows = [0, 0, 1, 2, 0, 0, 2, 1, 0, 1];
const (local variable) const(ubyte[]) streamstream = cast(const(ubyte)[]) ubyte[] std.zlib.compress(const(void)[] srcbuf)Compress data
compress((local variable) const(ubyte[]) rowsrows);
const (local variable) const(ulong) halfhalf = (local variable) const(ubyte[]) streamstream.(field) ulong const(ubyte[]).lengthlength / 2;
void images_wired_png_chunks.putChunk(ref ubyte[] output, string type, in ubyte[] data)GAP on encode: the length prefix and the CRC are computed by hand.
putChunk((local variable) ubyte[] pngpng, "IDAT", (local variable) const(ubyte[]) streamstream[0 .. (local variable) const(ulong) halfhalf]);
if ((parameter) images_wired_png_chunks.Variant variantvariant == (enum) images_wired_png_chunks.VariantVariant.(enum value) images_wired_png_chunks.Variant.splitIdat = 4splitIdat)
void images_wired_png_chunks.putChunk(ref ubyte[] output, string type, in ubyte[] data)GAP on encode: the length prefix and the CRC are computed by hand.
putChunk((local variable) ubyte[] pngpng, "tEXt", cast(const(ubyte)[]) "Comment\0split");
void images_wired_png_chunks.putChunk(ref ubyte[] output, string type, in ubyte[] data)GAP on encode: the length prefix and the CRC are computed by hand.
putChunk((local variable) ubyte[] pngpng, "IDAT", (local variable) const(ubyte[]) streamstream[(local variable) const(ulong) halfhalf .. $]);
const (local variable) const(int) xOffsetxOffset = (parameter) images_wired_png_chunks.Variant variantvariant == (enum) images_wired_png_chunks.VariantVariant.(enum value) images_wired_png_chunks.Variant.frameOutside = 6frameOutside ? 3 : 1;
void images_wired_png_chunks.putChunk(ref ubyte[] output, string type, in ubyte[] data)GAP on encode: the length prefix and the CRC are computed by hand.
putChunk((local variable) ubyte[] pngpng, "fcTL", ubyte[] images_wired_png_chunks.fixedBytes!(images_wired_png_chunks.Fctl)(in images_wired_png_chunks.Fctl value) pure nothrow @safefixedBytes((struct) images_wired_png_chunks.Fctl§11.3.6.2. The frame-region rule needs IHDR, so it cannot be a check here.
Fctl(1, 2, 1, (local variable) const(int) xOffsetxOffset, 1, 1, 10, (enum) images_wired_png_chunks.DisposeOpDisposeOp.(enum value) images_wired_png_chunks.DisposeOp.background = cast(ubyte)1ubackground, (enum) images_wired_png_chunks.BlendOpBlendOp.(enum value) images_wired_png_chunks.BlendOp.over = cast(ubyte)1uover)));
const ubyte[] (local variable) const(ubyte[]) frameRowframeRow = [0, 2, 2];
void images_wired_png_chunks.putChunk(ref ubyte[] output, string type, in ubyte[] data)GAP on encode: the length prefix and the CRC are computed by hand.
putChunk((local variable) ubyte[] pngpng, "fdAT", ubyte[] images_wired_png_chunks.be32(uint v)be32((parameter) images_wired_png_chunks.Variant variantvariant == (enum) images_wired_png_chunks.VariantVariant.(enum value) images_wired_png_chunks.Variant.sequenceGap = 5sequenceGap ? 3 : 2)
~ cast(const(ubyte)[]) ubyte[] std.zlib.compress(const(void)[] srcbuf)Compress data
compress((local variable) const(ubyte[]) frameRowframeRow));
void images_wired_png_chunks.putChunk(ref ubyte[] output, string type, in ubyte[] data)GAP on encode: the length prefix and the CRC are computed by hand.
putChunk((local variable) ubyte[] pngpng, "IEND", null);
if ((parameter) images_wired_png_chunks.Variant variantvariant == (enum) images_wired_png_chunks.VariantVariant.(enum value) images_wired_png_chunks.Variant.badCrc = 1badCrc)
(local variable) ubyte[] pngpng[8 + 8 + 13] ^= 0x01; // a bit of IHDR's CRC
if ((parameter) images_wired_png_chunks.Variant variantvariant == (enum) images_wired_png_chunks.VariantVariant.(enum value) images_wired_png_chunks.Variant.truncated = 8truncated)
(local variable) ubyte[] pngpng = (local variable) ubyte[] pngpng[0 .. 8 + 8 + 6];
return (local variable) ubyte[] pngpng;
}
void void images_wired_png_chunks.report(string label, in ubyte[] bytes)report((alias) object.string = stringstring (parameter) string labellabel, in ubyte[] (parameter) const(ubyte[]) bytesbytes)
{
auto (local variable) sparkles.base.expected.Expected!(Summary, BinError, Abort) rr = sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng(in ubyte[] bytes)GAP
the walk, the ordering rules of §5.6 Table 7, the colour-type
dependencies of §11.2.2 and §11.3.1.1, the IDAT run of §10.2, APNG
sequence numbers of §11.3.6.
parsePng((parameter) const(ubyte[]) bytesbytes);
if ((local variable) sparkles.base.expected.Expected!(Summary, BinError, Abort) rr.bool sparkles.base.expected.Expected!(images_wired_png_chunks.Summary, images_wired_png_chunks.BinError, sparkles.base.expected.Abort).hasError!()() const pure nothrow @nogc @property @safeChecks if Expected has error
hasError)
void std.stdio.writefln!(char, string, images_wired_png_chunks.BinErrorKind, ulong, string)(in char[] fmt, string __param_1, images_wired_png_chunks.BinErrorKind __param_2, ulong __param_3, string __param_4) @safeEquivalent to writef(fmt, args, '\n').
writefln("png: %s: %s at offset %s (%s)", (parameter) string labellabel, (local variable) sparkles.base.expected.Expected!(Summary, BinError, Abort) rr.inout(images_wired_png_chunks.BinError) sparkles.base.expected.Expected!(images_wired_png_chunks.Summary, images_wired_png_chunks.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_png_chunks.BinErrorKind images_wired_png_chunks.BinError.kindkind, (local variable) sparkles.base.expected.Expected!(Summary, BinError, Abort) rr.inout(images_wired_png_chunks.BinError) sparkles.base.expected.Expected!(images_wired_png_chunks.Summary, images_wired_png_chunks.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) ulong images_wired_png_chunks.BinError.offsetoffset, (local variable) sparkles.base.expected.Expected!(Summary, BinError, Abort) rr.inout(images_wired_png_chunks.BinError) sparkles.base.expected.Expected!(images_wired_png_chunks.Summary, images_wired_png_chunks.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) string images_wired_png_chunks.BinError.whatwhat);
else
void std.stdio.writefln!(char, string)(in char[] fmt, string __param_1) @safeEquivalent to writef(fmt, args, '\n').
writefln("png: %s: ok", (parameter) string labellabel);
}
void void D main()main()
{
enum (constant) sparkles.wired.schema.WireSchema images_wired_png_chunks.main.headerSchema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"])headerSchema = (template instance) sparkles.wired.schema.wireSchemaOf!(images_wired_png_chunks.BeFixed, images_wired_png_chunks.ChunkHeader)wireSchemaOf!((struct) images_wired_png_chunks.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_png_chunks.ChunkHeader§5.3: the part of a chunk the schema can describe.
ChunkHeader);
void std.stdio.writefln!(char, long, long, long, long, long)(in char[] fmt, long __param_1, long __param_2, long __param_3, long __param_4, long __param_5) @safeEquivalent to writef(fmt, args, '\n').
writefln("png: schema sizes: ChunkHeader %s, IHDR %s, cICP %s, acTL %s, fcTL %s bytes",
long images_wired_png_chunks.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_png_chunks.main.headerSchema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"])headerSchema, 0), long images_wired_png_chunks.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((template instance) sparkles.wired.schema.wireSchemaOf!(images_wired_png_chunks.BeFixed, images_wired_png_chunks.Ihdr)wireSchemaOf!((struct) images_wired_png_chunks.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_png_chunks.Ihdr§11.2.1. A PNG four-byte unsigned integer is at most 2^31 - 1 (§7.1).
Ihdr), 0),
long images_wired_png_chunks.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((template instance) sparkles.wired.schema.wireSchemaOf!(images_wired_png_chunks.BeFixed, images_wired_png_chunks.Cicp)wireSchemaOf!((struct) images_wired_png_chunks.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_png_chunks.Cicp§11.3.2.6.
Cicp), 0), long images_wired_png_chunks.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((template instance) sparkles.wired.schema.wireSchemaOf!(images_wired_png_chunks.BeFixed, images_wired_png_chunks.Actl)wireSchemaOf!((struct) images_wired_png_chunks.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_png_chunks.Actl§11.3.6.1: "0 is not a valid value".
Actl), 0),
long images_wired_png_chunks.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((template instance) sparkles.wired.schema.wireSchemaOf!(images_wired_png_chunks.BeFixed, images_wired_png_chunks.Fctl)wireSchemaOf!((struct) images_wired_png_chunks.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_png_chunks.Fctl§11.3.6.2. The frame-region rule needs IHDR, so it cannot be a check here.
Fctl), 0));
// What a backend can learn about a check from the schema: a spelling.
void std.stdio.writefln!(char, string)(in char[] fmt, string __param_1) @safeEquivalent to writef(fmt, args, '\n').
writefln("png: schema annotation on ChunkHeader.length: %s",
(constant) sparkles.wired.schema.WireSchema images_wired_png_chunks.main.headerSchema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"])headerSchema.(field) sparkles.wired.schema.SchemaAnnotation[] sparkles.wired.schema.WireSchema.annotationsannotations[(constant) sparkles.wired.schema.WireSchema images_wired_png_chunks.main.headerSchema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ChunkHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 2LU, 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.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "length", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("length", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [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]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, 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, 1LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, 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, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isBetween, \"\", AnyFormat)", "WireCheck!(isBetween, \"\", AnyFormat)"), SchemaAnnotation("WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)", "WireCheck!(isChunkType, \"chunk type byte is not a letter\", AnyFormat)")], ["length", "type"])headerSchema.(field) sparkles.wired.schema.SchemaNode[] sparkles.wired.schema.WireSchema.nodesnodes[1].(field) ulong sparkles.wired.schema.SchemaNode.firstAnnotationfirstAnnotation].(field) string sparkles.wired.schema.SchemaAnnotation.valueCTFE spelling of the attached value
value);
const (local variable) const(ubyte[]) pngpng = ubyte[] images_wired_png_chunks.buildPng(images_wired_png_chunks.Variant variant)buildPng((enum) images_wired_png_chunks.VariantVariant.(enum value) images_wired_png_chunks.Variant.valid = 0valid);
auto (local variable) sparkles.base.expected.Expected!(Summary, BinError, Abort) rr = sparkles.base.expected.Expected!(Summary, BinError, Abort) images_wired_png_chunks.parsePng(in ubyte[] bytes)GAP
the walk, the ordering rules of §5.6 Table 7, the colour-type
dependencies of §11.2.2 and §11.3.1.1, the IDAT run of §10.2, APNG
sequence numbers of §11.3.6.
parsePng((local variable) const(ubyte[]) pngpng);
assert((local variable) sparkles.base.expected.Expected!(Summary, BinError, Abort) rr.bool sparkles.base.expected.Expected!(images_wired_png_chunks.Summary, images_wired_png_chunks.BinError, sparkles.base.expected.Abort).hasValue!()() const pure nothrow @nogc @property @safeChecks if Expected has value
hasValue);
const (local variable) const(images_wired_png_chunks.Summary) ss = (local variable) sparkles.base.expected.Expected!(Summary, BinError, Abort) rr.inout(images_wired_png_chunks.Summary) sparkles.base.expected.Expected!(images_wired_png_chunks.Summary, images_wired_png_chunks.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;
void std.stdio.writefln!(char, ulong, const(ulong), const(uint), const(uint), const(images_wired_png_chunks.ColorType), const(ubyte), const(ulong))(in char[] fmt, ulong __param_1, const(ulong) __param_2, const(uint) __param_3, const(uint) __param_4, const(images_wired_png_chunks.ColorType) __param_5, const(ubyte) __param_6, const(ulong) __param_7) @safeEquivalent to writef(fmt, args, '\n').
writefln("png: valid: %s bytes, %s chunks, IHDR %sx%s %s depth %s, %s palette entries",
(local variable) const(ubyte[]) pngpng.(field) ulong const(ubyte[]).lengthlength, (local variable) const(images_wired_png_chunks.Summary) ss.(field) ulong images_wired_png_chunks.Summary.chunkschunks, (local variable) const(images_wired_png_chunks.Summary) ss.(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdrihdr.(field) uint images_wired_png_chunks.Ihdr.widthwidth, (local variable) const(images_wired_png_chunks.Summary) ss.(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdrihdr.(field) uint images_wired_png_chunks.Ihdr.heightheight, (local variable) const(images_wired_png_chunks.Summary) ss.(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdrihdr.(field) images_wired_png_chunks.ColorType images_wired_png_chunks.Ihdr.colorTypecolorType, (local variable) const(images_wired_png_chunks.Summary) ss.(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdrihdr.(field) ubyte images_wired_png_chunks.Ihdr.bitDepthbitDepth,
(local variable) const(images_wired_png_chunks.Summary) ss.(field) ulong images_wired_png_chunks.Summary.paletteEntriespaletteEntries);
void std.stdio.writefln!(char, const(ubyte), const(ubyte), const(ubyte), const(ubyte), const(uint), const(uint), const(ulong))(in char[] fmt, const(ubyte) __param_1, const(ubyte) __param_2, const(ubyte) __param_3, const(ubyte) __param_4, const(uint) __param_5, const(uint) __param_6, const(ulong) __param_7) @safeEquivalent to writef(fmt, args, '\n').
writefln("png: valid: cICP %s/%s/%s/%s, acTL frames %s plays %s, fcTL seen %s",
(local variable) const(images_wired_png_chunks.Summary) ss.(field) images_wired_png_chunks.Cicp images_wired_png_chunks.Summary.cicpcicp.(field) ubyte images_wired_png_chunks.Cicp.colourPrimariescolourPrimaries, (local variable) const(images_wired_png_chunks.Summary) ss.(field) images_wired_png_chunks.Cicp images_wired_png_chunks.Summary.cicpcicp.(field) ubyte images_wired_png_chunks.Cicp.transferFunctiontransferFunction, (local variable) const(images_wired_png_chunks.Summary) ss.(field) images_wired_png_chunks.Cicp images_wired_png_chunks.Summary.cicpcicp.(field) ubyte images_wired_png_chunks.Cicp.matrixCoefficientsmatrixCoefficients,
(local variable) const(images_wired_png_chunks.Summary) ss.(field) images_wired_png_chunks.Cicp images_wired_png_chunks.Summary.cicpcicp.(field) ubyte images_wired_png_chunks.Cicp.videoFullRangevideoFullRange, (local variable) const(images_wired_png_chunks.Summary) ss.(field) images_wired_png_chunks.Actl images_wired_png_chunks.Summary.actlactl.(field) uint images_wired_png_chunks.Actl.numFramesnumFrames, (local variable) const(images_wired_png_chunks.Summary) ss.(field) images_wired_png_chunks.Actl images_wired_png_chunks.Summary.actlactl.(field) uint images_wired_png_chunks.Actl.numPlaysnumPlays, (local variable) const(images_wired_png_chunks.Summary) ss.(field) ulong images_wired_png_chunks.Summary.framesframes);
void std.stdio.writefln!(char, const(ulong), const(ulong), ulong, const(ulong))(in char[] fmt, const(ulong) __param_1, const(ulong) __param_2, ulong __param_3, const(ulong) __param_4) @safeEquivalent to writef(fmt, args, '\n').
writefln("png: valid: %s IDAT chunks -> one zlib stream of %s bytes (IHDR implies %s); fdAT frame %s bytes",
(local variable) const(images_wired_png_chunks.Summary) ss.(field) ulong images_wired_png_chunks.Summary.idatChunksidatChunks, (local variable) const(images_wired_png_chunks.Summary) ss.(field) ulong images_wired_png_chunks.Summary.inflatedImageinflatedImage, ulong images_wired_png_chunks.expectedInflated(uint width, uint height, in images_wired_png_chunks.Ihdr h) pure nothrow @nogc @safeGAP
bytes per row plus the filter byte, times rows (§7.2, §9.2), for a
non-interlaced image: the output-size contract Wuffs calls workbuf_len.
expectedInflated((local variable) const(images_wired_png_chunks.Summary) ss.(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdrihdr.(field) uint images_wired_png_chunks.Ihdr.widthwidth, (local variable) const(images_wired_png_chunks.Summary) ss.(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdrihdr.(field) uint images_wired_png_chunks.Ihdr.heightheight, (local variable) const(images_wired_png_chunks.Summary) ss.(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdrihdr),
(local variable) const(images_wired_png_chunks.Summary) ss.(field) ulong images_wired_png_chunks.Summary.inflatedFramesinflatedFrames);
const (local variable) const(ubyte[]) againagain = ubyte[] images_wired_png_chunks.fixedBytes!(images_wired_png_chunks.Ihdr)(in images_wired_png_chunks.Ihdr value) pure nothrow @safefixedBytes((local variable) const(images_wired_png_chunks.Summary) ss.(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdrihdr);
void std.stdio.writefln!(char, ulong, bool)(in char[] fmt, ulong __param_1, bool __param_2) @safeEquivalent to writef(fmt, args, '\n').
writefln("png: round trip: IHDR re-encoded to %s bytes, identical: %s",
(local variable) const(ubyte[]) againagain.(field) ulong const(ubyte[]).lengthlength, (local variable) const(ubyte[]) againagain == (local variable) const(ubyte[]) pngpng[16 .. 29]);
void images_wired_png_chunks.report(string label, in ubyte[] bytes)report("bit flip in IHDR CRC", ubyte[] images_wired_png_chunks.buildPng(images_wired_png_chunks.Variant variant)buildPng((enum) images_wired_png_chunks.VariantVariant.(enum value) images_wired_png_chunks.Variant.badCrc = 1badCrc));
void images_wired_png_chunks.report(string label, in ubyte[] bytes)report("depth 16 with indexed colour", ubyte[] images_wired_png_chunks.buildPng(images_wired_png_chunks.Variant variant)buildPng((enum) images_wired_png_chunks.VariantVariant.(enum value) images_wired_png_chunks.Variant.badDepth = 2badDepth));
void images_wired_png_chunks.report(string label, in ubyte[] bytes)report("tRNS before PLTE", ubyte[] images_wired_png_chunks.buildPng(images_wired_png_chunks.Variant variant)buildPng((enum) images_wired_png_chunks.VariantVariant.(enum value) images_wired_png_chunks.Variant.trnsBeforePlte = 3trnsBeforePlte));
void images_wired_png_chunks.report(string label, in ubyte[] bytes)report("tEXt between IDATs", ubyte[] images_wired_png_chunks.buildPng(images_wired_png_chunks.Variant variant)buildPng((enum) images_wired_png_chunks.VariantVariant.(enum value) images_wired_png_chunks.Variant.splitIdat = 4splitIdat));
void images_wired_png_chunks.report(string label, in ubyte[] bytes)report("fdAT sequence gap", ubyte[] images_wired_png_chunks.buildPng(images_wired_png_chunks.Variant variant)buildPng((enum) images_wired_png_chunks.VariantVariant.(enum value) images_wired_png_chunks.Variant.sequenceGap = 5sequenceGap));
void images_wired_png_chunks.report(string label, in ubyte[] bytes)report("frame outside the canvas", ubyte[] images_wired_png_chunks.buildPng(images_wired_png_chunks.Variant variant)buildPng((enum) images_wired_png_chunks.VariantVariant.(enum value) images_wired_png_chunks.Variant.frameOutside = 6frameOutside));
void images_wired_png_chunks.report(string label, in ubyte[] bytes)report("cICP matrix coefficients 1", ubyte[] images_wired_png_chunks.buildPng(images_wired_png_chunks.Variant variant)buildPng((enum) images_wired_png_chunks.VariantVariant.(enum value) images_wired_png_chunks.Variant.cicpMatrix = 7cicpMatrix));
void images_wired_png_chunks.report(string label, in ubyte[] bytes)report("cut inside IHDR", ubyte[] images_wired_png_chunks.buildPng(images_wired_png_chunks.Variant variant)buildPng((enum) images_wired_png_chunks.VariantVariant.(enum value) images_wired_png_chunks.Variant.truncated = 8truncated));
}