# 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
    if isinstance(value, VxObject):
        ptr[0] = value.new_handle()
    else:
        ptr[0] = value
    return vx.SUCCESS

@api('SetContextAttribute')
@api('SetImageAttribute')
@api('SetKernelAttribute')
@api('SetGraphAttribute')
@api('SetNodeAttribute')
@api('SetThresholdAttribute')
@api('SetConvolutionAttribute')
@api('SetMetaFormatAttribute')
def set_attribute(ref, attribute, value):
    return ref.set_attribute(attribute, value)


@capi('vx_status vxSetContextAttribute(vx_context context, vx_enum attribute, void *ptr, vx_size size)')
@capi('vx_status vxSetImageAttribute(vx_image image, vx_enum attribute, void *out, vx_size size)')
@capi('vx_status vxSetKernelAttribute(vx_kernel kernel, vx_enum attribute, void *ptr, vx_size size)')
@capi('vx_status vxSetGraphAttribute(vx_graph graph, vx_enum attribute, void *ptr, vx_size size)')
@capi('vx_status vxSetNodeAttribute(vx_node node, vx_enum attribute, void *ptr, vx_size size)')
@capi('vx_status vxSetThresholdAttribute(vx_threshold thresh, vx_enum attribute, void *ptr, vx_size size)')
@capi('vx_status vxSetConvolutionAttribute(vx_convolution conv, vx_enum attribute, void *ptr, vx_size size)')
@capi('vx_status vxSetMetaFormatAttribute(vx_meta_format meta, vx_enum attribute, void *ptr, vx_size size)')
def c_set_attribute(ref, attribute, ptr, size):
    a = ref._attributes.get(attribute)
    if a is None:
        msg = 'Attribute %s does not exist' % attribute

# 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

    if isinstance(value, VxObject):
        ptr[0] = value.new_handle()
    else:
        ptr[0] = value
    return vx.SUCCESS

@api('SetContextAttribute')
@api('SetImageAttribute')
@api('SetKernelAttribute')
@api('SetGraphAttribute')
@api('SetNodeAttribute')
@api('SetThresholdAttribute')
@api('SetConvolutionAttribute')
@api('SetMetaFormatAttribute')
def set_attribute(ref, attribute, value):
    return ref.set_attribute(attribute, value)


@capi('vx_status vxSetContextAttribute(vx_context context, vx_enum attribute, void *ptr, vx_size size)')
@capi('vx_status vxSetImageAttribute(vx_image image, vx_enum attribute, void *out, vx_size size)')
@capi('vx_status vxSetKernelAttribute(vx_kernel kernel, vx_enum attribute, void *ptr, vx_size size)')
@capi('vx_status vxSetGraphAttribute(vx_graph graph, vx_enum attribute, void *ptr, vx_size size)')
@capi('vx_status vxSetNodeAttribute(vx_node node, vx_enum attribute, void *ptr, vx_size size)')
@capi('vx_status vxSetThresholdAttribute(vx_threshold thresh, vx_enum attribute, void *ptr, vx_size size)')
@capi('vx_status vxSetConvolutionAttribute(vx_convolution conv, vx_enum attribute, void *ptr, vx_size size)')
@capi('vx_status vxSetMetaFormatAttribute(vx_meta_format meta, vx_enum attribute, void *ptr, vx_size size)')
def c_set_attribute(ref, attribute, ptr, size):
    a = ref._attributes.get(attribute)
    if a is None:
        msg = 'Attribute %s does not exist' % attribute

        raise types.InvalidParametersError(msg, ref)