GwyLawn: Gwyddion Library Reference Manual

## GwyLawn GwyLawn — Three-dimensional data representation |

## Functions

gdouble | (*GwyCurveReduceFunction) ()
GwyLawn * | gwy_lawn_new ()
GwyLawn * | gwy_lawn_new_alike ()
GwyLawn * | gwy_lawn_new_part ()
void | gwy_lawn_data_changed ()
void | gwy_lawn_copy_data ()
GwyLawn * | gwy_lawn_copy ()
void | gwy_lawn_assign ()
gint | gwy_lawn_get_xres ()
gint | gwy_lawn_get_yres ()
gdouble | gwy_lawn_get_xreal ()
gdouble | gwy_lawn_get_yreal ()
gdouble | gwy_lawn_get_xoffset ()
gdouble | gwy_lawn_get_yoffset ()
gint | gwy_lawn_get_n_curves ()
void | gwy_lawn_set_xreal ()
void | gwy_lawn_set_yreal ()
void | gwy_lawn_set_xoffset ()
void | gwy_lawn_set_yoffset ()
gdouble | gwy_lawn_get_dx ()
gdouble | gwy_lawn_get_dy ()
GwyUnit * | gwy_lawn_get_unit_xy ()
GwyUnit * | gwy_lawn_get_unit_curve ()
void | gwy_lawn_copy_units ()
void | gwy_lawn_set_curve_label ()
const gchar * | gwy_lawn_get_curve_label ()
gint | gwy_lawn_find_curve_by_label ()
void | gwy_lawn_clear_curve_labels ()
GwyValueFormat * | gwy_lawn_get_value_format_xy ()
GwyValueFormat * | gwy_lawn_get_value_format_curve ()
gint | gwy_lawn_get_curve_length ()
gdouble * | gwy_lawn_get_curve_data ()
const gdouble * | gwy_lawn_get_curve_data_const ()
void | gwy_lawn_set_curve_data ()
const gdouble * | gwy_lawn_get_curves_data_const ()
void | gwy_lawn_set_curves ()
gint | gwy_lawn_get_n_segments ()
const gint * | gwy_lawn_get_segments ()
void | gwy_lawn_set_segments ()
const gchar * | gwy_lawn_get_segment_label ()
void | gwy_lawn_set_segment_label ()
gint | gwy_lawn_find_segment_by_label ()
void | gwy_lawn_clear_segment_labels ()
void | gwy_lawn_curve_set_segments ()
void | gwy_lawn_clear ()
void | gwy_lawn_area_reduce_to_plane ()
void | gwy_lawn_reduce_to_plane ()
void | gwy_lawn_copy_units_to_field ()
GwyField * | gwy_lawn_new_field_alike ()
GwyLawn * | gwy_lawn_new_rotated_90 ()
void | gwy_lawn_flip ()

## Signals

void | data-changed | Run First

## Types and Values

struct | GwyLawn
struct | GwyLawnClass

## Object Hierarchy

        GObject
        ╰── GwyLawn

## Implemented Interfaces

GwyLawn implements GwySerializable.

## Includes

    #include <libgwyddion/gwyddion.h>

## Description

GwyLawn represents 3D data arrays in Gwyddion. It is typically useful for different volume data obtained from SPMs, like in force volume measurements.

## Functions

### GwyCurveReduceFunction()

    gdouble
    (*GwyCurveReduceFunction) (gint ncurves,
                               gint curvelength,
                               const gdouble *curvedata,
                               gpointer userdata);

### gwy_lawn_new()

    GwyLawn *
    gwy_lawn_new (gint xres,
                  gint yres,
                  gdouble xreal,
                  gdouble yreal,
                  gint ncurves,
                  gint nsegments);

Creates a new data lawn.

[constructor]

#### Parameters

xres | X resolution, i.e., the number of samples in x direction |
yres | Y resolution, i.e., the number of samples in y direction |
xreal | Real physical dimension in x direction. |
yreal | Real physical dimension in y direction. |
ncurves | The number of curves at each sample. |
nsegments | The number of curve segments. |

