Class: ZPNG::BMP::BmpHdrPseudoChunk

Inherits:
Chunk::IHDR show all
Defined in:
lib/zpng/bmp/reader.rb

Constant Summary

Constants inherited from Chunk::IHDR

Chunk::IHDR::ALLOWED_DEPTHS, Chunk::IHDR::ALPHA_USED, Chunk::IHDR::COLOR_USED, Chunk::IHDR::FORMAT, Chunk::IHDR::PALETTE_USED, Chunk::IHDR::SAMPLES_PER_COLOR

Instance Attribute Summary

Attributes inherited from Chunk::IHDR

#color, #compression, #depth, #filter, #height, #interlace, #width

Attributes inherited from Chunk

#crc, #data, #idx, #size, #type

Instance Method Summary collapse

Methods inherited from Chunk::IHDR

#alpha_used?, #bpp, #color_used?, #export_data, #grayscale?, #palette_used?

Methods inherited from Chunk

#crc_ok?, #export, #export_data, #fix_crc!, from_stream

Methods included from DeepCopyable

#deep_copy

Constructor Details

#initialize(bmp_hdr) ⇒ BmpHdrPseudoChunk

Returns a new instance of BmpHdrPseudoChunk.



22
23
24
25
26
27
28
29
30
31
# File 'lib/zpng/bmp/reader.rb', line 22

def initialize bmp_hdr
  @bmp_hdr = bmp_hdr
  super(
    :width   => bmp_hdr.biWidth,
    :height  => bmp_hdr.biHeight.abs,
    :bpp     => bmp_hdr.biBitCount,
    :type    => 'BITMAPINFOHEADER',
    :crc     => :no_crc               # for CLI
  )
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(mname, *args) ⇒ Object



35
36
37
38
39
40
41
# File 'lib/zpng/bmp/reader.rb', line 35

def method_missing mname, *args
  if @bmp_hdr.respond_to?(mname)
    @bmp_hdr.send(mname,*args)
  else
    super
  end
end

Instance Method Details

#inspect(*args) ⇒ Object



32
33
34
# File 'lib/zpng/bmp/reader.rb', line 32

def inspect *args
  @bmp_hdr.inspect
end