Enums: Gwyddion Library Reference Manual

## Enums Enums — Common enumerations |

## Functions

const GwyEnum * | gwy_merge_type_get_enum ()
const GwyEnum * | gwy_masking_type_get_enum ()
const GwyEnum * | gwy_orientation_get_enum ()
const GwyEnum * | gwy_interpolation_type_get_enum ()
const GwyEnum * | gwy_windowing_type_get_enum ()
const GwyEnum * | gwy_correlation_type_get_enum ()
const GwyEnum * | gwy_direction_flags_get_enum ()
const GwyEnum * | gwy_sign_flags_get_enum ()
gint | gwy_computation_state_get_state ()
gdouble | gwy_computation_state_get_fraction ()

## Types and Values

enum | GwyOrientation
enum | GwyDirectionFlags
enum | GwySignFlags
enum | GwyTransformDirection
enum | GwyMaskingType
enum | GwyComputationStateType
enum | GwyPlaneFitQuantity
enum | GwyWindowingType
enum | GwyCorrSearchType
enum | GwyRotateResizeType
| GwyComputationState

## Object Hierarchy

        gpointer
        ╰── GwyComputationState

## Includes

    #include <libgwyddion/gwyddion.h>

## Description

## Functions

### gwy_merge_type_get_enum()

    const GwyEnum *
    gwy_merge_type_get_enum (void);

Returns GwyEnum for GwyMergeType enum type.

This is the full list of possible merge types, which is usually not that useful to offer to users.

#### Returns

`NULL`-terminated GwyEnum which must not be modified nor freed.

### gwy_masking_type_get_enum()

    const GwyEnum *
    gwy_masking_type_get_enum (void);

Returns GwyEnum for GwyMaskingType enum type.

#### Returns

`NULL`-terminated GwyEnum which must not be modified nor freed.

### gwy_orientation_get_enum()

    const GwyEnum *
    gwy_orientation_get_enum (void);

Returns GwyEnum for GwyOrientation enum type.

#### Returns

`NULL`-terminated GwyEnum which must not be modified nor freed.

### gwy_interpolation_type_get_enum()

    const GwyEnum *
    gwy_interpolation_type_get_enum (void);

Returns GwyEnum for GwyInterpolationType enum type.

#### Returns

`NULL`-terminated GwyEnum which must not be modified nor freed.

### gwy_windowing_type_get_enum()

    const GwyEnum *
    gwy_windowing_type_get_enum (void);

Returns GwyEnum for GwyWindowingType enum type.

#### Returns

`NULL`-terminated GwyEnum which must not be modified nor freed.

### gwy_correlation_type_get_enum()

    const GwyEnum *
    gwy_correlation_type_get_enum (void);

Returns GwyEnum for GwyCorrelationType enum type.

#### Returns

`NULL`-terminated GwyEnum which must not be modified nor freed.

### gwy_direction_flags_get_enum()

    const GwyEnum *
    gwy_direction_flags_get_enum (void);

Returns GwyEnum for GwyDirectionFlags enum type.

#### Returns

`NULL`-terminated GwyEnum which must not be modified nor freed.

### gwy_sign_flags_get_enum()

    const GwyEnum *
    gwy_sign_flags_get_enum (void);

Returns GwyEnum for GwySignFlags enum type.

#### Returns

`NULL`-terminated GwyEnum which must not be modified nor freed.

### gwy_computation_state_get_state()

    gint
    gwy_computation_state_get_state (GwyComputationState *compstate);

Gets the state field of a computation state struct.

Useful mostly for language bindings.

#### Parameters

compstate | Computation state. |

#### Returns

The state field of `compstate` .

### gwy_computation_state_get_fraction()

    gdouble
    gwy_computation_state_get_fraction (GwyComputationState *compstate);

Gets the fraction field of a computation state struct.

#### Parameters

compstate | Computation state. |

#### Returns

The fraction field of `compstate` .

## Types and Values

### enum GwyOrientation

Orientation type.

The enum is identical to GtkOrientation and the values should be interchangeable. It is, however, available in non-GUI context.

See also GwyDirectionFlags for flags, if the directions are not exclusive (and possibly ‘none’ is also an option).

#### Members

GWY_ORIENTATION_HORIZONTAL | Horizontal orientation (row-wise in images). |
GWY_ORIENTATION_VERTICAL | Vertical orientation (column-wise in images). |

### enum GwyDirectionFlags

Orientation flags.

If needed, zero (no flag set) can be used to represent no direction.

See also GwyOrientation for the exclusive variant (the orientation is always exactly one of the two).

#### Members

GWY_DIRECTION_HORIZONTAL | Horizontal direction (row-wise in images). |
GWY_DIRECTION_VERTICAL | Vertical orientation (column-wise in images). |
GWY_DIRECTION_BOTH | Both directions. |

### enum GwySignFlags

Sign flags.

If needed, zero (no flag set) can be used to represent neither sign. Not all signs may be valid for all functions.

#### Members

GWY_SIGN_NEGATIVE | Negative sign (upwards, towards larger values). |
GWY_SIGN_POSITIVE | Positive sign (downwards, towards smaller values). |
GWY_SIGN_BOTH | Both signs. |

### enum GwyTransformDirection

