gwyprocessenums

gwyprocessenums — Common enumerations

Functions

Types and Values

Object Hierarchy

    gpointer
    ╰── GwyComputationState

Includes

#include <libprocess/gwyprocess.h>

Description

Functions

gwy_merge_type_get_enum()

const GwyEnum *
gwy_merge_type_get_enum (void);

Returns GwyEnum for GwyMergeType enum type.

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_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 GwyMergeType

Mask merge type (namely used in grain processing).

Members

GWY_MERGE_UNION

Union (logical or) merging.

 

GWY_MERGE_INTERSECTION

Intersection (logical and) merging.

 

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 GwyWatershedStateType

Members

GWY_WATERSHED_STATE_INIT

   

GWY_WATERSHED_STATE_LOCATE

   

GWY_WATERSHED_STATE_MIN

   

GWY_WATERSHED_STATE_WATERSHED

   

GWY_WATERSHED_STATE_MARK

   

GWY_WATERSHED_STATE_FINISHED

   

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.

Members

GWY_SIGN_NEGATIVE

Negative sign (upwards).

 

GWY_SIGN_POSITIVE

Positive sign (downwards).

 

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 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_data_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 (Since 2.7).

 

GWY_WINDOWING_FLAT_TOP

Flat-top window (Since 2.7).

 

GWY_WINDOWING_KAISER25

Kaiser window with β=2.5 (Since 2.7).

 

enum GwyCorrelationType

Members

GWY_CORRELATION_NORMAL

   

GWY_CORRELATION_FFT

   

GWY_CORRELATION_POC

   

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 GwyExteriorType

Methods to handle pixels outside data.

Many methods currently use a fixed metod of handling of exterior pixels, for example area calculation uses extension (border and mirror coincide), convolution uses mirror extension, rotation fills exterior with a fixed value.

Members

GWY_EXTERIOR_UNDEFINED

The values corresponding to or calculated from exterior data values are undefined, they may be left unset or set to bogus values. The caller must handle them itself afterwards, for instance by resizing the result to consist of valid data only.

 

GWY_EXTERIOR_BORDER_EXTEND

Values of exterior pixels are considered to be equal to the values of the nearest interior pixels.

 

GWY_EXTERIOR_MIRROR_EXTEND

The data is considered to be periodically repeated, with odd instances reflected (the total period is thus twice the size of the data).

 

GWY_EXTERIOR_PERIODIC

The data is considered to be periodically repeated.

 

GWY_EXTERIOR_FIXED_VALUE

Values of exterior pixels are considered to be all equal to a user-specified value.

 

GWY_EXTERIOR_LAPLACE

Values of exterior pixels are extended using Laplace interpolation (actually extrapolation) like gwy_data_field_laplace_solve(). Only some functions implement this method. (Since 2.50)

 

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.

 

enum GwyAffineScalingType

Type of lattice vector scaling in affine transform preparation.

Members

GWY_AFFINE_SCALING_AS_GIVEN

Correct lattice vectors lengths are taken as given.

 

GWY_AFFINE_SCALING_PRESERVE_AREA

Correct lattice vectors are scaled to make the transformation area-preserving.

 

GWY_AFFINE_SCALING_PRESERVE_X

Correct lattice vectors are scaled to preserve the scale along x -axis.

 

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_data_field_foo_init(GwyDataField *data_field, ...);
do {
    gwy_data_field_foo_iteration(state);
    /* Update progress using state->fraction,
        let Gtk+ main loop run, check for abort, ... */
    if (aborted) {
        gwy_data_field_foo_finalize(state);
        return FALSE;
    }
} while (state->state != GWY_COMPUTATION_STATE_FINISHED);
gwy_data_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.