ext/rays/image.cpp in rays-0.1.7 vs ext/rays/image.cpp in rays-0.1.8
- old
+ new
@@ -12,17 +12,15 @@
using namespace Rucy;
using Rays::coord;
-static Class cImage;
+RUCY_DEFINE_VALUE_FROM_TO(Rays::Image)
-RUCY_DEFINE_VALUE_FROM_TO(Rays::Image, cImage)
-
#define THIS to<Rays::Image*>(self)
-#define CHECK RUCY_CHECK_OBJECT(Rays::Image, cImage, self)
+#define CHECK RUCY_CHECK_OBJECT(Rays::Image, self)
static
RUCY_DEF_ALLOC(alloc, klass)
{
@@ -31,11 +29,11 @@
RUCY_END
static
RUCY_DEFN(initialize)
{
- RUCY_CHECK_OBJ(Rays::Image, cImage, self);
+ RUCY_CHECK_OBJ(Rays::Image, self);
check_arg_count(__FILE__, __LINE__, "Image#initialize", argc, 1, 2, 3);
if (argc == 0) return self;
if (argv[0].is_kind_of(Rays::bitmap_class()))
@@ -61,11 +59,11 @@
RUCY_END
static
RUCY_DEF1(initialize_copy, obj)
{
- RUCY_CHECK_OBJ(Rays::Image, cImage, self);
+ RUCY_CHECK_OBJ(Rays::Image, self);
*THIS = to<Rays::Image&>(obj).copy();
return self;
}
RUCY_END
@@ -141,9 +139,11 @@
{
return value(Rays::load_image(path.c_str(), to<bool>(alpha_only)));
}
RUCY_END
+
+static Class cImage;
void
Init_image ()
{
Module mRays = define_module("Rays");