# Path: pyvx/vx.py
# def _get_attribute(func, ref, attribute, c_type, python_type):
# def _set_attribute(func, ref, attribute, value, c_type):
# def _enum2ctype(data_type):
# def _callback(ctype, callback, parent, error):
# def ReleaseContext(context):
# def QueryContext(context, attribute, c_type, python_type=None):
# def SetContextAttribute(context, attribute, value, c_type=None):
# def ReleaseImage(image):
# def QueryImage(image, attribute, c_type, python_type=None):
# def SetImageAttribute(image, attribute, value, c_type=None):
# def CreateUniformImage(context, width, height, color, value, c_type):
# def CreateImageFromHandle(context, color, addrs, ptrs, import_type):
# def AccessImagePatch(image, rect, plane_index, addr, ptr, usage):
# def CommitImagePatch(image, rect, plane_index, addr, ptr):
# def FormatImagePatchAddress1d(ptr, index, addr):
# def FormatImagePatchAddress2d(ptr, x, y, addr):
# def GetValidRegionImage(image):
# def ReleaseKernel(kernel):
# def QueryKernel(kernel, attribute, c_type, python_type=None):
# def SetKernelAttribute(kernel, attribute, value, c_type=None):
# def AddKernel(context, name, enumeration, func_ptr, numParams, input, output, init, deinit):
# def SetMetaFormatAttribute(meta, attribute, value, c_type=None):
# def LoadKernels(context, module):
# def ReleaseGraph(graph):
# def QueryGraph(graph, attribute, c_type, python_type=None):
# def SetGraphAttribute(graph, attribute, value, c_type=None):
# def ReleaseNode(node):
# def QueryNode(node, attribute, c_type, python_type=None):
# def SetNodeAttribute(node, attribute, value, c_type=None):
# def RemoveNode(node):
# def AssignNodeCallback(node, callback):
# def ReleaseParameter(parameter):
# def QueryParameter(parameter, attribute, c_type, python_type=None):
# def CreateScalar(context, data_type, value):
# def ReleaseScalar(scalar):
# def QueryScalar(scalar, attribute, c_type, python_type=None):
# def ReadScalarValue(scalar):
# def WriteScalarValue(scalar, value):
# def reference(reference):
# def from_reference(ref):
# def QueryReference(reference, attribute, c_type, python_type=None):
# def ReleaseDelay(delay):
# def QueryDelay(delay, attribute, c_type, python_type=None):
# def RegisterLogCallback(context, callback, reentrant):
#     def wrapper(context, ref, status, string):
# def ReleaseLUT(lut):
# def QueryLUT(lut, attribute, c_type, python_type=None):
# def AccessLUT(lut, ptr, usage):
# def CommitLUT(lut, ptr):
# def ReleaseDistribution(distribution):
# def QueryDistribution(distribution, attribute, c_type, python_type=None):
# def AccessDistribution(distribution, ptr, usage):
# def CommitDistribution(distribution, ptr):
# def ReleaseThreshold(threshold):
# def QueryThreshold(threshold, attribute, c_type, python_type=None):
# def SetThresholdAttribute(threshold, attribute, value, c_type=None):
# def ReleaseMatrix(matrix):
# def QueryMatrix(matrix, attribute, c_type, python_type=None):
# def ReadMatrix(mat, array):
# def WriteMatrix(mat, array):
# def ReleaseConvolution(convolution):
# def QueryConvolution(convolution, attribute, c_type, python_type=None):
# def SetConvolutionAttribute(convolution, attribute, value, c_type=None):
# def WriteConvolutionCoefficients(conv, array):
# def ReadConvolutionCoefficients(conv, array):
# def ReleasePyramid(pyramid):
# def QueryPyramid(pyramid, attribute, c_type, python_type=None):
# def ReleaseRemap(remap):
# def QueryRemap(remap, attribute, c_type, python_type=None):
# def GetRemapPoint(table, dst_x, dst_y):
# def ReleaseArray(array):
# def QueryArray(array, attribute, c_type, python_type=None):
# def FormatArrayPointer(ptr, index, stride):
# def ArrayItem(type, ptr, index, stride):
# def AddArrayItems(arr, count, ptr, stride):
# def AccessArrayRange(arr, start, end, stride, ptr, usage):
# def CommitArrayRange(arr, start, end, ptr):
# 
# Path: pyvx/vxu.py



from pyvx import vx, vxu

class TestDemo(object):
    def test_sobel(self):
        c = vx.CreateContext()
        img = vx.CreateImage(c, 640, 480, vx.DF_IMAGE_U8)
        dx = vx.CreateImage(c, 640, 480, vx.DF_IMAGE_S16)
        dy = vx.CreateImage(c, 640, 480, vx.DF_IMAGE_S16)
        assert vxu.Sobel3x3(c, img, dx, dy) == vx.SUCCESS
        # FIXME: assert something

