Module: PNG
- Defined in:
- lib/png.rb,
lib/png/version.rb,
ext/png/png.c
Defined Under Namespace
Classes: Decoder, Encoder, Meta
Constant Summary collapse
- VERSION =
"0.7.0"
Class Method Summary collapse
- .decode(png, **opt) ⇒ Object
- .decode_file(path, **opt) ⇒ Object
- .encode(w, h, raw, **opt) ⇒ Object
- .encode_file(w, h, path, **opt) ⇒ Object
- .read_header(data) ⇒ Object
Class Method Details
.decode(png, **opt) ⇒ Object
16 17 18 |
# File 'lib/png.rb', line 16 def decode(png, **opt) return PNG::Decoder.new(**opt) << png end |
.decode_file(path, **opt) ⇒ Object
20 21 22 |
# File 'lib/png.rb', line 20 def decode_file(path, **opt) return PNG.decode(IO.binread(path), **opt) end |
.encode(w, h, raw, **opt) ⇒ Object
24 25 26 |
# File 'lib/png.rb', line 24 def encode(w, h, raw, **opt) return PNG::Encoder.new(w, h, **opt) << raw end |