class Novika::Image

Overview

An image consists of the 'NKI' signature, payload compression type (see Image::CompressionType), and the (optionally compressed) payload itself (see ImagePayload).

Defined in:

novika/image.cr

Constant Summary

ENDIAN = ["big"]

An image consists of the 'NKI' signature, payload compression type (see Image::CompressionType), and the (optionally compressed) payload itself (see ImagePayload).

KLASS_NAME = [Novika::Image]

An image consists of the 'NKI' signature, payload compression type (see Image::CompressionType), and the (optionally compressed) payload itself (see ImagePayload).

PARTS = [{type: "string", name: signature, cls: String, onlyif: nil, verify: -> do signature == "NKI" end, length: -> do 3 end, value: nil, encoding: nil}, {type: "bitfield", name: 3, cls: Novika::Image, onlyif: nil, verify: nil}] of Nil

An image consists of the 'NKI' signature, payload compression type (see Image::CompressionType), and the (optionally compressed) payload itself (see ImagePayload).

REMAINING = [{type: "bytes", name: payload, onlyif: nil, verify: nil}] of Nil

An image consists of the 'NKI' signature, payload compression type (see Image::CompressionType), and the (optionally compressed) payload itself (see ImagePayload).

Constructors

Class Method Summary

Macro Summary

Instance Method Summary

Constructor Detail

def self.new(payload : ImagePayload, compression = CompressionType::GzipFast) #

def self.new(block : Block, caps : CapabilityCollection, compression = CompressionType::GzipFast, mode = CaptureMode::CaptureAll) #

Returns the Image formed with this block as the pivot block. Needs access to the current capability collection, caps, to read which capabilities are going to be required to run the image.

You can optionally specify the compression method used. For a list of available compression methods, see the CompressionType enum.

You can optionally specify mode. See BlockVisitor::VisitMode for a list of available visit modes.


Class Method Detail

def self.bit_fields #

An image consists of the 'NKI' signature, payload compression type (see Image::CompressionType), and the (optionally compressed) payload itself (see ImagePayload).


Macro Detail

macro novika_block_pool(name, onlyif = nil, verify = nil, value = nil) #

An image consists of the 'NKI' signature, payload compression type (see Image::CompressionType), and the (optionally compressed) payload itself (see ImagePayload).


macro novika_block_ref_snapshot(name, onlyif = nil, verify = nil, value = nil) #

An image consists of the 'NKI' signature, payload compression type (see Image::CompressionType), and the (optionally compressed) payload itself (see ImagePayload).


macro novika_boolean_snapshot(name, onlyif = nil, verify = nil, value = nil) #

An image consists of the 'NKI' signature, payload compression type (see Image::CompressionType), and the (optionally compressed) payload itself (see ImagePayload).


macro novika_builtin_snapshot(name, onlyif = nil, verify = nil, value = nil) #

An image consists of the 'NKI' signature, payload compression type (see Image::CompressionType), and the (optionally compressed) payload itself (see ImagePayload).


macro novika_byteslice_snapshot(name, onlyif = nil, verify = nil, value = nil) #

An image consists of the 'NKI' signature, payload compression type (see Image::CompressionType), and the (optionally compressed) payload itself (see ImagePayload).


macro novika_color_snapshot(name, onlyif = nil, verify = nil, value = nil) #

An image consists of the 'NKI' signature, payload compression type (see Image::CompressionType), and the (optionally compressed) payload itself (see ImagePayload).


macro novika_frozen_block(name, onlyif = nil, verify = nil, value = nil) #

An image consists of the 'NKI' signature, payload compression type (see Image::CompressionType), and the (optionally compressed) payload itself (see ImagePayload).


macro novika_frozen_block_dict(name, onlyif = nil, verify = nil, value = nil) #

An image consists of the 'NKI' signature, payload compression type (see Image::CompressionType), and the (optionally compressed) payload itself (see ImagePayload).


macro novika_frozen_block_friends(name, onlyif = nil, verify = nil, value = nil) #

An image consists of the 'NKI' signature, payload compression type (see Image::CompressionType), and the (optionally compressed) payload itself (see ImagePayload).


