png-chunks.dhover×1463all
#!/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_chunks

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

images_wired_png_chunks
;
import
(package) std
std
.
(module) std.stdio
Category Symbols
File handles _popen File isFileHandle openNetwork stderr stdin stdout
Reading chunks lines readf readfln readln
Writing toFile write writef writefln writeln
Misc KeepTerminator LockType StdioException

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

There are three layers of I/O:

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

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

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

Source

std/stdio.d

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

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

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

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

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

Source

std/traits.d

@copyrightCopyright The D Language Foundation 2005 - 2009.@licenseBoost License 1.0.@authorsWalter Bright, Tomasz Stachowiak (isExpressions), Andrei Alexandrescu, Shin Fujishiro, Robert Clipsham, David Nadlinger, Kenji Hara, Shoichi Kato
traits
:
(alias template) images_wired_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.

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

Strips off all enums from type T.

OriginalType
;
import
(package) std
std
.
(module) std.zlib

Compress/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

Wikipedia

Source

std/zlib.d

@copyrightCopyright The D Language Foundation 2000 - 2011.@licenseBoost License 1.0.@authorsWalter Bright
zlib
:
(alias) images_wired_png_chunks.compress = ubyte[] std.zlib.compress(const(void)[] srcbuf, int level)

Compress data

@paramsrcbuf buffer containing the data to compress@paramlevel compression level. Legal values are -1 .. 9, with -1 indicating the default level (6), 0 indicating no compression, 1 being the least compression and 9 being the most.@returnsthe compressed data
compress
,
(class) std.zlib.UnCompress

Used when the data to be decompressed is not all in one buffer.

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

This module is implementing the Expected idiom.

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

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

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

Similar work is expectations by Paul Backus.

Main features

  • lightweight, no other external dependencies

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

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

  • type inference for ease of use with ok and err

  • allows to use same types for T and E

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

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

  • can enforce result check (with a cost)

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

  • range interface

Description

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

  • T defines type of the success value

  • E defines type of the error

  • Hook defines behavior of the Expected

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

Abort is used as a default hook.

Hooks

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

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

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

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

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

  • Hook member

Semantics in Expected!(T, E, Hook)

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

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

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

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

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

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

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

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

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

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

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

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

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

  • 5f1f2083381fdfcfa22428541be98694087fcd30 makes isVoidValueEnabled read the member it checks;

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

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

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

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

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

Examples

Basic usage

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

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

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

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

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

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

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

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

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

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

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

Advanced usage - behavior modification

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

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

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

// use it as normal
assert(ok(42) == 42);
assert(err!int(new Exception("foo")).orElse(0) == 0);
assertThrown(ok(42).error);
assertThrown(err!int(new Exception("bar")).value);
@copyrightCopyright © 2019, Tomáš Chaloupka@authorsTomáš Chaloupka, with contributions from Kostiantyn Tokar, Jan Jurzitza, Beyar and Petar Kirov (the upstream history to the vendored commit)@licenseBSL-1.0
expected
:
(alias struct) images_wired_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.

@paramT represents type of the expected value@paramE represents type of the error value.@paramHook defines the Expected type behavior
Expected
,
(alias template) images_wired_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) sparkles
sparkles
.
(package) sparkles.wired
wired
.
(module) sparkles.wired.policy

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

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

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

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

policy
:
(alias template) images_wired_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) sparkles
sparkles
.
(package) sparkles.wired
wired
.
(module) sparkles.wired.schema

Compile-time wire-schema reification.

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

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

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

Structural node vocabulary shared by format walkers and derivations.

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

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

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

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

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

WireSchema
,
(alias template) images_wired_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 @safe

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

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

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

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

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

Structural node vocabulary shared by format walkers and derivations.

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

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

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

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

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

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

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

scalar storage width where it constrains wire values

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

Structural node vocabulary shared by format walkers and derivations.

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

scalar storage width where it constrains wire values

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

scalar storage width where it constrains wire values

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

Structural node vocabulary shared by format walkers and derivations.

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

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

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

range in WireSchema.edges

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

T[N] length, zero otherwise

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

Structural node vocabulary shared by format walkers and derivations.

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

range in WireSchema.edges

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

range in WireSchema.edges

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

range in WireSchema.edges

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

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

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

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

