Module: NL::FastPng

Defined in:
lib/nl/fast_png.rb,
lib/nl/fast_png/version.rb,
ext/nl-fast_png/png_ext.c

Defined Under Namespace

Modules: PngExt

Constant Summary collapse

VERSION =
"0.0.1"

Class Method Summary collapse

Class Method Details

.store_png(width, height, depth, data) ⇒ Object

Returns a String containing a compressed PNG version of the given grayscale data, which has width columns, height lines, and has a bit depth of depth (either 8 or 16).

Example:

File.write('/tmp/x.png', NL::FastPng.store_png(2, 2, 8, "\xff\x00\x00\xff"))


11
12
13
# File 'lib/nl/fast_png.rb', line 11

def self.store_png(width, height, depth, data)
  PngExt.store_png(width, height, depth, data)
end