#### Returns

A newly created data lawn.

[transfer full]

### gwy_lawn_new_alike()

    GwyLawn *
    gwy_lawn_new_alike (GwyLawn *model);

Creates a new data lawn similar to an existing one.

The new data lawn will have the same dimensions and the same curves, including names and units. It will not contain any data, however, and thus also no segments.

Use `gwy_lawn_duplicate()` if you want to copy a data lawn including data.

#### Parameters

model | A data lawn to take resolutions, units, and labels from. |

#### Returns

A newly created data lawn.

[transfer full]

### gwy_lawn_new_part()

    GwyLawn *
    gwy_lawn_new_part (GwyLawn *lawn,
                       gint xpos,
                       gint ypos,
                       gint xres,
                       gint yres,
                       gboolean keep_offsets);

Creates a new data lawn as a part of existing one.

Use `gwy_lawn_duplicate()` if you want to copy a whole data lawn.

#### Parameters

lawn | A data lawn to take data from |
xpos | x position where to start from |
ypos | y position where to start from |
xres | x resolution (width) to be extracted |
yres | y resolution (height) to be extracted |
keep_offsets | keep offsets of data during extraction |

#### Returns

A newly created data lawn.

[transfer full]

### gwy_lawn_data_changed()

    void
    gwy_lawn_data_changed (GwyLawn *lawn);

Emits signal "data_changed" on a data lawn.

#### Parameters

lawn | A data lawn. |

### gwy_lawn_copy_data()

    void
    gwy_lawn_copy_data (GwyLawn *lawn,
                        GwyLawn *target);

Copies the contents of an already allocated lawn to a lawn of the same size.

The same size means the same pixel dimensions and the same number of curves. Curve lengths do not need to be identical; curves are reallocated in such case.

Only the data are copied. To make a data lawn completely identical to another, including units and change of dimensions, you can use `gwy_lawn_assign()`.

#### Parameters

lawn | Source lawn. |
target | Destination lawn. |

### gwy_lawn_copy()

    GwyLawn *
    gwy_lawn_copy (GwyLawn *lawn);

Create a new data lawn as a copy of an existing one.

This function is a convenience `gwy_serializable_copy()` wrapper.

#### Parameters

lawn | A data lawn to duplicate. |

#### Returns

A copy of the data lawn.

[transfer full]

### gwy_lawn_assign()

    void
    gwy_lawn_assign (GwyLawn *destination,
                     GwyLawn *source);

Makes one data lawn equal to another.

This function is a convenience `gwy_serializable_assign()` wrapper.

#### Parameters

destination | Target data lawn. |
source | Source data lawn. |

### gwy_lawn_get_xres()

    gint
    gwy_lawn_get_xres (GwyLawn *lawn);

Gets the x resolution of a data lawn.

#### Parameters

lawn | A data lawn. |

#### Returns

Resolution (number of data points).

### gwy_lawn_get_yres()

    gint
    gwy_lawn_get_yres (GwyLawn *lawn);

Gets the y resolution of a data lawn.

#### Parameters

lawn | A data lawn. |

#### Returns

Resolution (number of data points).

### gwy_lawn_get_xreal()

    gdouble
    gwy_lawn_get_xreal (GwyLawn *lawn);

Gets the physical size of a data lawn in the x direction.

#### Parameters

lawn | A data lawn. |

#### Returns

Real size of a data lawn the x direction.

### gwy_lawn_get_yreal()

    gdouble
    gwy_lawn_get_yreal (GwyLawn *lawn);

Gets the physical size of a data lawn in the y direction.

#### Parameters

lawn | A data lawn. |

#### Returns

Real size of a data lawn the y direction.

### gwy_lawn_get_xoffset()

    gdouble
    gwy_lawn_get_xoffset (GwyLawn *lawn);

