Vips.Image.mask_ideal
Description: Reference for Vips.Image.mask_ideal

### Constructor

# Vips Imagemask_ideal

#### Declaration [src]

    int
    vips_mask_ideal (
      VipsImage** out,
      int width,
      int height,
      double frequency_cutoff,
      ...
    )

#### Description [src]

Make an ideal high- or low-pass filter, that is, one with a sharp cutoff positioned at `frequency_cutoff`, where `frequency_cutoff` is in the range 0 - 1.

This operation creates a one-band float image of the specified size. The image has values in the range [0, 1] and is typically used for multiplying against frequency domain images to filter them. Masks are created with the DC component at (0, 0). The DC pixel always has the value 1.0.

Set `nodc` to not set the DC pixel.

Set `optical` to position the DC component in the centre of the image. This makes the mask suitable for multiplying against optical Fourier transforms. See `vips_wrap()`.

Set `reject` to invert the sense of the filter. For example, low-pass becomes low-reject.

Set `uchar` to output an 8-bit unsigned char image rather than a float image. In this case, pixels are in the range [0 - 255].

Optional arguments

- `nodc`: `gboolean`, don’t set the DC pixel
- `reject`: `gboolean`, invert the filter sense
- `optical`: `gboolean`, coordinates in optical space
- `uchar`: `gboolean`, output a uchar image

See also

`vips_mask_ideal()`, `vips_mask_ideal_ring()`, `vips_mask_ideal_band()`, `vips_mask_butterworth()`, `vips_mask_butterworth_ring()`, `vips_mask_butterworth_band()`, `vips_mask_gaussian()`, `vips_mask_gaussian_ring()`, `vips_mask_gaussian_band()`.

This constructor is not directly available to language bindings.

#### Parameters

`out`

  Type: `VipsImage`

  Output image.

  The argument will be set by the function.
  The caller of the function takes ownership of the returned data, and is responsible for freeing it.

`width`

  Type: `int`

  Image size.

`height`

  Type: `int`

  Image size.

`frequency_cutoff`

  Type: `double`

  Threshold at which filter ends.

`...`

  Type: ``

  `NULL`-terminated list of optional named arguments.

#### Return value

Type: `int`

0 on success, -1 on error.