Exemple #1
0
crimp_image*     result;
int px, py, lx, ly, oxa, oya, oxb, oyb;
int pxa, pya, pxb, pyb;
crimp_geometry bb;

/*
 * Compute union area of the two images to process.
 * Note how the images do not have to match in size.
 */

crimp_rect_union (&imageA->geo, &imageB->geo, &bb);

result = crimp_new_fpcomplex_at (bb.x, bb.y, bb.w, bb.h);
oxa = crimp_x (imageA);
oya = crimp_y (imageA);
oxb = crimp_x (imageB);
oyb = crimp_y (imageB);

/*
 * px, py are physical coordinates in the result, starting from 0.
 * The associated logical coordinates in the 2D plane are
 *  lx = px + x(result)
 *  lx = py + y(result)
 * And when we are inside an input its physical coordinates, from the logical are
 *  px' = lx - x(input)
 *  py' = ly - y(input)
 * Important to note, we can compute all these directly as loop variables, as
 * they are all linearly related to each other.
 */

#ifndef BINOP_POST
Exemple #2
0
/* x, y, w, h - Parameters of the output image. Provided by caller */

crimp_image*     result;

int px, py, lx, ly, ox, oy, pxi, pyi;

/*
 * Get the area of the input image to process.
 */

result = crimp_new_grey8_at (x, y, w, h);
ox = crimp_x (image);
oy = crimp_y (image);

/*
 * px, py are physical coordinates in the result, starting from 0. The
 * associated logical coordinates in the 2D plane are
 *
 *  lx = px + x(result)
 *  lx = py + y(result)
 *
 * And when we are inside an input its physical coordinates, from the logical
 * are
 *
 *  px' = lx - x(input)
 *  py' = ly - y(input)
 *
 * Important to note, we can compute all these directly as loop variables, as
 * they are all linearly related to each other.
 */