1 .\" Title: \fBlqr_carver_bias_add\fR
2 .\" Author: Carlo Baldassi
3 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
5 .\" Manual: LqR library API reference
6 .\" Source: LqR library 0.4.0 API (3:0:3)
8 .TH "\FBLQR_CARVER_BIAS_ADD\FR" "3" "4 Maj 2009" "LqR library 0.4.0 API (3:0:3)" "LqR library API reference"
9 .\" disable hyphenation
11 .\" disable justification (adjust text to left margin only)
14 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
23 .BI "LqrRetVal lqr_carver_bias_add_xy(LqrCarver*\ " "carver" ", gdouble\ " "bias" ", gint\ " "x" ", gint\ " "y" ");"
25 .BI "LqrRetVal lqr_carver_bias_add_area(LqrCarver*\ " "carver" ", gdouble*\ " "buffer" ", gint\ " "bias_factor" ", gint\ " "width" ", gint\ " "height" ", gint\ " "x_off" ", gint\ " "y_off" ");"
27 .BI "LqrRetVal lqr_carver_bias_add(LqrCarver*\ " "carver" ", gdouble*\ " "buffer" ", gint\ " "bias_factor" ");"
29 .BI "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" ");"
31 .BI "LqrRetVal lqr_carver_bias_add_rgb(LqrCarver*\ " "carver" ", gdouble*\ " "buffer" ", gint\ " "bias_factor" ", gint\ " "channels" ");"
34 All the functions described in this page are used to add a bias to
36 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\&.
38 All of these functions must be called before
39 \fBlqr_carver_resize\fR(3)\&. If called multiple times, the biases added at each call will sum up\&.
40 .SH "ADDING A BIAS PIXEL BY PIXEL"
43 \fBlqr_carver_bias_add_xy\fR
47 pixel of the image loaded into the
56 (in absolute value)\&.
57 .SH "ADDING A BIAS FROM A BUFFER"
60 \fBlqr_carver_bias_add_area\fR
61 adds a bias to an area of the image loaded into the
68 must point to an array of
71 \fIwidth\fR * \fIheight\fR, ordered first by rows, then by columns\&.
73 The offset of the area relative to the image can be specified through
76 \fIy_off\fR\&. The bias area can exceed the boundary of the image, and the offsets can be negative\&.
80 is an overall bias scale\&. A typical value when the buffer contents are of the order of
84 (in absolute value)\&.
87 \fBlqr_carver_bias_add\fR
88 can be used when the area to add is of the same size of the image loaded in the
90 object and the offsets are
92 .SH "ADDING A BIAS FROM AN IMAGE"
95 \fBlqr_carver_bias_add_rgb_area\fR
97 \fBlqr_carver_bias_add_rgb\fR
99 \fBlqr_carver_bias_add_area\fR
101 \fBlqr_carver_bias_add\fR, except that they use 8\-bit multi\-channel images as inputs\&.
103 The number of channels in the image is passed via the parameter
104 \fIchannels\fR\&. The last channel is assumed to be the alpha (opacity) channel if
110 (if this is not the case, use the previous functions)\&.
112 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
114 when using a buffer in
115 \fBlqr_carver_bias_add_area\fR\&.
118 The return values follow the Liquid Rescale library signalling system\&.
122 \fBLqrRetVal\fR(3), \fBlqr_carver_init\fR(3), \fBlqr_carver_rigmask_add\fR(3)
124 Copyright \(co 2007-2009 Carlo Baldassi