Class: Libpng::DecodedImage

Inherits:
Struct
  • Object
show all
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

Instance Attribute Details

#bit_depthObject

Returns the value of attribute bit_depth

Returns:

  • (Object)

    the current value of bit_depth



21
22
23
# File 'lib/libpng/decoded_image.rb', line 21

def bit_depth
  @bit_depth
end

#colorObject

Returns the value of attribute color

Returns:

  • (Object)

    the current value of color



21
22
23
# File 'lib/libpng/decoded_image.rb', line 21

def color
  @color
end

#color_typeObject

Returns the value of attribute color_type

Returns:

  • (Object)

    the current value of color_type



21
22
23
# File 'lib/libpng/decoded_image.rb', line 21

def color_type
  @color_type
end

#formatObject

Returns the value of attribute format

Returns:

  • (Object)

    the current value of format



21
22
23
# File 'lib/libpng/decoded_image.rb', line 21

def format
  @format
end

#heightObject

Returns the value of attribute height

Returns:

  • (Object)

    the current value of height



21
22
23
# File 'lib/libpng/decoded_image.rb', line 21

def height
  @height
end

#interlaceObject

Returns the value of attribute interlace

Returns:

  • (Object)

    the current value of interlace



21
22
23
# File 'lib/libpng/decoded_image.rb', line 21

def interlace
  @interlace
end

#physObject

Returns the value of attribute phys

Returns:

  • (Object)

    the current value of phys



21
22
23
# File 'lib/libpng/decoded_image.rb', line 21

def phys
  @phys
end

#pixelsObject

Returns the value of attribute pixels

Returns:

  • (Object)

    the current value of pixels



21
22
23
# File 'lib/libpng/decoded_image.rb', line 21

def pixels
  @pixels
end

#textObject

Returns the value of attribute text

Returns:

  • (Object)

    the current value of text



21
22
23
# File 'lib/libpng/decoded_image.rb', line 21

def text
  @text
end

#widthObject

Returns the value of attribute width

Returns:

  • (Object)

    the current value of width



21
22
23
# File 'lib/libpng/decoded_image.rb', line 21

def width
  @width
end