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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96f6d3fcc750e5d014248e718d7002117e19cdbe90b3787bc7709e2bf20e940c
4
- data.tar.gz: 4f3e25a6ccade65ceb49178db07e71d70ace4d9afb81482a4bd19089b8ef8809
3
+ metadata.gz: e92f7108d33c694f8877f580f818be32b83c8c9ce4009ad96982d5bd05042de1
4
+ data.tar.gz: 9982b1b65bc51844487078768c483beba906e0b092d06ecebf1c015016a5e818
5
5
  SHA512:
6
- metadata.gz: 0512a0c2081412ef87f90d19690e38ba315eebd4ef51eb2f13047538384cf30f149db57bc46a216f30f1d37f3bd7a7800f630ca3ec0da9c7d9a32b5028b4f82b
7
- data.tar.gz: 922ce4a677d389b45eb98272a260c83d620070da48f14979609e2738782f5ff61602a3b7750c19ccbd3f8677b54a520e3a3d816a621a8843b4eb2e03811ac871
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bestguigui
4
- VERSION = '0.4.0'
4
+ VERSION = '0.5.0'
5
5
  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.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