BRL-CAD
if_mem.c File Reference
#include "common.h"
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include "bu/color.h"
#include "bu/log.h"
#include "bu/str.h"
#include "fb_private.h"
#include "fb.h"
Include dependency graph for if_mem.c:

Go to the source code of this file.

Data Structures

struct  mem_info
 
struct  modeflags
 

Macros

#define MI(ptr)   ((struct mem_info *)((ptr)->u1.p))
 
#define MIL(ptr)   ((ptr)->u1.p) /* left hand side version */
 
#define MODE_1MASK   (1<<1)
 
#define MODE_1BUFFERED   (0<<1) /* output flushed only at close */
 
#define MODE_1IMMEDIATE   (1<<1) /* pass-through writes */
 
#define MODE_2MASK   (1<<2)
 
#define MODE_2CLEAR   (0<<2) /* assume fb opens clear */
 
#define MODE_2PREREAD   (1<<2) /* pre-read data from fb */
 

Functions

HIDDEN int mem_open (fb *ifp, const char *file, int width, int height)
 
HIDDEN struct fb_platform_specificmem_get_fbps (uint32_t magic)
 
HIDDEN void mem_put_fbps (struct fb_platform_specific *fbps)
 
HIDDEN int mem_open_existing (fb *ifp, int width, int height, struct fb_platform_specific *fb_p)
 
HIDDEN int mem_close_existing (fb *ifp)
 
HIDDEN int mem_configure_window (fb *ifp, int width, int height)
 
HIDDEN int mem_refresh (fb *ifp, int x, int y, int w, int h)
 
HIDDEN int mem_close (fb *ifp)
 
HIDDEN int mem_clear (fb *ifp, unsigned char *pp)
 
HIDDEN ssize_t mem_read (fb *ifp, int x, int y, unsigned char *pixelp, size_t count)
 
HIDDEN ssize_t mem_write (fb *ifp, int x, int y, const unsigned char *pixelp, size_t count)
 
HIDDEN int mem_rmap (fb *ifp, ColorMap *cmp)
 
HIDDEN int mem_wmap (fb *ifp, const ColorMap *cmp)
 
HIDDEN int mem_view (fb *ifp, int xcenter, int ycenter, int xzoom, int yzoom)
 
HIDDEN int mem_getview (fb *ifp, int *xcenter, int *ycenter, int *xzoom, int *yzoom)
 
HIDDEN int mem_setcursor (fb *ifp, const unsigned char *bits, int xbits, int ybits, int xorig, int yorig)
 
HIDDEN int mem_cursor (fb *ifp, int mode, int x, int y)
 
HIDDEN int mem_getcursor (fb *ifp, int *mode, int *x, int *y)
 
HIDDEN int mem_poll (fb *ifp)
 
HIDDEN int mem_flush (fb *ifp)
 
HIDDEN int mem_help (fb *ifp)
 

Variables

fb memory_interface
 

Detailed Description

A Memory (virtual) Frame Buffer Interface.

Definition in file if_mem.c.

Macro Definition Documentation

#define MI (   ptr)    ((struct mem_info *)((ptr)->u1.p))
#define MIL (   ptr)    ((ptr)->u1.p) /* left hand side version */

Definition at line 53 of file if_mem.c.

Referenced by mem_close(), and mem_open().

#define MODE_1MASK   (1<<1)

Definition at line 55 of file if_mem.c.

Referenced by mem_open().

#define MODE_1BUFFERED   (0<<1) /* output flushed only at close */

Definition at line 56 of file if_mem.c.

#define MODE_1IMMEDIATE   (1<<1) /* pass-through writes */

Definition at line 57 of file if_mem.c.

Referenced by mem_open().

#define MODE_2MASK   (1<<2)

Definition at line 59 of file if_mem.c.

Referenced by mem_open().

#define MODE_2CLEAR   (0<<2) /* assume fb opens clear */

Definition at line 60 of file if_mem.c.

#define MODE_2PREREAD   (1<<2) /* pre-read data from fb */

Definition at line 61 of file if_mem.c.

Referenced by mem_open().

Function Documentation

HIDDEN int mem_open ( fb ifp,
const char *  file,
int  width,
int  height 
)

Definition at line 78 of file if_mem.c.

References OSL::Strings::alpha, bu_strncmp(), FB_CK_FB, fb_log(), fb_make_linear_cmap(), FB_NULL, fb_open(), fb_readrect(), fb_rmap(), fb_internal::if_height, fb_internal::if_selfd, fb_internal::if_width, MI, MIL, MODE_1IMMEDIATE, MODE_1MASK, MODE_2MASK, MODE_2PREREAD, and OSL::Strings::width.