BeFixed
{ template
(template) images_wired_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"])) = true
validateWireSchema
=
long images_wired_png_chunks.fixedSize(const(sparkles.wired.schema.WireSchema) schema, ulong index) pure nothrow @safe

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

fixedSize
(
(constant) sparkles.wired.schema.WireSchema sparkles.wired.schema.rawWireSchemaOf!(images_wired_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.BinErrorKind
BinErrorKind
: ubyte
{
(enum value) images_wired_png_chunks.BinErrorKind.none = cast(ubyte)0u
none
,
(enum value) images_wired_png_chunks.BinErrorKind.truncated = 1
truncated
,
(enum value) images_wired_png_chunks.BinErrorKind.notAMember = 2
notAMember
,
(enum value) images_wired_png_chunks.BinErrorKind.checkFailed = 3
checkFailed
,
(enum value) images_wired_png_chunks.BinErrorKind.badSignature = 4
badSignature
,
(enum value) images_wired_png_chunks.BinErrorKind.badCrc = 5
badCrc
,
(enum value) images_wired_png_chunks.BinErrorKind.badOrder = 6
badOrder
,
(enum value) images_wired_png_chunks.BinErrorKind.badLength = 7
badLength
,
(enum value) images_wired_png_chunks.BinErrorKind.missingChunk = 8
missingChunk
,
(enum value) images_wired_png_chunks.BinErrorKind.badSequence = 9
badSequence
,
(enum value) images_wired_png_chunks.BinErrorKind.badStream = 10
badStream
,
} struct
(struct) images_wired_png_chunks.BinError
BinError
{
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
(field) images_wired_png_chunks.BinErrorKind images_wired_png_chunks.BinError.kind
kind
;
(alias) object.size_t = ulong
size_t
(field) ulong images_wired_png_chunks.BinError.offset
offset
;
(alias) object.string = string
string
(field) string images_wired_png_chunks.BinError.what
what
;
} 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.

@paramT represents type of the expected value@paramE represents type of the error value.@paramHook defines the Expected type behavior
Expected
!(
(alias) T = images_wired_png_chunks.Cicp
T
,
(struct) images_wired_png_chunks.BinError
BinError
);
ulong
ulong images_wired_png_chunks.readBe(in ubyte[] bytes, ulong at, ulong width) pure nothrow @nogc @safe
readBe
(in ubyte[]
(parameter) const(ubyte[]) bytes
bytes
,
(alias) object.size_t = ulong
size_t
(parameter) ulong at
at
,
(alias) object.size_t = ulong
size_t
(parameter) ulong width
width
) @safe pure nothrow @nogc
{ ulong
(local variable) ulong value
value
;
foreach (
(parameter) const(ubyte) b
b
;
(parameter) const(ubyte[]) bytes
bytes
[
(parameter) ulong at
at
..
(parameter) ulong at
at
+
(parameter) ulong width
width
])
(local variable) ulong value
value
= (
(local variable) ulong value
value
<< 8) |
(local variable) const(ubyte) b
b
;
return
(local variable) ulong value
value
;
} /// Reads schema node `index` into `value`, in lockstep with the D type.
(struct) images_wired_png_chunks.BinError
BinError
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 @safe

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

readNode
(V, alias schema, size_t index)(ref
(alias) V = uint
V
(parameter) uint value
value
, in ubyte[]
(parameter) const(ubyte[]) bytes
bytes
,
ref
(alias) object.size_t = ulong
size_t
(parameter) ulong pos
pos
,
(alias) object.string = string
string
(parameter) string path
path
)
{ enum
(constant) sparkles.wired.schema.SchemaNode images_wired_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.nodes
nodes
[
(constant) ulong images_wired_png_chunks.index = 2LU
index
];
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.kind
kind
==
(enum) sparkles.wired.schema.NodeKind

Structural node vocabulary shared by format walkers and derivations.

NodeKind
.
(enum value) sparkles.wired.schema.NodeKind.aggregate = 2
aggregate
)
{ static foreach (i; 0 .. V.tupleof.length) {{ enum
(constant) ulong images_wired_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 = 1LU
child
=
(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.edges
edges
[
(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.firstEdge

range 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 = 1LU
i
];
const
(local variable) const(string) fieldPath
fieldPath
=
(parameter) string path
path
.
(field) ulong string.length
length
?
(parameter) string path
path
~ "." ~ schema.nodes[child].name :
(constant) sparkles.wired.schema.WireSchema images_wired_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.nodes
nodes
[
(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 = 1LU
child
].
(field) string sparkles.wired.schema.SchemaNode.name

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

name
;
const
(local variable) const(ulong) fieldStart
fieldStart
=
(parameter) ulong pos
pos
;
auto
(local variable) images_wired_png_chunks.BinError e
e
=
(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 = 2LU
readNode
!(typeof(
(field) uint images_wired_png_chunks.ChunkHeader.length
V
.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 = 0LU
i
]),
(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 = 1LU
child
)(
(parameter) images_wired_png_chunks.ChunkHeader value
value
.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 = 0LU
i
],
(parameter) const(ubyte[]) bytes
bytes
,
(parameter) ulong pos
pos
,
(local variable) const(string) fieldPath
fieldPath
);
if (
(local variable) images_wired_png_chunks.BinError e
e
.
(field) images_wired_png_chunks.BinErrorKind images_wired_png_chunks.BinError.kind
kind
!=
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.none = cast(ubyte)0u
none
)
return
(local variable) images_wired_png_chunks.BinError e
e
;
auto
(local variable) sparkles.wired.policy.WireCheckFailure[] failures
failures
=
(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 = 0LU
wireCheckFailures
!(
(struct) images_wired_png_chunks.BeFixed

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

BeFixed
,
(alias) V = images_wired_png_chunks.ChunkHeader
V
.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 = 0LU
i
])(
(parameter) images_wired_png_chunks.ChunkHeader value
value
.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 = 0LU
i
]);
if (
(local variable) sparkles.wired.policy.WireCheckFailure[] failures
failures
.
(field) ulong sparkles.wired.policy.WireCheckFailure[].length
length
)
return
(struct) images_wired_png_chunks.BinError
BinError
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.checkFailed = 3
checkFailed
,
(local variable) const(ulong) fieldStart
fieldStart
,
(local variable) const(string) fieldPath
fieldPath
~ ": " ~
(local variable) sparkles.wired.policy.WireCheckFailure[] failures
failures
[0].
(field) string sparkles.wired.policy.WireCheckFailure.reason
reason
);
}} return
(struct) images_wired_png_chunks.BinError
BinError
.
(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.kind
kind
==
(enum) sparkles.wired.schema.NodeKind

Structural node vocabulary shared by format walkers and derivations.

NodeKind
.
(enum value) sparkles.wired.schema.NodeKind.staticArray = 5
staticArray
)
{ enum
(constant) ulong images_wired_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 = 3LU
child
=
(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.edges
edges
[
(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.firstEdge

range in WireSchema.edges

firstEdge
];
foreach (
(local variable) ulong k
k
; 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.staticLength

T[N] length, zero otherwise

staticLength
)
{ auto
(local variable) images_wired_png_chunks.BinError e
e
=
(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 = 3LU
readNode
!(typeof(
(parameter) char[4] value
value
[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 = 3LU
child
)(
(parameter) char[4] value
value
[
(local variable) ulong k
k
],
(parameter) const(ubyte[]) bytes
bytes
,
(parameter) ulong pos
pos
,
(parameter) string path
path
);
if (
(local variable) images_wired_png_chunks.BinError e
e
.
(field) images_wired_png_chunks.BinErrorKind images_wired_png_chunks.BinError.kind
kind
!=
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.none = cast(ubyte)0u
none
)
return
(local variable) images_wired_png_chunks.BinError e
e
;
} return
(struct) images_wired_png_chunks.BinError
BinError
.
(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.kind
kind
==
(enum) sparkles.wired.schema.NodeKind

Structural node vocabulary shared by format walkers and derivations.

NodeKind
.
(enum value) sparkles.wired.schema.NodeKind.enumeration = 1
enumeration
)
{ const
(local variable) const(ubyte) raw
raw
= cast(
(alias) std.traits.OriginalType!(images_wired_png_chunks.ColorType) = ubyte

Strips 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.ColorType
V
)
ulong images_wired_png_chunks.readBe(in ubyte[] bytes, ulong at, ulong width) pure nothrow @nogc @safe
readBe
(
(parameter) const(ubyte[]) bytes
bytes
,
(parameter) ulong pos
pos
,
(constant) sparkles.wired.schema.SchemaNode images_wired_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.scalarBits

scalar storage width where it constrains wire values

scalarBits
/ 8);
static foreach (member; EnumMembers!V) if (
(local variable) const(ubyte) raw
raw
==
(enum value) images_wired_png_chunks.ColorType.greyscale = cast(ubyte)0u
member
)
{
(parameter) images_wired_png_chunks.ColorType value
value
=
(enum value) images_wired_png_chunks.ColorType.greyscale = cast(ubyte)0u
member
;
(parameter) ulong pos
pos
+=
(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.scalarBits

scalar storage width where it constrains wire values

scalarBits
/ 8;
return
(struct) images_wired_png_chunks.BinError
BinError
.
(constant) images_wired_png_chunks.BinError images_wired_png_chunks.BinError.init = BinError(BinErrorKind.none, 0LU, null)
init
;
} return
(struct) images_wired_png_chunks.BinError
BinError
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.notAMember = 2
notAMember
,
(parameter) ulong pos
pos
,
(parameter) string path
path
);
} else {
(parameter) uint value
value
= cast(
(alias) V = uint
V
)
ulong images_wired_png_chunks.readBe(in ubyte[] bytes, ulong at, ulong width) pure nothrow @nogc @safe
readBe
(
(parameter) const(ubyte[]) bytes
bytes
,
(parameter) ulong pos
pos
,
(constant) sparkles.wired.schema.SchemaNode images_wired_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.scalarBits

scalar storage width where it constrains wire values

scalarBits
/ 8);
(parameter) ulong pos
pos
+=
(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.scalarBits

scalar storage width where it constrains wire values

scalarBits
/ 8;
return
(struct) images_wired_png_chunks.BinError
BinError
.
(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.Fctl
T
sparkles.base.expected.Expected!(Fctl, BinError, Abort) images_wired_png_chunks.decodeFixed!(images_wired_png_chunks.Fctl)(in ubyte[] bytes, ulong at) pure nothrow @safe

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

decodeFixed
(T)(in ubyte[]
(parameter) const(ubyte[]) bytes
bytes
,
(alias) object.size_t = ulong
size_t
(parameter) ulong at
at
)
{ enum
(constant) sparkles.wired.schema.WireSchema images_wired_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.BeFixed

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

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

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

fixedSize
(
(constant) sparkles.wired.schema.WireSchema images_wired_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 at
at
>
(parameter) const(ubyte[]) bytes
bytes
.
(field) ulong const(ubyte[]).length
length
||
(parameter) const(ubyte[]) bytes
bytes
.
(field) ulong const(ubyte[]).length
length
-
(parameter) ulong at
at
<
(constant) ulong images_wired_png_chunks.decodeFixed!(images_wired_png_chunks.Fctl).size = 26LU
size
)
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 @safe

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

Examples

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

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

// other error type
{
    auto res = err!bool(42);
    static assert(is(typeof(res) == Expected!(bool, int)));
    assert(!res);
    assert(res.error == 42);
}
err
!
(alias) T = images_wired_png_chunks.Fctl
T
(
(struct) images_wired_png_chunks.BinError
BinError
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.truncated = 1
truncated
,
(parameter) ulong at
at
,
(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.Fctl
T
(local variable) images_wired_png_chunks.Fctl value
value
;
(alias) object.size_t = ulong
size_t
(local variable) ulong pos
pos
=
(parameter) ulong at
at
;
auto
(local variable) images_wired_png_chunks.BinError e
e
=
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 @safe

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

readNode
!(
(alias) T = images_wired_png_chunks.Fctl
T
,
(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 value
value
,
(parameter) const(ubyte[]) bytes
bytes
,
(local variable) ulong pos
pos
, "");
if (
(local variable) images_wired_png_chunks.BinError e
e
.
(field) images_wired_png_chunks.BinErrorKind images_wired_png_chunks.BinError.kind
kind
!=
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.none = cast(ubyte)0u
none
)
{
(local variable) images_wired_png_chunks.BinError e
e
.
(field) string images_wired_png_chunks.BinError.what
what
=
(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 e
e
.
(field) string images_wired_png_chunks.BinError.what
what
;
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 @safe

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

Examples

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

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

// other error type
{
    auto res = err!bool(42);
    static assert(is(typeof(res) == Expected!(bool, int)));
    assert(!res);
    assert(res.error == 42);
}
err
!
(alias) T = images_wired_png_chunks.Fctl
T
(
(local variable) images_wired_png_chunks.BinError e
e
);
} auto
(local variable) sparkles.wired.policy.WireCheckFailure[] failures
failures
=
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 @safe

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

wireCheckFailures
!(
(struct) images_wired_png_chunks.BeFixed

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

BeFixed
,
(alias) T = images_wired_png_chunks.Fctl
T
)(
(local variable) images_wired_png_chunks.Fctl value
value
);
if (
(local variable) sparkles.wired.policy.WireCheckFailure[] failures
failures
.
(field) ulong sparkles.wired.policy.WireCheckFailure[].length
length
)
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 @safe

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

Examples

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

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

// other error type
{
    auto res = err!bool(42);
    static assert(is(typeof(res) == Expected!(bool, int)));
    assert(!res);
    assert(res.error == 42);
}
err
!
(alias) T = images_wired_png_chunks.Fctl
T
(
(struct) images_wired_png_chunks.BinError
BinError
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.checkFailed = 3
checkFailed
,
(parameter) ulong at
at
,
(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[] failures
failures
[0].
(field) string sparkles.wired.policy.WireCheckFailure.reason
reason
));
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 @safe

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

ok
!
(struct) images_wired_png_chunks.BinError
BinError
(
(local variable) images_wired_png_chunks.Fctl value
value
);
} 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 @safe
writeNode
(V, alias schema, size_t index)(in
(alias) V = uint
V
(parameter) const(uint) value
value
, ref ubyte[]
(parameter) ubyte[] output
output
)
{ 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.nodes
nodes
[
(constant) ulong images_wired_png_chunks.index = 2LU
index
];
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.kind
kind
==
(enum) sparkles.wired.schema.NodeKind

Structural node vocabulary shared by format walkers and derivations.

NodeKind
.
(enum value) sparkles.wired.schema.NodeKind.aggregate = 2
aggregate
)
{ static foreach (i; 0 .. V.tupleof.length)
void images_wired_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 @safe
writeNode
!(typeof(
(field) uint images_wired_png_chunks.ChunkHeader.length
V
.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 = 0LU
i
]),
(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.firstEdge

range 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 = 1LU
i
])(
(parameter) const(images_wired_png_chunks.ChunkHeader) value
value
.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 = 0LU
i
],
(parameter) ubyte[] output
output
);
} 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.kind
kind
==
(enum) sparkles.wired.schema.NodeKind

Structural node vocabulary shared by format walkers and derivations.

NodeKind
.
(enum value) sparkles.wired.schema.NodeKind.staticArray = 5
staticArray
)
{ foreach (
(local variable) ulong k
k
; 0 ..
(constant) sparkles.wired.schema.SchemaNode images_wired_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.staticLength

T[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 @safe
writeNode
!(typeof(
(parameter) const(char[4]) value
value
[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]) value
value
[
(local variable) ulong k
k
],
(parameter) ubyte[] output
output
);
} else { const ulong
(local variable) const(ulong) raw
raw
= cast(ulong)
(parameter) const(uint) value
value
;
foreach_reverse (
(local variable) int k
k
; 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.scalarBits

scalar storage width where it constrains wire values

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

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

encodeFixed
(T)(in
(alias) T = images_wired_png_chunks.Fctl
T
(parameter) const(images_wired_png_chunks.Fctl) value
value
, ref ubyte[]
(parameter) ubyte[] output
output
)
{ 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.BeFixed

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

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

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

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

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

wireCheckFailures
!(
(struct) images_wired_png_chunks.BeFixed

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

BeFixed
,
(alias) T = images_wired_png_chunks.Fctl
T
)(
(parameter) const(images_wired_png_chunks.Fctl) value
value
))
return
(local variable) sparkles.wired.policy.WireCheckFailure failure
failure
.
(field) string sparkles.wired.policy.WireCheckFailure.reason
reason
;
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 @safe
writeNode
!(
(alias) T = images_wired_png_chunks.Fctl
T
,
(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) value
value
,
(parameter) ubyte[] output
output
);
return null; } // --------------------------------------------------------------------------- // PNG descriptions (W3C PNG Third Edition) // --------------------------------------------------------------------------- enum
(enum) images_wired_png_chunks.ColorType
ColorType
: ubyte
{
(enum value) images_wired_png_chunks.ColorType.greyscale = cast(ubyte)0u
greyscale
= 0,
(enum value) images_wired_png_chunks.ColorType.truecolor = cast(ubyte)2u
truecolor
= 2,
(enum value) images_wired_png_chunks.ColorType.indexed = cast(ubyte)3u
indexed
= 3,
(enum value) images_wired_png_chunks.ColorType.greyscaleAlpha = cast(ubyte)4u
greyscaleAlpha
= 4,
(enum value) images_wired_png_chunks.ColorType.truecolorAlpha = cast(ubyte)6u
truecolorAlpha
= 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 @safe

Table 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) h
h
) @safe pure nothrow @nogc
{ final switch (
(parameter) const(images_wired_png_chunks.Ihdr) h
h
.
(field) images_wired_png_chunks.ColorType images_wired_png_chunks.Ihdr.colorType
colorType
)
{ case
(enum) images_wired_png_chunks.ColorType
ColorType
.
(enum value) images_wired_png_chunks.ColorType.greyscale = cast(ubyte)0u
greyscale
:
return true; case
(enum) images_wired_png_chunks.ColorType
ColorType
.
(enum value) images_wired_png_chunks.ColorType.indexed = cast(ubyte)3u
indexed
:
return
(parameter) const(images_wired_png_chunks.Ihdr) h
h
.
(field) ubyte images_wired_png_chunks.Ihdr.bitDepth
bitDepth
<= 8;
case
(enum) images_wired_png_chunks.ColorType
ColorType
.
(enum value) images_wired_png_chunks.ColorType.truecolor = cast(ubyte)2u
truecolor
,
(enum) images_wired_png_chunks.ColorType
ColorType
.
(enum value) images_wired_png_chunks.ColorType.greyscaleAlpha = cast(ubyte)4u
greyscaleAlpha
,
(enum) images_wired_png_chunks.ColorType
ColorType
.
(enum value) images_wired_png_chunks.ColorType.truecolorAlpha = cast(ubyte)6u
truecolorAlpha
:
return
(parameter) const(images_wired_png_chunks.Ihdr) h
h
.
(field) ubyte images_wired_png_chunks.Ihdr.bitDepth
bitDepth
>= 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 @safe

Table 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.width
width
;
@
(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.height
height
;
@
(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.bitDepth
bitDepth
;
(enum) images_wired_png_chunks.ColorType
ColorType
(field) images_wired_png_chunks.ColorType images_wired_png_chunks.Ihdr.colorType
colorType
;
@
(template instance) sparkles.wired.policy.WireCheck!(isOneOf, "", sparkles.metadata.wire.AnyFormat)
WireCheck
!(
(template) sparkles.wired.policy.isOneOf!0

Declarative membership check usable as a WireCheck predicate.

isOneOf
!(0)) ubyte
(field) ubyte images_wired_png_chunks.Ihdr.compression
compression
;
@
(template instance) sparkles.wired.policy.WireCheck!(isOneOf, "", sparkles.metadata.wire.AnyFormat)
WireCheck
!(
(template) sparkles.wired.policy.isOneOf!0

Declarative membership check usable as a WireCheck predicate.

isOneOf
!(0)) ubyte
(field) ubyte images_wired_png_chunks.Ihdr.filter
filter
;
@
(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.interlace
interlace
;
} bool
bool images_wired_png_chunks.isChunkType(in char[4] t) pure nothrow @nogc @safe
isChunkType
(in char[4]
(parameter) const(char[4]) t
t
) @safe pure nothrow @nogc
{ foreach (
(parameter) const(char) c
c
;
(parameter) const(char[4]) t
t
)
if (!((
(local variable) const(char) c
c
>= 'A' &&
(local variable) const(char) c
c
<= 'Z') || (
(local variable) const(char) c
c
>= 'a' &&
(local variable) const(char) c
c
<= 'z')))
return false; return true; } /// §5.3: the part of a chunk the schema can describe. struct
images_wired_png_chunks.ChunkHeader ChunkHeader
ChunkHeader
{ @
(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.length
length
;
@
(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 @safe
isChunkType
, "chunk type byte is not a letter") char[4]
(field) char[4] images_wired_png_chunks.ChunkHeader.type
type
;
} /// §11.3.2.6. struct
(struct) images_wired_png_chunks.Cicp

§11.3.2.6.

Cicp
{ ubyte
(field) ubyte images_wired_png_chunks.Cicp.colourPrimaries
colourPrimaries
;
ubyte
(field) ubyte images_wired_png_chunks.Cicp.transferFunction
transferFunction
;
@
(template instance) sparkles.wired.policy.WireCheck!(isOneOf, "matrix coefficients must be 0 for RGB", sparkles.metadata.wire.AnyFormat)
WireCheck
!(
(template) sparkles.wired.policy.isOneOf!0

Declarative membership check usable as a WireCheck predicate.

isOneOf
!(0), "matrix coefficients must be 0 for RGB") ubyte
(field) ubyte images_wired_png_chunks.Cicp.matrixCoefficients
matrixCoefficients
;
@
(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.videoFullRange
videoFullRange
;
} /// §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.numFrames
numFrames
;
uint
(field) uint images_wired_png_chunks.Actl.numPlays
numPlays
;
} enum
(enum) images_wired_png_chunks.DisposeOp
DisposeOp
: ubyte {
(enum value) images_wired_png_chunks.DisposeOp.none = cast(ubyte)0u
none
= 0,
(enum value) images_wired_png_chunks.DisposeOp.background = cast(ubyte)1u
background
= 1,
(enum value) images_wired_png_chunks.DisposeOp.previous = cast(ubyte)2u
previous
= 2 }
enum
(enum) images_wired_png_chunks.BlendOp
BlendOp
: ubyte {
(enum value) images_wired_png_chunks.BlendOp.source = cast(ubyte)0u
source
= 0,
(enum value) images_wired_png_chunks.BlendOp.over = cast(ubyte)1u
over
= 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.sequenceNumber
sequenceNumber
;
uint
(field) uint images_wired_png_chunks.Fctl.width
width
;
uint
(field) uint images_wired_png_chunks.Fctl.height
height
;
uint
(field) uint images_wired_png_chunks.Fctl.xOffset
xOffset
;
uint
(field) uint images_wired_png_chunks.Fctl.yOffset
yOffset
;
ushort
(field) ushort images_wired_png_chunks.Fctl.delayNum
delayNum
;
ushort
(field) ushort images_wired_png_chunks.Fctl.delayDen
delayDen
;
(enum) images_wired_png_chunks.DisposeOp
DisposeOp
(field) images_wired_png_chunks.DisposeOp images_wired_png_chunks.Fctl.disposeOp
disposeOp
;
(enum) images_wired_png_chunks.BlendOp
BlendOp
(field) images_wired_png_chunks.BlendOp images_wired_png_chunks.Fctl.blendOp
blendOp
;
} // --------------------------------------------------------------------------- // GAP: everything below is hand-written // --------------------------------------------------------------------------- immutable ubyte[8]
(immutable global) immutable(ubyte[8]) images_wired_png_chunks.pngSignature
pngSignature
= [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 @safe

GAP

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[]) a
a
, in ubyte[]
(parameter) const(ubyte[]) b
b
) @safe pure nothrow @nogc
{ uint
(local variable) uint crc
crc
= 0xFFFF_FFFF;
const(ubyte)[][2]
(local variable) const(ubyte)[][2] parts
parts
= [
(parameter) const(ubyte[]) a
a
,
(parameter) const(ubyte[]) b
b
];
foreach (
(parameter) const(ubyte)[] part
part
;
(local variable) const(ubyte)[][2] parts
parts
)
foreach (
(parameter) const(ubyte) octet
octet
;
(local variable) const(ubyte)[] part
part
)
{
(local variable) uint crc
crc
^=
(local variable) const(ubyte) octet
octet
;
foreach (
(local variable) int _
_
; 0 .. 8)
(local variable) uint crc
crc
= (
(local variable) uint crc
crc
>> 1) ^ (0xEDB8_8320 & -(
(local variable) uint crc
crc
& 1));
} return ~
(local variable) uint crc
crc
;
} struct
(struct) images_wired_png_chunks.Chunk
Chunk
{
(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.header
header
;
(alias) object.size_t = ulong
size_t
(field) ulong images_wired_png_chunks.Chunk.start

offset of the length field

start
; /// offset of the length field
const(ubyte)[]
(field) const(ubyte)[] images_wired_png_chunks.Chunk.data

borrowed 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.Chunk
Chunk
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)[] bytes
bytes
,
(alias) object.size_t = ulong
size_t
(parameter) ulong at
at
)
{ auto
(local variable) sparkles.base.expected.Expected!(ChunkHeader, BinError, Abort) header
header
=
sparkles.base.expected.Expected!(ChunkHeader, BinError, Abort) images_wired_png_chunks.decodeFixed!(images_wired_png_chunks.ChunkHeader)(in ubyte[] bytes, ulong at) pure nothrow @safe

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

decodeFixed
!
(struct) images_wired_png_chunks.ChunkHeader

§5.3: the part of a chunk the schema can describe.

ChunkHeader
(
(parameter) const(ubyte)[] bytes
bytes
,
(parameter) ulong at
at
);
if (
(local variable) sparkles.base.expected.Expected!(ChunkHeader, BinError, Abort) header
header
.
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 @safe

Checks 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 @safe

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

Examples

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

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

// other error type
{
    auto res = err!bool(42);
    static assert(is(typeof(res) == Expected!(bool, int)));
    assert(!res);
    assert(res.error == 42);
}
err
!
(struct) images_wired_png_chunks.Chunk
Chunk
(
(local variable) sparkles.base.expected.Expected!(ChunkHeader, BinError, Abort) header
header
.
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 @safe

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

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

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

Note

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

error
);
const
(local variable) const(ulong) dataStart
dataStart
=
(parameter) ulong at
at
+ 8;
const ulong
(local variable) const(ulong) end
end
= cast(ulong)
(local variable) const(ulong) dataStart
dataStart
+
(local variable) sparkles.base.expected.Expected!(ChunkHeader, BinError, Abort) header
header
.
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 @safe

Returns the expected value if there is one.

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

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

Note

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

value
.
(field) uint images_wired_png_chunks.ChunkHeader.length
length
+ 4;
if (
(local variable) const(ulong) end
end
>
(parameter) const(ubyte)[] bytes
bytes
.
(field) ulong const(ubyte)[].length
length
)
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 @safe

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

Examples

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

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

// other error type
{
    auto res = err!bool(42);
    static assert(is(typeof(res) == Expected!(bool, int)));
    assert(!res);
    assert(res.error == 42);
}
err
!
(struct) images_wired_png_chunks.Chunk
Chunk
(
(struct) images_wired_png_chunks.BinError
BinError
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.truncated = 1
truncated
,
(parameter) ulong at
at
,
(local variable) sparkles.base.expected.Expected!(ChunkHeader, BinError, Abort) header
header
.
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 @safe

Returns the expected value if there is one.

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

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

Note

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

value
.
(field) char[4] images_wired_png_chunks.ChunkHeader.type
type
.
string object.idup!char(char[] a) pure nothrow @property @safe

Provide the .idup array property, which creates an immutable duplicate.

idup
));
auto
(local variable) const(ubyte)[] data
data
=
(parameter) const(ubyte)[] bytes
bytes
[
(local variable) const(ulong) dataStart
dataStart
..
(local variable) const(ulong) dataStart
dataStart
+
(local variable) sparkles.base.expected.Expected!(ChunkHeader, BinError, Abort) header
header
.
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 @safe

Returns the expected value if there is one.

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

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

Note

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

value
.
(field) uint images_wired_png_chunks.ChunkHeader.length
length
];
const
(local variable) const(uint) stored
stored
= cast(uint)
ulong images_wired_png_chunks.readBe(in ubyte[] bytes, ulong at, ulong width) pure nothrow @nogc @safe
readBe
(
(parameter) const(ubyte)[] bytes
bytes
,
(local variable) const(ulong) dataStart
dataStart
+
(local variable) sparkles.base.expected.Expected!(ChunkHeader, BinError, Abort) header
header
.
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 @safe

Returns the expected value if there is one.

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

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

Note

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

value
.
(field) uint images_wired_png_chunks.ChunkHeader.length
length
, 4);
if (
(local variable) const(uint) stored
stored
!=
uint images_wired_png_chunks.crc32(in ubyte[] a, in ubyte[] b) pure nothrow @nogc @safe

GAP

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)[] bytes
bytes
[
(parameter) ulong at
at
+ 4 ..
(parameter) ulong at
at
+ 8],
(local variable) const(ubyte)[] data
data
))
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 @safe

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

Examples

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

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

// other error type
{
    auto res = err!bool(42);
    static assert(is(typeof(res) == Expected!(bool, int)));
    assert(!res);
    assert(res.error == 42);
}
err
!
(struct) images_wired_png_chunks.Chunk
Chunk
(
(struct) images_wired_png_chunks.BinError
BinError
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.badCrc = 5
badCrc
,
(parameter) ulong at
at
,
(local variable) sparkles.base.expected.Expected!(ChunkHeader, BinError, Abort) header
header
.
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 @safe

Returns the expected value if there is one.

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

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

Note

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

value
.
(field) char[4] images_wired_png_chunks.ChunkHeader.type
type
.
string object.idup!char(char[] a) pure nothrow @property @safe

Provide 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 @safe

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

ok
!
(struct) images_wired_png_chunks.BinError
BinError
(
(struct) images_wired_png_chunks.Chunk
Chunk
(
(local variable) sparkles.base.expected.Expected!(ChunkHeader, BinError, Abort) header
header
.
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 @safe

Returns the expected value if there is one.

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

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

Note

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

value
,
(parameter) ulong at
at
,
(local variable) const(ubyte)[] data
data
));
} /// 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 @safe

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.

expectedInflated
(uint
(parameter) uint width
width
, uint
(parameter) uint height
height
, 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) h
h
) @safe pure nothrow @nogc
{ static immutable ubyte[7]
(immutable global) immutable(ubyte[7]) images_wired_png_chunks.expectedInflated.samples
samples
= [1, 0, 3, 1, 2, 0, 4];
const ulong
(local variable) const(ulong) bitsPerPixel
bitsPerPixel
=
(immutable global) immutable(ubyte[7]) images_wired_png_chunks.expectedInflated.samples
samples
[
(parameter) const(images_wired_png_chunks.Ihdr) h
h
.
(field) images_wired_png_chunks.ColorType images_wired_png_chunks.Ihdr.colorType
colorType
] *
(parameter) const(images_wired_png_chunks.Ihdr) h
h
.
(field) ubyte images_wired_png_chunks.Ihdr.bitDepth
bitDepth
;
return
(parameter) uint height
height
* (1 + (
(parameter) uint width
width
*
(local variable) const(ulong) bitsPerPixel
bitsPerPixel
+ 7) / 8);
} struct
(struct) images_wired_png_chunks.Summary
Summary
{
(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.ihdr
ihdr
;
(alias) object.size_t = ulong
size_t
(field) ulong images_wired_png_chunks.Summary.chunks
chunks
;
(alias) object.size_t = ulong
size_t
(field) ulong images_wired_png_chunks.Summary.idatChunks
idatChunks
;
(alias) object.size_t = ulong
size_t
(field) ulong images_wired_png_chunks.Summary.paletteEntries
paletteEntries
;
ulong
(field) ulong images_wired_png_chunks.Summary.inflatedImage
inflatedImage
;
ulong
(field) ulong images_wired_png_chunks.Summary.inflatedFrames
inflatedFrames
;
(struct) images_wired_png_chunks.Cicp

§11.3.2.6.

Cicp
(field) images_wired_png_chunks.Cicp images_wired_png_chunks.Summary.cicp
cicp
;
(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.actl
actl
;
(alias) object.size_t = ulong
size_t
(field) ulong images_wired_png_chunks.Summary.frames
frames
;
} /// 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.Summary
Summary
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[]) bytes
bytes
)
{ 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 @safe
relocate
= (
(struct) images_wired_png_chunks.BinError
BinError
(parameter) images_wired_png_chunks.BinError e
e
,
(alias) object.size_t = ulong
size_t
(parameter) ulong chunkAt
chunkAt
) =>
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 @safe

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

Examples

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

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

// other error type
{
    auto res = err!bool(42);
    static assert(is(typeof(res) == Expected!(bool, int)));
    assert(!res);
    assert(res.error == 42);
}
err
!
(struct) images_wired_png_chunks.Summary
Summary
(
(struct) images_wired_png_chunks.BinError
BinError
(
(parameter) images_wired_png_chunks.BinError e
e
.
(field) images_wired_png_chunks.BinErrorKind images_wired_png_chunks.BinError.kind
kind
,
(parameter) ulong chunkAt
chunkAt
+ 8 +
(parameter) images_wired_png_chunks.BinError e
e
.
(field) ulong images_wired_png_chunks.BinError.offset
offset
,
(parameter) images_wired_png_chunks.BinError e
e
.
(field) string images_wired_png_chunks.BinError.what
what
));
if (
(parameter) const(ubyte[]) bytes
bytes
.
(field) ulong const(ubyte[]).length
length
< 8 ||
(parameter) const(ubyte[]) bytes
bytes
[0 .. 8] !=
(immutable global) immutable(ubyte[8]) images_wired_png_chunks.pngSignature
pngSignature
[])
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 @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.badSignature = 4
badSignature
, 0, "signature");
(struct) images_wired_png_chunks.Summary
Summary
(local variable) images_wired_png_chunks.Summary s
s
;
bool
(local variable) bool sawPlte
sawPlte
,
(local variable) bool sawTrns
sawTrns
,
(local variable) bool sawCicp
sawCicp
,
(local variable) bool sawActl
sawActl
,
(local variable) bool sawIdat
sawIdat
,
(local variable) bool idatClosed
idatClosed
,
(local variable) bool sawIend
sawIend
;
uint
(local variable) uint nextSequence
nextSequence
;
auto
(local variable) std.zlib.UnCompress image
image
= new
(class) std.zlib.UnCompress

Used when the data to be decompressed is not all in one buffer.

UnCompress
;
(class) std.zlib.UnCompress

Used when the data to be decompressed is not all in one buffer.

UnCompress
(local variable) std.zlib.UnCompress frame
frame
;
(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 frameControl
frameControl
;
(alias) object.size_t = ulong
size_t
(local variable) ulong pos
pos
= 8;
while (
(local variable) ulong pos
pos
<
(parameter) const(ubyte[]) bytes
bytes
.
(field) ulong const(ubyte[]).length
length
)
{ auto
(local variable) sparkles.base.expected.Expected!(Chunk, BinError, Abort) c
c
=
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[]) bytes
bytes
,
(local variable) ulong pos
pos
);
if (
(local variable) sparkles.base.expected.Expected!(Chunk, BinError, Abort) c
c
.
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 @safe

Checks 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 @safe

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

Examples

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

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

// other error type
{
    auto res = err!bool(42);
    static assert(is(typeof(res) == Expected!(bool, int)));
    assert(!res);
    assert(res.error == 42);
}
err
!
(struct) images_wired_png_chunks.Summary
Summary
(
(local variable) sparkles.base.expected.Expected!(Chunk, BinError, Abort) c
c
.
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 @safe

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

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

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

Note

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

error
);
const
(local variable) const(images_wired_png_chunks.Chunk) chunk
chunk
=
(local variable) sparkles.base.expected.Expected!(Chunk, BinError, Abort) c
c
.
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 @safe

Returns the expected value if there is one.

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

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

Note

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

value
;
const
(local variable) const(char[4]) type
type
=
(local variable) const(images_wired_png_chunks.Chunk) chunk
chunk
.
(field) images_wired_png_chunks.ChunkHeader images_wired_png_chunks.Chunk.header
header
.
(field) char[4] images_wired_png_chunks.ChunkHeader.type
type
;
const
(local variable) const(ulong) at
at
=
(local variable) const(images_wired_png_chunks.Chunk) chunk
chunk
.
(field) ulong images_wired_png_chunks.Chunk.start

offset of the length field

start
;
(local variable) images_wired_png_chunks.Summary s
s
.
(field) ulong images_wired_png_chunks.Summary.chunks
chunks
++;
if (
(local variable) bool sawIend
sawIend
)
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 @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.badOrder = 6
badOrder
,
(local variable) const(ulong) at
at
, "chunk after IEND");
if (
(local variable) images_wired_png_chunks.Summary s
s
.
(field) ulong images_wired_png_chunks.Summary.chunks
chunks
== 1 &&
(local variable) const(char[4]) type
type
!= "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 @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.badOrder = 6
badOrder
,
(local variable) const(ulong) at
at
, "IHDR must be first");
if (
(local variable) bool sawIdat
sawIdat
&&
(local variable) const(char[4]) type
type
!= "IDAT")
(local variable) bool idatClosed
idatClosed
= true;
switch (
(local variable) const(char[4]) type
type
[])
{ case "IHDR": if (
(local variable) images_wired_png_chunks.Summary s
s
.
(field) ulong images_wired_png_chunks.Summary.chunks
chunks
!= 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 @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.badOrder = 6
badOrder
,
(local variable) const(ulong) at
at
, "second IHDR");
if (
(local variable) const(images_wired_png_chunks.Chunk) chunk
chunk
.
(field) const(ubyte)[] images_wired_png_chunks.Chunk.data

borrowed from the input

data
.
(field) ulong const(ubyte[]).length
length
!= 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 @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.badLength = 7
badLength
,
(local variable) const(ulong) at
at
, "IHDR");
auto
(local variable) sparkles.base.expected.Expected!(Ihdr, BinError, Abort) h
h
=
sparkles.base.expected.Expected!(Ihdr, BinError, Abort) images_wired_png_chunks.decodeFixed!(images_wired_png_chunks.Ihdr)(in ubyte[] bytes, ulong at) pure nothrow @safe

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

decodeFixed
!
(struct) images_wired_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) chunk
chunk
.
(field) const(ubyte)[] images_wired_png_chunks.Chunk.data

borrowed from the input

data
, 0);
if (
(local variable) sparkles.base.expected.Expected!(Ihdr, BinError, Abort) h
h
.
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 @safe

Checks if Expected has error

hasError
)
return relocate(
(local variable) sparkles.base.expected.Expected!(Ihdr, BinError, Abort) h
h
.
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 @safe

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

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

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

Note

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

error
,
(local variable) const(ulong) at
at
);
(local variable) images_wired_png_chunks.Summary s
s
.
(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdr
ihdr
=
(local variable) sparkles.base.expected.Expected!(Ihdr, BinError, Abort) h
h
.
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 @safe

Returns the expected value if there is one.

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

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

Note

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

value
;
break; case "PLTE": if (
(local variable) bool sawPlte
sawPlte
||
(local variable) bool sawIdat
sawIdat
)
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 @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.badOrder = 6
badOrder
,
(local variable) const(ulong) at
at
, "PLTE must be once, before IDAT");
if (
(local variable) images_wired_png_chunks.Summary s
s
.
(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdr
ihdr
.
(field) images_wired_png_chunks.ColorType images_wired_png_chunks.Ihdr.colorType
colorType
==
(enum) images_wired_png_chunks.ColorType
ColorType
.
(enum value) images_wired_png_chunks.ColorType.greyscale = cast(ubyte)0u
greyscale
||
(local variable) images_wired_png_chunks.Summary s
s
.
(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdr
ihdr
.
(field) images_wired_png_chunks.ColorType images_wired_png_chunks.Ihdr.colorType
colorType
==
(enum) images_wired_png_chunks.ColorType
ColorType
.
(enum value) images_wired_png_chunks.ColorType.greyscaleAlpha = cast(ubyte)4u
greyscaleAlpha
)
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 @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.badOrder = 6
badOrder
,
(local variable) const(ulong) at
at
, "PLTE forbidden for this colour type");
if (
(local variable) const(images_wired_png_chunks.Chunk) chunk
chunk
.
(field) const(ubyte)[] images_wired_png_chunks.Chunk.data

borrowed from the input

data
.
(field) ulong const(ubyte[]).length
length
== 0 ||
(local variable) const(images_wired_png_chunks.Chunk) chunk
chunk
.
(field) const(ubyte)[] images_wired_png_chunks.Chunk.data

borrowed from the input

data
.
(field) ulong const(ubyte[]).length
length
% 3 ||
(local variable) const(images_wired_png_chunks.Chunk) chunk
chunk
.
(field) const(ubyte)[] images_wired_png_chunks.Chunk.data

borrowed from the input

data
.
(field) ulong const(ubyte[]).length
length
/ 3 > 256
|| (
(local variable) images_wired_png_chunks.Summary s
s
.
(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdr
ihdr
.
(field) images_wired_png_chunks.ColorType images_wired_png_chunks.Ihdr.colorType
colorType
==
(enum) images_wired_png_chunks.ColorType
ColorType
.
(enum value) images_wired_png_chunks.ColorType.indexed = cast(ubyte)3u
indexed
&&
(local variable) const(images_wired_png_chunks.Chunk) chunk
chunk
.
(field) const(ubyte)[] images_wired_png_chunks.Chunk.data

borrowed from the input

data
.
(field) ulong const(ubyte[]).length
length
/ 3 > (1 <<
(local variable) images_wired_png_chunks.Summary s
s
.
(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdr
ihdr
.
(field) ubyte images_wired_png_chunks.Ihdr.bitDepth
bitDepth
)))
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 @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.badLength = 7
badLength
,
(local variable) const(ulong) at
at
, "PLTE");
(local variable) bool sawPlte
sawPlte
= true;
(local variable) images_wired_png_chunks.Summary s
s
.
(field) ulong images_wired_png_chunks.Summary.paletteEntries
paletteEntries
=
(local variable) const(images_wired_png_chunks.Chunk) chunk
chunk
.
(field) const(ubyte)[] images_wired_png_chunks.Chunk.data

borrowed from the input

data
.
(field) ulong const(ubyte[]).length
length
/ 3;
break; case "tRNS": if (
(local variable) bool sawTrns
sawTrns
||
(local variable) bool sawIdat
sawIdat
)
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 @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.badOrder = 6
badOrder
,
(local variable) const(ulong) at
at
, "tRNS must be once, before IDAT");
final switch (
(local variable) images_wired_png_chunks.Summary s
s
.
(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdr
ihdr
.
(field) images_wired_png_chunks.ColorType images_wired_png_chunks.Ihdr.colorType
colorType
)
{ case
(enum) images_wired_png_chunks.ColorType
ColorType
.
(enum value) images_wired_png_chunks.ColorType.greyscale = cast(ubyte)0u
greyscale
:
if (
(local variable) const(images_wired_png_chunks.Chunk) chunk
chunk
.
(field) const(ubyte)[] images_wired_png_chunks.Chunk.data

borrowed from the input

data
.
(field) ulong const(ubyte[]).length
length
!= 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 @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.badLength = 7
badLength
,
(local variable) const(ulong) at
at
, "tRNS");
break; case
(enum) images_wired_png_chunks.ColorType
ColorType
.
(enum value) images_wired_png_chunks.ColorType.truecolor = cast(ubyte)2u
truecolor
:
if (
(local variable) const(images_wired_png_chunks.Chunk) chunk
chunk
.
(field) const(ubyte)[] images_wired_png_chunks.Chunk.data

borrowed from the input

data
.
(field) ulong const(ubyte[]).length
length
!= 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 @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.badLength = 7
badLength
,
(local variable) const(ulong) at
at
, "tRNS");
break; case
(enum) images_wired_png_chunks.ColorType
ColorType
.
(enum value) images_wired_png_chunks.ColorType.indexed = cast(ubyte)3u
indexed
:
if (!
(local variable) bool sawPlte
sawPlte
)
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 @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.badOrder = 6
badOrder
,
(local variable) const(ulong) at
at
, "tRNS before PLTE");
if (
(local variable) const(images_wired_png_chunks.Chunk) chunk
chunk
.
(field) const(ubyte)[] images_wired_png_chunks.Chunk.data

borrowed from the input

data
.
(field) ulong const(ubyte[]).length
length
>
(local variable) images_wired_png_chunks.Summary s
s
.
(field) ulong images_wired_png_chunks.Summary.paletteEntries
paletteEntries
)
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 @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.badLength = 7
badLength
,
(local variable) const(ulong) at
at
, "tRNS longer than PLTE");
break; case
(enum) images_wired_png_chunks.ColorType
ColorType
.
(enum value) images_wired_png_chunks.ColorType.greyscaleAlpha = cast(ubyte)4u
greyscaleAlpha
,
(enum) images_wired_png_chunks.ColorType
ColorType
.
(enum value) images_wired_png_chunks.ColorType.truecolorAlpha = cast(ubyte)6u
truecolorAlpha
:
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 @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.badOrder = 6
badOrder
,
(local variable) const(ulong) at
at
, "tRNS forbidden for this colour type");
}
(local variable) bool sawTrns
sawTrns
= true;
break; case "cICP": if (
(local variable) bool sawCicp
sawCicp
||
(local variable) bool sawPlte
sawPlte
||
(local variable) bool sawIdat
sawIdat
)
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 @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.badOrder = 6
badOrder
,
(local variable) const(ulong) at
at
, "cICP must be once, before PLTE and IDAT");
if (
(local variable) const(images_wired_png_chunks.Chunk) chunk
chunk
.
(field) const(ubyte)[] images_wired_png_chunks.Chunk.data

borrowed from the input

data
.
(field) ulong const(ubyte[]).length
length
!= 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 @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.badLength = 7
badLength
,
(local variable) const(ulong) at
at
, "cICP");
auto
(local variable) sparkles.base.expected.Expected!(Cicp, BinError, Abort) v
v
=
sparkles.base.expected.Expected!(Cicp, BinError, Abort) images_wired_png_chunks.decodeFixed!(images_wired_png_chunks.Cicp)(in ubyte[] bytes, ulong at) pure nothrow @safe

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

decodeFixed
!
(struct) images_wired_png_chunks.Cicp

§11.3.2.6.

Cicp
(
(local variable) const(images_wired_png_chunks.Chunk) chunk
chunk
.
(field) const(ubyte)[] images_wired_png_chunks.Chunk.data

borrowed from the input

data
, 0);
if (
(local variable) sparkles.base.expected.Expected!(Cicp, BinError, Abort) v
v
.
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 @safe

Checks if Expected has error

hasError
)
return relocate(
(local variable) sparkles.base.expected.Expected!(Cicp, BinError, Abort) v
v
.
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 @safe

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

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

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

Note

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

error
,
(local variable) const(ulong) at
at
);
(local variable) images_wired_png_chunks.Summary s
s
.
(field) images_wired_png_chunks.Cicp images_wired_png_chunks.Summary.cicp
cicp
=
(local variable) sparkles.base.expected.Expected!(Cicp, BinError, Abort) v
v
.
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 @safe

Returns the expected value if there is one.

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

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

Note

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

value
;
(local variable) bool sawCicp
sawCicp
= true;
break; case "acTL": if (
(local variable) bool sawActl
sawActl
||
(local variable) bool sawIdat
sawIdat
)
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 @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.badOrder = 6
badOrder
,
(local variable) const(ulong) at
at
, "acTL must be once, before IDAT");
if (
(local variable) const(images_wired_png_chunks.Chunk) chunk
chunk
.
(field) const(ubyte)[] images_wired_png_chunks.Chunk.data

borrowed from the input

data
.
(field) ulong const(ubyte[]).length
length
!= 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 @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.badLength = 7
badLength
,
(local variable) const(ulong) at
at
, "acTL");
auto
(local variable) sparkles.base.expected.Expected!(Actl, BinError, Abort) v
v
=
sparkles.base.expected.Expected!(Actl, BinError, Abort) images_wired_png_chunks.decodeFixed!(images_wired_png_chunks.Actl)(in ubyte[] bytes, ulong at) pure nothrow @safe

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

decodeFixed
!
(struct) images_wired_png_chunks.Actl

§11.3.6.1: "0 is not a valid value".

Actl
(
(local variable) const(images_wired_png_chunks.Chunk) chunk
chunk
.
(field) const(ubyte)[] images_wired_png_chunks.Chunk.data

borrowed from the input

data
, 0);
if (
(local variable) sparkles.base.expected.Expected!(Actl, BinError, Abort) v
v
.
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 @safe

Checks if Expected has error

hasError
)
return relocate(
(local variable) sparkles.base.expected.Expected!(Actl, BinError, Abort) v
v
.
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 @safe

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

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

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

Note

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

error
,
(local variable) const(ulong) at
at
);
(local variable) images_wired_png_chunks.Summary s
s
.
(field) images_wired_png_chunks.Actl images_wired_png_chunks.Summary.actl
actl
=
(local variable) sparkles.base.expected.Expected!(Actl, BinError, Abort) v
v
.
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 @safe

Returns the expected value if there is one.

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

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

Note

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

value
;
(local variable) bool sawActl
sawActl
= true;
break; case "fcTL": if (
(local variable) const(images_wired_png_chunks.Chunk) chunk
chunk
.
(field) const(ubyte)[] images_wired_png_chunks.Chunk.data

borrowed from the input

data
.
(field) ulong const(ubyte[]).length
length
!= 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 @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.badLength = 7
badLength
,
(local variable) const(ulong) at
at
, "fcTL");
auto
(local variable) sparkles.base.expected.Expected!(Fctl, BinError, Abort) v
v
=
sparkles.base.expected.Expected!(Fctl, BinError, Abort) images_wired_png_chunks.decodeFixed!(images_wired_png_chunks.Fctl)(in ubyte[] bytes, ulong at) pure nothrow @safe

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

decodeFixed
!
(struct) images_wired_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) chunk
chunk
.
(field) const(ubyte)[] images_wired_png_chunks.Chunk.data

borrowed from the input

data
, 0);
if (
(local variable) sparkles.base.expected.Expected!(Fctl, BinError, Abort) v
v
.
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 @safe

Checks if Expected has error

hasError
)
return relocate(
(local variable) sparkles.base.expected.Expected!(Fctl, BinError, Abort) v
v
.
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 @safe

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

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

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

Note

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

error
,
(local variable) const(ulong) at
at
);
if (
(local variable) sparkles.base.expected.Expected!(Fctl, BinError, Abort) v
v
.
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 @safe

Returns the expected value if there is one.

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

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

Note

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

value
.
(field) uint images_wired_png_chunks.Fctl.sequenceNumber
sequenceNumber
!=
(local variable) uint nextSequence
nextSequence
++)
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 @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.badSequence = 9
badSequence
,
(local variable) const(ulong) at
at
, "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) v
v
.
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 @safe

Returns the expected value if there is one.

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

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

Note

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

value
.
(field) uint images_wired_png_chunks.Fctl.xOffset
xOffset
+
(local variable) sparkles.base.expected.Expected!(Fctl, BinError, Abort) v
v
.
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 @safe

Returns the expected value if there is one.

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

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

Note

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

value
.
(field) uint images_wired_png_chunks.Fctl.width
width
>
(local variable) images_wired_png_chunks.Summary s
s
.
(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdr
ihdr
.
(field) uint images_wired_png_chunks.Ihdr.width
width
|| cast(ulong)
(local variable) sparkles.base.expected.Expected!(Fctl, BinError, Abort) v
v
.
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 @safe

Returns the expected value if there is one.

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

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

Note

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

value
.
(field) uint images_wired_png_chunks.Fctl.yOffset
yOffset
+
(local variable) sparkles.base.expected.Expected!(Fctl, BinError, Abort) v
v
.
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 @safe

Returns the expected value if there is one.

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

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

Note

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

value
.
(field) uint images_wired_png_chunks.Fctl.height
height
>
(local variable) images_wired_png_chunks.Summary s
s
.
(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdr
ihdr
.
(field) uint images_wired_png_chunks.Ihdr.height
height
)
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 @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.checkFailed = 3
checkFailed
,
(local variable) const(ulong) at
at
, "fcTL region outside IHDR");
if (
(local variable) images_wired_png_chunks.Summary s
s
.
(field) ulong images_wired_png_chunks.Summary.frames
frames
> 0 && !
(local variable) bool sawIdat
sawIdat
)
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 @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.badOrder = 6
badOrder
,
(local variable) const(ulong) at
at
, "only one fcTL may precede IDAT");
if (
(local variable) std.zlib.UnCompress frame
frame
!is null)
(local variable) images_wired_png_chunks.Summary s
s
.
(field) ulong images_wired_png_chunks.Summary.inflatedFrames
inflatedFrames
+=
(local variable) std.zlib.UnCompress frame
frame
.
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[].length
length
;
(local variable) std.zlib.UnCompress frame
frame
=
(local variable) bool sawIdat
sawIdat
? new
(class) std.zlib.UnCompress

Used when the data to be decompressed is not all in one buffer.

UnCompress
: null;
(local variable) images_wired_png_chunks.Fctl frameControl
frameControl
=
(local variable) sparkles.base.expected.Expected!(Fctl, BinError, Abort) v
v
.
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 @safe

Returns the expected value if there is one.

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

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

Note

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

value
;
(local variable) images_wired_png_chunks.Summary s
s
.
(field) ulong images_wired_png_chunks.Summary.frames
frames
++;
break; case "IDAT": if (
(local variable) bool idatClosed
idatClosed
)
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 @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.badOrder = 6
badOrder
,
(local variable) const(ulong) at
at
, "IDAT chunks must be consecutive");
if (
(local variable) images_wired_png_chunks.Summary s
s
.
(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdr
ihdr
.
(field) images_wired_png_chunks.ColorType images_wired_png_chunks.Ihdr.colorType
colorType
==
(enum) images_wired_png_chunks.ColorType
ColorType
.
(enum value) images_wired_png_chunks.ColorType.indexed = cast(ubyte)3u
indexed
&& !
(local variable) bool sawPlte
sawPlte
)
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 @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.missingChunk = 8
missingChunk
,
(local variable) const(ulong) at
at
, "PLTE required for indexed colour");
(local variable) bool sawIdat
sawIdat
= true;
(local variable) images_wired_png_chunks.Summary s
s
.
(field) ulong images_wired_png_chunks.Summary.idatChunks
idatChunks
++;
// 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 s
s
.
(field) ulong images_wired_png_chunks.Summary.inflatedImage
inflatedImage
+=
(local variable) std.zlib.UnCompress image
image
.
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) chunk
chunk
.
(field) const(ubyte)[] images_wired_png_chunks.Chunk.data

borrowed from the input

data
).
(field) ulong const(void)[].length
length
;
break; case "fdAT": if (!
(local variable) bool sawIdat
sawIdat
||
(local variable) std.zlib.UnCompress frame
frame
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 @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.badOrder = 6
badOrder
,
(local variable) const(ulong) at
at
, "fdAT before IDAT or without fcTL");
if (
(local variable) const(images_wired_png_chunks.Chunk) chunk
chunk
.
(field) const(ubyte)[] images_wired_png_chunks.Chunk.data

borrowed from the input

data
.
(field) ulong const(ubyte[]).length
length
< 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 @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.badLength = 7
badLength
,
(local variable) const(ulong) at
at
, "fdAT");
if (
ulong images_wired_png_chunks.readBe(in ubyte[] bytes, ulong at, ulong width) pure nothrow @nogc @safe
readBe
(
(local variable) const(images_wired_png_chunks.Chunk) chunk
chunk
.
(field) const(ubyte)[] images_wired_png_chunks.Chunk.data

borrowed from the input

data
, 0, 4) !=
(local variable) uint nextSequence
nextSequence
++)
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 @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.badSequence = 9
badSequence
,
(local variable) const(ulong) at
at
, "fdAT sequence_number");
(local variable) images_wired_png_chunks.Summary s
s
.
(field) ulong images_wired_png_chunks.Summary.inflatedFrames
inflatedFrames
+=
(local variable) std.zlib.UnCompress frame
frame
.
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) chunk
chunk
.
(field) const(ubyte)[] images_wired_png_chunks.Chunk.data

borrowed from the input

data
[4 .. $]).
(field) ulong const(void)[].length
length
;
break; case "IEND": if (
(local variable) const(images_wired_png_chunks.Chunk) chunk
chunk
.
(field) const(ubyte)[] images_wired_png_chunks.Chunk.data

borrowed from the input

data
.
(field) ulong const(ubyte[]).length
length
!= 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 @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.badLength = 7
badLength
,
(local variable) const(ulong) at
at
, "IEND");
(local variable) bool sawIend
sawIend
= true;
break; default: if ((
(local variable) const(char[4]) type
type
[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 @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.missingChunk = 8
missingChunk
,
(local variable) const(ulong) at
at
, "unknown critical chunk");
break; // unknown ancillary chunks are skipped }
(local variable) ulong pos
pos
+= 12 +
(local variable) const(images_wired_png_chunks.Chunk) chunk
chunk
.
(field) const(ubyte)[] images_wired_png_chunks.Chunk.data

borrowed from the input

data
.
(field) ulong const(ubyte[]).length
length
;
} if (!
(local variable) bool sawIend
sawIend
)
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 @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.missingChunk = 8
missingChunk
,
(local variable) ulong pos
pos
, "IEND");
if (!
(local variable) bool sawIdat
sawIdat
)
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 @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.missingChunk = 8
missingChunk
,
(local variable) ulong pos
pos
, "IDAT");
(local variable) images_wired_png_chunks.Summary s
s
.
(field) ulong images_wired_png_chunks.Summary.inflatedImage
inflatedImage
+=
(local variable) std.zlib.UnCompress image
image
.
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[].length
length
;
if (
(local variable) std.zlib.UnCompress frame
frame
!is null)
(local variable) images_wired_png_chunks.Summary s
s
.
(field) ulong images_wired_png_chunks.Summary.inflatedFrames
inflatedFrames
+=
(local variable) std.zlib.UnCompress frame
frame
.
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[].length
length
;
if (
(local variable) images_wired_png_chunks.Summary s
s
.
(field) ulong images_wired_png_chunks.Summary.inflatedImage
inflatedImage
!=
ulong images_wired_png_chunks.expectedInflated(uint width, uint height, in images_wired_png_chunks.Ihdr h) pure nothrow @nogc @safe

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.

expectedInflated
(
(local variable) images_wired_png_chunks.Summary s
s
.
(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdr
ihdr
.
(field) uint images_wired_png_chunks.Ihdr.width
width
,
(local variable) images_wired_png_chunks.Summary s
s
.
(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdr
ihdr
.
(field) uint images_wired_png_chunks.Ihdr.height
height
,
(local variable) images_wired_png_chunks.Summary s
s
.
(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdr
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, ulong offset, string what) pure nothrow @nogc @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.badStream = 10
badStream
,
(local variable) ulong pos
pos
, "IDAT stream size differs from IHDR");
if (
(local variable) bool sawActl
sawActl
&&
(local variable) images_wired_png_chunks.Summary s
s
.
(field) images_wired_png_chunks.Actl images_wired_png_chunks.Summary.actl
actl
.
(field) uint images_wired_png_chunks.Actl.numFrames
numFrames
!=
(local variable) images_wired_png_chunks.Summary s
s
.
(field) ulong images_wired_png_chunks.Summary.frames
frames
)
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 @safe
fail
(
(enum) images_wired_png_chunks.BinErrorKind
BinErrorKind
.
(enum value) images_wired_png_chunks.BinErrorKind.checkFailed = 3
checkFailed
,
(local variable) ulong pos
pos
, "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 @safe

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

ok
!
(struct) images_wired_png_chunks.BinError
BinError
(
(local variable) images_wired_png_chunks.Summary s
s
);
} // --------------------------------------------------------------------------- // 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[] output
output
,
(alias) object.string = string
string
(parameter) string type
type
, in ubyte[]
(parameter) const(ubyte[]) data
data
)
{
(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 header
header
;
(local variable) images_wired_png_chunks.ChunkHeader header
header
.
(field) uint images_wired_png_chunks.ChunkHeader.length
length
= cast(uint)
(parameter) const(ubyte[]) data
data
.
(field) ulong const(ubyte[]).length
length
;
(local variable) images_wired_png_chunks.ChunkHeader header
header
.
(field) char[4] images_wired_png_chunks.ChunkHeader.type
type
=
(parameter) string type
type
[0 .. 4];
const
(local variable) const(string) refused
refused
=
string images_wired_png_chunks.encodeFixed!(images_wired_png_chunks.ChunkHeader)(in images_wired_png_chunks.ChunkHeader value, ref ubyte[] output) pure nothrow @safe

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

encodeFixed
(
(local variable) images_wired_png_chunks.ChunkHeader header
header
,
(parameter) ubyte[] output
output
);
assert(
(local variable) const(string) refused
refused
is null,
(local variable) const(string) refused
refused
);
(parameter) ubyte[] output
output
~=
(parameter) const(ubyte[]) data
data
;
const
(local variable) const(uint) crc
crc
=
uint images_wired_png_chunks.crc32(in ubyte[] a, in ubyte[] b) pure nothrow @nogc @safe

GAP

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 type
type
,
(parameter) const(ubyte[]) data
data
);
foreach_reverse (
(local variable) int k
k
; 0 .. 4)
(parameter) ubyte[] output
output
~= cast(ubyte)(
(local variable) const(uint) crc
crc
>> (8 *
(local variable) int k
k
));
} ubyte[]
ubyte[] images_wired_png_chunks.fixedBytes!(images_wired_png_chunks.Ihdr)(in images_wired_png_chunks.Ihdr value) pure nothrow @safe
fixedBytes
(T)(in
(alias) T = images_wired_png_chunks.Ihdr
T
(parameter) const(images_wired_png_chunks.Ihdr) value
value
)
{ ubyte[]
(local variable) ubyte[] output
output
;
const
(local variable) const(string) refused
refused
=
string images_wired_png_chunks.encodeFixed!(images_wired_png_chunks.Ihdr)(in images_wired_png_chunks.Ihdr value, ref ubyte[] output) pure nothrow @safe

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

encodeFixed
(
(parameter) const(images_wired_png_chunks.Ihdr) value
value
,
(local variable) ubyte[] output
output
);
assert(
(local variable) const(string) refused
refused
is null,
(local variable) const(string) refused
refused
);
return
(local variable) ubyte[] output
output
;
} ubyte[]
ubyte[] images_wired_png_chunks.be32(uint v)
be32
(uint
(parameter) uint v
v
) => [cast(ubyte)(
(parameter) uint v
v
>> 24), cast(ubyte)(
(parameter) uint v
v
>> 16), cast(ubyte)(
(parameter) uint v
v
>> 8), cast(ubyte)
(parameter) uint v
v
];
enum
(enum) images_wired_png_chunks.Variant
Variant
{
(enum value) images_wired_png_chunks.Variant.valid = 0
valid
,
(enum value) images_wired_png_chunks.Variant.badCrc = 1
badCrc
,
(enum value) images_wired_png_chunks.Variant.badDepth = 2
badDepth
,
(enum value) images_wired_png_chunks.Variant.trnsBeforePlte = 3
trnsBeforePlte
,
(enum value) images_wired_png_chunks.Variant.splitIdat = 4
splitIdat
,
(enum value) images_wired_png_chunks.Variant.sequenceGap = 5
sequenceGap
,
(enum value) images_wired_png_chunks.Variant.frameOutside = 6
frameOutside
,
(enum value) images_wired_png_chunks.Variant.cicpMatrix = 7
cicpMatrix
,
(enum value) images_wired_png_chunks.Variant.truncated = 8
truncated
,
} ubyte[]
ubyte[] images_wired_png_chunks.buildPng(images_wired_png_chunks.Variant variant)
buildPng
(
(enum) images_wired_png_chunks.Variant
Variant
(parameter) images_wired_png_chunks.Variant variant
variant
)
{ ubyte[]
(local variable) ubyte[] png
png
=
(immutable global) immutable(ubyte[8]) images_wired_png_chunks.pngSignature
pngSignature
.
ubyte[] object.dup!ubyte(const(ubyte)[] a) pure nothrow @property @safe
dup
;
const
(local variable) const(images_wired_png_chunks.Ihdr) ihdr
ihdr
=
(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 variant
variant
==
(enum) images_wired_png_chunks.Variant
Variant
.
(enum value) images_wired_png_chunks.Variant.badDepth = 2
badDepth
? 16 : 8,
(enum) images_wired_png_chunks.ColorType
ColorType
.
(enum value) images_wired_png_chunks.ColorType.indexed = cast(ubyte)3u
indexed
, 0, 0, 0);
ubyte[]
(local variable) ubyte[] ihdrBytes
ihdrBytes
;
// 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 @safe

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

encodeFixed
(
(local variable) const(images_wired_png_chunks.Ihdr) ihdr
ihdr
,
(local variable) ubyte[] ihdrBytes
ihdrBytes
) !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 @safe
writeNode
!(
(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.BeFixed

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

BeFixed
,
(struct) images_wired_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) ihdr
ihdr
,
(local variable) ubyte[] ihdrBytes
ihdrBytes
);
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[] png
png
, "IHDR",
(local variable) ubyte[] ihdrBytes
ihdrBytes
);
if (
(parameter) images_wired_png_chunks.Variant variant
variant
==
(enum) images_wired_png_chunks.Variant
Variant
.
(enum value) images_wired_png_chunks.Variant.cicpMatrix = 7
cicpMatrix
)
{ ubyte[]
(local variable) ubyte[] cicpBytes
cicpBytes
; // 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 @safe
writeNode
!(
(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.BeFixed

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

BeFixed
,
(struct) images_wired_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[] cicpBytes
cicpBytes
);
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[] png
png
, "cICP",
(local variable) ubyte[] cicpBytes
cicpBytes
);
} 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[] png
png
, "cICP",
ubyte[] images_wired_png_chunks.fixedBytes!(images_wired_png_chunks.Cicp)(in images_wired_png_chunks.Cicp value) pure nothrow @safe
fixedBytes
(
(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[] png
png
, "acTL",
ubyte[] images_wired_png_chunks.fixedBytes!(images_wired_png_chunks.Actl)(in images_wired_png_chunks.Actl value) pure nothrow @safe
fixedBytes
(
(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[]) palette
palette
= [255, 0, 0, 0, 255, 0, 0, 0, 255];
const ubyte[]
(local variable) const(ubyte[]) trns
trns
= [0];
if (
(parameter) images_wired_png_chunks.Variant variant
variant
==
(enum) images_wired_png_chunks.Variant
Variant
.
(enum value) images_wired_png_chunks.Variant.trnsBeforePlte = 3
trnsBeforePlte
)
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[] png
png
, "tRNS",
(local variable) const(ubyte[]) trns
trns
);
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[] png
png
, "PLTE",
(local variable) const(ubyte[]) palette
palette
);
if (
(parameter) images_wired_png_chunks.Variant variant
variant
!=
(enum) images_wired_png_chunks.Variant
Variant
.
(enum value) images_wired_png_chunks.Variant.trnsBeforePlte = 3
trnsBeforePlte
)
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[] png
png
, "tRNS",
(local variable) const(ubyte[]) trns
trns
);
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[] png
png
, "fcTL",
ubyte[] images_wired_png_chunks.fixedBytes!(images_wired_png_chunks.Fctl)(in images_wired_png_chunks.Fctl value) pure nothrow @safe
fixedBytes
(
(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.DisposeOp
DisposeOp
.
(enum value) images_wired_png_chunks.DisposeOp.none = cast(ubyte)0u
none
,
(enum) images_wired_png_chunks.BlendOp
BlendOp
.
(enum value) images_wired_png_chunks.BlendOp.source = cast(ubyte)0u
source
)));
// Two rows of filter byte 0 plus four palette indices: one zlib stream // split across two IDAT chunks. const ubyte[]
(local variable) const(ubyte[]) rows
rows
= [0, 0, 1, 2, 0, 0, 2, 1, 0, 1];
const
(local variable) const(ubyte[]) stream
stream
= cast(const(ubyte)[])
ubyte[] std.zlib.compress(const(void)[] srcbuf)

Compress data

@paramsrcbuf buffer containing the data to compress@paramlevel compression level. Legal values are -1 .. 9, with -1 indicating the default level (6), 0 indicating no compression, 1 being the least compression and 9 being the most.@returnsthe compressed data
compress
(
(local variable) const(ubyte[]) rows
rows
);
const
(local variable) const(ulong) half
half
=
(local variable) const(ubyte[]) stream
stream
.
(field) ulong const(ubyte[]).length
length
/ 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[] png
png
, "IDAT",
(local variable) const(ubyte[]) stream
stream
[0 ..
(local variable) const(ulong) half
half
]);
if (
(parameter) images_wired_png_chunks.Variant variant
variant
==
(enum) images_wired_png_chunks.Variant
Variant
.
(enum value) images_wired_png_chunks.Variant.splitIdat = 4
splitIdat
)
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[] png
png
, "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[] png
png
, "IDAT",
(local variable) const(ubyte[]) stream
stream
[
(local variable) const(ulong) half
half
.. $]);
const
(local variable) const(int) xOffset
xOffset
=
(parameter) images_wired_png_chunks.Variant variant
variant
==
(enum) images_wired_png_chunks.Variant
Variant
.
(enum value) images_wired_png_chunks.Variant.frameOutside = 6
frameOutside
? 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[] png
png
, "fcTL",
ubyte[] images_wired_png_chunks.fixedBytes!(images_wired_png_chunks.Fctl)(in images_wired_png_chunks.Fctl value) pure nothrow @safe
fixedBytes
(
(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) xOffset
xOffset
, 1, 1, 10,
(enum) images_wired_png_chunks.DisposeOp
DisposeOp
.
(enum value) images_wired_png_chunks.DisposeOp.background = cast(ubyte)1u
background
,
(enum) images_wired_png_chunks.BlendOp
BlendOp
.
(enum value) images_wired_png_chunks.BlendOp.over = cast(ubyte)1u
over
)));
const ubyte[]
(local variable) const(ubyte[]) frameRow
frameRow
= [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[] png
png
, "fdAT",
ubyte[] images_wired_png_chunks.be32(uint v)
be32
(
(parameter) images_wired_png_chunks.Variant variant
variant
==
(enum) images_wired_png_chunks.Variant
Variant
.
(enum value) images_wired_png_chunks.Variant.sequenceGap = 5
sequenceGap
? 3 : 2)
~ cast(const(ubyte)[])
ubyte[] std.zlib.compress(const(void)[] srcbuf)

Compress data

@paramsrcbuf buffer containing the data to compress@paramlevel compression level. Legal values are -1 .. 9, with -1 indicating the default level (6), 0 indicating no compression, 1 being the least compression and 9 being the most.@returnsthe compressed data
compress
(
(local variable) const(ubyte[]) frameRow
frameRow
));
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[] png
png
, "IEND", null);
if (
(parameter) images_wired_png_chunks.Variant variant
variant
==
(enum) images_wired_png_chunks.Variant
Variant
.
(enum value) images_wired_png_chunks.Variant.badCrc = 1
badCrc
)
(local variable) ubyte[] png
png
[8 + 8 + 13] ^= 0x01; // a bit of IHDR's CRC
if (
(parameter) images_wired_png_chunks.Variant variant
variant
==
(enum) images_wired_png_chunks.Variant
Variant
.
(enum value) images_wired_png_chunks.Variant.truncated = 8
truncated
)
(local variable) ubyte[] png
png
=
(local variable) ubyte[] png
png
[0 .. 8 + 8 + 6];
return
(local variable) ubyte[] png
png
;
} void
void images_wired_png_chunks.report(string label, in ubyte[] bytes)
report
(
(alias) object.string = string
string
(parameter) string label
label
, in ubyte[]
(parameter) const(ubyte[]) bytes
bytes
)
{ auto
(local variable) sparkles.base.expected.Expected!(Summary, BinError, Abort) r
r
=
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[]) bytes
bytes
);
if (
(local variable) sparkles.base.expected.Expected!(Summary, BinError, Abort) r
r
.
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 @safe

Checks 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) @safe

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

