rays 0.1.46 → 0.1.48

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/.doc/ext/rays/bitmap.cpp +499 -0
  3. data/.doc/ext/rays/camera.cpp +2 -2
  4. data/.doc/ext/rays/defs.cpp +35 -11
  5. data/.doc/ext/rays/font.cpp +50 -2
  6. data/.doc/ext/rays/native.cpp +2 -4
  7. data/.doc/ext/rays/painter.cpp +111 -6
  8. data/.doc/ext/rays/polygon.cpp +152 -41
  9. data/.doc/ext/rays/polyline.cpp +89 -10
  10. data/.doc/ext/rays/rays.cpp +91 -11
  11. data/.doc/ext/rays/{noise.cpp → util.cpp} +2 -2
  12. data/.github/workflows/test.yml +0 -1
  13. data/ChangeLog.md +38 -0
  14. data/Rakefile +4 -4
  15. data/VERSION +1 -1
  16. data/ext/rays/bitmap.cpp +501 -0
  17. data/ext/rays/camera.cpp +2 -2
  18. data/ext/rays/defs.cpp +35 -11
  19. data/ext/rays/defs.h +56 -3
  20. data/ext/rays/font.cpp +56 -4
  21. data/ext/rays/native.cpp +2 -4
  22. data/ext/rays/painter.cpp +125 -11
  23. data/ext/rays/polygon.cpp +161 -41
  24. data/ext/rays/polyline.cpp +95 -9
  25. data/ext/rays/rays.cpp +91 -11
  26. data/ext/rays/{noise.cpp → util.cpp} +2 -2
  27. data/include/rays/defs.h +24 -0
  28. data/include/rays/font.h +17 -3
  29. data/include/rays/matrix.h +2 -0
  30. data/include/rays/painter.h +29 -1
  31. data/include/rays/polygon.h +57 -33
  32. data/include/rays/polyline.h +20 -1
  33. data/include/rays/ruby/polygon.h +0 -11
  34. data/include/rays/ruby/rays.h +4 -0
  35. data/include/rays/{noise.h → util.h} +2 -2
  36. data/lib/rays/color.rb +1 -1
  37. data/lib/rays/font.rb +1 -1
  38. data/lib/rays/image.rb +1 -1
  39. data/lib/rays/painter.rb +13 -2
  40. data/lib/rays/point.rb +1 -1
  41. data/lib/rays/polygon.rb +54 -16
  42. data/lib/rays/polyline.rb +54 -8
  43. data/lib/rays.rb +0 -1
  44. data/rays.gemspec +2 -2
  45. data/src/color_space.cpp +2 -2
  46. data/src/font.cpp +24 -2
  47. data/src/font.h +8 -1
  48. data/src/ios/font.mm +88 -27
  49. data/src/matrix.cpp +8 -0
  50. data/src/osx/font.mm +90 -28
  51. data/src/osx/helper.h +2 -2
  52. data/src/osx/helper.mm +2 -2
  53. data/src/painter.cpp +227 -90
  54. data/src/painter.h +11 -3
  55. data/src/polygon.cpp +588 -205
  56. data/src/polyline.cpp +154 -28
  57. data/src/polyline.h +3 -5
  58. data/src/shader.cpp +36 -4
  59. data/src/shader.h +1 -1
  60. data/src/texture.cpp +2 -2
  61. data/src/{noise.cpp → util.cpp} +1 -1
  62. data/src/win32/font.cpp +1 -1
  63. data/test/test_bitmap.rb +16 -2
  64. data/test/test_color.rb +4 -0
  65. data/test/test_font.rb +20 -2
  66. data/test/test_image.rb +18 -18
  67. data/test/test_point.rb +1 -1
  68. data/test/test_polygon.rb +52 -45
  69. data/test/test_polyline.rb +191 -72
  70. metadata +11 -17
  71. data/.doc/ext/rays/polygon_line.cpp +0 -97
  72. data/ext/rays/polygon_line.cpp +0 -100
  73. data/lib/rays/polygon_line.rb +0 -33
  74. data/test/test_polygon_line.rb +0 -164
data/lib/rays/color.rb CHANGED
@@ -82,7 +82,7 @@ module Rays
82
82
  end
83
83
 
84
84
  def inspect()
85
- "#<#{self.class.name} #{to_s}>"
85
+ "#<#{self.class.name} #{to_a.join ' '}>"
86
86
  end
