- LqrRetVal lqr_carver_resize(LqrCarver* carver, gint new_width, gint new_height);
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.
If the new size (in one direction or in both) is greater than or equal to the original size multiplied by the enlargement step of the carver object (as obtained through lqr_carver_get_enl_step(3)), the rescaling will be performed in multiple steps. At each step, the original size stored internally is reset to the new value; therefore, each step in the process can be bigger then the previous one.
Whenever the resizing dirction changes (this may happen in a single call of the rescaling function or through multiple calls), or if performing a multiple steps enlargement as per the previous paragraph, the visibility map computed during the first direction rescale is dropped to make place for the one for the second (and the original size of the image is reset to the current value). These visibility maps can be saved by using the lqr_carver_set_vmap_dump function, for inspection or future use.
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 passed a negative or null size.
COPYRIGHTCopyright © 2007-2009 Carlo Baldassi