Transforming coordinates

int unpickerTransformToOriginal(SEAM_UNPICKER *picker, int *xptr, int *yptr);

This function is useful when reconstructing the image that would result from the seam removals performed so far. It translates coordinates in the current unpicker to coordinates in the original image. Put another way, it takes the coordinates of a pixel in the seam-carved image, and returns the coordinates of that pixel in the original image. So to reconstruct the seam-carved image, all a program need do is iterate over the width and height of the output, translating each position to the corresponding position in the input, where the colour data will be found for that pixel.

For some applications the actual seams removed (as returned in the buffers passed to unpickerNextSeam) can be ignored, and this function used to determine the result of the seam carving.

picker
Pointer to the unpicker to use.
xptr
Pointer to the x coordinate to transform.
yptr
Pointer to the y coordinate to transform.

Returns nonzero if the transformation was completed successfully. Returns zero if the coordinates were out of range of the unpicker's current size.

Hayden Walles 2015-09-02
SourceForge.net Logo