NetSurf
Data Structures | Macros | Functions | Variables
plot.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  s_vdi_sysinfo
 

Macros

#define CONV_KEEP_LIMIT   512000
 how much memory should be kept allocated for temp. More...
 
#define CONV_BLOCK_SIZE   32000
 how much memory to allocate if some is needed: More...
 
#define PLOT_FLAG_DITHER   0x04
 set if the plotter shall dither images More...
 
#define PLOT_FLAG_TRANS   0x08
 set if the plotter supports transparent operations More...
 
#define PLOT_FLAG_HAS_DITHER   0x0400
 
#define PLOT_FLAG_HAS_ALPHA   0x0800
 
#define PLOT_FLAG_OFFSCREEN   0x1000
 offscreen plotter should set this flag More...
 
#define PLOT_FLAG_LOCKED   0x08000
 plotter should set this flag during screen updates More...
 
#define FONTPLOT_FLAG_MONOGLYPH   0x01
 
#define MFDB_FLAG_STAND   0x01
 
#define MFDB_FLAG_ZEROMEM   0x02
 
#define MFDB_FLAG_NOALLOC   0x04
 
#define BITMAPF_MONOGLYPH   4096
 The bitmap is an character bitmap. More...
 
#define BITMAPF_BUFFER_NATIVE   8192
 Bitmap shall be kept converted
More...
 
#define ERR_BUFFERSIZE_EXCEEDS_SCREEN   1 /* The buffer allocated is larger than the screen */
 
#define ERR_NO_MEM   2 /* Not enough memory for requested operation */
 
#define ERR_PLOTTER_NOT_AVAILABLE   3 /* invalid plotter driver name passed */
 
#define NSLT2VDI(dst, src)
 
#define ABGR_TO_RGB(c)   ( ((c&0xFF)<<16) | (c&0xFF00) | ((c&0xFF0000)>>16) ) << 8
 
#define OFFSET_CUSTOM_COLOR   255
 

Functions

int plot_init (const struct redraw_context *ctx, char *fdrvrname)
 Init screen and font driver objects. More...
 
int plot_finalise (void)
 
const char * plot_err_str (int i)
 translate an error number More...
 
bool plot_lock (void)
 
bool plot_unlock (void)
 
bool plot_set_dimensions (const struct redraw_context *ctx, int x, int y, int w, int h)
 Set plot origin and canvas size. More...
 
bool plot_get_dimensions (GRECT *dst)
 Get current canvas size. More...
 
float plot_get_scale (void)
 
float plot_set_scale (float)
 set scale of plotter. More...
 
void plot_set_abs_clipping (const GRECT *area)
 Subsequent calls to plot_clip will be clipped by the absolute clip. More...
 
void plot_get_abs_clipping (struct rect *dst)
 Get the maximum clip extent, in absolute screen coords. More...
 
void plot_get_abs_clipping_grect (GRECT *dst)
 Get the maximum clip extent, in absolute screen coords. More...
 
bool plot_get_clip (struct rect *out)
 
void plot_get_clip_grect (GRECT *out)
 Get clipping for current framebuffer as GRECT. More...
 
VdiHdl plot_get_vdi_handle (void)
 
long plot_get_flags (void)
 
bool plot_blit_bitmap (struct bitmap *bmp, int x, int y, unsigned long bg, unsigned long flags)
 
bool plot_blit_mfdb (GRECT *loc, MFDB *insrc, short fgcolor, uint32_t flags)
 
bool plot_copy_rect (GRECT src, GRECT dst)
 copy an rectangle from the plot buffer to screen More...
 
void vdi1000_to_rgb (unsigned short *in, unsigned char *out)
 
void rgb_to_vdi1000 (unsigned char *in, RGB1000 *out)
 Convert an RGB color to an VDI Color. More...
 
short rgb_to_666_index (unsigned char r, unsigned char g, unsigned char b)
 

Variables

const struct plotter_table atari_plotters
 atari plottr operation table More...
 

Macro Definition Documentation

◆ ABGR_TO_RGB

#define ABGR_TO_RGB (   c)    ( ((c&0xFF)<<16) | (c&0xFF00) | ((c&0xFF0000)>>16) ) << 8

Definition at line 170 of file plot.h.

◆ BITMAPF_BUFFER_NATIVE