87
87
 
88
88
  end# Color
data/lib/rays/font.rb CHANGED
@@ -17,7 +17,7 @@ module Rays
17
17
  end
18
18
 
19
19
  def inspect()
20
- "#<Rays::Font name=#{name}, size=#{size}>"
20
+ "#<Rays::Font name='#{name}', size=#{size}>"
21
21
  end
22
22
 
23
23
  end# Font
data/lib/rays/image.rb CHANGED
@@ -9,7 +9,7 @@ module Rays
9
9
 
10
10
  extend Forwardable
11
11
 
12
- def_delegators :bitmap, :[], :[]=
12
+ def_delegators :bitmap, :pixels=, :pixels, :[]=, :[]
13
13
 
14
14
  def paint(&block)
15
15
  painter.paint self, &block
data/lib/rays/painter.rb CHANGED
@@ -118,9 +118,20 @@ module Rays
118
118
  replace: BLEND_REPLACE
119
119
  }
120
120
 
121
+ const_symbol_accessor :texcoord_mode, **{
122
+ image: TEXCOORD_IMAGE,
123
+ normal: TEXCOORD_NORMAL
124
+ }
125
+
126
+ const_symbol_accessor :texcoord_wrap, **{
127
+ clamp: TEXCOORD_CLAMP,
128
+ repeat: TEXCOORD_REPEAT
129
+ }
130
+
121
131
  universal_accessor :background, :fill, :stroke, :color,
122
- :stroke_width, :stroke_cap, :stroke_join, :miter_limit,
123
- :nsegment, :blend_mode, :shader, :clip, :font
132
+ :stroke_width, :stroke_outset, :stroke_cap, :stroke_join, :miter_limit,
133
+ :nsegment, :blend_mode, :texture, :texcoord_mode, :texcoord_wrap,
134
+ :shader, :clip, :font
124
135
 
125
136
  private
126
137
 
data/lib/rays/point.rb CHANGED
@@ -47,7 +47,7 @@ module Rays
47
47
  end
48
48
 
49
49
  def inspect()
50
- "#<Rays::Point #{to_a(3).join ', '}>"
50
+ "#<Rays::Point #{to_a(3).join ' '}>"
51
51
  end
52
52
 
53
53
  end# Point
data/lib/rays/polygon.rb CHANGED
@@ -8,45 +8,83 @@ module Rays
8
8
  class Polygon
9
9
 
10
10
  include Enumerable
11
+ include Comparable
11
12
 
12
- def initialize(*args, loop: true)
13
- setup args, loop
13
+ def initialize(*args, loop: true, colors: nil, texcoords: nil)
14
+ setup args, loop, colors, texcoords
14
15
  end
15
16
 
16
- def transform(matrix = nil, &block)
17
- lines = to_a
18
- lines = lines.map {|line| line.transform matrix} if matrix
19
- lines = block.call lines if block
20
- self.class.new(*lines)
17
+ def transform(&block)
18
+ polylines = block.call to_a
19
+ self.class.new(*polylines)
21
20
  end
22
21
 
23
22
  def intersects(obj)
24
23
  !(self & obj).empty?
25
24
  end
26
25
 
27
- def self.line(*args, loop: false)
28
- new(*args, loop: loop)
26
+ def <=>(o)
27
+ (size <=> o.size).then {|cmp| return cmp if cmp != 0}
28
+ to_a.zip(o.to_a).each {|a, b| cmp = a <=> b; return cmp if cmp != 0}
29
+ 0
30
+ end
31
+
32
+ def inspect()
33
+ "#<Rays::Polygon [#{map {|polyline| polyline.inspect}.join ', '}]>"
34
+ end
35
+
36
+ def self.points(*points)
37
+ points! points
38
+ end
39
+
40
+ def self.line(*points, loop: false)
41
+ line! points, loop
42
+ end
43
+
44
+ def self.lines(*points)
45
+ lines! points
46
+ end
47
+
48
+ def self.triangles(*points, loop: true, colors: nil, texcoords: nil)
49
+ triangles! points, loop, colors, texcoords
50
+ end
51
+
52
+ def self.triangle_strip(*points, colors: nil, texcoords: nil)
53
+ triangle_strip! points, colors, texcoords
54
+ end
55
+
56
+ def self.triangle_fan(*points, colors: nil, texcoords: nil)
57
+ triangle_fan! points, colors, texcoords
29
58
  end