# Path: pyvx/vx.py
# def _get_attribute(func, ref, attribute, c_type, python_type):
# def _set_attribute(func, ref, attribute, value, c_type):
# def _enum2ctype(data_type):
# def _callback(ctype, callback, parent, error):
# def ReleaseContext(context):
# def QueryContext(context, attribute, c_type, python_type=None):
# def SetContextAttribute(context, attribute, value, c_type=None):
# def ReleaseImage(image):
# def QueryImage(image, attribute, c_type, python_type=None):
# def SetImageAttribute(image, attribute, value, c_type=None):
# def CreateUniformImage(context, width, height, color, value, c_type):
# def CreateImageFromHandle(context, color, addrs, ptrs, import_type):
# def AccessImagePatch(image, rect, plane_index, addr, ptr, usage):
# def CommitImagePatch(image, rect, plane_index, addr, ptr):
# def FormatImagePatchAddress1d(ptr, index, addr):
# def FormatImagePatchAddress2d(ptr, x, y, addr):
# def GetValidRegionImage(image):
# def ReleaseKernel(kernel):
# def QueryKernel(kernel, attribute, c_type, python_type=None):
# def SetKernelAttribute(kernel, attribute, value, c_type=None):
# def AddKernel(context, name, enumeration, func_ptr, numParams, input, output, init, deinit):
# def SetMetaFormatAttribute(meta, attribute, value, c_type=None):
# def LoadKernels(context, module):
# def ReleaseGraph(graph):
# def QueryGraph(graph, attribute, c_type, python_type=None):
# def SetGraphAttribute(graph, attribute, value, c_type=None):
# def ReleaseNode(node):
# def QueryNode(node, attribute, c_type, python_type=None):
# def SetNodeAttribute(node, attribute, value, c_type=None):
# def RemoveNode(node):
# def AssignNodeCallback(node, callback):
# def ReleaseParameter(parameter):
# def QueryParameter(parameter, attribute, c_type, python_type=None):
# def CreateScalar(context, data_type, value):
# def ReleaseScalar(scalar):
# def QueryScalar(scalar, attribute, c_type, python_type=None):
# def ReadScalarValue(scalar):
# def WriteScalarValue(scalar, value):
# def reference(reference):
# def from_reference(ref):
# def QueryReference(reference, attribute, c_type, python_type=None):
# def ReleaseDelay(delay):
# def QueryDelay(delay, attribute, c_type, python_type=None):
# def RegisterLogCallback(context, callback, reentrant):
#     def wrapper(context, ref, status, string):
# def ReleaseLUT(lut):
# def QueryLUT(lut, attribute, c_type, python_type=None):
# def AccessLUT(lut, ptr, usage):
# def CommitLUT(lut, ptr):
# def ReleaseDistribution(distribution):
# def QueryDistribution(distribution, attribute, c_type, python_type=None):
# def AccessDistribution(distribution, ptr, usage):
# def CommitDistribution(distribution, ptr):
# def ReleaseThreshold(threshold):
# def QueryThreshold(threshold, attribute, c_type, python_type=None):
# def SetThresholdAttribute(threshold, attribute, value, c_type=None):
# def ReleaseMatrix(matrix):
# def QueryMatrix(matrix, attribute, c_type, python_type=None):
# def ReadMatrix(mat, array):
# def WriteMatrix(mat, array):
# def ReleaseConvolution(convolution):
# def QueryConvolution(convolution, attribute, c_type, python_type=None):
# def SetConvolutionAttribute(convolution, attribute, value, c_type=None):
# def WriteConvolutionCoefficients(conv, array):
# def ReadConvolutionCoefficients(conv, array):
# def ReleasePyramid(pyramid):
# def QueryPyramid(pyramid, attribute, c_type, python_type=None):
# def ReleaseRemap(remap):
# def QueryRemap(remap, attribute, c_type, python_type=None):
# def GetRemapPoint(table, dst_x, dst_y):
# def ReleaseArray(array):
# def QueryArray(array, attribute, c_type, python_type=None):
# def FormatArrayPointer(ptr, index, stride):
# def ArrayItem(type, ptr, index, stride):
# def AddArrayItems(arr, count, ptr, stride):
# def AccessArrayRange(arr, start, end, stride, ptr, usage):
# def CommitArrayRange(arr, start, end, ptr):
# 
# Path: pyvx/vxu.py



# Path: test/test_vxu.py
from pyvx import vx, vxu


class TestDemo(object):
    def test_sobel(self):
        c = vx.CreateContext()
        img = vx.CreateImage(c, 640, 480, vx.DF_IMAGE_U8)
        dx = vx.CreateImage(c, 640, 480, vx.DF_IMAGE_S16)
        dy = vx.CreateImage(c, 640, 480, vx.DF_IMAGE_S16)
        assert vxu.Sobel3x3(c, img, dx, dy) == vx.SUCCESS
        # FIXME: assert something

        assert vx.ReleaseContext(c) == vx.SUCCESS