Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 26aa221b81
Fetching contributors…

Cannot retrieve contributors at this time

23 lines (20 sloc) 0.798 kb
#pragma once
#include "ofImage.h"
#include "lunar.h"
class bludImage {
public:
static const char className[];
static Lunar<bludImage>::RegType methods[];
ofImage _image;
bludImage(lua_State *L) {
_image.setImageType(OF_IMAGE_COLOR_ALPHA);
}
int load (lua_State *L) {
return _image.loadImage(luaL_checkstring(L, 1));
}
int draw(lua_State *L) { _image.draw(luaL_checknumber(L, 1), luaL_checknumber(L, 2)); return 0; }
int drawScale(lua_State *L) { _image.draw(luaL_checknumber(L, 1), luaL_checknumber(L, 2), luaL_checknumber(L, 3), luaL_checknumber(L, 4)); return 0; }
int width(lua_State *L) { lua_pushnumber(L, _image.getWidth()); return 1; }
int height(lua_State *L) { lua_pushnumber(L, _image.getHeight()); return 1; }
~bludImage() { printf("deleted image (%p)\n", this); }
};
Jump to Line
Something went wrong with that request. Please try again.