30
59
 
31
60
  def self.rect(
32
- *args, round: nil, lt: nil, rt: nil, lb: nil, rb: nil, nsegment: nil)
61
+ *args, round: nil, lt: nil, rt: nil, lb: nil, rb: nil,
62
+ nsegment: nil)
63
+
64
+ rect! args, round, lt, rt, lb, rb, nsegment
65
+ end
66
+
67
+ def self.quads(*points, loop: true, colors: nil, texcoords: nil)
68
+ quads! points, loop, colors, texcoords
69
+ end
33
70
 
34
- create_rect args, round, lt, rt, lb, rb, nsegment
71
+ def self.quad_strip(*points, colors: nil, texcoords: nil)
72
+ quad_strip! points, colors, texcoords
35
73
  end
36
74
 
37
75
  def self.ellipse(
38
76
  *args, center: nil, radius: nil, hole: nil, from: nil, to: nil,
39
77
  nsegment: nil)
40
78
 
41
- create_ellipse args, center, radius, hole, from, to, nsegment
79
+ ellipse! args, center, radius, hole, from, to, nsegment
42
80
  end
43
81
 
44
- def self.curve(*args, loop: false)
45
- create_curve args, loop
82
+ def self.curve(*points, loop: false)
83
+ curve! points, loop
46
84
  end
47
85
 
48
- def self.bezier(*args, loop: false)
49
- create_bezier args, loop
86
+ def self.bezier(*points, loop: false)
87
+ bezier! points, loop
50
88
  end
51
89
 
52
90
  end# Polygon
data/lib/rays/polyline.rb CHANGED
@@ -7,20 +7,66 @@ module Rays
7
7
  class Polyline
8
8
 
9
9
  include Enumerable
10
+ include Comparable
10
11
 
11
- def initialize(*points, loop: false)
12
- setup points, loop
12
+ def initialize(
13
+ *points, loop: false, fill: nil, colors: nil, texcoords: nil, hole: false)
14
+
15
+ setup points, loop, (fill != nil ? fill : loop), colors, texcoords, hole
16
+ end
17
+
18
+ def with(**kwargs)
19
+ points_, loop_, fill_, colors_, texcoords_, hole_ =
20
+ kwargs.values_at :points, :loop, :fill, :colors, :texcoords, :hole
21
+ self.class.new(
22
+ *(points_ || (points? ? points : [])),
23
+ loop: loop_ != nil ? loop_ : loop?,
24
+ fill: fill_ != nil ? fill_ : fill?,
25
+ colors: colors_ || (colors? ? colors : nil),
26
+ texcoords: texcoords_ || (texcoords? ? texcoords : nil),
27
+ hole: hole_ != nil ? hole_ : hole?)
28
+ end
29
+
30
+ def points()
31
+ each_point.to_a
32
+ end
33
+
34
+ def colors()
35
+ each_color.to_a
36
+ end
37
+
38
+ def texcoords()
39
+ each_texcoord.to_a
40
+ end
41
+
42
+ def each_point(&block)
43
+ block ? each_point!(&block) : enum_for(:each_point!)
44
+ end
45
+
46
+ def each_color(&block)
47
+ block ? each_color!(&block) : enum_for(:each_color!)
48
+ end
49
+
50
+ def each_texcoord(&block)
51
+ block ? each_texcoord!(&block) : enum_for(:each_texcoord!)
13
52
  end
14
53
 
15
- def transform(matrix = nil, loop: loop?, &block)
16
- points = to_a
17
- points = points.map {|point| matrix * point} if matrix
18
- points = block.call points if block
19
- self.class.new(*points, loop: loop)
54
+ alias each each_point
55
+
56
+ def <=>(o)
57
+ (size <=> o.size) .then {|cmp| return cmp if cmp != 0}
58
+ (loop? <=> o.loop?).then {|cmp| return cmp if cmp != 0}
59
+ (fill? <=> o.fill?).then {|cmp| return cmp if cmp != 0}
60
+ points .zip(o.points) .each {|a, b| cmp = a <=> b; return cmp if cmp != 0}
61
+ colors .zip(o.colors) .each {|a, b| cmp = a <=> b; return cmp if cmp != 0}
62
+ texcoords.zip(o.texcoords).each {|a, b| cmp = a <=> b; return cmp if cmp != 0}
63
+ 0
20
64
  end
