44 #define DM_NULL (struct dm *)NULL
47 #define FONTBACK "-adobe-courier-medium-r-normal--10-100-75-75-m-60-iso8859-1"
53 #define FONT10 "10x20"
54 #define FONT12 "12x24"
56 #if defined(_WIN32) && !defined(__CYGWIN__)
57 # define DM_VALID_FONT_SIZE(_size) (14 <= (_size) && (_size) <= 29)
59 # define DM_VALID_FONT_SIZE(_size) (5 <= (_size) && (_size) <= 12 && (_size) != 11)
60 # define DM_FONT_SIZE_TO_NAME(_size) (((_size) == 5) ? FONT5 : (((_size) == 6) ? FONT6 : (((_size) == 7) ? FONT7 : (((_size) == 8) ? FONT8 : (((_size) == 9) ? FONT9 : (((_size) == 10) ? FONT10 : FONT12))))))
141 DM_EXPORT
extern int dm_draw_prim_labels(
struct dm *dmp,
146 int (*labelsHook)(
struct dm *dmp_arg,
struct rt_wdb *wdbp_arg,
147 const char *name_arg,
mat_t viewmat_arg,
148 int *labelsColor_arg,
void *labelsHookClientdata_arg),
149 void *labelsHookClientdata);
164 DM_EXPORT
extern const char *
dm_version(
void);
168 DM_EXPORT
extern int dm_valid_type(
const char *name,
const char *dpy_string);
199 DM_EXPORT
extern void dm_set_id(
struct dm *dmp,
unsigned long new_id);
202 DM_EXPORT
extern int dm_get_bg(
unsigned char **bg1,
unsigned char **bg2,
struct dm *dmp);
203 DM_EXPORT
extern int dm_set_bg(
struct dm *dmp,
unsigned char r1,
unsigned char g1,
unsigned char b1,
unsigned char r2,
unsigned char g2,
unsigned char b2);
205 DM_EXPORT
extern int dm_set_fg(
struct dm *dmp,
unsigned char r,
unsigned char g,
unsigned char b,
int strict,
fastf_t transparency);
206 DM_EXPORT
extern int dm_reshape(
struct dm *dmp,
int width,
int height);
208 DM_EXPORT
extern int dm_doevent(
struct dm *dmp,
void *clientData,
void *eventPtr);
249 DM_EXPORT
extern int dm_draw(
struct dm *dmp,
struct bv_vlist *(*callback)(
void *),
void **data);
290 fastf_t transparency_threshold,
292 short r,
short g,
short b,
303 DM_EXPORT
extern int dm_write_image(
struct bu_vls *msgs, FILE *fp,
struct dm *dmp);
305 DM_EXPORT
extern void dm_flush(
struct dm *dmp);
306 DM_EXPORT
extern void dm_sync(
struct dm *dmp);
335 #if defined(HAVE_SYS_TYPES_H)
336 # include <sys/types.h>
338 #if defined(HAVE_SYS_TIME_H)
339 # include <sys/time.h>
366 unsigned short cm_red[256];
367 unsigned short cm_green[256];
368 unsigned short cm_blue[256];
372 #define PIXEL_NULL (unsigned char *) 0
373 #define RGBPIXEL_NULL (unsigned char *) 0
374 #define COLORMAP_NULL (ColorMap *) 0
376 #define FB_NULL (struct fb *) 0
381 #define FB_CK_FB(_p) BU_CKMAG(_p, FB_MAGIC, "FB")
386 DM_EXPORT
struct fb *
fb_raw(
const char *type);
387 DM_EXPORT
void fb_put(
struct fb *ifp);
402 DM_EXPORT
extern int fb_help(
struct fb *ifp);
403 DM_EXPORT
extern int fb_free(
struct fb *ifp);
404 DM_EXPORT
extern int fb_clear(
struct fb *ifp,
unsigned char *pp);
405 DM_EXPORT
extern ssize_t
fb_read(
struct fb *ifp,
int x,
int y,
unsigned char *pp,
size_t count);
406 DM_EXPORT
extern ssize_t
fb_write(
struct fb *ifp,
int x,
int y,
const unsigned char *pp,
size_t count);
409 DM_EXPORT
extern int fb_view(
struct fb *ifp,
int xcenter,
int ycenter,
int xzoom,
int yzoom);
410 DM_EXPORT
extern int fb_getview(
struct fb *ifp,
int *xcenter,
int *ycenter,
int *xzoom,
int *yzoom);
411 DM_EXPORT
extern int fb_setcursor(
struct fb *ifp,
const unsigned char *bits,
int xb,
int yb,
int xo,
int yo);
414 DM_EXPORT
extern int fb_readrect(
struct fb *ifp,
int xmin,
int ymin,
int width,
int height,
unsigned char *pp);
415 DM_EXPORT
extern int fb_writerect(
struct fb *ifp,
int xmin,
int ymin,
int width,
int height,
const unsigned char *pp);
416 DM_EXPORT
extern int fb_bwreadrect(
struct fb *ifp,
int xmin,
int ymin,
int width,
int height,
unsigned char *pp);
417 DM_EXPORT
extern int fb_bwwriterect(
struct fb *ifp,
int xmin,
int ymin,
int width,
int height,
const unsigned char *pp);
419 DM_EXPORT
extern struct fb *
fb_open(
const char *file,
int _width,
int _height);
426 DM_EXPORT
extern int fb_rpixel(
struct fb *ifp,
unsigned char *pp);
427 DM_EXPORT
extern int fb_wpixel(
struct fb *ifp,
unsigned char *pp);
431 #if !defined(_WIN32) || defined(__CYGWIN__)
435 DM_EXPORT
extern int fb_null_setcursor(
struct fb *ifp,
const unsigned char *bits,
int xbits,
int ybits,
int xorig,
int yorig);
438 DM_EXPORT
extern int fb_common_file_size(
size_t *widthp,
size_t *heightp,
const char *filename,
int pixel_size);
440 DM_EXPORT
extern int fb_common_name_size(
size_t *widthp,
size_t *heightp,
const char *name);
441 DM_EXPORT
extern int fb_write_fp(
struct fb *ifp, FILE *fp,
int req_width,
int req_height,
int crunch,
int inverse,
struct bu_vls *result);
442 DM_EXPORT
extern int fb_read_fd(
struct 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);
443 DM_EXPORT
extern int fb_read_icv(
struct fb *ifp,
icv_image_t *img,
int file_xoff,
int file_yoff,
int file_maxwidth,
int file_maxheight,
int scr_xoff,
int scr_yoff,
int clear,
int zoom,
int inverse,
int one_line_only,
int multiple_lines,
struct bu_vls *result);
445 DM_EXPORT
extern int fb_read_png(
struct fb *ifp, FILE *fp_in,
int file_xoff,
int file_yoff,
int scr_xoff,
int scr_yoff,
int clear,
int zoom,
int inverse,
int one_line_only,
int multiple_lines,
int verbose,
int header_only,
double def_screen_gamma,
struct bu_vls *result);
453 DM_EXPORT
extern int fb_set_fd(
struct fb *ifp, fd_set *select_list);
469 DM_EXPORT
extern int fb_viewport(
struct fb *ifp,
int left,
int top,
int right,
int bottom);
470 DM_EXPORT
extern int fb_window(
struct fb *ifp,
int xcenter,
int ycenter);
471 DM_EXPORT
extern int fb_zoom(
struct fb *ifp,
int xzoom,
int yzoom);
477 #define COPYRGB(to, from) { (to)[RED]=(from)[RED];\
478 (to)[GRN]=(from)[GRN];\
479 (to)[BLU]=(from)[BLU]; }
482 #define FB_DEBUG_BIO 1
483 #define FB_DEBUG_CMAP 2
484 #define FB_DEBUG_RW 4
485 #define FB_DEBUG_BRW 8
490 DM_EXPORT
extern const char *
fb_version(
void);
495 #ifdef EXPOSE_FB_HEADER
496 # include "../src/libfb/fb_private.h"
499 typedef struct fb_internal
FBIO;
507 #define MSG_FBCLOSE 2
508 #define MSG_FBCLEAR 3
510 #define MSG_FBWRITE 5
511 #define MSG_FBCURSOR 6
512 #define MSG_FBWINDOW 7
514 #define MSG_FBSCURSOR 9
515 #define MSG_FBVIEW 10
516 #define MSG_FBGETVIEW 11
517 #define MSG_FBRMAP 12
518 #define MSG_FBWMAP 13
519 #define MSG_FBHELP 14
520 #define MSG_FBREADRECT 15
521 #define MSG_FBWRITERECT 16
522 #define MSG_FBFLUSH 17
523 #define MSG_FBFREE 18
524 #define MSG_FBGETCURSOR 19
525 #define MSG_FBPOLL 30
526 #define MSG_FBSETCURSOR 31
527 #define MSG_FBBWREADRECT 32
528 #define MSG_FBBWWRITERECT 33
531 #define MSG_RETURN 21
535 #define MSG_NORETURN 100
Header file for the BRL-CAD Numerical Computation Library, LIBBN.
Header file for the BRL-CAD common definitions.
This header holds generic routines and data structures used for TCP based communication between a fra...
#define _BU_ATTR_PRINTF12
void int float float float * scale
void float float int int int int float * size
long fb_poll_rate(struct fb *ifp)
int fb_reset(struct fb *ifp)
int dm_get_width(struct dm *dmp)
int dm_get_transparency(struct dm *dmp)
int dm_set_hook(const struct bu_structparse_map *map, const char *key, void *data, struct dm_hook_data *hook)
int dm_get_stereo(struct dm *dmp)
unsigned char * dm_get_fg(struct dm *dmp)
int dm_event_cmp(struct dm *dmp, dm_event_t type, int event)
int fb_close(struct fb *ifp)
void fb_put(struct fb *ifp)
struct fb * fb_raw(const char *type)
int fb_cursor(struct fb *ifp, int mode, int x, int y)
int dm_get_display_image(struct dm *dmp, unsigned char **image, int flip, int alpha)
int dm_free_dlists(struct dm *dmp, unsigned int list, int range)
void dm_set_fontsize(struct dm *dmp, int size)
unsigned long dm_get_id(struct dm *dmp)
int fb_bwwriterect(struct fb *ifp, int xmin, int ymin, int width, int height, const unsigned char *pp)
int dm_draw_obj(struct dm *dmp, struct bv_scene_obj *s)
int dm_get_linestyle(struct dm *dmp)
int dm_close(struct dm *dmp)
void dm_geometry_request(struct dm *dmp, int width, int height)
int dm_draw_point_2d(struct dm *dmp, fastf_t x, fastf_t y)
struct bu_structparse * dm_get_vparse(struct dm *dmp)
const char * fb_get_name(const struct fb *ifp)
void dm_set_bound(struct dm *dmp, fastf_t val)
struct fb * dm_get_fb(struct dm *dmp)
void dm_draw_rect(struct dm *dmp, struct bv_interactive_rect_state *grsp)
int dm_Normal2Xx(struct dm *dmp, fastf_t f)
int dm_get_zclip(struct dm *dmp)
void dm_set_vp(struct dm *dmp, fastf_t *vp)
void fb_log(const char *fmt,...) _BU_ATTR_PRINTF12
int fb_free(struct fb *ifp)
int dm_hud_begin(struct dm *dmp)
const char * dm_bestXType(const char *dpy_string)
int dm_gen_dlists(struct dm *dmp, size_t range)
void dm_flush(struct dm *dmp)
int fb_wmap(struct fb *ifp, const ColorMap *cmap)
fastf_t dm_Xy2Normal(struct dm *dmp, int y, int use_aspect)
int dm_draw_string_2d(struct dm *dmp, const char *str, fastf_t x, fastf_t y, int size, int use_aspect)
int dm_get_zbuffer(struct dm *dmp)
void dm_draw_hud_axes(struct dm *dmp, fastf_t viewSize, const mat_t rmat, struct bv_axes *bnasp)
struct fb * fb_open(const char *file, int _width, int _height)
int fb_view(struct fb *ifp, int xcenter, int ycenter, int xzoom, int yzoom)
int fb_is_set_fd(struct fb *ifp, fd_set *infds)
struct fb_platform_specific * fb_get_platform_specific(uint32_t magic)
struct bu_vls * dm_get_pathname(struct dm *dmp)
int fb_write_fp(struct fb *ifp, FILE *fp, int req_width, int req_height, int crunch, int inverse, struct bu_vls *result)
int dm_end_dlist(struct dm *dmp)
int dm_share_dlist(struct dm *dmp1, struct dm *dmp2)
int dm_set_bg(struct dm *dmp, unsigned char r1, unsigned char g1, unsigned char b1, unsigned char r2, unsigned char g2, unsigned char b2)
int dm_get_bound_flag(struct dm *dmp)
fastf_t dm_Xx2Normal(struct dm *dmp, int x)
const char * dm_graphics_system(const char *dmtype)
void dm_draw_scale(struct dm *dmp, fastf_t viewSize, const char *unit, int *lineColor, int *textColor)
void fb_set_standalone(struct fb *ifp, int val)
void dm_set_height(struct dm *dmp, int height)
int fb_window(struct fb *ifp, int xcenter, int ycenter)
void fb_make_linear_cmap(ColorMap *cmap)
int fb_null(struct fb *ifp)
void fb_put_platform_specific(struct fb_platform_specific *fb_p)
int dm_Normal2Xy(struct dm *dmp, fastf_t f, int use_aspect)
void dm_draw_adc(struct dm *dmp, struct bv_adc_state *adcp, mat_t view2model, mat_t model2view)
int dm_draw_vlist_hidden_line(struct dm *dmp, struct bv_vlist *vp)
void fb_setup_existing(struct fb *fbp, int _width, int _height, struct fb_platform_specific *fb_p)
int fb_setcursor(struct fb *ifp, const unsigned char *bits, int xb, int yb, int xo, int yo)
int dm_logfile(struct dm *dmp, const char *filename)
int dm_get_dirty(struct dm *dmp)
int dm_draw_line_2d(struct dm *dmp, fastf_t x1, fastf_t y1_2d, fastf_t x2, fastf_t y2)
int dm_draw_line_3d(struct dm *dmp, point_t pt1, point_t pt2)
int fb_writerect(struct fb *ifp, int xmin, int ymin, int width, int height, const unsigned char *pp)
int fb_clear(struct fb *ifp, unsigned char *pp)
int dm_set_fg(struct dm *dmp, unsigned char r, unsigned char g, unsigned char b, int strict, fastf_t transparency)
int fb_common_image_size(size_t *widthp, size_t *heightp, size_t npixels)
int fb_read_fd(struct 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)
fastf_t dm_wrap(fastf_t f)
int dm_set_zbuffer(struct dm *dmp, int zbuffer)
int fb_clear_fd(struct fb *ifp, fd_set *select_list)
ssize_t fb_read(struct fb *ifp, int x, int y, unsigned char *pp, size_t count)
int fb_viewport(struct fb *ifp, int left, int top, int right, int bottom)
const char * dm_get_dm_lname(struct dm *dmp)
int dm_doevent(struct dm *dmp, void *clientData, void *eventPtr)
int dm_draw_lines_3d(struct dm *dmp, int npoints, point_t *points, int sflag)
long fb_get_pagebuffer_pixel_size(struct fb *ifp)
int dm_set_transparency(struct dm *dmp, int transparency)
void dm_set_linewidth(struct dm *dmp, int linewidth)
void * dm_get_udata(struct dm *dmp)
void * dm_interp(struct dm *dmp)
unsigned char RGBpixel[3]
int dm_graphical(const struct dm *dmp)
int dm_begin_dlist(struct dm *dmp, unsigned int list)
void * dm_get_ctx(struct dm *dmp)
void dm_set_linestyle(struct dm *dmp, int linestyle)
int fb_configure_window(struct fb *, int, int)
int dm_set_depth_mask(struct dm *dmp, int d_on)
const char * fb_gettype(struct fb *ifp)
int dm_draw_begin(struct dm *dmp)
icv_image_t * fb_write_icv(struct fb *ifp, int scr_xoff, int scr_yoff, int width, int height)
int dm_get_light(struct dm *dmp)
int dm_set_line_attr(struct dm *dmp, int width, int style)
int fb_seek(struct fb *ifp, int x, int y)
int fb_close_existing(struct fb *ifp)
const char * dm_get_name(const struct dm *dmp)
vect_t * dm_get_clipmax(struct dm *dmp)
int fb_tell(struct fb *ifp, int *xp, int *yp)
int fb_getview(struct fb *ifp, int *xcenter, int *ycenter, int *xzoom, int *yzoom)
int dm_draw_vlist(struct dm *dmp, struct bv_vlist *vp)
void dm_draw_data_axes(struct dm *dmp, fastf_t viewSize, struct bv_data_axes_state *bndasp)
void fb_set_magic(struct fb *ifp, uint32_t magic)
void dm_list_types(struct bu_vls *list, const char *separator)
int dm_loadpmatrix(struct dm *dmp, const fastf_t *mat)
int dm_get_fontsize(struct dm *dmp)
void dm_draw_grid(struct dm *dmp, struct bv_grid_state *ggsp, fastf_t scale, mat_t model2view, fastf_t base2local)
int dm_make_current(struct dm *dmp)
int fb_help(struct fb *ifp)
int dm_get_linewidth(struct dm *dmp)
int dm_set_fb_visible(struct dm *dmp, int is_fb_visible)
int dm_hud_end(struct dm *dmp)
void dm_internal_var(struct bu_vls *result, struct dm *dmp, const char *key)
int dm_draw_point_3d(struct dm *dmp, point_t pt)
void dm_sync(struct dm *dmp)
int fb_get_max_width(struct fb *ifp)
fastf_t dm_get_aspect(struct dm *dmp)
int dm_get_perspective(struct dm *dmp)
int fb_read_png(struct fb *ifp, FILE *fp_in, int file_xoff, int file_yoff, int scr_xoff, int scr_yoff, int clear, int zoom, int inverse, int one_line_only, int multiple_lines, int verbose, int header_only, double def_screen_gamma, struct bu_vls *result)
const char * dm_default_type(void)
void dm_set_perspective(struct dm *dmp, fastf_t perspective)
struct fb * fb_open_existing(const char *file, int _width, int _height, struct fb_platform_specific *fb_p)
int dm_processOptions(struct dm *dmp, struct bu_vls *init_proc_vls, int argc, const char **argv)
int fb_refresh(struct fb *ifp, int x, int y, int w, int h)
int dm_draw_end(struct dm *dmp)
int fb_scursor(struct fb *ifp, int mode, int x, int y)
struct dm * dm_open(void *ctx, void *interp, const char *type, int argc, const char *argv[])
void dm_set_width(struct dm *dmp, int width)
int fb_set_interface(struct fb *ifp, const char *interface_type)
int dm_draw_dlist(struct dm *dmp, unsigned int list)
int dm_have_graphics(void)
int fb_ioinit(struct fb *ifp)
int fb_getheight(struct fb *ifp)
const char * dm_get_dm_name(const struct dm *dmp)
void dm_set_udata(struct dm *dmp, void *udata)
int fb_getcursor(struct fb *ifp, int *mode, int *x, int *y)
int vclip(point_t, point_t, fastf_t *, fastf_t *)
int fb_get_standalone(struct fb *ifp)
int fb_read_icv(struct fb *ifp, icv_image_t *img, int file_xoff, int file_yoff, int file_maxwidth, int file_maxheight, int scr_xoff, int scr_yoff, int clear, int zoom, int inverse, int one_line_only, int multiple_lines, struct bu_vls *result)
int fb_rpixel(struct fb *ifp, unsigned char *pp)
void * dm_get_mvars(struct dm *dmp)
int dm_draw_display_list(struct dm *dmp, struct display_list *obj)
void dm_fogHint(struct dm *dmp, int fastfog)
void dm_set_zclip(struct dm *dmp, int zclip)
const char * dm_get_type(struct dm *dmp)
int dm_get_debug(struct dm *dmp)
int clip(fastf_t *, fastf_t *, fastf_t *, fastf_t *)
int fb_poll(struct fb *ifp)
int fb_null_setcursor(struct 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 dm_set_debug(struct dm *dmp, int lvl)
int fb_common_name_size(size_t *widthp, size_t *heightp, const char *name)
int fb_flush(struct fb *ifp)
int fb_set_fd(struct fb *ifp, fd_set *select_list)
int fb_readrect(struct fb *ifp, int xmin, int ymin, int width, int height, unsigned char *pp)
int dm_get_bg(unsigned char **bg1, unsigned char **bg2, struct dm *dmp)
void dm_pop_pmatrix(struct dm *dmp)
int dm_set_light(struct dm *dmp, int light)
struct dm * fb_get_dm(struct fb *ifp)
void dm_set_id(struct dm *dmp, unsigned long new_id)
const char * fb_version(void)
int dm_reshape(struct dm *dmp, int width, int height)
struct bu_vls * dm_get_tkname(struct dm *dmp)
int dm_draw(struct dm *dmp, struct bv_vlist *(*callback)(void *), void **data)
int dm_draw_points_3d(struct dm *dmp, int npoints, point_t *points)
vect_t * dm_get_clipmin(struct dm *dmp)
int dm_set_win_bounds(struct dm *dmp, fastf_t *w)
const char * dm_init_msgs(void)
int dm_get_height(struct dm *dmp)
void dm_set_bound_flag(struct dm *dmp, int bound)
void dm_draw_scene_axes(struct dm *dmp, struct bv_scene_obj *s)
const char * dm_version(void)
int fb_rmap(struct fb *ifp, ColorMap *cmap)
int dm_configure_win(struct dm *dmp, int force)
int dm_get_fb_visible(struct dm *dmp)
void dm_set_dirty(struct dm *dmp, int i)
int fb_get_max_height(struct fb *ifp)
int fb_is_linear_cmap(const ColorMap *cmap)
int dm_loadmatrix(struct dm *dmp, fastf_t *mat, int eye)
int dm_string_bbox_2d(struct dm *dmp, vect2d_t *bmin, vect2d_t *bmax, const char *str, fastf_t x, fastf_t y, int size, int use_aspect)
int dm_get_displaylist(struct dm *dmp)
struct bu_vls * dm_get_dname(struct dm *dmp)
int fb_wpixel(struct fb *ifp, unsigned char *pp)
int fb_zoom(struct fb *ifp, int xzoom, int yzoom)
ssize_t fb_write(struct fb *ifp, int x, int y, const unsigned char *pp, size_t count)
int dm_draw_head_dl(struct dm *dmp, struct bu_list *dl, fastf_t transparency_threshold, fastf_t inv_viewsize, short r, short g, short b, int line_width, int draw_style, int draw_edit, unsigned char *gdc, int solids_down, int mv_dlist)
void dm_set_pathname(struct dm *dmp, const char *pname)
const char * dm_get_graphics_system(const struct dm *dmp)
int fb_bwreadrect(struct fb *ifp, int xmin, int ymin, int width, int height, unsigned char *pp)
int dm_valid_type(const char *name, const char *dpy_string)
fastf_t dm_get_bound(struct dm *dmp)
int fb_getwidth(struct fb *ifp)
fastf_t vect_t[ELEMENTS_PER_VECT]
3-tuple vector
double fastf_t
fastest 64-bit (or larger) floating point type
fastf_t mat_t[ELEMENTS_PER_MAT]
4x4 matrix
fastf_t point_t[ELEMENTS_PER_POINT]
3-tuple point
fastf_t vect2d_t[ELEMENTS_PER_VECT2D]
2-tuple vector
Global registry of recognized magic numbers.
void(* dm_hook)(const struct bu_structparse *, const char *, void *, const char *, void *)
fundamental vector, matrix, quaternion math macros