BRL-CAD
libfb (framebuffer)
Collaboration diagram for libfb (framebuffer):

Modules

 Framebuffer
 

Files

file  fb.h
 
file  asize.c
 
file  tcl.c
 

Data Structures

struct  ColorMap
 
struct  fb_platform_specific
 

Macros

#define PIXEL_NULL   (unsigned char *) 0
 
#define RGBPIXEL_NULL   (unsigned char *) 0
 
#define COLORMAP_NULL   (ColorMap *) 0
 
#define FB_NULL   (fb *) 0
 
#define FB_CK_FB(_p)   BU_CKMAG(_p, FB_MAGIC, "FB")
 
#define COPYRGB(to, from)
 
#define FB_DEBUG_BIO   1 /* Buffered io calls (less r/wpixel) */
 
#define FB_DEBUG_CMAP   2 /* Contents of colormaps */
 
#define FB_DEBUG_RW   4 /* Contents of reads and writes */
 
#define FB_DEBUG_BRW   8 /* Buffered IO rpixel and wpixel */
 

Typedefs

typedef unsigned char RGBpixel[3]
 
typedef struct fb_internal fb
 
typedef struct fb_internal FBIO
 

Functions

fbfb_get ()
 
void fb_put (fb *ifp)
 
char * fb_gettype (fb *ifp)
 
int fb_get_max_width (fb *ifp)
 
int fb_get_max_height (fb *ifp)
 
int fb_getwidth (fb *ifp)
 
int fb_getheight (fb *ifp)
 
int fb_poll (fb *ifp)
 
long fb_poll_rate (fb *ifp)
 
int fb_help (fb *ifp)
 
int fb_free (fb *ifp)
 
int fb_clear (fb *ifp, unsigned char *pp)
 
ssize_t fb_read (fb *ifp, int x, int y, unsigned char *pp, size_t count)
 
ssize_t fb_write (fb *ifp, int x, int y, const unsigned char *pp, size_t count)
 
int fb_rmap (fb *ifp, ColorMap *cmap)
 
int fb_wmap (fb *ifp, const ColorMap *cmap)
 
int fb_view (fb *ifp, int xcenter, int ycenter, int xzoom, int yzoom)
 
int fb_getview (fb *ifp, int *xcenter, int *ycenter, int *xzoom, int *yzoom)
 
int fb_setcursor (fb *ifp, const unsigned char *bits, int xb, int yb, int xo, int yo)
 
int fb_cursor (fb *ifp, int mode, int x, int y)
 
int fb_getcursor (fb *ifp, int *mode, int *x, int *y)
 
int fb_readrect (fb *ifp, int xmin, int ymin, int width, int height, unsigned char *pp)
 
int fb_writerect (fb *ifp, int xmin, int ymin, int width, int height, const unsigned char *pp)
 
int fb_bwreadrect (fb *ifp, int xmin, int ymin, int width, int height, unsigned char *pp)
 
int fb_bwwriterect (fb *ifp, int xmin, int ymin, int width, int height, const unsigned char *pp)
 
fbfb_open (const char *file, int _width, int _height)
 
int fb_close (fb *ifp)
 
int fb_close_existing (fb *ifp)
 
int fb_genhelp (void)
 
int fb_ioinit (fb *ifp)
 
int fb_seek (fb *ifp, int x, int y)
 
int fb_tell (fb *ifp, int *xp, int *yp)
 
int fb_rpixel (fb *ifp, unsigned char *pp)
 
int fb_wpixel (fb *ifp, unsigned char *pp)
 
int fb_flush (fb *ifp)
 
int fb_configure_window (fb *, int, int)
 
int fb_refresh (fb *ifp, int x, int y, int w, int h)
 
void fb_log (const char *fmt,...) _BU_ATTR_PRINTF12
 
int fb_null (fb *ifp)
 
int fb_null_setcursor (fb *ifp, const unsigned char *bits, int xbits, int ybits, int xorig, int yorig)
 
int fb_common_file_size (size_t *widthp, size_t *heightp, const char *filename, int pixel_size)
 
int fb_common_image_size (size_t *widthp, size_t *heightp, size_t npixels)
 
int fb_common_name_size (size_t *widthp, size_t *heightp, const char *name)
 
int fb_write_fp (fb *ifp, FILE *fp, int req_width, int req_height, int crunch, int inverse, struct bu_vls *result)
 