21
65
 
22
66
  def inspect()
23
- "#<Rays::Polyline #{to_a.join ', '}, loop: #{loop?}>"
67
+ p = points.map {|o| o.to_a.join ','}.join ', '
68
+ c, t = colors.size, texcoords.size
69
+ "#<Rays::Polyline [#{p}] loop:#{loop?} fill:#{fill?} hole:#{hole?} colors:#{c} texcoords:#{t}>"
24
70
  end
25
71
 
26
72
  end# Polyline
data/lib/rays.rb CHANGED
@@ -10,7 +10,6 @@ require 'rays/matrix'
10
10
  require 'rays/painter'
11
11
  require 'rays/polyline'
12
12
  require 'rays/polygon'
13
- require 'rays/polygon_line'
14
13
  require 'rays/bitmap'
15
14
  require 'rays/image'
16
15
  require 'rays/font'
data/rays.gemspec CHANGED
@@ -25,8 +25,8 @@ Gem::Specification.new do |s|
25
25
  s.platform = Gem::Platform::RUBY
26
26
  s.required_ruby_version = '>= 3.0.0'
27
27
 
28
- s.add_runtime_dependency 'xot', '~> 0.1.40'
29
- s.add_runtime_dependency 'rucy', '~> 0.1.41'
28
+ s.add_runtime_dependency 'xot', '~> 0.1.41'
29
+ s.add_runtime_dependency 'rucy', '~> 0.1.43'
30
30
 
31
31
  s.files = `git ls-files`.split $/
32
32
  s.executables = s.files.grep(%r{^bin/}) {|f| File.basename f}
data/src/color_space.cpp CHANGED
@@ -70,8 +70,8 @@ namespace Rays
70
70
  static const int BPPS[] =
71
71
  {
72
72
  0, // UNKNOWN
73
- 8, 16, 24, 32, 32, // GRAY
74
- 8, 16, 24, 32, 32, // ALPHA
73
+ 8, 16, 24, 32, 32, // GRAY
74
+ 8, 16, 24, 32, 32, // ALPHA
75
75
  24, 32, 32, 32, 32, // RGB(A)
76
76
  24, 32, 32, 32, 32, // BGR(A)
77
77
  96, 128, 128, // RGB(A) float
data/src/font.cpp CHANGED
@@ -27,7 +27,7 @@ namespace Rays
27
27
  if (pixel_density != for_pixel_density)
28
28
  {
29
29
  rawfont_for_pixel_density =
30
- RawFont(rawfont.name(), rawfont.size() * pixel_density);
30
+ RawFont(rawfont, rawfont.size() * pixel_density);
31
31
  for_pixel_density = pixel_density;
32
32
  }
33
33
 
@@ -37,8 +37,16 @@ namespace Rays
37
37
  };// Font::Data
38
38
 
39
39
 
40
+ Font
41
+ load_font (const char* path, coord size)
42
+ {
43
+ Font font;
44
+ font.self->rawfont = RawFont_load(path, size);
45
+ return font;
46
+ }
47
+
40
48
  const Font&