#define BITMAPF_BUFFER_NATIVE   8192

Bitmap shall be kept converted

Definition at line 50 of file plot.h.

◆ BITMAPF_MONOGLYPH

#define BITMAPF_MONOGLYPH   4096

The bitmap is an character bitmap.

Definition at line 49 of file plot.h.

◆ CONV_BLOCK_SIZE

#define CONV_BLOCK_SIZE   32000

how much memory to allocate if some is needed:

Definition at line 26 of file plot.h.

◆ CONV_KEEP_LIMIT

#define CONV_KEEP_LIMIT   512000

how much memory should be kept allocated for temp.

conversion bitmaps:

Definition at line 23 of file plot.h.

◆ ERR_BUFFERSIZE_EXCEEDS_SCREEN

#define ERR_BUFFERSIZE_EXCEEDS_SCREEN   1 /* The buffer allocated is larger than the screen */

Definition at line 53 of file plot.h.

◆ ERR_NO_MEM

#define ERR_NO_MEM   2 /* Not enough memory for requested operation */

Definition at line 54 of file plot.h.

◆ ERR_PLOTTER_NOT_AVAILABLE

#define ERR_PLOTTER_NOT_AVAILABLE   3 /* invalid plotter driver name passed */

Definition at line 55 of file plot.h.

◆ FONTPLOT_FLAG_MONOGLYPH

#define FONTPLOT_FLAG_MONOGLYPH   0x01

Definition at line 41 of file plot.h.

◆ MFDB_FLAG_NOALLOC

#define MFDB_FLAG_NOALLOC   0x04

Definition at line 46 of file plot.h.

◆ MFDB_FLAG_STAND

#define MFDB_FLAG_STAND   0x01

Definition at line 44 of file plot.h.

◆ MFDB_FLAG_ZEROMEM

#define MFDB_FLAG_ZEROMEM   0x02

Definition at line 45 of file plot.h.

◆ NSLT2VDI

#define NSLT2VDI (   dst,
  src 
)
Value:
dst = 0; \
switch( src->stroke_type ) { \
dst = (0xAAAA00 | 7); \
break; \
dst = 3; \
break; \
default: \
dst = 1; \
break; \
}
@ PLOT_OP_TYPE_NONE
No operation.
Definition: plot_style.h:66
@ PLOT_OP_TYPE_DASH
Dashed plot.
Definition: plot_style.h:69
@ PLOT_OP_TYPE_DOT
Dotted plot.
Definition: plot_style.h:68
@ PLOT_OP_TYPE_SOLID
Solid colour.
Definition: plot_style.h:67

Definition at line 143 of file plot.h.

◆ OFFSET_CUSTOM_COLOR

#define OFFSET_CUSTOM_COLOR   255

Definition at line 175 of file plot.h.

◆ PLOT_FLAG_DITHER

#define PLOT_FLAG_DITHER   0x04

set if the plotter shall dither images

Definition at line 29 of file plot.h.

◆ PLOT_FLAG_HAS_ALPHA

#define PLOT_FLAG_HAS_ALPHA   0x0800

Definition at line 34 of file plot.h.

◆ PLOT_FLAG_HAS_DITHER

#define PLOT_FLAG_HAS_DITHER   0x0400

Definition at line 33 of file plot.h.

◆ PLOT_FLAG_LOCKED

#define PLOT_FLAG_LOCKED   0x08000

plotter should set this flag during screen updates

Definition at line 38 of file plot.h.

◆ PLOT_FLAG_OFFSCREEN

#define PLOT_FLAG_OFFSCREEN   0x1000

offscreen plotter should set this flag

Definition at line 35 of file plot.h.

◆ PLOT_FLAG_TRANS

#define PLOT_FLAG_TRANS   0x08

set if the plotter supports transparent operations

Definition at line 30 of file plot.h.

Function Documentation

◆ plot_blit_bitmap()

bool plot_blit_bitmap ( struct bitmap bmp,
int  x,
int  y,
unsigned long  bg,
unsigned long  flags 
)

Definition at line 1482 of file plot.c.

References atari_plot_vdi_handle, bitmap_convert, clip(), s_view::clipping, convert_bitmap_done(), bitmap::height, plot_get_visible_grect(), snapshot_suspend(), view, bitmap::width, s_view::x, rect::x0, rect::x1, s_view::y, rect::y0, and rect::y1.

