rays 0.1.43 → 0.1.45

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: 83a7e942a767423281efdc41e40f43384c02705353789ceab7c16d2e736b42c7
4
- data.tar.gz: db348ce01ddfcb1b38e6c2c067bdcc34913fd9f9d3706d7f2c74d8297a5ffb45
3
+ metadata.gz: de6e5c2c628009735eed4907bd62ec314d315daab2b001e3c37a365f71b6f19b
4
+ data.tar.gz: c18e37667880bd753332a216f56a59c473ce4fbb2e7b65eb98894d6718d4e506
5
5
  SHA512:
6
- metadata.gz: 5e239c3eb35d610697eacfd12e56de5c897ffd5cab0e9d3055700060015b885215ba7a7d08856af93183f5d3c6990fe13bf4be387670a50040b6e95e0b5a7ec6
7
- data.tar.gz: 99dbb7d4b15fa3bde13bd55648b7fece89869b81b72293549555526537994a5261d4c635192826c85d12048fee947183c4552356b81b4986910ef78a8e094840
6
+ metadata.gz: 6e11a2e80087715bf194d3857950386d7cbad58c9273d2d7f85d2701d58e0978c6bc966145c60582f896ffdc2066ead9b58649d41fc41910101028cc02cbd75a
7
+ data.tar.gz: a0db99c72e1dd15a7731ff18a20a452929bf8fa2701a95cd31fd093bfbcdf09451de0cadf9e5d2e327066fd595124966218352fc25d14ccbae9cd6dca47e1728
@@ -1,6 +1,7 @@
1
1
  #include "rays/ruby/bounds.h"
2
2
 
3
3
 
4
+ #include <assert.h>
4
5
  #include "rays/ruby/point.h"
5
6
  #include "defs.h"
6
7
 
@@ -1,6 +1,7 @@
1
1
  #include "rays/ruby/color.h"
2
2
 
3
3
 
4
+ #include <assert.h>
4
5
  #include <map>
5
6
  #include "defs.h"
6
7
 
@@ -1,6 +1,7 @@
1
1
  #include "rays/ruby/color_space.h"
2
2
 
3
3
 
4
+ #include <assert.h>
4
5
  #include "defs.h"
5
6
 
6
7
 
@@ -1,6 +1,7 @@
1
1
  #include "rays/ruby/font.h"
2
2
 
3
3
 
4
+ #include <assert.h>
4
5
  #include "defs.h"
5
6
 
6
7
 
@@ -1,6 +1,7 @@
1
1
  #include "rays/ruby/matrix.h"
2
2
 
3
3
 
4
+ #include <assert.h>
4
5
  #include "rays/ruby/point.h"
5
6
  #include "defs.h"
6
7
 
@@ -1,6 +1,7 @@
1
1
  #include "rays/ruby/point.h"
2
2
 
3
3
 
4
+ #include <assert.h>
4
5
  #include "defs.h"
5
6
 
6
7
 
@@ -1,6 +1,7 @@
1
1
  #include "rays/ruby/polygon.h"
2
2
 
3
3
 
4
+ #include <assert.h>
4
5
  #include <vector>
5
6
  #include <functional>
6
7
  #include "rays/ruby/bounds.h"
@@ -1,6 +1,7 @@
1
1
  #include "rays/ruby/polygon.h"
2
2
 
3
3
 
4
+ #include <assert.h>
4
5
  #include "rays/ruby/polyline.h"
5
6
  #include "defs.h"
6
7
 
@@ -1,6 +1,7 @@
1
1
  #include "rays/ruby/polyline.h"
2
2
 
3
3
 
4
+ #include <assert.h>
4
5
  #include <vector>
5
6
  #include "rays/ruby/point.h"
6
7
  #include "rays/ruby/bounds.h"
@@ -1,6 +1,7 @@
1
1
  #include "rays/ruby/rays.h"
2
2
 
3
3
 
4
+ #include <assert.h>
4
5
  #include <vector>
5
6
  #include "defs.h"
6
7
 
@@ -1,6 +1,7 @@
1
1
  #include "rays/ruby/shader.h"
2
2
 
3
3
 
4
+ #include <assert.h>
4
5
  #include "rays/ruby/image.h"
5
6
  #include "defs.h"
6
7
 
data/ChangeLog.md CHANGED
@@ -1,6 +1,16 @@
1
1
  # rays ChangeLog
2
2
 
3
3
 
4
+ ## [v0.1.45] - 2023-10-29
5
+
6
+ - Fixed Image class to clear the update flag only when one of the bitmap and texture is being updated
7
+
8
+
9
+ ## [v0.1.44] - 2023-10-25
10
+
11
+ - Add '#include <assert.h>' to Fix compile errors
12
+
13
+
4
14
  ## [v0.1.43] - 2023-06-22
5
15
 
