Class: Libpng::DecodedImage
- Inherits:
-
Struct
- Object
- Struct
- Libpng::DecodedImage
- Defined in:
- lib/libpng/decoded_image.rb
Overview
Result of decode. A frozen-keyword Struct so it crosses Ractor boundaries cleanly via moving semantics.
width image width in pixels (Integer)
height image height in pixels (Integer)
format pixel format String ("RGBA", "RGB", "GRAY", "GA")
pixels binary String of raw pixel bytes, row-major top-down
bit_depth bits per channel (8 or 16). nil if not extracted.
color_type PNG_COLOR_TYPE_* integer from IHDR. nil if not extracted.
interlace PNG_INTERLACE_* integer from IHDR. nil if not extracted.
text Hash<String,String> of tEXt/zTXt/iTXt keyword -> UTF-8
value. Empty Hash when no text chunks present.
color Hash<Symbol,> of gAMA/cHRM/sRGB/iCCP fields. Empty
Hash when no color metadata present.
phys Hash<Symbol,> from pHYs chunk, or nil when absent.
Keys: :pixels_per_unit_x, :pixels_per_unit_y, :unit,
and (when unit==1) :dpi_x, :dpi_y.
Instance Attribute Summary collapse
-
#bit_depth ⇒ Object
Returns the value of attribute bit_depth.
-
#color ⇒ Object
Returns the value of attribute color.
-
#color_type ⇒ Object
Returns the value of attribute color_type.
-
#format ⇒ Object
Returns the value of attribute format.
-
#height ⇒ Object
Returns the value of attribute height.
-
#interlace ⇒ Object
Returns the value of attribute interlace.
-
#phys ⇒ Object
Returns the value of attribute phys.
-
#pixels ⇒ Object
Returns the value of attribute pixels.
-
#text ⇒ Object
Returns the value of attribute text.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Attribute Details
#bit_depth ⇒ Object
Returns the value of attribute bit_depth
21 22 23 |
# File 'lib/libpng/decoded_image.rb', line 21 def bit_depth @bit_depth end |
#color ⇒ Object
Returns the value of attribute color
21 22 23 |
# File 'lib/libpng/decoded_image.rb', line 21 def color @color end |
#color_type ⇒ Object
Returns the value of attribute color_type
21 22 23 |
# File 'lib/libpng/decoded_image.rb', line 21 def color_type @color_type end |
#format ⇒ Object
Returns the value of attribute format
21 22 23 |
# File 'lib/libpng/decoded_image.rb', line 21 def format @format end |
#height ⇒ Object
Returns the value of attribute height
21 22 23 |
# File 'lib/libpng/decoded_image.rb', line 21 def height @height end |
#interlace ⇒ Object
Returns the value of attribute interlace
21 22 23 |
# File 'lib/libpng/decoded_image.rb', line 21 def interlace @interlace end |
#phys ⇒ Object
Returns the value of attribute phys
21 22 23 |
# File 'lib/libpng/decoded_image.rb', line 21 def phys @phys end |
#pixels ⇒ Object
Returns the value of attribute pixels
21 22 23 |
# File 'lib/libpng/decoded_image.rb', line 21 def pixels @pixels end |
#text ⇒ Object
Returns the value of attribute text
21 22 23 |
# File 'lib/libpng/decoded_image.rb', line 21 def text @text end |
#width ⇒ Object
Returns the value of attribute width
21 22 23 |
# File 'lib/libpng/decoded_image.rb', line 21 def width @width end |