pixelart 1.3.5 → 1.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pixelart/image.rb +22 -6
- data/lib/pixelart/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92c0d22468eb46c7120b5cdfeeca63f0d4049bdfc055037186e05690e81f3404
|
4
|
+
data.tar.gz: 1d5cb926059539d9bce964243a099307e1c03de5be9de7c5285bc76d54acb7cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17a632b18859b6c341e5d80ecc91bdacff31037c3067efcda244d722515e70f8689613dbc205ed0e43300fdb5e5e36da70e079287adf7b4775041ca6ed3d1653
|
7
|
+
data.tar.gz: 8fe33b806a59f408ce6666de365e13023175f87314b832cad3f196dc96f4c83aee37013ab554e30e015e2df621047a28091937506b03df1f09deef10773dc5e3
|
data/lib/pixelart/image.rb
CHANGED
@@ -23,20 +23,27 @@ end
|
|
23
23
|
|
24
24
|
|
25
25
|
|
26
|
-
|
27
26
|
def self.read( path ) ## convenience helper
|
28
27
|
img_inner = ChunkyPNG::Image.from_file( path )
|
29
|
-
|
30
|
-
img
|
28
|
+
new( img_inner.width, img_inner.height, img_inner )
|
31
29
|
end
|
32
30
|
|
33
31
|
def self.parse_base64( str )
|
34
32
|
blob = Base64.decode64( str )
|
35
33
|
img_inner = ChunkyPNG::Image.from_blob( blob )
|
36
|
-
|
37
|
-
|
34
|
+
new( img_inner.width, img_inner.height, img_inner )
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.blob( blob )
|
38
|
+
img_inner = ChunkyPNG::Image.from_blob( blob )
|
39
|
+
new( img_inner.width, img_inner.height, img_inner )
|
38
40
|
end
|
39
41
|
|
42
|
+
class << self
|
43
|
+
alias_method :from_blob, :blob
|
44
|
+
end
|
45
|
+
|
46
|
+
|
40
47
|
|
41
48
|
|
42
49
|
|
@@ -133,7 +140,10 @@ def left( left )
|
|
133
140
|
end
|
134
141
|
|
135
142
|
|
136
|
-
|
143
|
+
def to_blob
|
144
|
+
@img.to_blob
|
145
|
+
end
|
146
|
+
alias_method :blob, :to_blob
|
137
147
|
|
138
148
|
|
139
149
|
#######################
|
@@ -149,6 +159,11 @@ alias_method :greyscale, :grayscale
|
|
149
159
|
######################
|
150
160
|
# flip horizontally on x-axis (top-to-bottom/bottom-to-top)
|
151
161
|
# e.g. pixels on the top will now be pixels on the bottom
|
162
|
+
#
|
163
|
+
# todo/check: commom use is reverse?
|
164
|
+
# e.g. flip_vertically is top-to-bottom!!!
|
165
|
+
# use flip_y_axis, flip_x_axis or something else - why? why not?
|
166
|
+
# check photoshop and gimp terminology and update later if different - why? why not?
|
152
167
|
def flip_horizontally
|
153
168
|
img = @img.flip_horizontally
|
154
169
|
Image.new( img.width, img.height, img )
|
@@ -158,6 +173,7 @@ end
|
|
158
173
|
alias_method :flop, :flip_horizontally
|
159
174
|
|
160
175
|
|
176
|
+
|
161
177
|
###
|
162
178
|
# flip vertially on y-axis (right-to-left/left-to-right)
|
163
179
|
# e.g. pixels on the left will now be pixels on the right
|
data/lib/pixelart/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pixelart
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cocos
|