# Path: pyvx/types.py
# SCALE_PYRAMID_HALF = 0.5
# SCALE_PYRAMID_ORB = 0.8408964
# FMT_REF = ffi.string(lib._get_FMT_REF())
# FMT_SIZE = ffi.string(lib._get_FMT_SIZE())
# def KERNEL_BASE(vendor, libid):
# def imagepatch_addressing_t(dim_x=0, dim_y=0, stride_x=0, stride_y=0, scale_x=0, scale_y=0, step_x=0, step_y=0):
# def perf_t(tmp=0, beg=0, end=0, sum=0, avg=0, min=0, num=0, max=0):
# def kernel_info_t(enumeration, name):
# def border_mode_t(mode, constant_value=0):
# def keypoint_t(x, y, strength, scale, orientation, tracking_status, error):
# def rectangle_t(start_x, start_y, end_x, end_y):
# def delta_rectangle_t(delta_start_x, delta_start_y, delta_end_x, delta_end_y):
# def coordinates2d_t(x, y):
# def coordinates3d_t(x, y, z):
# 
# Path: pyvx/types.py
# SCALE_PYRAMID_HALF = 0.5
# SCALE_PYRAMID_ORB = 0.8408964
# FMT_REF = ffi.string(lib._get_FMT_REF())
# FMT_SIZE = ffi.string(lib._get_FMT_SIZE())
# def KERNEL_BASE(vendor, libid):
# def imagepatch_addressing_t(dim_x=0, dim_y=0, stride_x=0, stride_y=0, scale_x=0, scale_y=0, step_x=0, step_y=0):
# def perf_t(tmp=0, beg=0, end=0, sum=0, avg=0, min=0, num=0, max=0):
# def kernel_info_t(enumeration, name):
# def border_mode_t(mode, constant_value=0):
# def keypoint_t(x, y, strength, scale, orientation, tracking_status, error):
# def rectangle_t(start_x, start_y, end_x, end_y):
# def delta_rectangle_t(delta_start_x, delta_start_y, delta_end_x, delta_end_y):
# def coordinates2d_t(x, y):
# def coordinates3d_t(x, y, z):


from pyvx.inc import vx
from pyvx.types import VxError
from pyvx import types
    from pyvx.optimized_backend import Context
    import traceback


class VxObject(object):
    __metaclass__ = VxObjectMeta


def exception2errno(e):
    if hasattr(e, 'errno'):
        return e.errno
    return vx.FAILURE


def _log_exception(e):
    log = '\n' + traceback.format_exc()
    if hasattr(e, 'ref') and e.ref is not None:
        e.ref.add_log_entry(e.errno, log)
    else:
        print log


class return_errno(object):
    @staticmethod
    def hanlde(e):
        _log_exception(e)
        return exception2errno(e)


class return_none(object):
    @staticmethod
    def hanlde(e):

# Path: pyvx/types.py
# SCALE_PYRAMID_HALF = 0.5
# SCALE_PYRAMID_ORB = 0.8408964
# FMT_REF = ffi.string(lib._get_FMT_REF())
# FMT_SIZE = ffi.string(lib._get_FMT_SIZE())
# def KERNEL_BASE(vendor, libid):
# def imagepatch_addressing_t(dim_x=0, dim_y=0, stride_x=0, stride_y=0, scale_x=0, scale_y=0, step_x=0, step_y=0):
# def perf_t(tmp=0, beg=0, end=0, sum=0, avg=0, min=0, num=0, max=0):
# def kernel_info_t(enumeration, name):
# def border_mode_t(mode, constant_value=0):
# def keypoint_t(x, y, strength, scale, orientation, tracking_status, error):
# def rectangle_t(start_x, start_y, end_x, end_y):
# def delta_rectangle_t(delta_start_x, delta_start_y, delta_end_x, delta_end_y):
# def coordinates2d_t(x, y):
# def coordinates3d_t(x, y, z):
# 
# Path: pyvx/types.py
# SCALE_PYRAMID_HALF = 0.5
# SCALE_PYRAMID_ORB = 0.8408964
# FMT_REF = ffi.string(lib._get_FMT_REF())
# FMT_SIZE = ffi.string(lib._get_FMT_SIZE())
# def KERNEL_BASE(vendor, libid):
# def imagepatch_addressing_t(dim_x=0, dim_y=0, stride_x=0, stride_y=0, scale_x=0, scale_y=0, step_x=0, step_y=0):
# def perf_t(tmp=0, beg=0, end=0, sum=0, avg=0, min=0, num=0, max=0):
# def kernel_info_t(enumeration, name):
# def border_mode_t(mode, constant_value=0):
# def keypoint_t(x, y, strength, scale, orientation, tracking_status, error):
# def rectangle_t(start_x, start_y, end_x, end_y):
# def delta_rectangle_t(delta_start_x, delta_start_y, delta_end_x, delta_end_y):
# def coordinates2d_t(x, y):
# def coordinates3d_t(x, y, z):


# Path: old/pyvx/model.py
from pyvx.inc import vx
from pyvx.types import VxError
from pyvx import types
    from pyvx.optimized_backend import Context
    import traceback



class VxObject(object):
    __metaclass__ = VxObjectMeta


def exception2errno(e):
    if hasattr(e, 'errno'):
        return e.errno
    return vx.FAILURE


def _log_exception(e):
    log = '\n' + traceback.format_exc()
    if hasattr(e, 'ref') and e.ref is not None:
        e.ref.add_log_entry(e.errno, log)
    else:
        print log


class return_errno(object):
    @staticmethod
    def hanlde(e):
        _log_exception(e)
        return exception2errno(e)


class return_none(object):
    @staticmethod
    def hanlde(e):

        _log_exception(e)