papirus 0.3.3 → 0.3.4
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 +14 -11
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e0840e36ffb54c514619ca41dbf7f790a744d66
|
4
|
+
data.tar.gz: a9909869584431544c0ed88e344f86f844e03d44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff4c3d413224e6f3b81f9c46b8003ad52d7c7bc4d91468d81ea0d7bd78375fa40ee59bf07fac4acb99a32f6a9ad71f5e18f22308886be1dcd74643c9acd2e2b7
|
7
|
+
data.tar.gz: 8dc13d17e357419725683ad96630fcb01492e80533bf6c3da1408b094664dbdfed2ebff434a209bd79c83661c01e825ab3fdcd3139ec1adbd7292dcb65d6a980
|
data/README.md
CHANGED
@@ -40,10 +40,12 @@ $ gem install rmagick
|
|
40
40
|
## Using an irb session to play around:
|
41
41
|
|
42
42
|
```
|
43
|
-
$
|
43
|
+
$ irb
|
44
|
+
require 'papirus'
|
45
|
+
require 'papirus/rmagick'
|
44
46
|
display = PaPiRus::Display.new()
|
45
47
|
image = Magick::Image::read('/path/to/img/file.[png|jpg|etc]').first
|
46
|
-
display.show(image.to_bit_stream(display.width, display.height))
|
48
|
+
display.show(data: image.to_bit_stream(display.width, display.height))
|
47
49
|
```
|
48
50
|
|
49
51
|
# Using with ChunkyPNG
|
@@ -59,10 +61,12 @@ $ gem install chunky_png
|
|
59
61
|
## Load an image from a png file
|
60
62
|
|
61
63
|
```ruby
|
62
|
-
$
|
64
|
+
$ irb
|
65
|
+
require 'papirus'
|
66
|
+
require 'papirus/chunky'
|
63
67
|
display = PaPiRus::Display.new()
|
64
68
|
image = ChunkyPNG::Image.from_file('out.png')
|
65
|
-
display.show(image.to_bit_stream(display.width, display.height))
|
69
|
+
display.show(data: image.to_bit_stream(display.width, display.height))
|
66
70
|
```
|
67
71
|
|
68
72
|
The only problem here is the aspect ration of the image is not ok anymore. is a todo
|
@@ -93,19 +97,19 @@ have a look at [chunkypng](https://github.com/wvanbergen/chunky_png/wiki) for mo
|
|
93
97
|
|
94
98
|
```
|
95
99
|
#and last we dump the image as bitsteam to the display
|
96
|
-
display.show(image.to_bit_stream)
|
100
|
+
display.show(data: image.to_bit_stream)
|
97
101
|
|
98
102
|
# now we could also change the circle and fast update the screen
|
99
103
|
image.replace!(ChunkyPNG::Image.new(display.width, display.height, ChunkyPNG::Color::WHITE))
|
100
104
|
image.circle(display.width/2, display.height/2, display.height/4)
|
101
|
-
display.show(image.to_bit_stream, 'F')
|
105
|
+
display.show(data: image.to_bit_stream, 'F')
|
102
106
|
|
103
107
|
# or update the screen for multiple circles
|
104
108
|
display.clear
|
105
109
|
2.step(image.height/2-2, 5).each do |radius|
|
106
110
|
image.replace!(ChunkyPNG::Image.new(display.width, display.height, ChunkyPNG::Color::WHITE))
|
107
111
|
image.circle(display.width/2, display.height/2, radius)
|
108
|
-
display.show(image.to_bit_stream, 'F')
|
112
|
+
display.show(data: image.to_bit_stream, command: 'F')
|
109
113
|
end
|
110
114
|
```
|
111
115
|
|
@@ -114,19 +118,19 @@ end
|
|
114
118
|
Full update (with screen cleaning):
|
115
119
|
|
116
120
|
```
|
117
|
-
display.show(image.to_bit_stream(display.width, display.height))
|
121
|
+
display.show(data: image.to_bit_stream(display.width, display.height))
|
118
122
|
```
|
119
123
|
|
120
124
|
Fast update:
|
121
125
|
|
122
126
|
```
|
123
|
-
display.show(image.to_bit_stream(display.width, display.height)), 'F')
|
127
|
+
display.show(data: image.to_bit_stream(display.width, display.height)), command: 'F')
|
124
128
|
```
|
125
129
|
|
126
130
|
Partial update:
|
127
131
|
|
128
132
|
```
|
129
|
-
display.show(image.to_bit_stream(display.width, display.height), 'P')
|
133
|
+
display.show(data: image.to_bit_stream(display.width, display.height), command: 'P')
|
130
134
|
```
|
131
135
|
|
132
136
|
## Testing without a PaPiRus display
|
@@ -134,7 +138,6 @@ display.show(image.to_bit_stream(display.width, display.height), 'P')
|
|
134
138
|
If you want to test the gem, but don't have your PaPiRus available, you can do the following
|
135
139
|
|
136
140
|
clone this repo
|
137
|
-
* start irb
|
138
141
|
|
139
142
|
```
|
140
143
|
$ bundle exec irb -r ./lib/papirus
|