Name

lqr_carver_resize — liquid rescale a LqrCarver object

Synopsis

#include <lqr.h>
LqrRetVal lqr_carver_resize(LqrCarver* carver,
 gint new_width,
 gint new_height);
 

Description

The function lqr_carver_resize performs the liquid rescaling over the LqrCarver object pointed to by carver. If a visibility map was loaded through the function lqr_vmap_load, and the carver was not initialized, the resizing operations must be limited to the direction and the sizes included in the loaded map. If the carver was initialized through the function lqr_carver_init, the only limitation to the operations is that the final size must not exceed twice the original size in any of the two dimensions (the original size is reset by the function lqr_carver_flatten).

The resizing function can be called multiple times, and it will decide automatically whether the computation of the visibility map is necessary or not. In case it isn't, the function returns almost immediately, otherwise operations will proceed following the order given through the function lqr_carver_set_resize_order. Currently, on-the-fly rescaling without computation is only possible for a single direction at a time.

Whenever the resizing dirction change (this may happen in a single call of the rescaling function or through multiple calls), the visibility map computed during the first direction rescale is dropped to make place for the one for the second. These visibility maps can be saved by using the lqr_carver_set_vmap_dump function, for inspection or future use.

Return value

The return value follows the Liquid Rescale library signalling system. It returns an error if trying to exceed the limitations of a loaded visibility map, or if trying to increase the size of the image by more than twice the original size.

See also

LqrRetVal(3), lqr_carver_init(3), lqr_carver_flatten(3), lqr_vmap_load(3)