GRASS 8 Programmer's Manual 8.6.0dev(2026)-1878fdfec5
Loading...
Searching...
No Matches
maskfd.c
Go to the documentation of this file.
1/*!
2 * \file lib/raster/maskfd.c
3 *
4 * \brief Raster Library - Mask file descriptor and state.
5 *
6 * SPDX-FileCopyrightText: 2001-2024 GRASS Development Team
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 *
9 * \author Original author CERL
10 * \author Vaclav Petras (documentation)
11 */
12
13#include <grass/gis.h>
14#include <grass/raster.h>
15
16#include "R.h"
17
18/*!
19 * \brief Test for raster mask presence and get file descriptor if present.
20 *
21 * This function tests the mask presence and takes into account the state of
22 * auto-masking in the library, so mask is considered as not present when
23 * masking is suppressed regardless of the presence of the mask raster.
24 *
25 * \return -1 if mask is not present
26 * \return file descriptor if raster mask is present and active
27 */
28int Rast_maskfd(void)
29{
31
32 return R__.auto_mask > 0 ? R__.mask_fd : -1;
33}
int Rast__check_for_auto_masking(void)
Checks for auto masking.
Definition auto_mask.c:32
int Rast_maskfd(void)
Test for raster mask presence and get file descriptor if present.
Definition maskfd.c:28
Definition R.h:82
int auto_mask
Definition R.h:85
int mask_fd
Definition R.h:84