Name

lqr_carver_set_gradient_function — set the gradient function for an LqrCarver object

Synopsis

#include <lqr.h>
void lqr_carver_set_gradient_function(LqrCarver* carver,
 LqrGradFuncType gf_ind);
 

Description

Function lqr_carver_set_gradient_function is used to set the function of the gradient which will be used by the LqrCarver object pointed to by carver in determining the relevance of a pixel (less relevant pixels being the ones which tend to be crossed by the seams, and thus the ones affected by rescaling). For each pixel, the gradient is computed for each direction as the difference of the values of nighboring pixels, the value being computed as the average over the colour channels multiplied by the alpha channel value (if present).

Possible values of the argument gs_ind are:

LQR_GF_XABS

absolute value of the gradient in the direction of the rescaling

LQR_GF_SUMABS

sum of absolute values of the gradients in both directions

LQR_GF_NORM

gradient norm

LQR_GF_NULL

always returns 0

The default value for newly created LqrCarver objects is LQR_GF_XABS. The value LQR_GF_NULL can be used together with the function lqr_carver_bias_add_area(3) ant the like to override completely the automatic feature detection.

See also

lqr_carver_init(3), lqr_carver_bias_add_area(3), lqr_carver_set_resize_order(3), lqr_carver_set_dump_vmaps(3), lqr_carver_set_side_switch_frequency(3), lqr_carver_set_progress(3)