class ChunkyPNG::Chunk::Header

def self.read(type, content)

def self.read(type, content)
  fields = content.unpack('NNC5')
  self.new(:width => fields[0],  :height => fields[1], :depth => fields[2], :color => fields[3],
                 :compression => fields[4], :filtering => fields[5], :interlace => fields[6])
end

def content

def content
  [width, height, depth, color, compression, filtering, interlace].pack('NNC5')
end

def initialize(attrs = {})

def initialize(attrs = {})
  super('IHDR', attrs)
  @depth       ||= 8
  @color       ||= ChunkyPNG::COLOR_TRUECOLOR
  @compression ||= ChunkyPNG::COMPRESSION_DEFAULT
  @filtering   ||= ChunkyPNG::FILTERING_DEFAULT
  @interlace   ||= ChunkyPNG::INTERLACING_NONE
end