Transform (namely integral transform) direction.

In FFT, it is equal to sign of the exponent, that is the backward transform uses -1, the forward transform +1. This is the opposite sign convention to FFTW (for instance), so care must be taken when mixing operations.

#### Members

GWY_TRANSFORM_DIRECTION_BACKWARD | Backward (inverse) transform. |
GWY_TRANSFORM_DIRECTION_FORWARD | Forward (direct) transform. |

### enum GwyMaskingType

Mask handling in procedures that can apply masking.

Note at present many procedures do not have a masking argument and hence cannot apply masks in exclude mode.

#### Members

GWY_MASK_EXCLUDE | Exclude data under mask, i.e. take into account only data not covered by the mask. |
GWY_MASK_INCLUDE | Take into account only data under the mask. |
GWY_MASK_IGNORE | Ignore mask, if present, and use all data. |

### enum GwyComputationStateType

Common iterative computation iterator state type.

#### Members

GWY_COMPUTATION_STATE_INIT | Iterator was set up, the next step will actually create temporary data structures and precalculate values. |
GWY_COMPUTATION_STATE_ITERATE | Iteration is in progress, the `fraction` field of state struct holds the fraction completed. |
GWY_COMPUTATION_STATE_FINISHED | Calculation has been finished, further calls to the iterator will be no-op. |

### enum GwyPlaneFitQuantity

Local plane fitting quantity to request from `gwy_field_area_fit_local_planes()` and similar functions.

#### Members

GWY_PLANE_FIT_A | Constant coefficient (mean value). |
GWY_PLANE_FIT_BX | Linear coefficient in `x` , where `x` is in pixel coordinates. |
GWY_PLANE_FIT_BY | Linear coefficient in `y` , where `y` is in pixel coordinates. |
GWY_PLANE_FIT_ANGLE | Slope orientation in (x,y) plane (in radians). |
GWY_PLANE_FIT_SLOPE | Absolute slope value (that is sqrt(bx*bx + by*by)). |
GWY_PLANE_FIT_S0 | Residual sum of squares. |
GWY_PLANE_FIT_S0_REDUCED | Slope-reduced residual sum of squares. |

### enum GwyWindowingType

Frequency windowing type.

#### Members

GWY_WINDOWING_NONE | No windowing is applied. |
GWY_WINDOWING_HANN | Hann window. |
GWY_WINDOWING_HAMMING | Hamming window. |
GWY_WINDOWING_BLACKMANN | Blackmann window. |
GWY_WINDOWING_LANCZOS | Lanczos window. |
GWY_WINDOWING_WELCH | Welch window. |
GWY_WINDOWING_RECT | Rectangular window. |
GWY_WINDOWING_NUTTALL | Nuttall window. |
GWY_WINDOWING_FLAT_TOP | Flat-top window. |
GWY_WINDOWING_KAISER25 | Kaiser window with β=2.5. |

### enum GwyCorrSearchType

Type of correlation search output.

#### Members

GWY_CORR_SEARCH_COVARIANCE_RAW | Raw average of data values multiplied by kernel values. |
GWY_CORR_SEARCH_COVARIANCE | Local mean value is subtracted from data before kernel multiplication. |
GWY_CORR_SEARCH_COVARIANCE_SCORE | In addition, result is normalised by dividing by the local variance. |
GWY_CORR_SEARCH_HEIGHT_DIFF_RAW | Raw mean square difference between data and kernel values. |
GWY_CORR_SEARCH_HEIGHT_DIFF | Mean values of data and kernel are adjusted before summing the squared differences. |
GWY_CORR_SEARCH_HEIGHT_DIFF_SCORE | In addition, result is normalised by dividing by the local variance. |
GWY_CORR_SEARCH_PHASE_ONLY_SCORE | Score from phase-only correlation (since 2.63). |

### enum GwyRotateResizeType

Type of rotated data field size determination method.

#### Members

GWY_ROTATE_RESIZE_SAME_SIZE | The result has the same area as the original. |
GWY_ROTATE_RESIZE_EXPAND | The result is sufficiently large so that all original data are present (usually meaning that there will be also lot of exterior). |
GWY_ROTATE_RESIZE_CUT | The result is optimally cut to interior data only. |

### GwyComputationState

    typedef struct {
        guint state;
        gdouble fraction;
    } GwyComputationState;

State of iterative computation.

Iterators usually append their own private state data, therefore it must not be assumed the public fields `state` and `fraction` are the only fields.

A typical iteration, assuming an iterative computation `foo' with the default GwyComputationStateType state could be:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    GwyComputationStateType *state;

    state = gwy_field_foo_init(GwyField *field, ...);
    do {
        gwy_field_foo_iteration(state);
        /* Update progress using state->fraction,
            let Gtk+ main loop run, check for abort, ... */
        if (aborted) {
            gwy_field_foo_finalize(state);
            return FALSE;
        }
    } while (state->state != GWY_COMPUTATION_STATE_FINISHED);
    gwy_field_foo_finalize(state);
    return TRUE;

#### Members

guint `state`; | Current computation state, usually of GwyComputationStateType, but particular iterators can define their own types. |
gdouble `fraction`; | Fraction of computation completed. For staged algorithms, the fraction refers to the current stage only. |