Basic methods
Prev | Chapter 1. Introduction | Next

## Basic methods

Following is a list of the basic public methods associated with the `LqrCarver` objects:

- constructors and destructor

      LqrCarver * lqr_carver_new (guchar *buffer, gint width, gint height, gint channels);
      LqrCarver * lqr_carver_new_ext (void *buffer, gint width, gint height, gint channels, LqrColDepth colour_depth);
      void lqr_carver_destroy (LqrCarver *carver);

- initialization

      LqrRetVal lqr_carver_init (LqrCarver *carver, gint delta_x, gfloat rigidity);

- image manipulations

      LqrRetVal lqr_carver_resize (LqrCarver *carver, gint new_width, gint new_width);
      LqrRetVal lqr_carver_flatten (LqrCarver *carver);

- readout

      gboolean lqr_carver_scan (LqrCarver *carver, gint *x, gint *y, guchar **rgb);
      gboolean lqr_carver_scan_ext (LqrCarver *carver, gint *x, gint *y, void **rgb);
      gboolean lqr_carver_scan_by_row (LqrCarver *carver);
      gboolean lqr_carver_scan_line (LqrCarver *carver, gint *n, guchar **rgb);
      gboolean lqr_carver_scan_line_ext (LqrCarver *carver, gint *n, void **rgb);

- get values

      gint lqr_carver_get_width (LqrCarver *carver);
      gint lqr_carver_get_height (LqrCarver *carver);
      gint lqr_carver_get_channels (LqrCarver *carver);
      LqrColDepth lqr_carver_get_col_depth (LqrCarver *carver);

The fastest way to see how they work is having a look at the code of `examples/liquidrescale-basic.cpp`, which is a very simple and fully commented demostrative program.

The return value of many functions is of type `LqrRetVal`. This is just an enum type which can be used for signal handling, see the Signal handling section.

The other classes are optional: the class `LqrVMap` is used to hold the carving information (and the class `LqrVMapList` is used to retrieve it from the `LqrCarver` ojects); the class `LqrProgress` is used to customize progress report from the resizing engine (by default it is turned off).

A complete list of the library public methods can be found in the reference at the end of this document.

Prev | Up | Next
Overview of the library | Home | Chapter 2. LqR library API user manual