plotwal.rawdata: Plot raw pixel index data as image.

Description Usage Arguments Examples

Description

Plot raw pixel index data as image.

Usage

1
plotwal.rawdata(raw_data, width, height, apply_palette = wal::pal_q2())

Arguments

raw_data

integer vector in containing width * height values in range 0..255, and optionally additional mipmap data at the end (which will be ignored). The raw image data. Can be a Q2 WAL data, Q1 miptex data, or anything else.

width

positive integer, the image width.

height

positive integer, the image height.

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.

Examples

1
2
3
4
5
6
7
## Not run: 
# Plot the Q1 shambler skin:
mdl = read.quake.mdl("~/data/q1_pak/progs/shambler.mdl");
plotwal.rawdata(mdl$skins$skin_pic, mdl$header$skin_width,
 mdl$header$skin_height, apply_palette = pal_q1());

## End(Not run)

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