int fb_read_fd (fb *ifp, int fd, int file_width, int file_height, int file_xoff, int file_yoff, int scr_width, int scr_height, int scr_xoff, int scr_yoff, int fileinput, char *file_name, int one_line_only, int multiple_lines, int autosize, int inverse, int clear, int zoom, struct bu_vls *result)
 
void fb_set_interface (fb *ifp, const char *interface_type)
 
void fb_set_name (fb *ifp, const char *name)
 
char * fb_get_name (fb *ifp)
 
void fb_set_magic (fb *ifp, uint32_t magic)
 
long fb_get_pagebuffer_pixel_size (fb *ifp)
 
int fb_is_set_fd (fb *ifp, fd_set *infds)
 
int fb_set_fd (fb *ifp, fd_set *select_list)
 
int fb_clear_fd (fb *ifp, fd_set *select_list)
 
int fb_is_linear_cmap (const ColorMap *cmap)
 
void fb_make_linear_cmap (ColorMap *cmap)
 
struct fb_platform_specificfb_get_platform_specific (uint32_t magic)
 
void fb_put_platform_specific (struct fb_platform_specific *fb_p)
 
fbfb_open_existing (const char *file, int _width, int _height, struct fb_platform_specific *fb_p)
 
int fb_reset (fb *ifp)
 
int fb_viewport (fb *ifp, int left, int top, int right, int bottom)
 
int fb_window (fb *ifp, int xcenter, int ycenter)
 
int fb_zoom (fb *ifp, int xzoom, int yzoom)
 
int fb_scursor (fb *ifp, int mode, int x, int y)
 
void fb_tcl_setup (void)
 
int Fb_Init (Tcl_Interp *interp)
 
const char * fb_version (void)
 

Detailed Description

Macro Definition Documentation

#define PIXEL_NULL   (unsigned char *) 0

Definition at line 89 of file fb.h.

Referenced by fb_close(), fb_ioinit(), fb_read_fd(), and rem_clear().

#define RGBPIXEL_NULL   (unsigned char *) 0

Definition at line 90 of file fb.h.

Referenced by fb_read_fd(), fb_write_fp(), fbo_clear_tcl(), and mem_clear().

#define COLORMAP_NULL   (ColorMap *) 0

Definition at line 91 of file fb.h.

Referenced by fbs_rfbwmap(), mem_wmap(), and rem_wmap().

#define COPYRGB (   to,
  from 
)
Value:
{ (to)[RED]=(from)[RED];\
(to)[GRN]=(from)[GRN];\
(to)[BLU]=(from)[BLU]; }
#define RED
Definition: color.h:39
#define BLU
Definition: color.h:41
#define GRN
Definition: color.h:40

Definition at line 191 of file fb.h.

Referenced by disk_color_clear(), fb_rpixel(), and fb_wpixel().

#define FB_DEBUG_BIO   1 /* Buffered io calls (less r/wpixel) */

Definition at line 196 of file fb.h.

Referenced by fb_ioinit(), fb_seek(), and fb_tell().

#define FB_DEBUG_CMAP   2 /* Contents of colormaps */

Definition at line 197 of file fb.h.

Referenced by deb_wmap().

#define FB_DEBUG_RW   4 /* Contents of reads and writes */

Definition at line 198 of file fb.h.

Referenced by deb_write().

#define FB_DEBUG_BRW   8 /* Buffered IO rpixel and wpixel */

Definition at line 199 of file fb.h.

Typedef Documentation

typedef unsigned char RGBpixel[3]

Format of disk pixels is .pix raw image files. Formerly used as arguments to many of the library routines, but has fallen into disuse due to the difficulties with ANSI function prototypes, and the fact that arrays are not real types in C. The most notable problem is that of passing a pointer to an array of RGBpixel. It looks doubly dimensioned, but isn't.

Definition at line 73 of file fb.h.

typedef struct fb_internal fb

Definition at line 94 of file fb.h.

typedef struct fb_internal FBIO

Definition at line 218 of file fb.h.

Function Documentation

fb* fb_get ( )

Definition at line 83 of file fb_generic.c.

References BU_GET, FB_NULL, and fb_internal::if_name.

void fb_put ( fb ifp)

Definition at line 91 of file fb_generic.c.

References BU_PUT, and FB_NULL.

Referenced by dm_put(), and fb_close_existing().

char* fb_gettype ( fb ifp)

Definition at line 226 of file fb_generic.c.

References fb_internal::if_type.

