GRASS 8 Programmer's Manual 8.6.0dev(2026)-4bb960b182
Loading...
Searching...
No Matches
gis/set_window.c
Go to the documentation of this file.
1/*!
2 \file lib/gis/set_window.c
3
4 \brief GIS Library - Set window (map region)
5
6 SPDX-FileCopyrightText: 2001-2009, 2011 GRASS Development Team
7 SPDX-License-Identifier: GPL-2.0-or-later
8
9 \author Original author CERL
10 */
11
12#include <grass/gis.h>
13#include <grass/glocale.h>
14
15#include "G.h"
16
17#include "gis_local_proto.h"
18
19/*!
20 \brief Get the current working window (region)
21
22 The current working window values are returned in the structure
23 \p window.
24
25 Previous calls to G_set_window() affects values returned by this function.
26 Previous calls to G_put_window() affects values returned by this function
27 only if the current working window is not initialized.
28
29 \param[out] window pointer to window structure to be set
30
31 \sa G_set_window(), G_get_window()
32 */
33void G_get_set_window(struct Cell_head *window)
34{
36 *window = G__.window;
37}
38
39/*!
40 \brief Establishes \p window as the current working window (region).
41
42 This function adjusts the \p window before setting the region
43 so you don't have to call G_adjust_Cell_head().
44
45 \note Only the current process is affected.
46
47 \param window window to become operative window
48
49 \sa G_get_set_window(), G_put_window()
50 */
51void G_set_window(struct Cell_head *window)
52{
53 /* adjust window, check for valid window */
54 G_adjust_Cell_head(window, 0, 0);
55
56 /* copy the window to the current window */
57 G__.window = *window;
58 G__.window_set = 1;
59}
void G__init_window(void)
Initialize window (region).
void G_adjust_Cell_head(struct Cell_head *, int, int)
Adjust cell header.
Definition adj_cellhd.c:49
void G_get_set_window(struct Cell_head *window)
Get the current working window (region)
void G_set_window(struct Cell_head *window)
Establishes window as the current working window (region).
2D/3D raster map header (used also for region)
Definition gis.h:443
Definition G.h:11
int window_set
Definition G.h:13
struct Cell_head window
Definition G.h:12