papirus 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +13 -8
- data/lib/{chunky.rb → papirus/chunky.rb} +0 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3383785799a1d57bc50f8521650c4a6367eee8d
|
4
|
+
data.tar.gz: 2a72256c267feefdd72fcd4bff71d6dccf70f59f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2ef93f982daa6ccde5d204a86205198d0ac68802e3a5bad0422e4b966fe91fee83a2b896fd4fe6da93a139293fc9cebf5f4b104b41bd40f946729e05964f390
|
7
|
+
data.tar.gz: 576b13337d8dbccb574e295908725ca0ccd66ac9b274f774e709a095a689887e0a31c868a4fc57df1702178d60e3a4b2231903f2a0816a26b36f0ac1af4e9852
|
data/README.md
CHANGED
@@ -34,15 +34,20 @@ display = PaPiRus::Display.new()
|
|
34
34
|
|
35
35
|
# Playing with RMagic
|
36
36
|
|
37
|
-
```
|
38
|
-
require '
|
39
|
-
|
40
|
-
|
37
|
+
```ruby
|
38
|
+
require 'rmagick'
|
39
|
+
|
40
|
+
img = Magick::Image::read('/path/to/img/file.(png|jpg/etc')[0]
|
41
|
+
# we have to translate it to a 2 bit grayscale as that is what our PaPiRus understands
|
42
|
+
display.show(img.resize_to_fit(display.width, display.height).quantize(2, Magick::GRAYColorspace).to_blob())
|
41
43
|
```
|
42
44
|
|
43
45
|
# Playing with Chunky_PNG
|
44
|
-
```
|
45
|
-
|
46
|
+
```ruby
|
47
|
+
git clone https://github.com/mmolhoek/papirus
|
48
|
+
irb
|
49
|
+
require 'papirus'
|
50
|
+
require_relative 'lib/chunky' # add's to_bit_stream function to chucky
|
46
51
|
|
47
52
|
#lets get a clean png of the size of the display to play with using chunky_png
|
48
53
|
image = ChunkyPNG::Image.new(display.width, display.height, ChunkyPNG::Color::WHITE)
|
@@ -52,7 +57,7 @@ image.circle(display.width/2, display.height/2, display.height/2-2)
|
|
52
57
|
|
53
58
|
have a look at [chunky_png](https://github.com/wvanbergen/chunky_png/wiki) for more examples
|
54
59
|
|
55
|
-
```
|
60
|
+
```ruby
|
56
61
|
#and last we dump the image as bitsteam to the display
|
57
62
|
display.show(image.to_bit_stream)
|
58
63
|
|
@@ -91,7 +96,7 @@ Partial update:
|
|
91
96
|
|
92
97
|
## Load an image from a png file
|
93
98
|
|
94
|
-
```
|
99
|
+
```ruby
|
95
100
|
image = ChunkyPNG::Image.from_file('/some/png/file/path.png')
|
96
101
|
display.show(encode_png_pixels_to_scanline_grayscale_1bit(pixels))
|
97
102
|
```
|
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: papirus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mischa Molhoek
|
@@ -94,8 +94,8 @@ files:
|
|
94
94
|
- LICENSE.txt
|
95
95
|
- README.md
|
96
96
|
- README.rdoc
|
97
|
-
- lib/chunky.rb
|
98
97
|
- lib/papirus.rb
|
98
|
+
- lib/papirus/chunky.rb
|
99
99
|
homepage: http://github.com/mmolhoek/papirus
|
100
100
|
licenses:
|
101
101
|
- MIT
|