Gets the offset of data lawn origin in x direction.

#### Parameters

lawn | A data lawn. |

#### Returns

Offset value.

### gwy_lawn_get_yoffset()

    gdouble
    gwy_lawn_get_yoffset (GwyLawn *lawn);

Gets the offset of data lawn origin in y direction.

#### Parameters

lawn | A data lawn. |

#### Returns

Offset value.

### gwy_lawn_get_n_curves()

    gint
    gwy_lawn_get_n_curves (GwyLawn *lawn);

Gets the number of curves at each sample.

#### Parameters

lawn | A data lawn. |

#### Returns

Number of curves.

### gwy_lawn_set_xreal()

    void
    gwy_lawn_set_xreal (GwyLawn *lawn,
                        gdouble xreal);

Sets the real x dimension of a lawn.

#### Parameters

lawn | A data lawn. |
xreal | New real x dimensions value |

### gwy_lawn_set_yreal()

    void
    gwy_lawn_set_yreal (GwyLawn *lawn,
                        gdouble yreal);

Sets the real y dimension of a lawn.

#### Parameters

lawn | A data lawn. |
yreal | New real y dimensions value |

### gwy_lawn_set_xoffset()

    void
    gwy_lawn_set_xoffset (GwyLawn *lawn,
                          gdouble xoffset);

Sets the offset of a data lawn origin in the x direction.

Note offsets don't affect any calculation.

#### Parameters

lawn | A data lawn. |
xoffset | New offset value. |

### gwy_lawn_set_yoffset()

    void
    gwy_lawn_set_yoffset (GwyLawn *lawn,
                          gdouble yoffset);

Sets the offset of a data lawn origin in the y direction.

Note offsets don't affect any calculation.

#### Parameters

lawn | A data lawn. |
yoffset | New offset value. |

### gwy_lawn_get_dx()

    gdouble
    gwy_lawn_get_dx (GwyLawn *lawn);

Gets the horizontal (X) pixel size of a lawn in real units.

The result is the same as gwy_lawn_get_xreal(lawn)/gwy_lawn_get_xres(lawn).

#### Parameters

lawn | A data lawn. |

#### Returns

Horizontal pixel size.

### gwy_lawn_get_dy()

    gdouble
    gwy_lawn_get_dy (GwyLawn *lawn);

Gets the vertical (Y) pixel size of a lawn in real units.

The result is the same as gwy_lawn_get_yreal(lawn)/gwy_lawn_get_yres(lawn).

#### Parameters

lawn | A data lawn. |

#### Returns

Vertical pixel size.

### gwy_lawn_get_unit_xy()

    GwyUnit *
    gwy_lawn_get_unit_xy (GwyLawn *lawn);

Returns x- and y-direction SI unit of a data lawn.

The returned object can be modified to change the lawn lateral units.

#### Parameters

lawn | A data lawn. |

#### Returns

SI unit corresponding to the lateral (X) dimension of the data lawn. Its reference count is not incremented.

[transfer none]

### gwy_lawn_get_unit_curve()

    GwyUnit *
    gwy_lawn_get_unit_curve (GwyLawn *lawn,
                             gint i);

Returns value SI unit of a curve of a data lawn.

The returned object can be modified to change the corresponding lawn curve units.

#### Parameters

lawn | A data lawn. |
i | Index of a curve in `lawn` . |

#### Returns

SI unit corresponding to the "value" of the data lawn. Its reference count is not incremented.

[transfer none]

### gwy_lawn_copy_units()

    void
    gwy_lawn_copy_units (GwyLawn *lawn,
                         GwyLawn *target);

Sets lateral and curve units of a data lawn to match another data lawn.

#### Parameters

lawn | A data lawn. |
target | Target data lawn. |

### gwy_lawn_set_curve_label()

    void
    gwy_lawn_set_curve_label (GwyLawn *lawn,
                              gint i,
                              const gchar *label);

