bestguigui_lab 0.4.0 → 0.5.0
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/lib/bestguigui_lab/image_pixels.rb +17 -0
- data/lib/bestguigui_lab/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e92f7108d33c694f8877f580f818be32b83c8c9ce4009ad96982d5bd05042de1
|
|
4
|
+
data.tar.gz: 9982b1b65bc51844487078768c483beba906e0b092d06ecebf1c015016a5e818
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 896e80de61cbcfd3d063ae0c21e8bf3fdb1147397b1e038de31867f987d5ff807e43b4a31b92d5680ea6442055786b5858acb0e3b9e4e34c63f8663edb680e41
|
|
7
|
+
data.tar.gz: 573a0f8e55aa2f7a83b2cdb82ef98a610ce3f81b3802c65d4a4529ccaadd2ec0f5c59da815a175a77a5df8ef85b3c04b5f65eda73eeb30673212b51b01f3d9cd
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Monkey patch de Gosu::Image pour lire/ecrire un pixel individuel.
|
|
4
|
+
class Gosu::Image
|
|
5
|
+
def get_pixel(x, y)
|
|
6
|
+
return nil if x < 0 || x >= width || y < 0 || y >= height
|
|
7
|
+
|
|
8
|
+
r, g, b, a = to_blob[((y * width) + x) * 4, 4].unpack('C4')
|
|
9
|
+
Gosu::Color.new(a, r, g, b)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def set_pixel(x, y, color)
|
|
13
|
+
blob = [color.red, color.green, color.blue, color.alpha].pack('C4')
|
|
14
|
+
pixel = Gosu::Image.from_blob(1, 1, blob)
|
|
15
|
+
insert(pixel, x, y)
|
|
16
|
+
end
|
|
17
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bestguigui_lab
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bestguigui
|
|
@@ -45,6 +45,7 @@ files:
|
|
|
45
45
|
- lib/bestguigui_lab/assets.rb
|
|
46
46
|
- lib/bestguigui_lab/gl_texture.rb
|
|
47
47
|
- lib/bestguigui_lab/helpers.rb
|
|
48
|
+
- lib/bestguigui_lab/image_pixels.rb
|
|
48
49
|
- lib/bestguigui_lab/input.rb
|
|
49
50
|
- lib/bestguigui_lab/obj_model.rb
|
|
50
51
|
- lib/bestguigui_lab/render_3d.rb
|