Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

lqr_carver_resize(3) [debian man page]

LQR_CARVER_RESIZE(3)					     LqR library API reference					      LQR_CARVER_RESIZE(3)

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 initialised, the resizing operations must be limited to the direction and the sizes included in the loaded map. If the carver was initialised through the function lqr_carver_init, there are no limitations to the final size. 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. 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 passed a negative or null size. SEE ALSO
LqrRetVal(3), lqr_carver_init(3), lqr_carver_flatten(3), lqr_carver_set_enl_step(3), lqr_carver_get_enl_step(3), lqr_carver_cancel(3), lqr_vmap_load(3) COPYRIGHT
Copyright (C) 2007-2009 Carlo Baldassi LqR library 0.4.1 API (3:1:3) 10 Maj 2009 LQR_CARVER_RESIZE(3)

Check Out this Related Man Page

LQR_CARVER_BIAS_ADD(3)					     LqR library API reference					    LQR_CARVER_BIAS_ADD(3)

NAME
lqr_carver_bias_add_xy, lqr_carver_bias_add_area, lqr_carver_bias_add, lqr_carver_bias_add_rgb_area, lqr_carver_bias_add_rgb - update an LqrCarver bias SYNOPSIS
#include <lqr.h> LqrRetVal lqr_carver_bias_add_xy(LqrCarver* carver, gdouble bias, gint x, gint y); LqrRetVal lqr_carver_bias_add_area(LqrCarver* carver, gdouble* buffer, gint bias_factor, gint width, gint height, gint x_off, gint y_off); LqrRetVal lqr_carver_bias_add(LqrCarver* carver, gdouble* buffer, gint bias_factor); LqrRetVal lqr_carver_bias_add_rgb_area(LqrCarver* carver, gdouble* buffer, gint bias_factor, gint channels, gint width, gint height, gint x_off, gint y_off); LqrRetVal lqr_carver_bias_add_rgb(LqrCarver* carver, gdouble* buffer, gint bias_factor, gint channels); FOREWORD
All the functions described in this page are used to add a bias to LqrCarver objects. A positive biased pixel will be more likely to be avoided by seams, and thus be preserved during rescaling, while a negative bias has the opposite effect. All of these functions must be called before lqr_carver_resize(3). If called multiple times, the biases added at each call will sum up. ADDING A BIAS PIXEL BY PIXEL
The function lqr_carver_bias_add_xy adds a bias to the x, y pixel of the image loaded into the LqrCarver object pointed to by carver A typical value for bias_factor would be 1000 (in absolute value). ADDING A BIAS FROM A BUFFER
The function lqr_carver_bias_add_area adds a bias to an area of the image loaded into the LqrCarver object pointed to by carver. The parameter buffer must point to an array of doubles of size width * height, ordered first by rows, then by columns. The offset of the area relative to the image can be specified through x_off and y_off. The bias area can exceed the boundary of the image, and the offsets can be negative. The parameter bias_factor is an overall bias scale. A typical value when the buffer contents are of the order of 1 would be 1000 (in absolute value). The function lqr_carver_bias_add can be used when the area to add is of the same size of the image loaded in the LqrCarver object and the offsets are 0. ADDING A BIAS FROM AN IMAGE
The functions lqr_carver_bias_add_rgb_area and lqr_carver_bias_add_rgb are very similar to lqr_carver_bias_add_area and lqr_carver_bias_add, except that they use 8-bit multi-channel images as inputs. The number of channels in the image is passed via the parameter channels. The last channel is assumed to be the alpha (opacity) channel if channels is equal to 2 or greater than 3 (if this is not the case, use the previous functions). The bias is computed from the average of the colour channels, multiplied by the value of the alpha channel if present. For example, in RGBA images a white, nontransparent pixel is equivalent to a value of 1.0 when using a buffer in lqr_carver_bias_add_area. RETURN VALUES
The return values follow the Liquid Rescale library signalling system. SEE ALSO
LqrRetVal(3), lqr_carver_init(3), lqr_carver_rigmask_add(3) COPYRIGHT
Copyright (C) 2007-2009 Carlo Baldassi LqR library 0.4.1 API (3:1:3) 10 Maj 2009 LQR_CARVER_BIAS_ADD(3)
Man Page