Sets the label of a curve in data lawn.

All curves can be either unlabelled or labelled. When they are unlabelled and you set the first label, all others automatically get a label (‘Unknown’, ‘Curve 1’ or similar).

#### Parameters

lawn | A data lawn. |
i | Index of a curve in `lawn` . |
label | New curve label. |

### gwy_lawn_get_curve_label()

    const gchar *
    gwy_lawn_get_curve_label (GwyLawn *lawn,
                              gint i);

Gets the label of a curve in data lawn.

#### Parameters

lawn | A data lawn. |
i | Index of a curve in `lawn` . |

#### Returns

Curve label, as a string owned by `lawn` . It may be `NULL`.

[nullable]

### gwy_lawn_find_curve_by_label()

    gint
    gwy_lawn_find_curve_by_label (GwyLawn *lawn,
                                  const gchar *label);

Finds the first curve in data lawn matching a label.

It is possible to pass `NULL` as `label` . It can find anything only if all curves are unlabelled, and in such case it will return the first curve index. Hence, it is not particularly useful.

#### Parameters

lawn | A data lawn. |
label | Curve label to find. | [nullable]

#### Returns

The curve index if found, a negative value (-1) if not found.

### gwy_lawn_clear_curve_labels()

    void
    gwy_lawn_clear_curve_labels (GwyLawn *lawn);

Completely removes all data labels in a data lawn.

The data lawn revert to a clean state when `gwy_lawn_get_curve_label()` returns `NULL` for all curves. See `gwy_lawn_set_curve_label()` for a discussion.

#### Parameters

lawn | A data lawn. |

### gwy_lawn_get_value_format_xy()

    GwyValueFormat *
    gwy_lawn_get_value_format_xy (GwyLawn *lawn,
                                  GwyUnitFormatStyle style,
                                  GwyValueFormat *format);

Finds value format good for displaying coordinates of a data lawn.

#### Parameters

lawn | A data lawn. |
style | Unit format style. |
format | A SI value format to modify, or `NULL` to allocate a new one. | [nullable]

#### Returns

The value format. If `format` is `NULL`, a newly allocated format is returned, otherwise (modified) `format` itself is returned.

### gwy_lawn_get_value_format_curve()

    GwyValueFormat *
    gwy_lawn_get_value_format_curve (GwyLawn *lawn,
                                     gint i,
                                     GwyUnitFormatStyle style,
                                     GwyValueFormat *format);

Finds value format good for displaying values of a data lawn.

Note this functions searches for minimum and maximum value in `lawn` , therefore it's relatively slow.

#### Parameters

lawn | A data lawn. |
i | Index of a curve in `lawn` . |
style | Unit format style. |
format | A SI value format to modify, or `NULL` to allocate a new one. | [nullable]

#### Returns

The value format. If `format` is `NULL`, a newly allocated format is returned, otherwise (modified) `format` itself is returned.

### gwy_lawn_get_curve_length()

    gint
    gwy_lawn_get_curve_length (GwyLawn *lawn,
                               gint col,
                               gint row);

Gets the length of the curves at given position in a data lawn.

#### Parameters

lawn | A data lawn. |
col | Position in the lawn (column index). |
row | Position in the lawn (row index). |

#### Returns

The curves length at given index.

### gwy_lawn_get_curve_data()

    gdouble *
    gwy_lawn_get_curve_data (GwyLawn *lawn,
                             gint col,
                             gint row,
                             gint i,
                             gint *curvelength);

Gets the data array of a curve at given position in a data lawn.

The returned buffer is not guaranteed to be valid through whole data lawn life time.

#### Parameters

lawn | A data lawn. |
col | Position in the lawn (column index). |
row | Position in the lawn (row index). |
i | Index of a curve in `lawn` . |
curvelength | Location to store the length of the curve, or `NULL`. | [out]

#### Returns

The `i` -th curve data at given index. When there are no data at the pixel, `NULL` is returned.

[array length=curvelength]

### gwy_lawn_get_curve_data_const()

    const gdouble *
    gwy_lawn_get_curve_data_const (GwyLawn *lawn,
                                   gint col,
                                   gint row,
                                   gint i,
                                   gint *curvelength);

Gets the data array of a curve at given position in a data lawn.

#### Parameters

lawn | A data lawn. |
col | Position in the lawn (column index). |
row | Position in the lawn (row index). |
i | Index of a curve in `lawn` . |
curvelength | To store the length of the curve (optional). | [out]

#### Returns

The `i` -th curve data at given index. The returned data are owned by `lawn` and must not be modified nor freed. When there are no data at the pixel, `NULL` is returned.

[array length=curvelength]

### gwy_lawn_set_curve_data()

    void
    gwy_lawn_set_curve_data (GwyLawn *lawn,
                             gint col,
                             gint row,
                             gint i,
                             const gdouble *curvedata);

Sets the data of a single curve in a data lawn.

The number of points remains the same since all curves at give pixel must have the same number of points. If you want to change the number of points set the data of all curves together using `gwy_lawn_set_curves()`.

#### Parameters

lawn | A data lawn. |
col | Position in the lawn (column index). |
row | Position in the lawn (row index). |
i | Index of a curve in `lawn` . |
curvedata | New data of the `i` -th curve. |

### gwy_lawn_get_curves_data_const()

    const gdouble *
    gwy_lawn_get_curves_data_const (GwyLawn *lawn,
                                    gint col,
                                    gint row,
                                    gint *curvelength);

Gets the data array of all curves at given position in a data lawn.

The array contains concatenated data of all curves.

#### Parameters

lawn | A data lawn. |
col | Position in the lawn (column index). |
row | Position in the lawn (row index). |
curvelength | To store the length of the curves (optional). |

#### Returns

The curves data at given index. When there are no data at the pixel, `NULL` is returned.

### gwy_lawn_set_curves()

    void
    gwy_lawn_set_curves (GwyLawn *lawn,
                         gint col,
                         gint row,
                         gint curvelength,
                         const gdouble *curvesdata,
                         const gint *segments);

Sets data for all curves at given position in a data lawn.

Note that passing `NULL` `segments` can result in segmentation which is not valid for `curvelength` . In such case you need to correct the segmentation afterwards.

#### Parameters

lawn | A data lawn. |
col | Position in the lawn (column index). |
row | Position in the lawn (row index). |
curvelength | Length of each of the curves. |
curvesdata | Curve data array. | [array]
segments | Segmentation for the curve. May be `NULL` to leave the current segmentation unchanged. | [nullable]

### gwy_lawn_get_n_segments()

    gint
    gwy_lawn_get_n_segments (GwyLawn *lawn);

Gets the number of segments marked in curves in a data lawn.

All curves have the same number of segments, even empty curves. Empty curves simply have the corresponding number of trivial zero-length segments.

#### Parameters

lawn | A data lawn. |

#### Returns

The number of segments. Zero is returned if no segments are marked.

### gwy_lawn_get_segments()

    const gint *
    gwy_lawn_get_segments (GwyLawn *lawn,
                           gint col,
                           gint row,
                           gint *nsegments);

Gets the segmentation of a curve in a data lawn.

See `gwy_lawn_set_segments()` for the array format.

The number of segments is filled in `nsegments` for convenience. It cannot differ between individual pixels and is always equal to the return value of `gwy_lawn_get_n_segments()`.

#### Parameters

lawn | A data lawn. |
col | Position in the lawn (column index). |
row | Position in the lawn (row index). |
nsegments | Location where to store the number of segments, or `NULL`. | [out]

#### Returns

The segmentation for the curve, as an array owned by `lawn` which must not be modified nor freed.

[array]

### gwy_lawn_set_segments()

    void
    gwy_lawn_set_segments (GwyLawn *lawn,
                           gint nsegments,
                           const gint *segments);

