Commit 1cdc12e0 authored by Manuel Günther's avatar Manuel Günther
Browse files

Updated to new build system.

parent 1c745c7d
......@@ -10,7 +10,6 @@
#include <bob.blitz/cppapi.h>
#include <bob.blitz/cleanup.h>
#include "drawing.h"
#include "utils.h"
template <typename T>
......@@ -26,7 +25,7 @@ static PyObject* inner_box (PyBlitzArrayObject* image,
if (!ok) return 0;
try {
bob::ip::draw_box(*PyBlitzArrayCxx_AsBlitz<T,2>(image), y, x,
bob::ip::draw::draw_box(*PyBlitzArrayCxx_AsBlitz<T,2>(image), y, x,
h, w, c);
}
catch (std::exception& e) {
......@@ -34,7 +33,7 @@ static PyObject* inner_box (PyBlitzArrayObject* image,
return 0;
}
catch (...) {
PyErr_SetString(PyExc_RuntimeError, "caught unknown exception while calling C++ bob::ip::draw_box");
PyErr_SetString(PyExc_RuntimeError, "caught unknown exception while calling C++ bob::ip::draw::draw_box");
return 0;
}
......@@ -48,7 +47,7 @@ static PyObject* inner_box (PyBlitzArrayObject* image,
if (!ok) return 0;
try {
bob::ip::draw_box(*PyBlitzArrayCxx_AsBlitz<T,3>(image), y, x,
bob::ip::draw::draw_box(*PyBlitzArrayCxx_AsBlitz<T,3>(image), y, x,
h, w, boost::tuple<T,T,T>(r, g, b));
}
catch (std::exception& e) {
......@@ -56,7 +55,7 @@ static PyObject* inner_box (PyBlitzArrayObject* image,
return 0;
}
catch (...) {
PyErr_SetString(PyExc_RuntimeError, "caught unknown exception while calling C++ bob::ip::draw_box");
PyErr_SetString(PyExc_RuntimeError, "caught unknown exception while calling C++ bob::ip::draw::draw_box");
return 0;
}
......
......@@ -11,7 +11,6 @@
#include <bob.blitz/cppapi.h>
#include <bob.blitz/cleanup.h>
#include "drawing.h"
#include "utils.h"
template <typename T>
......@@ -27,7 +26,7 @@ static PyObject* inner_cross (PyBlitzArrayObject* image,
if (!ok) return 0;
try {
bob::ip::draw_cross(*PyBlitzArrayCxx_AsBlitz<T,2>(image),
bob::ip::draw::draw_cross(*PyBlitzArrayCxx_AsBlitz<T,2>(image),
y, x, radius, c);
Py_RETURN_NONE;
}
......@@ -35,7 +34,7 @@ static PyObject* inner_cross (PyBlitzArrayObject* image,
PyErr_Format(PyExc_RuntimeError, "%s", e.what());
}
catch (...) {
PyErr_SetString(PyExc_RuntimeError, "caught unknown exception while calling C++ bob::ip::draw_cross");
PyErr_SetString(PyExc_RuntimeError, "caught unknown exception while calling C++ bob::ip::draw::draw_cross");
}
}
break;
......@@ -47,7 +46,7 @@ static PyObject* inner_cross (PyBlitzArrayObject* image,
if (!ok) return 0;
try {
bob::ip::draw_cross(*PyBlitzArrayCxx_AsBlitz<T,3>(image),
bob::ip::draw::draw_cross(*PyBlitzArrayCxx_AsBlitz<T,3>(image),
y, x, radius, boost::tuple<T,T,T>(r, g, b));
Py_RETURN_NONE;
}
......@@ -55,7 +54,7 @@ static PyObject* inner_cross (PyBlitzArrayObject* image,
PyErr_Format(PyExc_RuntimeError, "%s", e.what());
}
catch (...) {
PyErr_SetString(PyExc_RuntimeError, "caught unknown exception while calling C++ bob::ip::draw_cross");
PyErr_SetString(PyExc_RuntimeError, "caught unknown exception while calling C++ bob::ip::draw::draw_cross");
}
}
......@@ -119,7 +118,7 @@ static PyObject* inner_plus (PyBlitzArrayObject* image,
if (!ok) return 0;
try {
bob::ip::draw_cross_plus(*PyBlitzArrayCxx_AsBlitz<T,2>(image),
bob::ip::draw::draw_cross_plus(*PyBlitzArrayCxx_AsBlitz<T,2>(image),
y, x, radius, c);
Py_RETURN_NONE;
}
......@@ -127,7 +126,7 @@ static PyObject* inner_plus (PyBlitzArrayObject* image,
PyErr_Format(PyExc_RuntimeError, "%s", e.what());
}
catch (...) {
PyErr_SetString(PyExc_RuntimeError, "caught unknown exception while calling C++ bob::ip::draw_cross_plus");
PyErr_SetString(PyExc_RuntimeError, "caught unknown exception while calling C++ bob::ip::draw::draw_cross_plus");
}
}
break;
......@@ -139,7 +138,7 @@ static PyObject* inner_plus (PyBlitzArrayObject* image,
if (!ok) return 0;
try {
bob::ip::draw_cross_plus(*PyBlitzArrayCxx_AsBlitz<T,3>(image),
bob::ip::draw::draw_cross_plus(*PyBlitzArrayCxx_AsBlitz<T,3>(image),
y, x, radius, boost::tuple<T,T,T>(r, g, b));
Py_RETURN_NONE;
}
......@@ -147,7 +146,7 @@ static PyObject* inner_plus (PyBlitzArrayObject* image,
PyErr_Format(PyExc_RuntimeError, "%s", e.what());
}
catch (...) {
PyErr_SetString(PyExc_RuntimeError, "caught unknown exception while calling C++ bob::ip::draw_cross_plus");
PyErr_SetString(PyExc_RuntimeError, "caught unknown exception while calling C++ bob::ip::draw::draw_cross_plus");
}
}
......
/**
* @file bob/ip/drawing.h
* @date Sun Jul 24 21:13:21 2011 +0200
* @author Andre Anjos <andre.anjos@idiap.ch>
*
......@@ -8,15 +7,15 @@
* Copyright (C) 2011-2013 Idiap Research Institute, Martigny, Switzerland
*/
#ifndef BOB_IP_DRAWING_H
#define BOB_IP_DRAWING_H
#ifndef BOB_IP_DRAW_DRAWING_H
#define BOB_IP_DRAW_DRAWING_H
#include <stdexcept>
#include <algorithm>
#include <blitz/array.h>
#include <boost/tuple/tuple.hpp>
namespace bob { namespace ip {
namespace bob { namespace ip { namespace draw {
/**
* Draws a point in the 2D gray-scale image. No checks, if you try to access
......@@ -270,6 +269,6 @@ namespace bob { namespace ip {
draw_line(image, y, x + width, y + height, x + width, color);
}
}}
} } } // namespaces
#endif /* BOB_IP_DRAWING_H */
#endif /* BOB_IP_DRAW_DRAWING_H */
......@@ -10,7 +10,6 @@
#include <bob.blitz/cppapi.h>
#include <bob.blitz/cleanup.h>
#include "drawing.h"
#include "utils.h"
template <typename T>
......@@ -26,7 +25,7 @@ static PyObject* inner_line (PyBlitzArrayObject* image,
if (!ok) return 0;
try {
bob::ip::draw_line(*PyBlitzArrayCxx_AsBlitz<T,2>(image), y1, x1,
bob::ip::draw::draw_line(*PyBlitzArrayCxx_AsBlitz<T,2>(image), y1, x1,
y2, x2, c);
}
catch (std::exception& e) {
......@@ -34,7 +33,7 @@ static PyObject* inner_line (PyBlitzArrayObject* image,
return 0;
}
catch (...) {
PyErr_SetString(PyExc_RuntimeError, "caught unknown exception while calling C++ bob::ip::draw_line");
PyErr_SetString(PyExc_RuntimeError, "caught unknown exception while calling C++ bob::ip::draw::draw_line");
return 0;
}
......@@ -48,7 +47,7 @@ static PyObject* inner_line (PyBlitzArrayObject* image,
if (!ok) return 0;
try {
bob::ip::draw_line(*PyBlitzArrayCxx_AsBlitz<T,3>(image), y1, x1,
bob::ip::draw::draw_line(*PyBlitzArrayCxx_AsBlitz<T,3>(image), y1, x1,
y2, x2, boost::tuple<T,T,T>(r, g, b));
}
catch (std::exception& e) {
......@@ -56,7 +55,7 @@ static PyObject* inner_line (PyBlitzArrayObject* image,
return 0;
}
catch (...) {
PyErr_SetString(PyExc_RuntimeError, "caught unknown exception while calling C++ bob::ip::draw_point");
PyErr_SetString(PyExc_RuntimeError, "caught unknown exception while calling C++ bob::ip::draw::draw_point");
return 0;
}
......
......@@ -2,7 +2,7 @@
* @author Andre Anjos <andre.anjos@idiap.ch>
* @date Fri 4 Apr 15:02:59 2014 CEST
*
* @brief Bindings to bob::ip color converters
* @brief Bindings to bob::ip::draw
*/
#ifdef NO_IMPORT_ARRAY
......
......@@ -11,7 +11,6 @@
#include <bob.blitz/cppapi.h>
#include <bob.blitz/cleanup.h>
#include "drawing.h"
#include "utils.h"
template <typename T>
......@@ -27,14 +26,14 @@ static PyObject* inner_point (PyBlitzArrayObject* image,
if (!ok) return 0;
try {
bob::ip::draw_point(*PyBlitzArrayCxx_AsBlitz<T,2>(image), y, x, c);
bob::ip::draw::draw_point(*PyBlitzArrayCxx_AsBlitz<T,2>(image), y, x, c);
}
catch (std::exception& e) {
PyErr_Format(PyExc_RuntimeError, "%s", e.what());
return 0;
}
catch (...) {
PyErr_SetString(PyExc_RuntimeError, "caught unknown exception while calling C++ bob::ip::draw_point");
PyErr_SetString(PyExc_RuntimeError, "caught unknown exception while calling C++ bob::ip::draw::draw_point");
return 0;
}
}
......@@ -47,7 +46,7 @@ static PyObject* inner_point (PyBlitzArrayObject* image,
if (!ok) return 0;
try {
bob::ip::draw_point(*PyBlitzArrayCxx_AsBlitz<T,3>(image), y, x,
bob::ip::draw::draw_point(*PyBlitzArrayCxx_AsBlitz<T,3>(image), y, x,
boost::tuple<T,T,T>(r, g, b));
}
catch (std::exception& e) {
......@@ -55,7 +54,7 @@ static PyObject* inner_point (PyBlitzArrayObject* image,
return 0;
}
catch (...) {
PyErr_SetString(PyExc_RuntimeError, "caught unknown exception while calling C++ bob::ip::draw_point");
PyErr_SetString(PyExc_RuntimeError, "caught unknown exception while calling C++ bob::ip::draw::draw_point");
return 0;
}
......
......@@ -11,7 +11,6 @@
#include <bob.blitz/cppapi.h>
#include <bob.blitz/cleanup.h>
#include "drawing.h"
#include "utils.h"
template <typename T>
......@@ -27,14 +26,14 @@ static PyObject* inner_point (PyBlitzArrayObject* image,
if (!ok) return 0;
try {
bob::ip::try_draw_point(*PyBlitzArrayCxx_AsBlitz<T,2>(image), y, x, c);
bob::ip::draw::try_draw_point(*PyBlitzArrayCxx_AsBlitz<T,2>(image), y, x, c);
}
catch (std::exception& e) {
PyErr_Format(PyExc_RuntimeError, "%s", e.what());
return 0;
}
catch (...) {
PyErr_SetString(PyExc_RuntimeError, "caught unknown exception while calling C++ bob::ip::try_draw_point");
PyErr_SetString(PyExc_RuntimeError, "caught unknown exception while calling C++ bob::ip::draw::try_draw_point");
return 0;
}
}
......@@ -47,7 +46,7 @@ static PyObject* inner_point (PyBlitzArrayObject* image,
if (!ok) return 0;
try {
bob::ip::try_draw_point(*PyBlitzArrayCxx_AsBlitz<T,3>(image), y, x,
bob::ip::draw::try_draw_point(*PyBlitzArrayCxx_AsBlitz<T,3>(image), y, x,
boost::tuple<T,T,T>(r, g, b));
}
catch (std::exception& e) {
......@@ -55,7 +54,7 @@ static PyObject* inner_point (PyBlitzArrayObject* image,
return 0;
}
catch (...) {
PyErr_SetString(PyExc_RuntimeError, "caught unknown exception while calling C++ bob::ip::try_draw_point");
PyErr_SetString(PyExc_RuntimeError, "caught unknown exception while calling C++ bob::ip::draw::try_draw_point");
return 0;
}
......
......@@ -8,6 +8,7 @@
*/
#include <Python.h>
#include <bob.ip.draw/drawing.h>
/**
* Returns and checks a single component color
......
......@@ -10,17 +10,17 @@ extensions = bob.buildout
auto-checkout = *
develop = src/bob.extension
src/bob.blitz
src/bob.core
.
; options for bob.buildout extension
debug = true
verbose = true
prefixes = /idiap/group/torch5spro/releases/preview/install/linux-x86_64-release
/Users/andre/work/bob/b/dbg/
[sources]
bob.extension = git https://github.com/bioidiap/bob.extension
bob.blitz = git https://github.com/bioidiap/bob.blitz
bob.core = git https://github.com/bioidiap/bob.core
[scripts]
recipe = bob.buildout:scripts
......@@ -4,9 +4,13 @@
# Thu 30 Jan 08:45:49 2014 CET
from setuptools import setup, find_packages, dist
dist.Distribution(dict(setup_requires=['bob.blitz']))
dist.Distribution(dict(setup_requires=['bob.blitz', 'bob.core']))
from bob.blitz.extension import Extension
import os
package_dir = os.path.dirname(os.path.realpath(__file__))
include_dir = os.path.join(package_dir, 'bob', 'ip', 'draw', 'include')
packages = ['boost']
version = '2.0.0a0'
......@@ -34,16 +38,18 @@ setup(
namespace_packages=[
"bob",
"bob.ip",
],
],
ext_modules = [
Extension("bob.ip.draw.version",
[
"bob/ip/draw/version.cpp",
],
],
version = version,
packages = packages,
),
bob_packages = ['bob.core'],
include_dirs = [include_dir]
),
Extension("bob.ip.draw._library",
[
"bob/ip/draw/point.cpp",
......@@ -52,11 +58,13 @@ setup(
"bob/ip/draw/cross.cpp",
"bob/ip/draw/box.cpp",
"bob/ip/draw/main.cpp",
],
],
packages = packages,
version = version,
),
],
bob_packages = ['bob.core'],
include_dirs = [include_dir]
),
],
classifiers = [
'Development Status :: 3 - Alpha',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment