VisionWorks: Warp Affine

I am attempting to use the warp affine function in VisionWorks, except, using negative numbers to rotate generates a black image. Here is the code:

vx_float32 a = -1.0f, b = 0.0f, c = 0.0f, d = 0.0f, e = -1.0f , f = 0.0f;
//! [warp affine]
// x0 = a x + b y + c;
// y0 = d x + e y + f;
vx_float32 mat[3][2] = {
{a, d}, // ‘x’ coefficients
{b, e}, // ‘y’ coefficients
{c, f}, // ‘offsets’
vx_matrix matrix_rot = vxCreateMatrix(context, VX_TYPE_FLOAT32, 2, 3);
vxWriteMatrix(matrix_rot, mat);
vx_status status = vxuWarpAffine(context, src, matrix_rot, VX_INTERPOLATION_TYPE_NEAREST_NEIGHBOR, dst);

In OpenVX, the coordinate system of a width x height image is from (0, 0) to (width-1, height-1). Coordinate (0, 0) is the top left pixel of the image.

With your coefficients, we get:
x0 = -x; y0 = -y;

Knowing that the operation of WarpAffine does: output(x, y) = input(x0, y0)
it means that you get output(x, y) = input(-x, -y)

A negative pixel coordinate is out of the bounds of the images and since you used the default ‘border mode’ (undefined border mode) when calling vxuWarpAffine, you could potentially get any random values in the output image. In VisionWorks, the undefined ‘border mode’ has been mapped to ‘constant with value 0’ for WarpAffine and then any out-of-bound pixel get value 0, what explains why you get a black image. The behavior is then normal.

If you want to flip the image, you would need for instance something like this:
x0 = width - x; y0 = height - y;

then :
vx_float32 a = -1.0f, b = 0.0f, c = width, d = 0.0f, e = -1.0f , f = height;