int fb_get_max_width ( fb ifp)

Definition at line 240 of file fb_generic.c.

References fb_internal::if_max_width.

int fb_get_max_height ( fb ifp)

Definition at line 244 of file fb_generic.c.

References fb_internal::if_max_height.

int fb_getwidth ( fb ifp)
int fb_getheight ( fb ifp)
int fb_poll ( fb ifp)

Definition at line 250 of file fb_generic.c.

References fb_internal::if_poll.

Referenced by fbs_rfbpoll(), mem_poll(), and stk_poll().

long fb_poll_rate ( fb ifp)

Definition at line 255 of file fb_generic.c.

References fb_internal::if_poll_refresh_rate.

int fb_help ( fb ifp)

Definition at line 260 of file fb_generic.c.

References fb_internal::if_help.

Referenced by fbs_rfbhelp(), and stk_help().

int fb_free ( fb ifp)

Definition at line 264 of file fb_generic.c.

References fb_internal::if_free.

Referenced by stk_free().

int fb_clear ( fb ifp,
unsigned char *  pp 
)
ssize_t fb_read ( fb ifp,
int  x,
int  y,
unsigned char *  pp,
size_t  count 
)

Definition at line 272 of file fb_generic.c.

References fb_internal::if_read.

Referenced by fb_sim_bwreadrect(), fb_sim_readrect(), fb_write_fp(), fbs_rfbread(), and stk_read().

ssize_t fb_write ( fb ifp,
int  x,
int  y,
const unsigned char *  pp,
size_t  count 
)
int fb_rmap ( fb ifp,
ColorMap cmap 
)

Definition at line 280 of file fb_generic.c.

References fb_internal::if_rmap.

Referenced by fb_write_fp(), fbs_rfbrmap(), mem_open(), and stk_rmap().

int fb_wmap ( fb ifp,
const ColorMap cmap 
)

Definition at line 284 of file fb_generic.c.

References fb_internal::if_wmap.

Referenced by fbs_rfbwmap(), mem_close(), mem_flush(), mem_wmap(), and stk_wmap().

int fb_view ( fb ifp,
int  xcenter,
int  ycenter,
int  xzoom,
int  yzoom 
)

Definition at line 288 of file fb_generic.c.

References fb_internal::if_view.

Referenced by fb_read_fd(), fb_window(), fb_zoom(), fbs_rfbview(), mem_view(), and stk_view().

int fb_getview ( fb ifp,
int *  xcenter,
int *  ycenter,
int *  xzoom,
int *  yzoom 
)

Definition at line 292 of file fb_generic.c.

References fb_internal::if_getview.

Referenced by fb_window(), fb_zoom(), fbs_rfbgetview(), mem_getview(), and stk_getview().

int fb_setcursor ( fb ifp,
const unsigned char *  bits,
int  xb,
int  yb,
int  xo,
int  yo 
)

Definition at line 296 of file fb_generic.c.

References fb_internal::if_setcursor.

Referenced by fbs_rfbsetcursor(), mem_setcursor(), and stk_setcursor().

int fb_cursor ( fb ifp,
int  mode,
int  x,
int  y 
)

Definition at line 300 of file fb_generic.c.

References fb_internal::if_cursor.

Referenced by fbo_cursor_tcl(), fbs_rfbcursor(), mem_cursor(), and stk_cursor().

int fb_getcursor ( fb ifp,
int *  mode,
int *  x,
int *  y 
)
int fb_readrect ( fb ifp,
int  xmin,
int  ymin,
int  width,
int  height,
unsigned char *  pp 
)

Definition at line 308 of file fb_generic.c.

References fb_internal::if_readrect, and OSL::Strings::width.

Referenced by fbs_rfbreadrect(), mem_open(), and stk_readrect().

int fb_writerect ( fb ifp,
int  xmin,
int  ymin,
int  width,
int  height,
const unsigned char *  pp 
)
int fb_bwreadrect ( fb ifp,
int  xmin,
int  ymin,
int  width,
int  height,
unsigned char *  pp 
)

Definition at line 316 of file fb_generic.c.

References fb_internal::if_bwreadrect, and OSL::Strings::width.

Referenced by fbs_rfbbwreadrect(), and stk_bwreadrect().

int fb_bwwriterect ( fb ifp,
int  xmin,
int  ymin,
int  width,
int  height,
const unsigned char *  pp 
)

Definition at line 320 of file fb_generic.c.

