Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

lqr_carver_get_true_energy(3) [debian man page]

LQR_CARVER_GET_ENERGY(3)				     LqR library API reference					  LQR_CARVER_GET_ENERGY(3)

NAME
lqr_carver_get_energy, lqr_carver_get_true_energy, lqr_carver_get_energy_image - get the energy map for a LqrCarver object SYNOPSIS
#include <lqr.h> LqrRetVal lqr_carver_get_energy(LqrCarver* carver, gfloat * buffer, gint orientation); SYNOPSIS
#include <lqr.h> LqrRetVal lqr_carver_get_true_energy(LqrCarver* carver, gfloat * buffer, gint orientation); SYNOPSIS
#include <lqr.h> LqrRetVal lqr_carver_get_energy(LqrCarver* carver, void * buffer, gint orientation, LqrColDepth col_depth, LqrImageType image_type); DESCRIPTION
The function lqr_carver_get_energy writes the energy map of the LqrCarver object pointed to by carver to the given buffer, in a format suitable for plotting: all values are in the range between 0 and 1, and the true values are mapped nonlinearly and stretched on this whole range, so that the differences between the middle values are enhanced with respect to very high or very low values. The orientation parameter must be either 0 to get the energy map used for horizontal scalings, or 1 to get the map for vertical scalings. The buffer must be allocated by the user before calling this function, and its size must be at least width * height, where width and height are the current width and height of the carver. The energy values are ordered by row first, then by column. The outcome will include the effect of the bias added to the carver, if any. This function can be called over non-initialised LqrCarver objects, e.g. to provide previews on the effect of different energy functions, but it can also be invoked at any later time. Note, however, that in this latter case the carver could be flattened if necessary, therefore the function invocation is potentially destructive of the internal visibiliy map. The function lqr_carvet_get_true_energy is identical to the previous one, but the resulting buffer will contain the true energy, not scaled nor shifted. The function lqr_carver_get_energy_image is very similar to the function lqr_carveR_get_energy, but it can be used to fill directly an image buffer of the format specified through the additional parameters col_depth and image_type (see LqrColDepth(3) and LqrImageType(3)). The buffer must be passed as void*, but it must point to a memory area with sufficient allocated space for the chosen image type and colour depth. The image type cannot be LQR_CUSTOM_IMAGE. For any choice of the parameters describing the image, the resulting buffer will hold a greyscale image, ranging from black (lowest energy) to white (highest energy). The opacity (alpha) will be set to 1, if present. All the information will be stored in the black channel in LQR_CMYK_IMAGE and LQR_CMYKA_IMAGE image types. RETURN VALUES
The return values follow the Liquid Rescale library signalling system. The function lqr_carver_get_energy_image will return an error if image_type is LQR_CUSTOM_IMAGE. SEE ALSO
lqr_carver_set_energy_function_builtin(3), lqr_carver_set_energy_function(3), lqr_carver_bias_add(3) COPYRIGHT
Copyright (C) 2007-2009 Carlo Baldassi LqR library 0.4.1 API (3:1:3) 10 Maj 2009 LQR_CARVER_GET_ENERGY(3)

Check Out this Related Man Page

LQR_CARVER_RIGMASK_ADD(3)				     LqR library API reference					 LQR_CARVER_RIGMASK_ADD(3)

NAME
lqr_carver_rigmask_add_xy, lqr_carver_rigmask_add_area, lqr_carver_rigmask_add, lqr_carver_rigmask_add_rgb_area, lqr_carver_rigmask_add_rgb - update an LqrCarver rigidity mask SYNOPSIS
#include <lqr.h> LqrRetVal lqr_carver_rigmask_add_xy(LqrCarver* carver, gdouble rigidity, gint x, gint y); LqrRetVal lqr_carver_rigmask_add_area(LqrCarver* carver, gdouble* buffer, gint width, gint height, gint x_off, gint y_off); LqrRetVal lqr_carver_rigmask_add(LqrCarver* carver, gdouble* buffer); LqrRetVal lqr_carver_rigmask_add_area(LqrCarver* carver, gdouble* buffer, gint channels, gint width, gint height, gint x_off, gint y_off); LqrRetVal lqr_carver_rigmask_add_rgb(LqrCarver* carver, gdouble* buffer, gint channels); FOREWORD
All the functions described in this page are used to add a rigidity mask to LqrCarver objects. Whenever one of these functions is called, a rigidity mask is activated for the whole image; the mask contains coefficients which modulate the value of the rigidity (which is set with lqr_carver_init(3)) in different areas of the image. It is very important to note that using no rigidity masks at all is equivalent to use a rigidity mask over the whole image with all the values set to 1.0, but, when first adding a rigidity mask to a LqrCarver object, all the pixels outside the affected area will have their rigidity set to zero; therefore, the functions lqr_carver_rigmask_add_xy, lqr_carver_rigmask_add_area and lqr_carver_rigmask_add_rgb_area actually affect the whole image, despite their name. All the functions must be called after lqr_carver_init and before lqr_carver_resize. If called multiple times over the same area, new values will replace the old ones. SETTING THE RIGIDITY MASK PIXEL BY PIXEL
The function lqr_carver_rigmask_add_xy sets the rigidity mask value of the x, y pixel of the image loaded into the LqrCarver object pointed to by carver SETTING THE RIGIDITY MASK FROM A BUFFER
The function lqr_carver_rigmask_add_area adds a rigidity mask to an area of the image loaded in 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 are specified through x_off and y_off. The rigidity mask area can exceed the boundary of the image, and the offsets can be negative. The values in the given buffer are scaled by the overall rigidity value set when calling the function lqr_carver_init. The function lqr_carver_rigmask_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. SETTING THE RIGIDITY MASK FROM AN IMAGE
The functions lqr_carver_rigmask_add_rgb_area and lqr_carver_rigmask_add_rgb are very similar to lqr_carver_rigmask_add_area and lqr_carver_rigmask_add, but 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 rigidity value 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_rigmask_add_area. RETURN VALUE
The return values follow the Liquid Rescale library signalling system. SEE ALSO
LqrRetVal(3), lqr_carver_init(3), lqr_carver_bias_add(3) COPYRIGHT
Copyright (C) 2007-2009 Carlo Baldassi LqR library 0.4.1 API (3:1:3) 10 Maj 2009 LQR_CARVER_RIGMASK_ADD(3)
Man Page