Here is the call graph for this function:

HIDDEN struct fb_platform_specific* mem_get_fbps ( uint32_t  magic)

Definition at line 190 of file if_mem.c.

HIDDEN void mem_put_fbps ( struct fb_platform_specific fbps)

Definition at line 197 of file if_mem.c.

HIDDEN int mem_open_existing ( fb ifp,
int  width,
int  height,
struct fb_platform_specific fb_p 
)

Definition at line 203 of file if_mem.c.

HIDDEN int mem_close_existing ( fb ifp)

Definition at line 209 of file if_mem.c.

HIDDEN int mem_configure_window ( fb ifp,
int  width,
int  height 
)

Definition at line 215 of file if_mem.c.

HIDDEN int mem_refresh ( fb ifp,
int  x,
int  y,
int  w,
int  h 
)

Definition at line 221 of file if_mem.c.

HIDDEN int mem_close ( fb ifp)

Definition at line 227 of file if_mem.c.

References fb_close(), FB_NULL, fb_wmap(), fb_writerect(), fb_internal::if_height, fb_internal::if_width, MI, and MIL.

Here is the call graph for this function:

HIDDEN int mem_clear ( fb ifp,
unsigned char *  pp 
)

Definition at line 251 of file if_mem.c.

References BLU, fb_clear(), GRN, fb_internal::if_height, fb_internal::if_width, memset(), MI, RED, RGBPIXEL_NULL, and OSL::Strings::v.

Here is the call graph for this function:

HIDDEN ssize_t mem_read ( fb ifp,
int  x,
int  y,
unsigned char *  pixelp,
size_t  count 
)

Definition at line 289 of file if_mem.c.

References fb_internal::if_height, fb_internal::if_width, and MI.

HIDDEN ssize_t mem_write ( fb ifp,
int  x,
int  y,
const unsigned char *  pixelp,
size_t  count 
)

Definition at line 308 of file if_mem.c.

References fb_write(), fb_internal::if_height, fb_internal::if_width, and MI.

Here is the call graph for this function:

HIDDEN int mem_rmap ( fb ifp,
ColorMap cmp 
)

Definition at line 332 of file if_mem.c.

References MI.

HIDDEN int mem_wmap ( fb ifp,
const ColorMap cmp 
)

Definition at line 340 of file if_mem.c.

References COLORMAP_NULL, fb_make_linear_cmap(), fb_wmap(), and MI.

Here is the call graph for this function:

HIDDEN int mem_view ( fb ifp,
int  xcenter,
int  ycenter,
int  xzoom,
int  yzoom 
)

Definition at line 358 of file if_mem.c.

References fb_sim_view(), fb_view(), and MI.

Here is the call graph for this function:

HIDDEN int mem_getview ( fb ifp,
int *  xcenter,
int *  ycenter,
int *  xzoom,
int *  yzoom 
)

Definition at line 370 of file if_mem.c.

References fb_getview(), fb_sim_getview(), and MI.

Here is the call graph for this function:

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

Definition at line 382 of file if_mem.c.

References fb_setcursor(), and MI.

Here is the call graph for this function:

HIDDEN int mem_cursor ( fb ifp,
int  mode,
int  x,
int  y 
)

Definition at line 393 of file if_mem.c.

References fb_cursor(), fb_sim_cursor(), and MI.

Here is the call graph for this function:

HIDDEN int mem_getcursor ( fb ifp,
int *  mode,
int *  x,
int *  y 
)

Definition at line 404 of file if_mem.c.

References fb_getcursor(), fb_sim_getcursor(), and MI.

Here is the call graph for this function:

HIDDEN int mem_poll ( fb ifp)

Definition at line 415 of file if_mem.c.

References fb_poll(), and MI.

Here is the call graph for this function:

HIDDEN int mem_flush ( fb ifp)

Definition at line 425 of file if_mem.c.

References fb_flush(), FB_NULL, fb_wmap(), fb_writerect(), fb_internal::if_height, fb_internal::if_width, and MI.

Here is the call graph for this function:

HIDDEN int mem_help ( fb ifp)

Definition at line 450 of file if_mem.c.

References fb_log(), fb_internal::if_height, fb_internal::if_max_height, fb_internal::if_max_width, fb_internal::if_name, fb_internal::if_type, fb_internal::if_width, and memory_interface.

Here is the call graph for this function:

Variable Documentation

fb memory_interface

Definition at line 471 of file if_mem.c.

Referenced by mem_help().