writefln
("png: %s: %s at offset %s (%s)",
(parameter) string label
label
,
(local variable) sparkles.base.expected.Expected!(Summary, BinError, Abort) r
r
.
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 @safe

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

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

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

Note

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

error
.
(field) images_wired_png_chunks.BinErrorKind images_wired_png_chunks.BinError.kind
kind
,
(local variable) sparkles.base.expected.Expected!(Summary, BinError, Abort) r
r
.
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 @safe

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

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

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

Note

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

error
.
(field) ulong images_wired_png_chunks.BinError.offset
offset
,
(local variable) sparkles.base.expected.Expected!(Summary, BinError, Abort) r
r
.
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 @safe

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

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

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

Note

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

error
.
(field) string images_wired_png_chunks.BinError.what
what
);
else
void std.stdio.writefln!(char, string)(in char[] fmt, string __param_1) @safe

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

writefln
("png: %s: ok",
(parameter) string label
label
);
} 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.BeFixed

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

BeFixed
,
(struct) images_wired_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) @safe

Equivalent 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 @safe

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

fixedSize
(
(constant) sparkles.wired.schema.WireSchema images_wired_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 @safe

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

fixedSize
(
(template instance) sparkles.wired.schema.wireSchemaOf!(images_wired_png_chunks.BeFixed, images_wired_png_chunks.Ihdr)
wireSchemaOf
!(
(struct) images_wired_png_chunks.BeFixed

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

BeFixed
,
(struct) images_wired_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 @safe

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

fixedSize
(
(template instance) sparkles.wired.schema.wireSchemaOf!(images_wired_png_chunks.BeFixed, images_wired_png_chunks.Cicp)
wireSchemaOf
!(
(struct) images_wired_png_chunks.BeFixed

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

BeFixed
,
(struct) images_wired_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 @safe

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

fixedSize
(
(template instance) sparkles.wired.schema.wireSchemaOf!(images_wired_png_chunks.BeFixed, images_wired_png_chunks.Actl)
wireSchemaOf
!(
(struct) images_wired_png_chunks.BeFixed

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

BeFixed
,
(struct) images_wired_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 @safe

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

fixedSize
(
(template instance) sparkles.wired.schema.wireSchemaOf!(images_wired_png_chunks.BeFixed, images_wired_png_chunks.Fctl)
wireSchemaOf
!(
(struct) images_wired_png_chunks.BeFixed

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

BeFixed
,
(struct) images_wired_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) @safe

Equivalent 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.annotations
annotations
[
(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.nodes
nodes
[1].
(field) ulong sparkles.wired.schema.SchemaNode.firstAnnotation
firstAnnotation
].
(field) string sparkles.wired.schema.SchemaAnnotation.value

CTFE spelling of the attached value

value
);
const
(local variable) const(ubyte[]) png
png
=
ubyte[] images_wired_png_chunks.buildPng(images_wired_png_chunks.Variant variant)
buildPng
(
(enum) images_wired_png_chunks.Variant
Variant
.
(enum value) images_wired_png_chunks.Variant.valid = 0
valid
);
auto
(local variable) sparkles.base.expected.Expected!(Summary, BinError, Abort) r
r
=
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[]) png
png
);
assert(
(local variable) sparkles.base.expected.Expected!(Summary, BinError, Abort) r
r
.
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 @safe

Checks if Expected has value

hasValue
);
const
(local variable) const(images_wired_png_chunks.Summary) s
s
=
(local variable) sparkles.base.expected.Expected!(Summary, BinError, Abort) r
r
.
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 @safe

Returns the expected value if there is one.

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

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

Note

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

value
;
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) @safe

Equivalent 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[]) png
png
.
(field) ulong const(ubyte[]).length
length
,
(local variable) const(images_wired_png_chunks.Summary) s
s
.
(field) ulong images_wired_png_chunks.Summary.chunks
chunks
,
(local variable) const(images_wired_png_chunks.Summary) s
s
.
(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdr
ihdr
.
(field) uint images_wired_png_chunks.Ihdr.width
width
,
(local variable) const(images_wired_png_chunks.Summary) s
s
.
(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdr
ihdr
.
(field) uint images_wired_png_chunks.Ihdr.height
height
,
(local variable) const(images_wired_png_chunks.Summary) s
s
.
(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdr
ihdr
.
(field) images_wired_png_chunks.ColorType images_wired_png_chunks.Ihdr.colorType
colorType
,
(local variable) const(images_wired_png_chunks.Summary) s
s
.
(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdr
ihdr
.
(field) ubyte images_wired_png_chunks.Ihdr.bitDepth
bitDepth
,
(local variable) const(images_wired_png_chunks.Summary) s
s
.
(field) ulong images_wired_png_chunks.Summary.paletteEntries
paletteEntries
);
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) @safe

Equivalent 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) s
s
.
(field) images_wired_png_chunks.Cicp images_wired_png_chunks.Summary.cicp
cicp
.
(field) ubyte images_wired_png_chunks.Cicp.colourPrimaries
colourPrimaries
,
(local variable) const(images_wired_png_chunks.Summary) s
s
.
(field) images_wired_png_chunks.Cicp images_wired_png_chunks.Summary.cicp
cicp
.
(field) ubyte images_wired_png_chunks.Cicp.transferFunction
transferFunction
,
(local variable) const(images_wired_png_chunks.Summary) s
s
.
(field) images_wired_png_chunks.Cicp images_wired_png_chunks.Summary.cicp
cicp
.
(field) ubyte images_wired_png_chunks.Cicp.matrixCoefficients
matrixCoefficients
,
(local variable) const(images_wired_png_chunks.Summary) s
s
.
(field) images_wired_png_chunks.Cicp images_wired_png_chunks.Summary.cicp
cicp
.
(field) ubyte images_wired_png_chunks.Cicp.videoFullRange
videoFullRange
,
(local variable) const(images_wired_png_chunks.Summary) s
s
.
(field) images_wired_png_chunks.Actl images_wired_png_chunks.Summary.actl
actl
.
(field) uint images_wired_png_chunks.Actl.numFrames
numFrames
,
(local variable) const(images_wired_png_chunks.Summary) s
s
.
(field) images_wired_png_chunks.Actl images_wired_png_chunks.Summary.actl
actl
.
(field) uint images_wired_png_chunks.Actl.numPlays
numPlays
,
(local variable) const(images_wired_png_chunks.Summary) s
s
.
(field) ulong images_wired_png_chunks.Summary.frames
frames
);
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) @safe

Equivalent 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) s
s
.
(field) ulong images_wired_png_chunks.Summary.idatChunks
idatChunks
,
(local variable) const(images_wired_png_chunks.Summary) s
s
.
(field) ulong images_wired_png_chunks.Summary.inflatedImage
inflatedImage
,
ulong images_wired_png_chunks.expectedInflated(uint width, uint height, in images_wired_png_chunks.Ihdr h) pure nothrow @nogc @safe

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.

expectedInflated
(
(local variable) const(images_wired_png_chunks.Summary) s
s
.
(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdr
ihdr
.
(field) uint images_wired_png_chunks.Ihdr.width
width
,
(local variable) const(images_wired_png_chunks.Summary) s
s
.
(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdr
ihdr
.
(field) uint images_wired_png_chunks.Ihdr.height
height
,
(local variable) const(images_wired_png_chunks.Summary) s
s
.
(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdr
ihdr
),
(local variable) const(images_wired_png_chunks.Summary) s
s
.
(field) ulong images_wired_png_chunks.Summary.inflatedFrames
inflatedFrames
);
const
(local variable) const(ubyte[]) again
again
=
ubyte[] images_wired_png_chunks.fixedBytes!(images_wired_png_chunks.Ihdr)(in images_wired_png_chunks.Ihdr value) pure nothrow @safe
fixedBytes
(
(local variable) const(images_wired_png_chunks.Summary) s
s
.
(field) images_wired_png_chunks.Ihdr images_wired_png_chunks.Summary.ihdr
ihdr
);
void std.stdio.writefln!(char, ulong, bool)(in char[] fmt, ulong __param_1, bool __param_2) @safe

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

writefln
("png: round trip: IHDR re-encoded to %s bytes, identical: %s",
(local variable) const(ubyte[]) again
again
.
(field) ulong const(ubyte[]).length
length
,
(local variable) const(ubyte[]) again
again
==
(local variable) const(ubyte[]) png
png
[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.Variant
Variant
.
(enum value) images_wired_png_chunks.Variant.badCrc = 1
badCrc
));
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.Variant
Variant
.
(enum value) images_wired_png_chunks.Variant.badDepth = 2
badDepth
));
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.Variant
Variant
.
(enum value) images_wired_png_chunks.Variant.trnsBeforePlte = 3
trnsBeforePlte
));
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.Variant
Variant
.
(enum value) images_wired_png_chunks.Variant.splitIdat = 4
splitIdat
));
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.Variant
Variant
.
(enum value) images_wired_png_chunks.Variant.sequenceGap = 5
sequenceGap
));
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.Variant
Variant
.
(enum value) images_wired_png_chunks.Variant.frameOutside = 6
frameOutside
));
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.Variant
Variant
.
(enum value) images_wired_png_chunks.Variant.cicpMatrix = 7
cicpMatrix
));
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.Variant
Variant
.
(enum value) images_wired_png_chunks.Variant.truncated = 8
truncated
));
}