Skip to documentation
DocumentationAll documentsEnglish

BW-FB(1)

NAME

bw-fb - display a black and white bw image on a framebuffer

On this page

SYNOPSIS

bw-fb [-aiczRGB] [-F framebuffer] [-s squarefilesize] [-w file_width] [-n file_height] [-S squarescrsize] [-W scr_width] [-N scr_height] [-x file_xoff] [-y file_yoff] [-X scr_xoff] [-Y scr_yoff] [infile.bw]

DESCRIPTION

bw-fb reads a bw(5) format file (from standard input if an input file is not given) and displays the image on the currently selected framebuffer. The environment variable FB_FILE specifies the current framebuffer; see brlcad(1).

OPTIONS

-F framebuffer

Explicitly specify the framebuffer to use.

-a

Causes the program to attempt to autosize. A table of common image sizes is consulted, and if any match the size of the input file, then the width and height values associated with that size will be used. By default, the bw file (and, automatically, the requested framebuffer size) is assumed to be 512x512 pixels.

-i

Output the image from top to bottom. Customarily, bw files are stored bottom to top, so this inverts the image.

-c

Clear the screen before the image is displayed. The default behavior is to overwrite the current image with the new image without clearing the screen.

-z

Zoom and center on the image being displayed to make it fill the display area.

-R, -G, -B

Select individual color planes (red, green, or blue, respectively) into which the image will be loaded. One or more can be given. By default all three colors are written with the bw pixel value.

-w file_width

Specifies the width of each scanline in the input file, in pixels.

-n file_height

Specifies the height in scanlines of the input file.

-s squarefilesize

Sets both the file width and file height to the given size.

-W scr_width

Specifies the width of the display device.

-N scr_height

Specifies the height of the display device.

-S squarescrsize

Sets both the display width and display height to the given size. If no display dimensions are provided, the display device uses the dimensions of the input file.

-x file_xoff, -y file_yoff

Offset into the file by the given amounts. The coordinate system for these offsets is first quadrant, with the origin at the lower left corner of the image.

-X scr_xoff, -Y scr_yoff

Offset onto the screen by the given amounts. The coordinate system for these offsets is first quadrant, with the origin at the lower left corner of the image.

FORMAT

A bw(5) file contains sequences of pixels. Each pixel is stored as one unsigned char. The first pixel in a bw file is the lower left corner of the image. The pixels proceed from left-to-right across each scanline, with scanlines being written from the bottom to the top of the image.

EXAMPLES

The following examples demonstrate how to display a bw format file on a framebuffer, including displaying a specific size, autosizing, and displaying only a specific color plane.

Example 1. Displaying a 1024x1024 bw file
$ bw-fb -s 1024 image.bw

Displays the 1024x1024 file image.bw on the currently selected framebuffer.

Example 2. Autosizing and zooming an image
$ bw-fb -a -z image.bw

Attempts to automatically determine the image dimensions from the file size of image.bw and displays it, zooming in and centering it to fill the display area.

Example 3. Displaying an image only in the red color plane
$ bw-fb -R image.bw

Displays image.bw in the red color plane of the framebuffer, leaving the green and blue planes unaffected.

SEE ALSO

brlcad(1), fb-bw(1), pix-fb(1), bw(5)

AUTHOR

BRL-CAD Team

This software is Copyright (c) 1989-2026 by the United States Government as represented by U.S. Army Research Laboratory.

BUG REPORTS

Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org