read.wal: Read bitmap file in WAL format.

Description Usage Arguments Value Examples

View source: R/read_wal.R

Description

Read bitmap file in WAL format.

Usage

1
read.wal(filepath, hdr = TRUE, hdr_only = FALSE, apply_palette = wal::pal_q2())

Arguments

filepath

character string, path to the file including extension

hdr

logical, whether to return full list with header

hdr_only

logical, whether to read only the header

apply_palette

optional 256 x 3 integer matrix, the palette. Must contain values in range 0..255. Pass NULL if you do not want to apply any palette. The resulting wal object will not have an 'image' entry then.

Value

integer pixel matrix, each pixel value is in range 0-255 and refers to an index in a palette. The palette is NOT included in the file, so you will need to define one or get it from elsewhere to see the final image.

Examples

1
2
3
4
5
6
## Not run: 
   walf = '~/data/q2_pak0_extracted/textures/e1u2/basic1_7.wal';
   wal = read.wal(walf);
   plot(wal);

## End(Not run)

wal documentation built on Jan. 17, 2021, 5:10 p.m.