References fb_internal::if_bwwriterect, and OSL::Strings::width.

Referenced by stk_bwwriterect().

fb* fb_open ( const char *  file,
int  _width,
int  _height 
)

Definition at line 384 of file fb_generic.c.

References bu_strlcpy, bu_strncmp(), disk_interface, fb_log(), FB_MAGIC, FB_NULL, fb_internal::if_magic, fb_internal::if_name, fb_internal::if_open, Malloc_Bomb, remote_interface, and strchr().

Referenced by fbo_open_tcl(), mem_open(), and stk_open().

Here is the call graph for this function:

int fb_close ( fb ifp)

Definition at line 478 of file fb_generic.c.

References FB_CK_FB, fb_flush(), fb_log(), fb_internal::if_close, fb_internal::if_name, fb_internal::if_pbase, and PIXEL_NULL.

Referenced by fbo_deleteProc(), mem_close(), and stk_close().

Here is the call graph for this function:

int fb_close_existing ( fb ifp)

Definition at line 498 of file fb_generic.c.

References BRLCAD_ERROR, BRLCAD_OK, FB_CK_FB, fb_flush(), fb_log(), fb_put(), fb_internal::if_close_existing, and fb_internal::if_name.

Referenced by to_close_fbs().

Here is the call graph for this function:

int fb_genhelp ( void  )

Generic Help. Print out the list of available frame buffers.

Definition at line 526 of file fb_generic.c.

References disk_interface, fb_log(), fb_internal::if_name, fb_internal::if_type, and remote_interface.

Here is the call graph for this function:

int fb_ioinit ( fb ifp)

Referenced by fbo_open_tcl().

int fb_seek ( fb ifp,
int  x,
int  y 
)
int fb_tell ( fb ifp,
int *  xp,
int *  yp 
)
int fb_rpixel ( fb ifp,
unsigned char *  pp 
)

Referenced by fbo_pixel_tcl().

int fb_wpixel ( fb ifp,
unsigned char *  pp 
)
int fb_configure_window ( fb ,
int  ,
int   
)

Definition at line 162 of file fb_generic.c.

References fb_internal::if_configure_window.

Referenced by dmo_configure_tcl(), fbo_configure_tcl(), and to_configure().

int fb_refresh ( fb ifp,
int  x,
int  y,
int  w,
int  h 
)

Definition at line 156 of file fb_generic.c.

Referenced by go_refresh_draw(), and to_paint_rect_area().

int fb_null ( fb ifp)

Filler for fb function slots not used by a particular device

Definition at line 359 of file fb_generic.c.

References FB_CK_FB.

int fb_null_setcursor ( fb ifp,
const unsigned char *  bits,
int  xbits,
int  ybits,
int  xorig,
int  yorig 
)

Used by if_*.c routines that don't have programmable cursor patterns.

Definition at line 372 of file fb_generic.c.

References FB_CK_FB.

int fb_common_file_size ( size_t *  widthp,
size_t *  heightp,
const char *  filename,
int  pixel_size 
)

Definition at line 86 of file asize.c.

References fb_common_image_size(), fb_common_name_size(), filename, and strchr().

Referenced by fb_cmd_common_file_size(), and fb_read_fd().

Here is the call graph for this function:

int fb_common_image_size ( size_t *  widthp,
size_t *  heightp,
size_t  npixels 
)

Definition at line 173 of file asize.c.

References fb_common_sizes, sizes::height, and sizes::width.

Referenced by fb_common_file_size().

int fb_common_name_size ( size_t *  widthp,
size_t *  heightp,
const char *  name 
)

Definition at line 137 of file asize.c.

References strchr().

Referenced by fb_common_file_size().

Here is the call graph for this function:

int fb_write_fp ( fb ifp,
FILE *  fp,
int  req_width,
int  req_height,
int  crunch,
int  inverse,
struct bu_vls result 
)

Definition at line 601 of file fb_generic.c.

References BRLCAD_ERROR, BRLCAD_OK, bu_free(), bu_vls_printf(), fb_getheight(), fb_getwidth(), fb_is_linear_cmap(), fb_read(), fb_rmap(), RGBPIXEL_NULL, and scanbytes.

Referenced by ged_fb2pix().

Here is the call graph for this function:

