read.wal: Read bitmap file in WAL format.

View source: R/read_wal.R

read.walR Documentation

Read bitmap file in WAL format.

Description

Read bitmap file in WAL format.

Usage

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

## Not run: 
   walf = '~/data/q2_pak0_extracted/textures/e1u2/basic1_7.wal';
   wal = read.wal(walf);
   plot(wal);

## End(Not run)


dfsp-spirit/wal documentation built on Feb. 5, 2024, 1:59 p.m.