Referenced by plot_bitmap().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ plot_blit_mfdb()

bool plot_blit_mfdb ( GRECT *  loc,
MFDB *  insrc,
short  fgcolor,
uint32_t  flags 
)

Definition at line 1551 of file plot.c.

References atari_plot_vdi_handle, init_mfdb(), PLOT_FLAG_TRANS, plot_get_clip_grect(), view, s_view::x, and s_view::y.

Here is the call graph for this function:

◆ plot_copy_rect()

bool plot_copy_rect ( GRECT  src,
GRECT  dst 
)

copy an rectangle from the plot buffer to screen

because this is an on-screen plotter, this is an screen to screen copy.

Definition at line 374 of file plot.c.

References atari_plot_vdi_handle, plot_get_visible_grect(), plot_lock(), plot_unlock(), view, s_view::x, and s_view::y.

Here is the call graph for this function:

◆ plot_err_str()

const char * plot_err_str ( int  i)

translate an error number

Definition at line 216 of file plot.c.

References plot_error_codes.

Referenced by plot_init().

Here is the caller graph for this function:

◆ plot_finalise()

int plot_finalise ( void  )

Definition at line 1748 of file plot.c.

References atari_plot_vdi_handle, buf_packed, buf_planar, delete_font_plotter(), fplotter, hermes_cnv_h, snapshot_destroy(), and vfmt.

Referenced by gui_quit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ plot_get_abs_clipping()

void plot_get_abs_clipping ( struct rect dst)

Get the maximum clip extent, in absolute screen coords.

Parameters
dstthe structure that receives the absolute clipping

Definition at line 1899 of file plot.c.

References s_view::abs_clipping, and view.

◆ plot_get_abs_clipping_grect()

void plot_get_abs_clipping_grect ( GRECT *  dst)

Get the maximum clip extent, in absolute screen coords.

Parameters
dstthe structure that receives the absolute clipping

Definition at line 1909 of file plot.c.

References s_view::abs_clipping, view, rect::x0, rect::x1, rect::y0, and rect::y1.

Referenced by plot_clip().

Here is the caller graph for this function:

◆ plot_get_clip()

bool plot_get_clip ( struct rect out)

Definition at line 1930 of file plot.c.

References s_view::clipping, view, rect::x0, rect::x1, rect::y0, and rect::y1.

Referenced by plot_bitmap(), and plot_get_clip_grect().

Here is the caller graph for this function:

◆ plot_get_clip_grect()

void plot_get_clip_grect ( GRECT *  out)

Get clipping for current framebuffer as GRECT.

Definition at line 1940 of file plot.c.

References clip(), and plot_get_clip().

Referenced by plot_blit_mfdb(), and plot_clip().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ plot_get_dimensions()

bool plot_get_dimensions ( GRECT *  dst)

Get current canvas size.

Parameters
dstthe GRECT * which receives the canvas size

Definition at line 1838 of file plot.c.

References s_view::h, view, s_view::w, s_view::x, and s_view::y.

Referenced by plot_clip(), and plot_set_abs_clipping().

Here is the caller graph for this function:

◆ plot_get_flags()

long plot_get_flags ( void  )

Definition at line 1924 of file plot.c.

References atari_plot_flags.

Referenced by atari_treeview_redraw().

Here is the caller graph for this function:

◆ plot_get_scale()

float plot_get_scale ( void  )

Definition at line 1864 of file plot.c.

References s_view::scale, and view.

Referenced by atari_font_position(), atari_font_split(), and atari_font_width().

Here is the caller graph for this function:

◆ plot_get_vdi_handle()

VdiHdl plot_get_vdi_handle ( void  )

Definition at line 1918 of file plot.c.

References atari_plot_vdi_handle.

Referenced by atari_about_show(), atari_treeview_redraw(), and window_redraw_favicon().

Here is the caller graph for this function:

◆ plot_init()

int plot_init ( const struct redraw_context ctx,
char *  fdrvrname 
)

Init screen and font driver objects.

Parameters
ctxThe current redraw context.
fdrvrnamefont driver name.
Returns
value > 1 when the objects could be succesfully created or <= 0 to indicate an error.