int fb_read_fd ( fb ifp,
int  fd,
int  file_width,
int  file_height,
int  file_xoff,
int  file_yoff,
int  scr_width,
int  scr_height,
int  scr_xoff,
int  scr_yoff,
int  fileinput,
char *  file_name,
int  one_line_only,
int  multiple_lines,
int  autosize,
int  inverse,
int  clear,
int  zoom,
struct bu_vls result 
)

Definition at line 686 of file fb_generic.c.

References BRLCAD_OK, bu_exit(), bu_mread(), fb_clear(), fb_common_file_size(), fb_getheight(), fb_getwidth(), fb_view(), fb_write(), fb_writerect(), PIXEL_NULL, RGBPIXEL_NULL, scanbytes, xout, and yout.

Referenced by ged_pix2fb().

Here is the call graph for this function:

void fb_set_interface ( fb ifp,
const char *  interface_type 
)

Definition at line 97 of file fb_generic.c.

References bu_strncmp(), FB_NULL, and fb_internal::if_name.

Referenced by fb_open_existing().

Here is the call graph for this function:

void fb_set_name ( fb ifp,
const char *  name 
)

Definition at line 171 of file fb_generic.c.

References bu_malloc(), bu_strlcpy, and fb_internal::if_name.

Here is the call graph for this function:

char* fb_get_name ( fb ifp)

Definition at line 179 of file fb_generic.c.

References fb_internal::if_name.

void fb_set_magic ( fb ifp,
uint32_t  magic 
)

Definition at line 220 of file fb_generic.c.

References fb_internal::if_magic, and magic.

Referenced by fb_open_existing().

long fb_get_pagebuffer_pixel_size ( fb ifp)

Definition at line 185 of file fb_generic.c.

References fb_internal::if_ppixels.

int fb_is_set_fd ( fb ifp,
fd_set *  infds 
)

Definition at line 191 of file fb_generic.c.

References fb_internal::if_selfd.

int fb_set_fd ( fb ifp,
fd_set *  select_list 
)

Definition at line 200 of file fb_generic.c.

References fb_internal::if_selfd.

int fb_clear_fd ( fb ifp,
fd_set *  select_list 
)

Definition at line 210 of file fb_generic.c.

References fb_internal::if_selfd.

int fb_is_linear_cmap ( const ColorMap cmap)

Referenced by dsk_wmap().

void fb_make_linear_cmap ( ColorMap cmap)

Referenced by mem_open(), mem_wmap(), and qt_wmap().

struct fb_platform_specific* fb_get_platform_specific ( uint32_t  magic)

Definition at line 113 of file fb_generic.c.

References FB_NULL.

void fb_put_platform_specific ( struct fb_platform_specific fb_p)

Definition at line 129 of file fb_generic.c.

References FB_NULL, fb_platform_specific::magic, and fb_internal::type_magic.

fb* fb_open_existing ( const char *  file,
int  _width,
int  _height,
struct fb_platform_specific fb_p 
)

Definition at line 146 of file fb_generic.c.

References FB_MAGIC, fb_set_interface(), fb_set_magic(), and fb_internal::if_open_existing.

Here is the call graph for this function:

int fb_reset ( fb ifp)

Definition at line 111 of file fb_util.c.

References FB_CK_FB.

int fb_viewport ( fb ifp,
int  left,
int  top,
int  right,
int  bottom 
)

Definition at line 122 of file fb_util.c.

References FB_CK_FB.

int fb_window ( fb ifp,
int  xcenter,
int  ycenter 
)

Definition at line 133 of file fb_util.c.

References FB_CK_FB, fb_getview(), and fb_view().

Referenced by fbs_rfbwindow().

Here is the call graph for this function:

int fb_zoom ( fb ifp,
int  xzoom,
int  yzoom 
)

Definition at line 151 of file fb_util.c.

References FB_CK_FB, fb_getview(), and fb_view().

Referenced by fbs_rfbzoom().

Here is the call graph for this function:

int fb_scursor ( fb ifp,
int  mode,
int  x,
int  y 
)

Definition at line 170 of file fb_util.c.

References FB_CK_FB.

Referenced by fbs_rfbscursor().

void fb_tcl_setup ( void  )
int Fb_Init ( Tcl_Interp *  interp)

Definition at line 113 of file tcl.c.

References BU_CMD_NULL, fb_cmd_common_file_size(), and Fbo_Init().

Referenced by Tclcad_Init().

Here is the call graph for this function:

const char* fb_version ( void  )

report version information about LIBFB

returns the compile-time version of libfb

Definition at line 31 of file vers.c.