Class: ChunkyPNG::Chunk::ImageData

### Home Classes Methods

### In Files

- lib/chunky_png/chunk.rb

### Parent

ChunkyPNG::Chunk::Generic

### Methods

- ::combine_chunks
- ::split_in_chunks

### Files

- BENCHMARKING.rdoc
- CHANGELOG.rdoc
- CONTRIBUTING.rdoc
- README.rdoc

### Class/Module Index

Quicksearch

- ChunkyPNG
- ChunkyPNG::CRCMismatch
- ChunkyPNG::Canvas
- ChunkyPNG::Canvas::Adam7Interlacing
- ChunkyPNG::Canvas::DataUrlExporting
- ChunkyPNG::Canvas::DataUrlImporting
- ChunkyPNG::Canvas::Drawing
- ChunkyPNG::Canvas::Masking
- ChunkyPNG::Canvas::Operations
- ChunkyPNG::Canvas::PNGDecoding
- ChunkyPNG::Canvas::PNGEncoding
- ChunkyPNG::Canvas::Resampling
- ChunkyPNG::Canvas::StreamExporting
- ChunkyPNG::Canvas::StreamImporting
- ChunkyPNG::Chunk
- ChunkyPNG::Chunk::Base
- ChunkyPNG::Chunk::CompressedText
- ChunkyPNG::Chunk::End
- ChunkyPNG::Chunk::Generic
- ChunkyPNG::Chunk::Header
- ChunkyPNG::Chunk::ImageData
- ChunkyPNG::Chunk::InternationalText
- ChunkyPNG::Chunk::Palette
- ChunkyPNG::Chunk::Text
- ChunkyPNG::Chunk::Transparency
- ChunkyPNG::Color
- ChunkyPNG::Datastream
- ChunkyPNG::Dimension
- ChunkyPNG::Exception
- ChunkyPNG::ExpectationFailed
- ChunkyPNG::Image
- ChunkyPNG::NotSupported
- ChunkyPNG::OutOfBounds
- ChunkyPNG::Palette
- ChunkyPNG::Point
- ChunkyPNG::RMagick
- ChunkyPNG::SignatureMismatch
- ChunkyPNG::Vector
- Enumerable
- String

No matching classes.

# ChunkyPNG::Chunk::ImageData

### Public Class Methods

combine_chunks(data_chunks) click to toggle source

    # File lib/chunky_png/chunk.rb, line 247
    def self.combine_chunks(data_chunks)
      Zlib::Inflate.inflate(data_chunks.map { |c| c.content }.join(''))
    end

split_in_chunks(data, level = Zlib::DEFAULT_COMPRESSION, chunk_size = 2147483647) click to toggle source

    # File lib/chunky_png/chunk.rb, line 251
    def self.split_in_chunks(data, level = Zlib::DEFAULT_COMPRESSION, chunk_size = 2147483647)
      streamdata = Zlib::Deflate.deflate(data, level)
      # TODO: Split long streamdata over multiple chunks
      [ ChunkyPNG::Chunk::ImageData.new('IDAT', streamdata) ]
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.