macro novika_frozen_block_tape(name, onlyif = nil, verify = nil, value = nil) #

An image consists of the 'NKI' signature, payload compression type (see Image::CompressionType), and the (optionally compressed) payload itself (see ImagePayload).


macro novika_frozen_entry(name, onlyif = nil, verify = nil, value = nil) #

An image consists of the 'NKI' signature, payload compression type (see Image::CompressionType), and the (optionally compressed) payload itself (see ImagePayload).


macro novika_image(name, onlyif = nil, verify = nil, value = nil) #

An image consists of the 'NKI' signature, payload compression type (see Image::CompressionType), and the (optionally compressed) payload itself (see ImagePayload).


macro novika_image_payload(name, onlyif = nil, verify = nil, value = nil) #

An image consists of the 'NKI' signature, payload compression type (see Image::CompressionType), and the (optionally compressed) payload itself (see ImagePayload).


macro novika_image_payload_capabilities(name, onlyif = nil, verify = nil, value = nil) #

An image consists of the 'NKI' signature, payload compression type (see Image::CompressionType), and the (optionally compressed) payload itself (see ImagePayload).


macro novika_image_payload_capability_id(name, onlyif = nil, verify = nil, value = nil) #

An image consists of the 'NKI' signature, payload compression type (see Image::CompressionType), and the (optionally compressed) payload itself (see ImagePayload).


macro novika_image_payload_ver(name, onlyif = nil, verify = nil, value = nil) #

An image consists of the 'NKI' signature, payload compression type (see Image::CompressionType), and the (optionally compressed) payload itself (see ImagePayload).


macro novika_large_decimal_snapshot(name, onlyif = nil, verify = nil, value = nil) #

An image consists of the 'NKI' signature, payload compression type (see Image::CompressionType), and the (optionally compressed) payload itself (see ImagePayload).


macro novika_quote_snapshot(name, onlyif = nil, verify = nil, value = nil) #

An image consists of the 'NKI' signature, payload compression type (see Image::CompressionType), and the (optionally compressed) payload itself (see ImagePayload).


macro novika_quoted_word_snapshot(name, onlyif = nil, verify = nil, value = nil) #

An image consists of the 'NKI' signature, payload compression type (see Image::CompressionType), and the (optionally compressed) payload itself (see ImagePayload).


macro novika_small_decimal_snapshot(name, onlyif = nil, verify = nil, value = nil) #

An image consists of the 'NKI' signature, payload compression type (see Image::CompressionType), and the (optionally compressed) payload itself (see ImagePayload).


macro novika_snapshot(name, onlyif = nil, verify = nil, value = nil) #

An image consists of the 'NKI' signature, payload compression type (see Image::CompressionType), and the (optionally compressed) payload itself (see ImagePayload).


macro novika_typed_snapshot(name, onlyif = nil, verify = nil, value = nil) #

An image consists of the 'NKI' signature, payload compression type (see Image::CompressionType), and the (optionally compressed) payload itself (see ImagePayload).


macro novika_word_snapshot(name, onlyif = nil, verify = nil, value = nil) #

An image consists of the 'NKI' signature, payload compression type (see Image::CompressionType), and the (optionally compressed) payload itself (see ImagePayload).


Instance Method Detail

def __format__ : IO::ByteFormat #

def compression : CompressionType #

Holds compression method used to compress the payload.


def compression=(compression : UInt8) #

Holds compression method used to compress the payload.


def compression=(value : CompressionType) #

Holds compression method used to compress the payload.


def payload : Bytes #

Holds the payload, which may or may not be compressed.


def payload=(payload : Bytes) #

Holds the payload, which may or may not be compressed.


def reserved : UInt8 #

def reserved=(reserved : UInt8) #

def signature : String #

Holds Novika image signature, the string 'NKI'.


def signature=(signature : String) #

Holds Novika image signature, the string 'NKI'.


def to_block(caps : CapabilityCollection) #

Reconstructs the pivot block and its hierarchy from this image. Returns the resulting block.

Capability collection caps is required to make sure all required capabilities are enabled/available.