6
16
  - Image.new can take pixel density with decimal point
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.43
1
+ 0.1.45
data/ext/rays/bounds.cpp CHANGED
@@ -1,6 +1,7 @@
1
1
  #include "rays/ruby/bounds.h"
2
2
 
3
3
 
4
+ #include <assert.h>
4
5
  #include "rays/ruby/point.h"
5
6
  #include "defs.h"
6
7
 
data/ext/rays/color.cpp CHANGED
@@ -1,6 +1,7 @@
1
1
  #include "rays/ruby/color.h"
2
2
 
3
3
 
4
+ #include <assert.h>
4
5
  #include <map>
5
6
  #include "defs.h"
6
7
 
@@ -1,6 +1,7 @@
1
1
  #include "rays/ruby/color_space.h"
2
2
 
3
3
 
4
+ #include <assert.h>
4
5
  #include "defs.h"
5
6
 
6
7
 
data/ext/rays/font.cpp CHANGED
@@ -1,6 +1,7 @@
1
1
  #include "rays/ruby/font.h"
2
2
 
3
3
 
4
+ #include <assert.h>
4
5
  #include "defs.h"
5
6
 
6
7
 
data/ext/rays/matrix.cpp CHANGED
@@ -1,6 +1,7 @@
1
1
  #include "rays/ruby/matrix.h"
2
2
 
3
3
 
4
+ #include <assert.h>
4
5
  #include "rays/ruby/point.h"
5
6
  #include "defs.h"
6
7
 
data/ext/rays/point.cpp CHANGED
@@ -1,6 +1,7 @@
1
1
  #include "rays/ruby/point.h"
2
2
 
3
3
 
4
+ #include <assert.h>
4
5
  #include "defs.h"
5
6
 
6
7
 
data/ext/rays/polygon.cpp CHANGED
@@ -1,6 +1,7 @@
1
1
  #include "rays/ruby/polygon.h"
2
2
 
3
3
 
4
+ #include <assert.h>
4
5
  #include <vector>
5
6
  #include <functional>
6
7
  #include "rays/ruby/bounds.h"
@@ -1,6 +1,7 @@
1
1
  #include "rays/ruby/polygon.h"
2
2
 
3
3
 
4
+ #include <assert.h>
4
5
  #include "rays/ruby/polyline.h"
5
6
  #include "defs.h"
6
7
 
@@ -1,6 +1,7 @@
1
1
  #include "rays/ruby/polyline.h"
2
2
 
3
3
 
4
+ #include <assert.h>
4
5
  #include <vector>
5
6
  #include "rays/ruby/point.h"
6
7
  #include "rays/ruby/bounds.h"
data/ext/rays/rays.cpp CHANGED
@@ -1,6 +1,7 @@
1
1
  #include "rays/ruby/rays.h"
2
2
 
3
3
 
4
+ #include <assert.h>
4
5
  #include <vector>
5
6
  #include "defs.h"
6
7
 
data/ext/rays/shader.cpp CHANGED
@@ -1,6 +1,7 @@
1
1
  #include "rays/ruby/shader.h"
2
2
 
3
3
 
4
+ #include <assert.h>
4
5
  #include "rays/ruby/image.h"
5
6
  #include "defs.h"
6
7
 
data/rays.gemspec CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
26
26
  s.required_ruby_version = '>= 3.0.0'
27
27
 
28
28
  s.add_runtime_dependency 'xot', '~> 0.1.39'
29
- s.add_runtime_dependency 'rucy', '~> 0.1.39'
29
+ s.add_runtime_dependency 'rucy', '~> 0.1.40'
30
30
 
31
31
  s.add_development_dependency 'rake'
32
32
  s.add_development_dependency 'test-unit'
data/src/color_space.cpp CHANGED
@@ -1,7 +1,6 @@
1
1
  #include "color_space.h"
2
2
 
3
3
 
4
- #include <assert.h>
5
4
  #include <xot/util.h>
6
5
  #include "rays/exception.h"
7
6
 
data/src/image.cpp CHANGED
@@ -30,6 +30,15 @@ namespace Rays
30
30
  };// Image::Data
31
31
 
32
32
 
33
+ static void
34
+ clear_modified_flags (Image* image)
35
+ {
36
+ Image::Data* self = image->self.get();
37
+
38
+ if (self->bitmap) Bitmap_set_modified(&self->bitmap, false);
39
+ if (self->texture) self->texture.set_modified(false);
40
+ }
41
+
33
42
  static void
34
43
  invalidate_texture (Image* image)
