GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-bea8435a9e
raster/window_map.c File Reference

Raster Library - Window mapping functions. More...

#include <stdlib.h>
#include <grass/gis.h>
#include <grass/raster.h>
#include "R.h"
Include dependency graph for raster/window_map.c:

Go to the source code of this file.

Macros

#define alloc_index(n)   (COLUMN_MAPPING *)G_malloc((n) * sizeof(COLUMN_MAPPING))
 

Functions

void Rast__create_window_mapping (int fd)
 Create window mapping. More...
 
int Rast_row_repeat_nomask (int fd, int row)
 Loops rows until mismatch?. More...
 

Detailed Description

Raster Library - Window mapping functions.

(C) 2001-2009 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author
Original author CERL

Definition in file raster/window_map.c.

Macro Definition Documentation

◆ alloc_index

#define alloc_index (   n)    (COLUMN_MAPPING *)G_malloc((n) * sizeof(COLUMN_MAPPING))

Definition at line 20 of file raster/window_map.c.

Function Documentation

◆ Rast__create_window_mapping()

void Rast__create_window_mapping ( int  fd)

Create window mapping.

Creates mapping from cell header into window. The boundaries and resolution of the two spaces do not have to be the same or aligned in any way.

Parameters
fdfile descriptor

Definition at line 31 of file raster/window_map.c.

References alloc_index, fileinfo::C1, fileinfo::C2, fileinfo::cellhd, fileinfo::col_map, Cell_head::cols, Cell_head::east, Cell_head::ew_res, R__::fileinfo, G_debug(), G_free(), Cell_head::north, Cell_head::ns_res, fileinfo::open_mode, OPEN_OLD, Cell_head::proj, PROJECTION_LL, R__::rd_window, Cell_head::west, and x.

◆ Rast_row_repeat_nomask()

int Rast_row_repeat_nomask ( int  fd,
int  row 
)

Loops rows until mismatch?.

This routine works fine if the mask is not set. It may give incorrect results with a mask, since the mask row may have a different repeat value. The issue can be fixed by doing it for the mask as well and using the smaller value.

Parameters
fdfile descriptor
rowstarting row
Returns
number of rows completed

Definition at line 131 of file raster/window_map.c.

References fileinfo::C1, fileinfo::C2, count, R__::fileinfo, R__::rd_window, and Cell_head::rows.