RASOPS(9) | Kernel Developer's Manual | RASOPS(9)

# NAME

`rasops`, `rasops_init`, `rasops_reconfig` —
raster display operations

# SYNOPSIS

`#include <dev/wscons/wsdisplayvar.h>`
`#include <dev/rasops/rasops.h>`

int
`rasops_init`(struct rasops_info *ri, int wantrows, int wantcols);

int
`rasops_reconfig`(struct rasops_info *ri, int wantrows, int wantcols);

`options RASOPS_DEFAULT_WIDTH=80`
`options RASOPS_DEFAULT_HEIGHT=25`

# DESCRIPTION

The `rasops` subsystem is a set of raster operations for wscons(9).

The primary data type for using the raster operations is the rasops_info structure in `<dev/rasops/rasops.h>`.

Valid values for the ri_flg member are:

`RI_FULLCLEAR`
  `eraserows`() hack to clear full screen
`RI_FORCEMONO`
  monochrome output even if we can do color
`RI_BSWAP`
  framebuffer endianness doesn't match CPU
`RI_CURSOR`
  cursor is switched on
`RI_CLEAR`
  clear display on startup
`RI_CENTER`
  center onscreen output
`RI_CURSORCLIP`
  cursor is currently clipped
`RI_CFGDONE`
  `rasops_reconfig`() completed successfully
`RI_NO_AUTO`
  do not generate box drawing characters for ISO fonts. Use this when it is not safe to allocate memory, for example when setting up an early console.
`RI_ENABLE_ALPHA`
  the caller supports anti-aliased fonts in the given colour depth. Without this flag `rasops_init`() will only pick bitmap fonts.
`RI_8BIT_IS_RGB`
  the caller uses an R3G3B2 colour map in 8 bit. `rasops_init`() will generate an appropriate ri_devcmap`[]` but the caller still needs to set up the actual colour map.

# FUNCTIONS

`rasops_init`() initialises a rasops_info descriptor. `rasops_reconfig`() is used to reconfigure it if parameters have changed in some way.

The arguments wantrows and wantcols are the number of rows and columns we'd like. Passing zero for either one of them uses the default — normally 80 by 25 but it can be changed with config options `RASOPS_DEFAULT_WIDTH` and `RASOPS_DEFAULT_HEIGHT`.

In terms of optimization, bitmap fonts of width 8 or 16 work the best for all depths. For depths other than 1 the fonts of width 12 are also optimized.

If calling `rasops_reconfig`() to change the font and ri_wsfcookie is non-negative, you must call `wsfont_unlock`() on it, and reset it to -1 or a new, valid cookie.

# CODE REFERENCES

The rasops subsystem is implemented within the directory sys/dev/rasops. The `rasops` module itself is implemented within the file sys/dev/rasops/rasops.c.

# SEE ALSO

intro(9), wscons(9), wsdisplay(9), wsfont(9)

# HISTORY

The `rasops` subsystem appeared in NetBSD 1.5.

# AUTHORS

The `rasops` subsystem was written by Andrew Doran ⟨ad@NetBSD.org⟩.

August 7, 2019 | NetBSD 9.0