41
- default_font ()
49
+ get_default_font ()
42
50
  {
43
51
  static const Font FONT(NULL);
44
52
  return FONT;
@@ -79,12 +87,26 @@ namespace Rays
79
87
  {
80
88
  }
81
89
 
90
+ Font
91
+ Font::dup () const
92
+ {
93
+ Font f;
94
+ f.self->rawfont = RawFont(self->rawfont, self->rawfont.size());
95
+ return f;
96
+ }
97
+
82
98
  String
83
99
  Font::name () const
84
100
  {
85
101
  return self->rawfont.name();
86
102
  }
87
103
 
104
+ void
105
+ Font::set_size (coord size)
106
+ {
107
+ self->rawfont = RawFont(self->rawfont, size);
108
+ }
109
+
88
110
  coord
89
111
  Font::size () const
90
112
  {
data/src/font.h CHANGED
@@ -15,11 +15,15 @@ namespace Rays
15
15
  class RawFont
16
16
  {
17
17
 
18
+ typedef RawFont This;
19
+
18
20
  public:
19
21
 
20
22
  RawFont ();
21
23
 
22
- RawFont (const char* name, coord size = 0);
24
+ RawFont (const char* name, coord size);
25
+
26
+ RawFont (const This& obj, coord size);
23
27
 
24
28
  ~RawFont ();
25
29
 
@@ -58,6 +62,9 @@ namespace Rays
58
62
  coord* ascent = NULL, coord* descent = NULL, coord* leading = NULL);
59
63
 
60
64
 
65
+ RawFont RawFont_load (const char* path, coord size);
66
+
67
+
61
68
  }// Rays
62
69
 
63
70
 
data/src/ios/font.mm CHANGED
@@ -2,6 +2,7 @@
2
2
  #include "../font.h"
3
3
 
4
4
 
5
+ #include <memory>
5
6
  #import <CoreGraphics/CGContext.h>
6
7
  #import <CoreText/CoreText.h>
7
8
  #include "rays/exception.h"
@@ -12,15 +13,23 @@ namespace Rays
12
13
  {
13
14
 
14
15
 
16
+ typedef std::shared_ptr<const __CFDictionary> CFDictionaryPtr;
17
+
18
+ typedef std::shared_ptr<const __CFAttributedString> CFAttributedStringPtr;
19
+
20
+ typedef std::shared_ptr<CGDataProvider> CGDataProviderPtr;
21
+
22
+ typedef std::shared_ptr<CGFont> CGFontPtr;
23
+
24
+ typedef std::shared_ptr<const __CTLine> CTLinePtr;
25
+
26
+
15
27
  struct RawFont::Data
16
28
  {
17
29
 
18
- CTFontRef font;
30
+ CTFontRef font = NULL;
19
31
 
20
- Data ()
21
- : font(NULL)
22
- {
23
- }
32
+ String path;
24
33
 
25
34
  ~Data ()
26
35
  {
@@ -34,7 +43,7 @@ namespace Rays
34
43
  };// RawFont::Data
35
44
 
36
45
 
37
- static CTLineRef
46
+ static CTLinePtr
38
47
  make_line (CTFontRef font, const char* str)
39
48
  {
40
49
  if (!font || !str || *str == '\0')
@@ -50,18 +59,67 @@ namespace Rays
50
59
  };
51
60
  size_t nkeys = sizeof(keys) / sizeof(keys[0]);
52
61
 
53
- CFDictionaryRef attr = CFDictionaryCreate(
54
- NULL, (const void**) &keys, (const void**) &values, nkeys,
55
- &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
62
+ CFDictionaryPtr attr(
63
+ CFDictionaryCreate(
64
+ NULL, (const void**) &keys, (const void**) &values, nkeys,
65
+ &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks),
66
+ CFRelease);
67
+
68
+ CFAttributedStringPtr attrstr(
69
+ CFAttributedStringCreate(NULL, cfstring(str).get(), attr.get()),
70
+ CFRelease);
56
71
 
57
- CFAttributedStringRef attrstr = CFAttributedStringCreate(
58
- NULL, cfstring(str).get(), attr);
59
- CFRelease(attr);
72
+ return CTLinePtr(
73
+ CTLineCreateWithAttributedString(attrstr.get()),
74
+ CFRelease);
75
+ }
60
76
 
61
- CTLineRef line = CTLineCreateWithAttributedString(attrstr);
62
- CFRelease(attrstr);
77
+ const FontFamilyMap&
78
+ get_font_families ()
79
+ {
80
+ static const FontFamilyMap MAP = []() {
81
+ NSFontManager* fm = NSFontManager.sharedFontManager;
63
82
 
64
- return line;
83
+ FontFamilyMap map;
84
+ for (NSString* family in fm.availableFontFamilies)
85
+ {
86
+ FontFamilyMap::mapped_type array;
87
+ for (NSArray<NSString*>* members in [fm availableMembersOfFontFamily: family])
88
+ array.emplace_back(members[0].UTF8String);
89
+ map[family.UTF8String] = array;
90
+ }
91
+ return map;
92
+ }();
93
+ return MAP;
94
+ }
95
+
96
+ RawFont
97
+ RawFont_load (const char* path, coord size)
98
+ {
99
+ if (!path)
100
+ argument_error(__FILE__, __LINE__);
101
+
102
+ CGDataProviderPtr data_provider(
103
+ CGDataProviderCreateWithFilename(path),
104
+ CGDataProviderRelease);
105
+ if (!data_provider)
106
+ rays_error(__FILE__, __LINE__, "failed to create CGDataProvider");
107
+
108
+ CGFontPtr cgfont(
109
+ CGFontCreateWithDataProvider(data_provider.get()),
110
+ CGFontRelease);
111
+ if (!cgfont)
112
+ rays_error(__FILE__, __LINE__, "failed to create CGFont");
113
+
114
+ CTFontRef ctfont = CTFontCreateWithGraphicsFont(
115
+ cgfont.get(), size, NULL, NULL);
116
+ if (!ctfont)
117
+ rays_error(__FILE__, __LINE__, "failed to create CTFont");
118
+
119
+ RawFont rawfont;
120
+ rawfont.self->font = ctfont;
121
+ rawfont.self->path = path;
122
+ return rawfont;
65
123
  }
66
124
 
67
125
 
@@ -76,6 +134,15 @@ namespace Rays
76
134
  : CTFontCreateUIFontForLanguage(kCTFontSystemFontType, size, NULL);
77
135
  }
78
136
 
137
+ RawFont::RawFont (const This& obj, coord size)
138
+ {
139
+ const char* path = obj.self->path.empty() ? NULL : obj.self->path.c_str();
140
+ if (path)
141
+ *this = RawFont_load(path, size);
142
+ else
143
+ self->font = CTFontCreateWithName(cfstring(obj.name()).get(), size, NULL);
144
+ }
145
+
79
146
  RawFont::~RawFont ()
80
147
  {
81
148
  }
@@ -92,7 +159,7 @@ namespace Rays
92
159
 
93
160
  if (*str == '\0') return;
94
161
 
95
- CTLineRef line = make_line(self->font, str);
162
+ CTLinePtr line = make_line(self->font, str);
96
163
  if (!line)
97
164
  rays_error(__FILE__, __LINE__, "creating CTLineRef failed.");
98
165
 
@@ -112,10 +179,8 @@ namespace Rays
112
179
  CGContextSaveGState(context);
113
180
  CGContextSetTextMatrix(context, CGAffineTransformIdentity);
114
181
  CGContextSetTextPosition(context, x, context_height - ascent - y);
115
- CTLineDraw(line, context);
182
+ CTLineDraw(line.get(), context);
116
183
  CGContextRestoreGState(context);
117
-
118
- CFRelease(line);
119
184
  }
120
185
 
121
186
  String
@@ -123,14 +188,13 @@ namespace Rays
123
188
  {
124
189
  if (!*this) return "";
125
190
 
126
- CFStringRef str = CTFontCopyFullName(self->font);
191
+ CFStringPtr str(CTFontCopyFullName(self->font), CFRelease);
127
192
 
128
193
  enum {BUFSIZE = 2048};
129
194
  char buf[BUFSIZE + 1];
130
- if (!CFStringGetCString(str, buf, BUFSIZE, kCFStringEncodingUTF8))
195
+ if (!CFStringGetCString(str.get(), buf, BUFSIZE, kCFStringEncodingUTF8))
131
196
  buf[0] = '\0';
132
197
 
133
- CFRelease(str);
134
198
  return buf;
135
199
  }
136
200
 
@@ -152,14 +216,11 @@ namespace Rays
152
216
 
153
217
  if (*str == '\0') return 0;
154
218
 
155
- CTLineRef line = make_line(self->font, str);
219
+ CTLinePtr line = make_line(self->font, str);
156
220
  if (!line)
157
221
  rays_error(__FILE__, __LINE__, "creating CTLineRef failed.");
158
222
 
159
- coord w = CTLineGetTypographicBounds(line, NULL, NULL, NULL);
160
- CFRelease(line);
161
-
162
- return w;
223
+ return CTLineGetTypographicBounds(line.get(), NULL, NULL, NULL);
163
224
  }
164
225
 
165
226
  coord
data/src/matrix.cpp CHANGED
@@ -32,6 +32,14 @@ namespace Rays
32
32
  reset(elements, size);
33
33
  }
34
34
 
35
+ Matrix::Matrix (void* null)
36
+ {
37
+ if (null != NULL)
38
+ argument_error(__FILE__, __LINE__);
39
+
40
+ // do nothing to avoid initialization
41
+ }
42
+
35
43
  Matrix
36
44
  Matrix::dup () const
37
45
  {