Sets the segmentation of all curves in a data lawn.

This is the only function which allows changing the number of segments. If the number of segments changes all the labels are reset.

See `gwy_lawn_curve_set_segments()` for the single-curve `segments` array format. When setting the data for an entire `lawn` the array must contain this data for all pixels, concatenated.

#### Parameters

lawn | A data lawn. |
nsegments | New number of segments. |
segments | The new segmentation for entire `lawn` . | [array]

### gwy_lawn_get_segment_label()

    const gchar *
    gwy_lawn_get_segment_label (GwyLawn *lawn,
                                gint segment);

Gets the label of a curve segment in data lawn.

#### Parameters

lawn | A data lawn. |
segment | Index of a curve segment in `lawn` . |

#### Returns

Segment label, as a string owned by `lawn` . It may be `NULL`.

[nullable]

### gwy_lawn_set_segment_label()

    void
    gwy_lawn_set_segment_label (GwyLawn *lawn,
                                gint segment,
                                const gchar *label);

Sets the label of a curve segment in data lawn.

Since all curves in `lawn` are segmented into the same segments the segments share labels. The first segment label corresponds to the first segment in all the curves.

All segments can be either unlabelled or labelled. When they are unlabelled and you set the first label, all others automatically get a label (‘Unknown’, ‘Segment 1’ or similar).

#### Parameters

lawn | A data lawn. |
segment | Index of a curve segment in `lawn` . |
label | New segment label. |

### gwy_lawn_find_segment_by_label()

    gint
    gwy_lawn_find_segment_by_label (GwyLawn *lawn,
                                    const gchar *label);

Finds the first segment in data lawn matching a label.

It is possible to pass `NULL` as `label` . It can find anything only if all segments are unlabelled, and in such case it will return the first segment index. Hence, it is not particularly useful.

#### Parameters

lawn | A data lawn. |
label | Segment label to find. | [nullable]

#### Returns

The segment index if found, a negative value (-1) if not found.

### gwy_lawn_clear_segment_labels()

    void
    gwy_lawn_clear_segment_labels (GwyLawn *lawn);

Completely removes all data labels in a data lawn.

The data lawn revert to a clean state when `gwy_lawn_get_segment_label()` returns `NULL` for all segments. See `gwy_lawn_set_segment_label()` for a discussion.

#### Parameters

lawn | A data lawn. |

### gwy_lawn_curve_set_segments()

    void
    gwy_lawn_curve_set_segments (GwyLawn *lawn,
                                 gint col,
                                 gint row,
                                 const gint *segments);

Sets the segmentation of a curve in data lawn.

All curves have the same number of segments, equal to the value returned by `gwy_lawn_get_n_segments()`.

The array `segments` contains twice as much elements as there are segments. They are organised [`start₀` , `end₀` , `start₁` , `end₁` , etc.]. A segment starts at the postion `start` and has length `end` -`start` . In other words, `start` is inclusive, but `end` is exclusive. If a segment is zero-length even `start` can correspond to non-existent data (the typical case is an empty curve).

#### Parameters

lawn | A data lawn. |
col | Position in the lawn (column index). |
row | Position in the lawn (row index). |
segments | The new segmentation for the curve. | [array]

### gwy_lawn_clear()

    void
    gwy_lawn_clear (GwyLawn *lawn);

Removes curve data in all pixels.

The number of curves, their units and labels are preserved as well as the number and labels of segments. Segmentation data should be considered undefined (currently it is preserved).

#### Parameters

lawn | A data lawn. |

### gwy_lawn_area_reduce_to_plane()

    void
    gwy_lawn_area_reduce_to_plane (GwyLawn *lawn,
                                   GwyField *target,
                                   GwyCurveReduceFunction func,
                                   gpointer user_data,
                                   gint col,
                                   gint row,
                                   gint width,
                                   gint height,
                                   gboolean keep_offsets);

Reduces curves data at each point of a rectangular region to a value, storing the results in a data field.