Definition at line 1612 of file plot.c.

References atari_font_flags, atari_plot_bpp_virt, atari_plot_flags, atari_plot_vdi_handle, bitmap_convert, bitmap_convert_tc(), buf_packed, buf_planar, clip(), plotter_table::clip, die(), dump_font_drivers(), dump_vdi_info(), FONTPLOT_FLAG_MONOGLYPH, fplotter, s_view::h, hermes_cnv_h, hermes_res_h, s_vdi_sysinfo::mask_a, s_vdi_sysinfo::mask_b, s_vdi_sysinfo::mask_g, s_vdi_sysinfo::mask_r, new_font_plotter(), nsfmt, NSLOG, nsoption_int, redraw_context::plot, plot_err_str(), PLOT_FLAG_DITHER, PLOT_FLAG_TRANS, plot_set_scale(), read_vdi_sysinfo(), rgb_to_vdi1000(), s_vdi_sysinfo::scr_bpp, size_buf_packed, size_buf_planar, update_visible_rect(), vdi1000_to_rgb(), VDI_FORMAT_PACK, vdi_sysinfo, s_vdi_sysinfo::vdiformat, verbose_log, vfmt, view, s_view::w, s_view::x, and s_view::y.

Referenced by gui_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ plot_lock()

bool plot_lock ( void  )

Definition at line 1775 of file plot.c.

References atari_plot_flags, and PLOT_FLAG_LOCKED.

Referenced by atari_treeview_redraw(), plot_copy_rect(), and window_process_redraws().

Here is the caller graph for this function:

◆ plot_set_abs_clipping()

void plot_set_abs_clipping ( const GRECT *  area)

Subsequent calls to plot_clip will be clipped by the absolute clip.

Parameters
areathe maximum clipping rectangle (absolute screen coords)

Definition at line 1875 of file plot.c.

References s_view::abs_clipping, plot_get_dimensions(), view, rect::x0, rect::x1, rect::y0, and rect::y1.

Referenced by plot_set_dimensions(), and window_process_redraws().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ plot_set_dimensions()

bool plot_set_dimensions ( const struct redraw_context ctx,
int  x,
int  y,
int  w,
int  h 
)

Set plot origin and canvas size.

Parameters
ctxThe current redraw context.
xthe x origin
ythe y origin
wthe width of the plot area
hthe height of the plot area

Definition at line 1806 of file plot.c.

References plotter_table::clip, s_view::h, redraw_context::plot, plot_set_abs_clipping(), update_visible_rect(), view, s_view::w, s_view::x, and s_view::y.

Referenced by atari_treeview_redraw(), toolbar_redraw(), window_redraw_content(), and window_redraw_favicon().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ plot_set_scale()

float plot_set_scale ( float  scale)

set scale of plotter.

Parameters
scalethe new scale value
Returns
the old scale value

Definition at line 1854 of file plot.c.

References s_view::scale, and view.

Referenced by plot_init(), toolbar_redraw(), and window_redraw_content().

Here is the caller graph for this function:

◆ plot_unlock()

bool plot_unlock ( void  )

Definition at line 1791 of file plot.c.

References atari_plot_flags, atari_plot_vdi_handle, and PLOT_FLAG_LOCKED.

Referenced by atari_treeview_redraw(), plot_copy_rect(), and window_process_redraws().

Here is the caller graph for this function:

◆ rgb_to_666_index()

short rgb_to_666_index ( unsigned char  r,
unsigned char  g,
unsigned char  b 
)

◆ rgb_to_vdi1000()

void rgb_to_vdi1000 ( unsigned char *  in,
RGB1000 *  out 
)
inline

Convert an RGB color to an VDI Color.

Definition at line 564 of file plot.c.

Referenced by plot_init(), vsf_rgbcolor(), and vsl_rgbcolor().

Here is the caller graph for this function:

◆ vdi1000_to_rgb()

void vdi1000_to_rgb ( unsigned short *  in,
unsigned char *  out 
)
inline

Definition at line 576 of file plot.c.

Referenced by plot_init().

Here is the caller graph for this function:

Variable Documentation

◆ atari_plotters

const struct plotter_table atari_plotters
extern

atari plottr operation table

Definition at line 2507 of file plot.c.

Referenced by atari_treeview_redraw(), and gui_init().