GDAL

Public Member Functions | Public Attributes | List of all members
gdal::viewshed::Window Struct Reference

A window in a raster including pixels in [xStart, xStop) and [yStart, yStop). More...

`#include <viewshed_types.h>`

## Public Member Functions
bool | operator== (const Window &w2) const
| Returns true when one window is equal to the other.
int | xSize () const
| Window size in the X direction.
int | ySize () const
| Window size in the Y direction.
size_t | size () const
| Number of cells.
bool | containsX (int nX) const
| Determine if the X window contains the index.
bool | containsY (int nY) const
| Determine if the Y window contains the index.
bool | contains (int nX, int nY) const
| Determine if the window contains the index.
int | clampX (int nX) const
| Clamp the argument to be in the window in the X dimension.
int | clampY (int nY) const
| Clamp the argument to be in the window in the Y dimension.
void | shiftX (int nShift)
| Shift the X dimension by nShift.

## Public Attributes
int | xStart {}
| X start position.
int | xStop {}
| X end position.
int | yStart {}
| Y start position.
int | yStop {}
| Y end position.

## Detailed Description

A window in a raster including pixels in [xStart, xStop) and [yStart, yStop).

## Member Function Documentation

## ◆ clampX()

int gdal::viewshed::Window::clampX | ( | int | nX | ) | const
| inline

Clamp the argument to be in the window in the X dimension.

Parameters

  nX | Value to clamp.

Returns
  Clamped value.

## ◆ clampY()

int gdal::viewshed::Window::clampY | ( | int | nY | ) | const
| inline

Clamp the argument to be in the window in the Y dimension.

Parameters

  nY | Value to clamp.

Returns
  Clamped value.

## ◆ contains()

bool gdal::viewshed::Window::contains | ( | int | nX,
|  | int | nY
| ) |  | const
| inline

Determine if the window contains the index.

Parameters

  nX | X coordinate of the index to check
  nY | Y coordinate of the index to check

Returns
  True if the index is contained, false otherwise.

## ◆ containsX()

bool gdal::viewshed::Window::containsX | ( | int | nX | ) | const
| inline

Determine if the X window contains the index.

Parameters

  nX | Index to check

Returns
  True if the index is contained, false otherwise.

## ◆ containsY()

bool gdal::viewshed::Window::containsY | ( | int | nY | ) | const
| inline

Determine if the Y window contains the index.

Parameters

  nY | Index to check

Returns
  True if the index is contained, false otherwise.

## ◆ shiftX()

void gdal::viewshed::Window::shiftX | ( | int | nShift | ) |
| inline

Shift the X dimension by nShift.

Parameters

  nShift | Amount to shift

The documentation for this struct was generated from the following file:

- viewshed_types.h