#### Parameters

lawn | A data lawn. |
target | Datafield to be filled by summed plane. Its dimensions should be (width, height). |
func | Function to reduce the curves data array to a single value. | [scope call]
user_data | Data passed to `func` . |
col | Column where to start (pixel coordinates). |
row | Row where to start (pixel coordinates). |
width | Pixel width of summed plane. |
height | Pixel height of summed plane. |
keep_offsets | Keep the physical offsets in extracted field. |

### gwy_lawn_reduce_to_plane()

    void
    gwy_lawn_reduce_to_plane (GwyLawn *lawn,
                              GwyField *target,
                              GwyCurveReduceFunction func,
                              gpointer user_data);

Sums all z-profiles of a data lawn to a data field.

Reduces curves data at each point of the lawn to a value, storing the results in a data field.

#### Parameters

lawn | A data lawn. |
target | Datafield to be filled by the summary data. It should have the same dimensions as lawn. |
func | Function to reduce the curves data array to a single value. | [scope call]
user_data | Data passed to `func` . |

### gwy_lawn_copy_units_to_field()

    void
    gwy_lawn_copy_units_to_field (GwyLawn *lawn,
                                  gint i,
                                  GwyField *field);

Sets lateral and possibly value units of a data field to match a data lawn.

Lateral units will match `lawn` lateral units.

Value units will match the curve with index `i` . Pass negative `i` to leave the value units unchanged.

#### Parameters

lawn | A data lawn. |
i | Index of a curve in `lawn` . |
field | A data field which should have units set. |

### gwy_lawn_new_field_alike()

    GwyField *
    gwy_lawn_new_field_alike (GwyLawn *lawn,
                              gint i,
                              gboolean nullme);

Creates a new data field matching a data lawn.

The pixel dimensions, physical dimensions, offsets and units will match `lawn` . Value units will match the curve with index `i` . Pass negative `i` to leave the value units unset.

#### Parameters

lawn | A data lawn. |
i | Index of a curve in `lawn` . |
nullme | Whether the data field should be initialized to zeros. If `FALSE`, the data will not be initialized. |

#### Returns

A new data field matching `lawn` .

[transfer full]

### gwy_lawn_new_rotated_90()

    GwyLawn *
    gwy_lawn_new_rotated_90 (GwyLawn *lawn,
                             gboolean clockwise);

Creates a new data lawn by rotating a data lawn by 90 degrees.

#### Parameters

lawn | A data lawn. |
clockwise | `TRUE` to rotate clockwise, `FALSE` to rotate anti-clockwise. |

#### Returns

A newly created data lawn.

[transfer full]

### gwy_lawn_flip()

    void
    gwy_lawn_flip (GwyLawn *lawn,
                   gboolean xflipped,
                   gboolean yflipped);

Flips a data lawn in place.

Since real sizes cannot go backward, flipping an axis results in the corresponding offset being reset (the real dimension stays positive).

#### Parameters

lawn | A data lawn. |
xflipped | `TRUE` to reflect X, i.e. rows within the XY plane. The image will be left–right mirrored. |
yflipped | `TRUE` to reflect Y, i.e. columns within the XY plane. The image will be flipped upside down. |

## Types and Values

### struct GwyLawn

    struct GwyLawn;

The GwyLawn struct contains private data only and should be accessed using the functions below.

### struct GwyLawnClass

    struct GwyLawnClass {
        GObjectClass parent_class;

        void (*data_changed)(GwyLawn *lawn);
    };

## Signal Details

### The `“data-changed”` signal

    void
    user_function (GwyLawn *gwylawn,
                   gpointer user_data)

The ::data-changed signal is never emitted by the object itself. It is intended as a means to notify object users they should update themselves, usually when a computation modifying the data is finished.

#### Parameters

gwylawn | The GwyLawn which received the signal. |
user_data | user data set when the signal handler was connected. |

Flags: Run First