35
44
  {
@@ -64,7 +73,7 @@ namespace Rays
64
73
 
65
74
  Image::Data* self = image->self.get();
66
75
 
67
- if (!image)
76
+ if (!*image)
68
77
  {
69
78
  assert(!self->bitmap);
70
79
  return self->bitmap;
@@ -76,6 +85,7 @@ namespace Rays
76
85
  self->bitmap = Bitmap_from(self->texture);
77
86
  else
78
87
  self->bitmap = Bitmap(self->width, self->height, self->color_space);
88
+ clear_modified_flags(image);
79
89
  }
80
90
  else if (
81
91
  self->texture &&
@@ -83,11 +93,9 @@ namespace Rays
83
93
  !Bitmap_get_modified(self->bitmap))
84
94
  {
85
95
  self->bitmap = Bitmap_from(self->texture);
96
+ clear_modified_flags(image);
86
97
  }
87
98
 
88
- if (self->bitmap) Bitmap_set_modified(&self->bitmap, false);
89
- if (self->texture) self->texture.set_modified(false);
90
-
91
99
  return self->bitmap;
92
100
  }
93
101
 
@@ -117,6 +125,7 @@ namespace Rays
117
125
  p.clear();
118
126
  p.end();
119
127
  }
128
+ clear_modified_flags(&image);
120
129
  }
121
130
  else if (
122
131
  self->bitmap &&
@@ -124,11 +133,9 @@ namespace Rays
124
133
  !self->texture.modified())
125
134
  {
126
135
  self->texture = Texture(self->bitmap);
136
+ clear_modified_flags(&image);
127
137
  }
128
138
 
129
- if (self->bitmap) Bitmap_set_modified(&self->bitmap, false);
130
- if (self->texture) self->texture.set_modified(false);
131
-
132
139
  return self->texture;
133
140
  }
134
141
 
data/src/ios/bitmap.mm CHANGED
@@ -2,6 +2,7 @@
2
2
  #import "bitmap.h"
3
3
 
4
4
 
5
+ #include <assert.h>
5
6
  #import <ImageIO/CGImageDestination.h>
6
7
  #import <MobileCoreServices/UTCoreTypes.h>
7
8
  #include "rays/exception.h"
data/src/ios/camera.mm CHANGED
@@ -2,6 +2,7 @@
2
2
  #import "rays/camera.h"
3
3
 
4
4
 
5
+ #include <assert.h>
5
6
  #import <AVFoundation/AVFoundation.h>
6
7
  #include "rays/exception.h"
7
8
  #include "bitmap.h"
data/src/osx/bitmap.mm CHANGED
@@ -2,6 +2,7 @@
2
2
  #import "bitmap.h"
3
3
 
4
4
 
5
+ #include <assert.h>
5
6
  #import <Cocoa/Cocoa.h>
6
7
  #include "rays/exception.h"
7
8
  #include "../color_space.h"
data/src/polygon.cpp CHANGED
@@ -480,7 +480,7 @@ namespace Rays
480
480
  round_left_top == 0 && round_right_top == 0 &&
481
481
  round_left_bottom == 0 && round_right_bottom == 0)
482
482
  {
483
- setup_rect(x, y, width, height, nsegment);
483
+ setup_rect(x, y, width, height);
484
484
  }
485
485
  else
486
486
  {
@@ -509,9 +509,7 @@ namespace Rays
509
509
  coord x, y, offset_sign_x, offset_sign_y, round;
510
510
  };
511
511
 
512
- void setup_rect (
513
- coord x, coord y, coord width, coord height,
514
- uint nsegment)
512
+ void setup_rect (coord x, coord y, coord width, coord height)
515
513
  {
516
514
  const Point points[] = {
517
515
  Point(x, y),
@@ -846,7 +844,7 @@ namespace Rays
846
844
  }
847
845
 
848
846
  Polygon
849
- create_rect(const Bounds& bounds, coord round, uint nsegment)
847
+ create_rect (const Bounds& bounds, coord round, uint nsegment)
850
848
  {
851
849
  return create_rect(
852
850
  bounds.x, bounds.y, bounds.width, bounds.height,
data/src/shader.cpp CHANGED
@@ -1,6 +1,7 @@
1
1
  #include "shader.h"
2
2
 
3
3
 
4
+ #include <assert.h>
4
5
  #include <regex>
5
6
  #include "rays/exception.h"
6
7
  #include "opengl.h"
data/src/win32/bitmap.cpp CHANGED
@@ -1,6 +1,7 @@
1
1
  #include "../bitmap.h"
2
2
 
3
3
 
4
+ #include <assert.h>
4
5
  #include "font.h"
5
6
  #include "gdi.h"
6
7
 
data/src/win32/gdi.cpp CHANGED
@@ -1,6 +1,7 @@
1
1
  #include "gdi.h"
2
2
 
3
3
 
4
+ #include <assert.h>
4
5
  #include <vector>
5
6
 
6
7
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rays
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.43
4
+ version: 0.1.45
5
5
  platform: ruby
6
6
  authors:
7
7
  - xordog
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-22 00:00:00.000000000 Z
11
+ date: 2023-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xot
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.1.39
33
+ version: 0.1.40
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.1.39
40
+ version: 0.1.40
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement