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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +14 -11
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5a26e1edf6b65c615e866725ea32e8c76b376a7e
4
- data.tar.gz: 799cc512691f78a1400a588d0f1c19ed3c6a418a
3
+ metadata.gz: 5e0840e36ffb54c514619ca41dbf7f790a744d66
4
+ data.tar.gz: a9909869584431544c0ed88e344f86f844e03d44
5
5
  SHA512:
6
- metadata.gz: a821ef2457c0ccfdf3ccb826e99b9920b97401032dc61ac6a48edc0a7c38b24efa49e550f9150f3430d3c3b2029515fba120c8462277b020d10cf2e85234767a
7
- data.tar.gz: 8c7da2f32417ca1953fe23209bae94d4491467d82c6682b47f5a6424cfdd2c728d53b6cf849aeec9a3bb3e77317b350b096023a1e2a47d45cd3ed229cd8e2fc2
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
- $ bundle exec irb -r lib/papirus -r ./lib/papirus/rmagick
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
- $ bundle exec irb -r lib/papirus -r ./lib/papirus/chunky
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
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.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mischa Molhoek