struct

DataDungeon::ImageMeta

Inherits JSON::Serializable < DataDungeon::AssetMeta < Struct < Value < Object

Image fields (image_meta). nil means not known, never zero.

Measured by DataDungeon from the stored bytes: width, height, transparent (any pixel not fully opaque), dominant_color (0xRRGGBB, hex in JSON), the content box around the visible pixels (content_*), and an animation's frames (animation). For an animation every field describes its first frame, and keyframes record what changes.

Set by the application, usually from what it asked the generator for: the view (view_x/y/z, a unit vector from the thing toward the camera, in the thing's frame, and view_roll in quarter turns), the light (light_x/y/z, where it comes from, in the picture's frame), the anchor (anchor_x/y, 0 to 1 across and down, the point that sits on the ground or attaches), and the thing's real size in metres in its own frame (world_width across, world_height up, world_depth front to back). view: and light: take the readable form (Direction).

Constants

SET_FIELDS = ["usage_class", "presentation", "view_x", "view_y", "view_z", "view_roll", "light_x", "light_y", "light_z", "anchor_x", "anchor_y", "world_width", "world_height", "world_depth"] of ::String

The fields the application sets, which update_asset(image:) changes.

Constructors

new(width : Int32 | Nil = nil, height : Int32 | Nil = nil, usage_class : String | Nil = nil, compression : String = "original", quality_floor : Int32 | Nil = nil, max_colors : Int32 | Nil = nil, target_format : String | Nil = nil, presentation : String | Nil = nil, transparent : Bool | Nil = nil, dominant_color : Int32 | Nil = nil, content_x : Int32 | Nil = nil, content_y : Int32 | Nil = nil, content_w : Int32 | Nil = nil, content_h : Int32 | Nil = nil, measured : Bool = false, view_x : Float64 | Nil = nil, view_y : Float64 | Nil = nil, view_z : Float64 | Nil = nil, view_roll : Float64 | Nil = nil, light_x : Float64 | Nil = nil, light_y : Float64 | Nil = nil, light_z : Float64 | Nil = nil, anchor_x : Float64 | Nil = nil, anchor_y : Float64 | Nil = nil, world_width : Float64 | Nil = nil, world_height : Float64 | Nil = nil, world_depth : Float64 | Nil = nil, animation : ImageAnimation | Nil = nil, view : Direction | Nil = nil, light : Direction | Nil = nil)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

anchor_x
Source
anchor_y
Source
animated

Whether it's an animation (see animation).

Source
animation
Source
compression
Source
content_h
Source
content_w
Source
content_x
Source
content_y
Source
dominant_color
Source
height
Source
light

The light in readable form, or nil when not known.

Source
light_x
Source
light_y
Source
light_z
Source
max_colors
Source
measured(measurement : Measurement) : ImageMeta

These fields with what DataDungeon measured in place of its own.

Source
measured?

Whether DataDungeon has read the bytes (measuring what their format allows).

Source
presentation

Renderer placement hint (opaque JSON blob). Present on visual media (image, video); nil for audio and text.

Source
quality_floor
Source
target_format
Source
transparent
Source
tried

These fields marked as read, for bytes DataDungeon can't measure.

Source
usage_class
Source
view

The view in readable form, or nil when not known.

Source
view_roll
Source
view_x
Source
view_y
Source
view_z
Source
width
Source
world_depth
Source
world_height
Source
world_width
Source