rays 0.1.3 → 0.1.4
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.
- data/.doc/ext/rays/bitmap.cpp +76 -53
- data/.doc/ext/rays/font.cpp +31 -27
- data/.doc/ext/rays/image.cpp +44 -37
- data/.doc/ext/rays/native.cpp +6 -0
- data/.doc/ext/rays/painter.cpp +276 -160
- data/.doc/ext/rays/rays.cpp +8 -9
- data/.doc/ext/rays/texture.cpp +50 -28
- data/.gitignore +14 -0
- data/Rakefile +5 -30
- data/VERSION +1 -1
- data/ext/rays/bitmap.cpp +77 -53
- data/ext/rays/bounds.cpp +426 -0
- data/ext/rays/color.cpp +199 -0
- data/ext/rays/defs.h +1 -18
- data/ext/rays/extconf.rb +10 -8
- data/ext/rays/font.cpp +31 -27
- data/ext/rays/image.cpp +44 -37
- data/ext/rays/matrix.cpp +154 -0
- data/ext/rays/native.cpp +6 -0
- data/ext/rays/painter.cpp +288 -163
- data/ext/rays/point.cpp +175 -0
- data/ext/rays/rays.cpp +8 -9
- data/ext/rays/texture.cpp +52 -28
- data/include/rays.h +1 -2
- data/include/rays/bitmap.h +5 -3
- data/include/rays/bounds.h +94 -0
- data/include/rays/color.h +53 -0
- data/include/rays/colorspace.h +2 -2
- data/include/rays/exception.h +1 -1
- data/include/rays/font.h +7 -3
- data/include/rays/image.h +6 -2
- data/include/rays/matrix.h +63 -0
- data/include/rays/opengl.h +1 -1
- data/include/rays/painter.h +138 -39
- data/include/rays/point.h +39 -0
- data/include/rays/ruby.h +3 -0
- data/include/rays/ruby/bitmap.h +5 -3
- data/include/rays/ruby/bounds.h +41 -0
- data/include/rays/ruby/color.h +41 -0
- data/include/rays/ruby/font.h +5 -3
- data/include/rays/ruby/image.h +5 -3
- data/include/rays/ruby/matrix.h +41 -0
- data/include/rays/ruby/painter.h +5 -3
- data/include/rays/ruby/point.h +41 -0
- data/include/rays/ruby/texture.h +5 -3
- data/include/rays/texture.h +6 -2
- data/lib/rays.rb +3 -0
- data/lib/rays/autoinit.rb +1 -1
- data/lib/rays/bitmap.rb +15 -1
- data/lib/rays/bounds.rb +138 -0
- data/lib/rays/color.rb +52 -0
- data/lib/rays/ext.rb +4 -0
- data/lib/rays/image.rb +1 -1
- data/lib/rays/module.rb +9 -2
- data/lib/rays/painter.rb +40 -41
- data/lib/rays/point.rb +82 -0
- data/lib/rays/texture.rb +1 -1
- data/rays.gemspec +16 -37
- data/src/bounds.cpp +234 -0
- data/src/cocoa/bitmap.mm +4 -4
- data/src/cocoa/font.mm +35 -30
- data/src/cocoa/rays.mm +2 -0
- data/src/color.cpp +77 -0
- data/src/colorspace.cpp +3 -3
- data/src/exception.cpp +3 -18
- data/src/image.cpp +9 -2
- data/src/matrix.cpp +103 -0
- data/src/painter.cpp +475 -224
- data/src/point.cpp +52 -0
- data/src/texture.cpp +14 -2
- data/src/win32/bitmap.cpp +2 -2
- data/src/win32/gdi.cpp +22 -13
- data/src/win32/gdi.h +7 -7
- data/test/helpers.rb +1 -5
- data/test/test_bitmap.rb +9 -0
- data/test/test_bounds.rb +246 -0
- data/test/test_color.rb +88 -0
- data/test/test_font.rb +28 -0
- data/test/test_image.rb +9 -0
- data/test/test_painter.rb +1 -3
- data/test/test_point.rb +121 -0
- data/test/test_rays.rb +2 -3
- data/test/test_texture.rb +1 -3
- metadata +146 -75
- data/include/rays/helpers.h +0 -37
- data/include/rays/transform.h +0 -35
- data/src/helpers.cpp +0 -22
- data/src/transform.cpp +0 -88
data/include/rays/helpers.h
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
// -*- c++ -*-
|
2
|
-
#pragma once
|
3
|
-
#ifndef __RAYS_HELPERS_H__
|
4
|
-
#define __RAYS_HELPERS_H__
|
5
|
-
|
6
|
-
|
7
|
-
#include <boost/shared_ptr.hpp>
|
8
|
-
|
9
|
-
|
10
|
-
namespace Rays
|
11
|
-
{
|
12
|
-
|
13
|
-
|
14
|
-
template <typename T>
|
15
|
-
class Impl : public boost::shared_ptr<T>
|
16
|
-
{
|
17
|
-
|
18
|
-
typedef boost::shared_ptr<T> Super;
|
19
|
-
|
20
|
-
public:
|
21
|
-
|
22
|
-
Impl () : Super(new T) {}
|
23
|
-
|
24
|
-
Impl (T* p) : Super(p) {}
|
25
|
-
|
26
|
-
};// Impl
|
27
|
-
|
28
|
-
|
29
|
-
int bit2byte (int bits);
|
30
|
-
|
31
|
-
int byte2bit (int bytes);
|
32
|
-
|
33
|
-
|
34
|
-
}// Rays
|
35
|
-
|
36
|
-
|
37
|
-
#endif//EOH
|
data/include/rays/transform.h
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
// -*- c++ -*-
|
2
|
-
#pragma once
|
3
|
-
#ifndef __RAYS_TRANSFORM_H__
|
4
|
-
#define __RAYS_TRANSFORM_H__
|
5
|
-
|
6
|
-
|
7
|
-
#include <rays/defs.h>
|
8
|
-
|
9
|
-
|
10
|
-
namespace Rays
|
11
|
-
{
|
12
|
-
|
13
|
-
|
14
|
-
bool translate (coord x, coord y, coord z = 0);
|
15
|
-
|
16
|
-
bool scale (coord x, coord y, coord z = 1);
|
17
|
-
|
18
|
-
bool rotate (coord angle, coord x = 0, coord y = 0, coord z = 1);
|
19
|
-
|
20
|
-
|
21
|
-
bool set_matrix (coord value = 1);
|
22
|
-
|
23
|
-
bool set_matrix (coord* elements, size_t size);
|
24
|
-
|
25
|
-
bool get_matrix (coord* elements, size_t size);
|
26
|
-
|
27
|
-
bool push_matrix ();
|
28
|
-
|
29
|
-
bool pop_matrix ();
|
30
|
-
|
31
|
-
|
32
|
-
}// Rays
|
33
|
-
|
34
|
-
|
35
|
-
#endif//EOH
|
data/src/helpers.cpp
DELETED
data/src/transform.cpp
DELETED
@@ -1,88 +0,0 @@
|
|
1
|
-
#include "rays/painter.h"
|
2
|
-
|
3
|
-
|
4
|
-
#include "rays/opengl.h"
|
5
|
-
|
6
|
-
|
7
|
-
namespace Rays
|
8
|
-
{
|
9
|
-
|
10
|
-
|
11
|
-
static bool
|
12
|
-
is_error ()
|
13
|
-
{
|
14
|
-
GLenum e = glGetError();
|
15
|
-
return e == GL_INVALID_OPERATION;
|
16
|
-
}
|
17
|
-
|
18
|
-
static bool
|
19
|
-
is_error (GLenum error)
|
20
|
-
{
|
21
|
-
GLenum e = glGetError();
|
22
|
-
return e == GL_INVALID_OPERATION || e == error;
|
23
|
-
}
|
24
|
-
|
25
|
-
|
26
|
-
bool
|
27
|
-
translate (coord x, coord y, coord z)
|
28
|
-
{
|
29
|
-
glTranslatef(x, y, z);
|
30
|
-
return !is_error();
|
31
|
-
}
|
32
|
-
|
33
|
-
bool
|
34
|
-
scale (coord x, coord y, coord z)
|
35
|
-
{
|
36
|
-
glScalef(x, y, z);
|
37
|
-
return !is_error();
|
38
|
-
}
|
39
|
-
|
40
|
-
bool
|
41
|
-
rotate (float angle, coord x, coord y, coord z)
|
42
|
-
{
|
43
|
-
glRotatef(angle, x, y, z);
|
44
|
-
return !is_error();
|
45
|
-
}
|
46
|
-
|
47
|
-
|
48
|
-
bool
|
49
|
-
set_matrix (coord value)
|
50
|
-
{
|
51
|
-
glLoadIdentity();
|
52
|
-
if (is_error()) return false;
|
53
|
-
if (value == 1) return true;
|
54
|
-
return scale(value, value, value);
|
55
|
-
}
|
56
|
-
|
57
|
-
bool
|
58
|
-
set_matrix (const coord* elements, size_t size)
|
59
|
-
{
|
60
|
-
if (!elements || size != 16) return false;
|
61
|
-
glLoadMatrixf(elements);
|
62
|
-
return !is_error();
|
63
|
-
}
|
64
|
-
|
65
|
-
bool
|
66
|
-
get_matrix (coord* elements, size_t size)
|
67
|
-
{
|
68
|
-
if (!elements || size != 16) return false;
|
69
|
-
glGetFloatv(GL_MODELVIEW_MATRIX, elements);
|
70
|
-
return !is_error(GL_INVALID_ENUM);
|
71
|
-
}
|
72
|
-
|
73
|
-
bool
|
74
|
-
push_matrix ()
|
75
|
-
{
|
76
|
-
glPushMatrix();
|
77
|
-
return !is_error(GL_STACK_OVERFLOW);
|
78
|
-
}
|
79
|
-
|
80
|
-
bool
|
81
|
-
pop_matrix ()
|
82
|
-
{
|
83
|
-
glPopMatrix();
|
84
|
-
return !is_error(GL_STACK_UNDERFLOW);
|
85
|
-
}
|
86
|
-
|
87
|
-
|
88
|
-
}// Rays
|