hpgs  1.1.8
About: HPGS is an HPGL/2 interpreter, which renders HPGL/2 through a Postscript-like API. Currently, it can render to eps and png files.
  Fossies Dox: hpgs-1.1.8.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

Reader

Data Structures

struct  hpgs_reader_poly_point_st
 A point in hte HPGL polygon buffer. More...
 
struct  hpgs_reader_pcl_palette_st
 A PCL palette as used by PCL push/pop palette. More...
 
struct  hpgs_reader_st
 A HPGL interpreter. More...
 

Typedefs

typedef struct hpgs_reader_st hpgs_reader
 
typedef struct hpgs_reader_poly_point_st hpgs_reader_poly_point
 
typedef struct hpgs_reader_pcl_palette_st hpgs_reader_pcl_palette
 
typedef int(* hpgs_reader_hpglcmd_func_t) (hpgs_reader *reader)
 

Functions

HPGS_API hpgs_readerhpgs_new_reader (hpgs_istream *in, hpgs_device *dev, hpgs_bool multipage, int v)
 
HPGS_API void hpgs_reader_set_lw_factor (hpgs_reader *reader, double lw_factor)
 
HPGS_API void hpgs_reader_set_fixed_page (hpgs_reader *reader, hpgs_bbox *bbox, double page_width, double page_height, double border, double angle)
 
HPGS_API void hpgs_reader_set_dynamic_page (hpgs_reader *reader, hpgs_bbox *bbox, double max_page_width, double max_page_height, double border, double angle)
 
HPGS_API void hpgs_reader_set_page_asset_func (hpgs_reader *reader, void *ctxt, hpgs_reader_asset_func_t func)
 
HPGS_API void hpgs_reader_set_frame_asset_func (hpgs_reader *reader, void *ctxt, hpgs_reader_asset_func_t func)
 
HPGS_API void hpgs_reader_interrupt (hpgs_reader *reader)
 
HPGS_API int hpgs_reader_get_current_pen (hpgs_reader *reader)
 
HPGS_API int hpgs_reader_imbue (hpgs_reader *reader, hpgs_device *dev)
 
HPGS_API int hpgs_reader_attach (hpgs_reader *reader, hpgs_istream *in)
 
HPGS_API int hpgs_reader_stamp (hpgs_reader *reader, const hpgs_bbox *bb, const char *stamp, const char *encoding, double stamp_size)
 
HPGS_API int hpgs_device_stamp (hpgs_device *dev, const hpgs_bbox *bb, const char *stamp, const char *encoding, double stamp_size)
 
HPGS_API int hpgs_reader_set_png_dump (hpgs_reader *reader, const char *filename)
 
HPGS_API int hpgs_read (hpgs_reader *reader, hpgs_bool finish)
 
HPGS_API void hpgs_destroy_reader (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_check_param_end (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_read_pcl_int (hpgs_reader *reader, int *x, int *sign)
 
HPGS_INTERNAL_API int hpgs_reader_read_int (hpgs_reader *reader, int *x)
 
HPGS_INTERNAL_API int hpgs_reader_read_double (hpgs_reader *reader, double *x)
 
HPGS_INTERNAL_API int hpgs_reader_read_point (hpgs_reader *reader, hpgs_point *p, int xform)
 
HPGS_INTERNAL_API int hpgs_reader_read_new_string (hpgs_reader *reader, char *str)
 
HPGS_INTERNAL_API int hpgs_reader_read_label_string (hpgs_reader *reader, char *str)
 
HPGS_INTERNAL_API void hpgs_reader_set_page_matrix (hpgs_reader *reader, const hpgs_bbox *bb)
 
HPGS_INTERNAL_API void hpgs_reader_set_default_transformation (hpgs_reader *reader)
 
HPGS_INTERNAL_API void hpgs_reader_set_default_state (hpgs_reader *reader)
 
HPGS_INTERNAL_API void hpgs_reader_set_defaults (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_set_plotsize (hpgs_reader *reader, double xs, double ys)
 
HPGS_INTERNAL_API int hpgs_reader_showpage (hpgs_reader *reader, int ipage)
 
HPGS_INTERNAL_API void hpgs_reader_set_std_pen_colors (hpgs_reader *reader, int i0, int n)
 
HPGS_INTERNAL_API int hpgs_reader_checkpath (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_moveto (hpgs_reader *reader, hpgs_point *p)
 
HPGS_INTERNAL_API int hpgs_reader_lineto (hpgs_reader *reader, hpgs_point *p)
 
HPGS_INTERNAL_API int hpgs_reader_curveto (hpgs_reader *reader, hpgs_point *p1, hpgs_point *p2, hpgs_point *p3)
 
HPGS_INTERNAL_API int hpgs_reader_stroke (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_fill (hpgs_reader *reader, hpgs_bool winding)
 
HPGS_INTERNAL_API int hpgs_reader_closepath (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_setpen (hpgs_reader *reader, int pen)
 
HPGS_INTERNAL_API int hpgs_device_setrgb_all (hpgs_device *dev, const hpgs_color *rgb)
 
HPGS_INTERNAL_API int hpgs_reader_label (hpgs_reader *reader, const char *str, int str_len, int face, int encoding, int posture, int weight, const hpgs_point *left_vec, const hpgs_point *up_vec, const hpgs_point *space_vec)
 
HPGS_INTERNAL_API int hpgs_device_label (hpgs_device *dev, hpgs_point *pos, const char *str, int str_len, int face, const char *encoding, int posture, int weight, const hpgs_point *left_vec, const hpgs_point *up_vec, const hpgs_point *space_vec)
 
HPGS_INTERNAL_API int hpgs_reader_do_PCL (hpgs_reader *reader, hpgs_bool take_pos)
 
HPGS_INTERNAL_API int hpgs_reader_do_PJL (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_push_pcl_palette (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_pop_pcl_palette (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_AA (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_AC (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_AD (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_AR (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_AT (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_BP (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_BR (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_BZ (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_CI (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_CO (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_CP (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_CR (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_DI (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_DR (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_DT (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_DV (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_EA (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_EP (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_ER (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_ES (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_EW (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_FP (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_FR (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_FT (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_IN (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_IP (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_IR (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_IW (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_LA (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_LB (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_LO (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_LT (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_MC (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_MG (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_NP (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_PC (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_PA (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_PD (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_PE (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_PG (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_PM (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_PP (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_PR (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_PS (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_PU (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_PW (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_RA (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_RO (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_RR (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_RT (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_SA (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_SC (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_SD (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_SI (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_SL (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_SM (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_SP (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_SR (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_SS (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_TR (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_UL (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_WG (hpgs_reader *reader)
 
HPGS_INTERNAL_API int hpgs_reader_do_WU (hpgs_reader *reader)
 

Detailed Description

Typedef Documentation

◆ hpgs_reader

typedef struct hpgs_reader_st hpgs_reader

Definition at line 847 of file hpgs.h.

◆ hpgs_reader_hpglcmd_func_t

typedef int(* hpgs_reader_hpglcmd_func_t) (hpgs_reader *reader)

Definition at line 445 of file hpgsreader.h.

◆ hpgs_reader_pcl_palette

Definition at line 137 of file hpgsreader.h.

◆ hpgs_reader_poly_point

Definition at line 124 of file hpgsreader.h.

Function Documentation

◆ hpgs_destroy_reader()

◆ hpgs_device_label()

HPGS_INTERNAL_API int hpgs_device_label ( hpgs_device dev,
hpgs_point pos,
const char *  str,
int  str_len,
int  face,
const char *  encoding,
int  posture,
int  weight,
const hpgs_point left_vec,
const hpgs_point up_vec,
const hpgs_point space_vec 
)

Definition at line 251 of file hpgslabel.c.

References hpgs_device_label_internal(), hpgs_i18n(), HPGS_LABEL_UCS_ENC, and hpgs_set_error().

Referenced by hpgs_device_stamp().

Here is the caller graph for this function:

◆ hpgs_device_setrgb_all()

HPGS_INTERNAL_API int hpgs_device_setrgb_all ( hpgs_device dev,
const hpgs_color rgb 
)

Simultaneously set the promary and the pattern color on a device.

Definition at line 114 of file hpgspen.c.

References hpgs_setpatcol(), and hpgs_setrgbcolor().

Referenced by hpgs_device_stamp(), hpgs_reader_do_PC(), hpgs_reader_do_setpen(), and shade().

Here is the caller graph for this function:

◆ hpgs_device_stamp()

HPGS_API int hpgs_device_stamp ( hpgs_device dev,
const hpgs_bbox bb,
const char *  stamp,
const char *  encoding,
double  stamp_size 
)

This is a highlevel interface to stamp the device with a text prior to printing any data. This is used in order to print a 'draft' or 'obsoleted' mark to the paper.

If encodeing is a null pointer

Definition at line 862 of file hpgsreader.c.

References hpgs_color_st::b, hpgs_color_st::g, hpgs_device_label(), hpgs_device_setrgb_all(), hpgs_utf8_strlen(), hpgs_bbox_st::llx, hpgs_bbox_st::lly, hpgs_color_st::r, hpgs_bbox_st::urx, hpgs_bbox_st::ury, hpgs_point_st::x, and hpgs_point_st::y.

Referenced by hpgs_reader_stamp(), and main().

Here is the caller graph for this function:

◆ hpgs_new_reader()

HPGS_API hpgs_reader* hpgs_new_reader ( hpgs_istream in,
hpgs_device dev,
hpgs_bool  multipage,
int  v 
)

Contructs a HPGL reader on the heap using the given input device in and the given output vector drawing device dev.

The argument multipage specifies, whether the reader processes more than one page.

The argument v specifies the verbosity of the HPGL reader. A value of 0 forces the reader to not report anything to hpgs_log(). Value of 1 or 2 give diagnostics output to hpgs_log() with increasing volume.

You do not have to call neither hpgs_close on in nor hpgs_destroy on dev.

In the case of an error, a null pointer is returned. This only happens, if the system is out of memory.

Definition at line 58 of file hpgsreader.c.

References hpgs_reader_st::content_bbox, hpgs_reader_st::current_page, hpgs_reader_st::device, hpgs_reader_st::frame_asset_ctxt, hpgs_reader_st::frame_asset_func, HP_TO_PT, hpgs_device_destroy(), HPGS_FALSE, hpgs_istream_close(), hpgs_matrix_set_identity(), hpgs_reader_set_defaults(), hpgs_reader_st::in, hpgs_reader_st::interrupted, hpgs_bbox_st::llx, hpgs_bbox_st::lly, hpgs_reader_st::lw_factor, hpgs_reader_st::page_angle, hpgs_reader_st::page_asset_ctxt, hpgs_reader_st::page_asset_func, hpgs_reader_st::page_bbox, hpgs_reader_st::page_border, hpgs_reader_st::page_height, hpgs_reader_st::page_matrix, hpgs_reader_st::page_mode, hpgs_reader_st::page_scale, hpgs_reader_st::page_width, hpgs_reader_st::pcl_i_palette, hpgs_reader_st::pcl_image, hpgs_reader_st::pcl_n_palettes, hpgs_reader_st::pcl_palettes, hpgs_reader_st::pcl_raster_data, hpgs_reader_st::pen_colors, hpgs_reader_st::pen_widths, hpgs_reader_st::plotsize_device, hpgs_reader_st::png_dump_count, hpgs_reader_st::png_dump_filename, hpgs_reader_st::poly_buffer, hpgs_bbox_st::urx, hpgs_bbox_st::ury, and hpgs_reader_st::verbosity.

Referenced by main().

Here is the caller graph for this function:

◆ hpgs_read()

HPGS_API int hpgs_read ( hpgs_reader reader,
hpgs_bool  finish 
)

Interprets the input stream associated with reader and passes the result to the associated vector device.

The argument finish specifies, whether this is the last file written to the underlying hpgs_device. If finish is HPGS_TRUE, hpgs_device_finish is called. Otherwise, another input stream may be attached using hpgs_reader_attach and hpgs_read may be called again. This way, multiple input files may collated together in a single output file.

The function return 0 upon success. A value of -1 is returned, when an error is encountered.

You have to call hpgs_reader_get_error in order to retrieve the error message in the latter case.

Definition at line 449 of file hpgsreader.c.

References hpgs_reader_st::bytes_ignored, hpgs_reader_st::clipsave_depth, hpgs_reader_st::current_page, hpgs_reader_st::device, DT_CMD, hpgs_reader_st::eoc, hpgs_reader_hpglcmd_rec_st::func, hpgl_recover(), hpglcmds, hpgs_clear_error(), hpgs_cliprestore(), HPGS_DEVICE_CAP_MULTISIZE, hpgs_device_capabilities(), hpgs_device_finish(), hpgs_error_ctxt(), HPGS_ESC, HPGS_FALSE, hpgs_getc(), hpgs_getplotsize(), hpgs_have_error(), hpgs_i18n(), hpgs_istream_iseof(), hpgs_istream_iserror(), hpgs_istream_seek(), hpgs_istream_tell(), hpgs_log(), hpgs_reader_read_double(), hpgs_reader_set_default_transformation(), hpgs_reader_set_defaults(), hpgs_reader_set_page_matrix(), hpgs_reader_showpage(), hpgs_set_error(), hpgs_setplotsize(), HPGS_SIZE_T_FMT, HPGS_SIZE_T_FMT_ARG, HPGS_TRUE, hpgs_ungetc(), hpgs_reader_st::in, hpgs_reader_st::interrupted, hpgs_reader_st::last_byte, LB_CMD, hpgs_bbox_st::llx, hpgs_bbox_st::lly, hpgs_reader_st::page_bbox, PE_CMD, hpgs_reader_st::plotsize_device, skip_ESC_block(), skip_MF_block(), hpgs_bbox_st::urx, hpgs_bbox_st::ury, and hpgs_reader_st::verbosity.

Referenced by main().

Here is the caller graph for this function:

◆ hpgs_reader_attach()

HPGS_API int hpgs_reader_attach ( hpgs_reader reader,
hpgs_istream in 
)

Attach a new input stream to a HPGL reader. This is useful in multipage mode in order to collate multiple input files.

The function return 0 in any case.

Definition at line 201 of file hpgsreader.c.

References hpgs_istream_close(), and hpgs_reader_st::in.

Referenced by main().

Here is the caller graph for this function:

◆ hpgs_reader_check_param_end()

◆ hpgs_reader_checkpath()

◆ hpgs_reader_closepath()

◆ hpgs_reader_curveto()

◆ hpgs_reader_do_AA()

◆ hpgs_reader_do_AC()

◆ hpgs_reader_do_AD()

◆ hpgs_reader_do_AR()

◆ hpgs_reader_do_AT()

◆ hpgs_reader_do_BP()

◆ hpgs_reader_do_BR()

◆ hpgs_reader_do_BZ()

HPGS_INTERNAL_API int hpgs_reader_do_BZ ( hpgs_reader reader)

Definition at line 813 of file hpgspath.c.

References hpgs_reader_st::eoc, hpgs_reader_curveto(), and hpgs_reader_read_point().

◆ hpgs_reader_do_CI()

◆ hpgs_reader_do_CO()

◆ hpgs_reader_do_CP()

◆ hpgs_reader_do_CR()

◆ hpgs_reader_do_DI()

HPGS_INTERNAL_API int hpgs_reader_do_DI ( hpgs_reader reader)

◆ hpgs_reader_do_DR()

◆ hpgs_reader_do_DT()

◆ hpgs_reader_do_DV()

◆ hpgs_reader_do_EA()

◆ hpgs_reader_do_EP()

◆ hpgs_reader_do_ER()

◆ hpgs_reader_do_ES()

◆ hpgs_reader_do_EW()

◆ hpgs_reader_do_FP()

◆ hpgs_reader_do_FR()

◆ hpgs_reader_do_FT()

◆ hpgs_reader_do_IN()

◆ hpgs_reader_do_IP()

◆ hpgs_reader_do_IR()

◆ hpgs_reader_do_IW()

◆ hpgs_reader_do_LA()

◆ hpgs_reader_do_LB()

◆ hpgs_reader_do_LO()

HPGS_INTERNAL_API int hpgs_reader_do_LO ( hpgs_reader reader)

◆ hpgs_reader_do_LT()

◆ hpgs_reader_do_MC()

◆ hpgs_reader_do_MG()

◆ hpgs_reader_do_NP()

HPGS_INTERNAL_API int hpgs_reader_do_NP ( hpgs_reader reader)

◆ hpgs_reader_do_PA()

◆ hpgs_reader_do_PC()

◆ hpgs_reader_do_PCL()

HPGS_INTERNAL_API int hpgs_reader_do_PCL ( hpgs_reader reader,
hpgs_bool  take_pos 
)

◆ hpgs_reader_do_PD()

◆ hpgs_reader_do_PE()

◆ hpgs_reader_do_PG()

◆ hpgs_reader_do_PJL()

HPGS_INTERNAL_API int hpgs_reader_do_PJL ( hpgs_reader reader)

Read a PJL block of the file.

Return values:

  • -1 Error, unexpected EOF.
  • 0 Success, ESC found, continue with ESC evaluation.
  • 1 Success, return to HPGL context.
  • 2 Success, plotsize set, skip interpretation of file.
  • 3 Success, go to PCL context.

Definition at line 99 of file hpgspjl.c.

References hpgs_reader_st::bytes_ignored, hpgs_reader_st::eoc, HP_TO_PT, HPGS_ESC, hpgs_getc(), hpgs_i18n(), hpgs_istream_seek(), hpgs_istream_tell(), hpgs_log(), hpgs_reader_read_pcl_int(), hpgs_reader_set_plotsize(), hpgs_set_error(), hpgs_ungetc(), hpgs_reader_st::in, hpgs_reader_st::last_byte, hpgs_reader_st::pcl_raster_res, hpgs_reader_st::pcl_scale, pjl_read_line(), and hpgs_reader_st::verbosity.

Referenced by skip_ESC_block().

Here is the caller graph for this function:

◆ hpgs_reader_do_PM()

◆ hpgs_reader_do_PP()

HPGS_INTERNAL_API int hpgs_reader_do_PP ( hpgs_reader reader)

◆ hpgs_reader_do_PR()

◆ hpgs_reader_do_PS()

◆ hpgs_reader_do_PU()

◆ hpgs_reader_do_PW()

◆ hpgs_reader_do_RA()

◆ hpgs_reader_do_RO()

◆ hpgs_reader_do_RR()

◆ hpgs_reader_do_RT()

◆ hpgs_reader_do_SA()

HPGS_INTERNAL_API int hpgs_reader_do_SA ( hpgs_reader reader)

Definition at line 355 of file hpgscharacter.c.

References hpgs_reader_st::alternate_font.

◆ hpgs_reader_do_SC()

◆ hpgs_reader_do_SD()

◆ hpgs_reader_do_setpen()

◆ hpgs_reader_do_SI()

◆ hpgs_reader_do_SL()

HPGS_INTERNAL_API int hpgs_reader_do_SL ( hpgs_reader reader)

◆ hpgs_reader_do_SM()

◆ hpgs_reader_do_SP()

HPGS_INTERNAL_API int hpgs_reader_do_SP ( hpgs_reader reader)

Definition at line 141 of file hpgspen.c.

References hpgs_reader_st::eoc, hpgs_reader_do_setpen(), and hpgs_reader_read_int().

◆ hpgs_reader_do_SR()

◆ hpgs_reader_do_SS()

HPGS_INTERNAL_API int hpgs_reader_do_SS ( hpgs_reader reader)

Definition at line 364 of file hpgscharacter.c.

References hpgs_reader_st::alternate_font.

◆ hpgs_reader_do_TR()

◆ hpgs_reader_do_UL()

◆ hpgs_reader_do_WG()

◆ hpgs_reader_do_WU()

HPGS_INTERNAL_API int hpgs_reader_do_WU ( hpgs_reader reader)

◆ hpgs_reader_fill()

◆ hpgs_reader_get_current_pen()

HPGS_API int hpgs_reader_get_current_pen ( hpgs_reader reader)

Returns the curent HPGL pen of the given reader structure. This information might be used by page or frame asset functions.

Definition at line 1024 of file hpgsreader.c.

References hpgs_reader_st::current_pen.

◆ hpgs_reader_imbue()

HPGS_API int hpgs_reader_imbue ( hpgs_reader reader,
hpgs_device dev 
)

Sets a vector drawing device to a HPGL reader an resets the input stream.

The function return 0 in any case.

Definition at line 166 of file hpgsreader.c.

References hpgs_reader_st::current_page, hpgs_reader_st::device, HPGS_DEVICE_CAP_PLOTSIZE, hpgs_device_capabilities(), hpgs_device_destroy(), hpgs_istream_seek(), hpgs_reader_set_defaults(), hpgs_reader_st::in, and hpgs_reader_st::plotsize_device.

Referenced by main().

Here is the caller graph for this function:

◆ hpgs_reader_interrupt()

HPGS_API void hpgs_reader_interrupt ( hpgs_reader reader)

Interrupt a currently running call to hpgs_reader_read from another thread. There's no guarantee when hpgs_read will terminate after calling hpgs_reader_interrupt. If the reader is currently performing a time-consuming task like rendering a large imge to the device, hpgs_read may continue for several seconds after this call.

Definition at line 143 of file hpgsreader.c.

References HPGS_TRUE, and hpgs_reader_st::interrupted.

◆ hpgs_reader_label()

HPGS_INTERNAL_API int hpgs_reader_label ( hpgs_reader reader,
const char *  str,
int  str_len,
int  face,
int  encoding,
int  posture,
int  weight,
const hpgs_point left_vec,
const hpgs_point up_vec,
const hpgs_point space_vec 
)

Definition at line 192 of file hpgslabel.c.

References hpgs_reader_st::current_point, hpgs_reader_st::device, encoding_names, hpgs_device_label_internal(), hpgs_i18n(), HPGS_LABEL_UCS_ENC, and hpgs_set_error().

Referenced by hpgs_reader_do_LB().

Here is the caller graph for this function:

◆ hpgs_reader_lineto()

◆ hpgs_reader_moveto()

◆ hpgs_reader_pop_pcl_palette()

HPGS_INTERNAL_API int hpgs_reader_pop_pcl_palette ( hpgs_reader reader)

Definition at line 264 of file hpgssetup.c.

References hpgs_i18n(), hpgs_reader_destroy_pcl_palette(), hpgs_set_error(), hpgs_reader_st::pcl_i_palette, and hpgs_reader_st::pcl_palettes.

Referenced by pcl_do_cmd().

Here is the caller graph for this function:

◆ hpgs_reader_push_pcl_palette()

◆ hpgs_reader_read_double()

◆ hpgs_reader_read_int()

◆ hpgs_reader_read_label_string()

HPGS_INTERNAL_API int hpgs_reader_read_label_string ( hpgs_reader reader,
char *  str 
)

◆ hpgs_reader_read_new_string()

HPGS_INTERNAL_API int hpgs_reader_read_new_string ( hpgs_reader reader,
char *  str 
)

read a new string argument from the stream return values:

  • -1 read error/EOF
  • 0 success.
  • 1 End of command.

Definition at line 284 of file hpgslexer.c.

References hpgs_reader_st::eoc, hpgs_getc(), HPGS_MAX_LABEL_SIZE, hpgs_reader_check_param_end(), hpgs_reader_st::in, and hpgs_reader_st::last_byte.

Referenced by hpgs_reader_do_BP(), hpgs_reader_do_CO(), and hpgs_reader_do_MG().

Here is the caller graph for this function:

◆ hpgs_reader_read_pcl_int()

HPGS_INTERNAL_API int hpgs_reader_read_pcl_int ( hpgs_reader reader,
int *  x,
int *  sign 
)

read an integer argument from the stream - PCL version. return values:

  • -1 read error/EOF
  • 0 no integer found.
  • 1 integer found.

Definition at line 104 of file hpgslexer.c.

References hpgs_getc(), hpgs_ungetc(), hpgs_reader_st::in, and hpgs_reader_st::last_byte.

Referenced by hpgs_reader_do_PCL(), hpgs_reader_do_PJL(), and skip_ESC_block().

Here is the caller graph for this function:

◆ hpgs_reader_read_point()

◆ hpgs_reader_set_default_state()

HPGS_INTERNAL_API void hpgs_reader_set_default_state ( hpgs_reader reader)

Definition at line 87 of file hpgssetup.c.

References hpgs_reader_st::absolute_plotting, hpgs_reader_st::alternate_encoding, hpgs_reader_st::alternate_face, hpgs_reader_st::alternate_font, hpgs_reader_st::alternate_height, hpgs_reader_st::alternate_pitch, hpgs_reader_st::alternate_posture, hpgs_reader_st::alternate_spacing, hpgs_reader_st::alternate_weight, hpgs_reader_st::anchor_point, hpgs_reader_st::cr_point, hpgs_reader_st::current_char_size, hpgs_reader_st::current_extra_space, hpgs_reader_st::current_ft, hpgs_reader_st::current_label_angle, hpgs_reader_st::current_label_origin, hpgs_reader_st::current_linetype, hpgs_reader_st::current_pen, hpgs_reader_st::current_point, hpgs_reader_st::current_slant, hpgs_reader_st::current_text_line, hpgs_reader_st::current_text_path, hpgs_reader_st::default_encoding, hpgs_reader_st::default_face, hpgs_reader_st::default_height, hpgs_reader_st::default_pitch, hpgs_reader_st::default_posture, hpgs_reader_st::default_spacing, hpgs_reader_st::default_weight, hpgs_reader_st::delta_P, hpgs_matrix_st::dx, hpgs_matrix_st::dy, hpgs_reader_st::frame_x, hpgs_reader_st::frame_y, hpgs_reader_st::ft10_level, hpgs_reader_st::ft3_angle, hpgs_reader_st::ft3_spacing, hpgs_reader_st::ft4_angle, hpgs_reader_st::ft4_spacing, hpgs_reader_st::have_current_point, HP_TO_PT, hpgs_reader_set_default_transformation(), HPGS_TRUE, hpgs_reader_st::label_term, hpgs_reader_st::label_term_ignore, hpgs_reader_st::linetype_nsegs, hpgs_reader_st::linetype_segs, hpgs_reader_st::P1, hpgs_reader_st::P2, hpgs_reader_st::page_matrix, hpgs_reader_st::pattern_transparency, hpgs_reader_st::pen_down, hpgs_reader_st::pen_width_relative, hpgs_reader_st::poly_buffer_size, hpgs_reader_st::polygon_mode, hpgs_reader_st::polygon_open, hpgs_reader_st::rop3, hpgs_reader_st::rotation, hpgs_reader_st::sc_bottom, hpgs_reader_st::sc_left, hpgs_reader_st::sc_type, hpgs_reader_st::sc_xmax, hpgs_reader_st::sc_xmin, hpgs_reader_st::sc_ymax, hpgs_reader_st::sc_ymin, hpgs_reader_st::src_transparency, std_linetype_nsegs, std_linetype_segs, hpgs_point_st::x, hpgs_reader_st::x_size, hpgs_point_st::y, and hpgs_reader_st::y_size.

Referenced by hpgs_reader_do_IN(), hpgs_reader_do_PCL(), and hpgs_reader_set_defaults().

Here is the caller graph for this function:

◆ hpgs_reader_set_default_transformation()

◆ hpgs_reader_set_defaults()

HPGS_INTERNAL_API void hpgs_reader_set_defaults ( hpgs_reader reader)

Definition at line 276 of file hpgssetup.c.

References hpgs_color_st::b, hpgs_palette_color_st::b, hpgs_reader_st::bytes_ignored, hpgs_reader_st::clipsave_depth, hpgs_reader_st::eoc, hpgs_color_st::g, hpgs_palette_color_st::g, hpgs_image_destroy(), hpgs_reader_destroy_pcl_palette(), hpgs_reader_push_pcl_palette(), hpgs_reader_set_default_state(), hpgs_reader_st::max_color, hpgs_reader_st::min_color, hpgs_reader_st::npens, hpgs_reader_st::pcl_foreground_color, hpgs_reader_st::pcl_hmi, hpgs_reader_st::pcl_i_palette, hpgs_reader_st::pcl_image, hpgs_reader_st::pcl_palettes, hpgs_reader_st::pcl_pattern, hpgs_reader_st::pcl_point, hpgs_reader_st::pcl_raster_compression, hpgs_reader_st::pcl_raster_data, hpgs_reader_st::pcl_raster_data_size, hpgs_reader_st::pcl_raster_dest_height, hpgs_reader_st::pcl_raster_dest_width, hpgs_reader_st::pcl_raster_line, hpgs_reader_st::pcl_raster_mode, hpgs_reader_st::pcl_raster_plane, hpgs_reader_st::pcl_raster_planes, hpgs_reader_st::pcl_raster_presentation, hpgs_reader_st::pcl_raster_res, hpgs_reader_st::pcl_raster_src_height, hpgs_reader_st::pcl_raster_src_width, hpgs_reader_st::pcl_raster_y_offset, hpgs_reader_st::pcl_scale, hpgs_reader_st::pcl_vmi, hpgs_reader_st::pen_colors, hpgs_reader_st::pen_widths, hpgs_reader_st::poly_buffer, hpgs_reader_st::poly_buffer_alloc_size, hpgs_reader_st::poly_buffer_size, hpgs_color_st::r, hpgs_palette_color_st::r, std_pen_colors, std_pen_widths, hpgs_point_st::x, and hpgs_point_st::y.

Referenced by hpgs_new_reader(), hpgs_read(), and hpgs_reader_imbue().

Here is the caller graph for this function:

◆ hpgs_reader_set_dynamic_page()

HPGS_API void hpgs_reader_set_dynamic_page ( hpgs_reader reader,
hpgs_bbox bbox,
double  max_page_width,
double  max_page_height,
double  border,
double  angle 
)

Force the placement of the content on a dynamically sized page. Call this subroutine after you determined the plot size using a plotsize device.

max_page_width and max_page_height specifiy the maximal dimension of the page, which will be adjusted to the size of the HPGL content of each individual page. border specifies the border from the page to the HPGL content.

bbox holds the bounding box of the HPGL content of the first page on input and on output, the bounding box of the whole page is returned. The returned bounding box should be used to set up your device, which will be passed to hpgs_reader_imbue after issuing this call.

Definition at line 825 of file hpgsreader.c.

References hpgs_reader_set_default_transformation(), hpgs_reader_set_page_matrix(), hpgs_reader_st::page_angle, hpgs_reader_st::page_bbox, hpgs_reader_st::page_border, hpgs_reader_st::page_height, hpgs_reader_st::page_mode, and hpgs_reader_st::page_width.

Referenced by main().

Here is the caller graph for this function:

◆ hpgs_reader_set_fixed_page()

HPGS_API void hpgs_reader_set_fixed_page ( hpgs_reader reader,
hpgs_bbox bbox,
double  page_width,
double  page_height,
double  border,
double  angle 
)

Force the placement of the content on a fixed page. Call this subroutine after you determined the plot size using a plotsize device.

page_width and page_height specifiy the dimension of the page in point (1/72 inch). border specifies the border from the page to the HPGL content.

bbox holds the bounding box of the HPGL content of the first page on input and on output, the bounding box of the whole page is returned. The returned bounding box should be used to set up your device, which will be passed to hpgs_reader_imbue after issuing this call.

Definition at line 790 of file hpgsreader.c.

References hpgs_reader_set_default_transformation(), hpgs_reader_set_page_matrix(), hpgs_reader_st::page_angle, hpgs_reader_st::page_bbox, hpgs_reader_st::page_border, hpgs_reader_st::page_height, hpgs_reader_st::page_mode, and hpgs_reader_st::page_width.

Referenced by main().

Here is the caller graph for this function:

◆ hpgs_reader_set_frame_asset_func()

HPGS_API void hpgs_reader_set_frame_asset_func ( hpgs_reader reader,
void *  ctxt,
hpgs_reader_asset_func_t  func 
)

Sets a callback function, which allows to render additional frame assets before a HPGL FR command becomes effective or the reader calls hpgs_showpage.

The call back function is passed the given ctxt pointer, the device on which the reader operates, the bounding box of the HPGL content and the transformation matrix from HPGL coordinates to page coordinates.

Definition at line 973 of file hpgsreader.c.

References hpgs_reader_st::frame_asset_ctxt, and hpgs_reader_st::frame_asset_func.

Referenced by main().

Here is the caller graph for this function:

◆ hpgs_reader_set_lw_factor()

HPGS_API void hpgs_reader_set_lw_factor ( hpgs_reader reader,
double  lw_factor 
)

Set the factor lw_factor for scaling HPGL linewidths to output linewidths. Usually you set this factor to 1.0, although for rendering to pixel device with a low resolution a factor of 0.5 may be useful to enforce the creation of thin lines.

Definition at line 155 of file hpgsreader.c.

References hpgs_reader_st::lw_factor.

Referenced by main().

Here is the caller graph for this function:

◆ hpgs_reader_set_page_asset_func()

HPGS_API void hpgs_reader_set_page_asset_func ( hpgs_reader reader,
void *  ctxt,
hpgs_reader_asset_func_t  func 
)

Sets a callback function, which allows to render additional page assets before the reader calls hpgs_showpage.

The call back function is passed the given ctxt pointer, the device on which the reader operates, the bounding box of the HPGL content and the transformation matrix from HPGL coordinates to page coordinates.

Definition at line 955 of file hpgsreader.c.

References hpgs_reader_st::page_asset_ctxt, and hpgs_reader_st::page_asset_func.

Referenced by main().

Here is the caller graph for this function:

◆ hpgs_reader_set_page_matrix()

◆ hpgs_reader_set_plotsize()

◆ hpgs_reader_set_png_dump()

HPGS_API int hpgs_reader_set_png_dump ( hpgs_reader reader,
const char *  filename 
)

Sets a filename for dumping inline PCL images in PNG format. The actual filenames written are:" filename0001.png, filename0002.png, ..... If filename contains an extension .png the counter is put between the basename and the .png extension.

Definition at line 988 of file hpgsreader.c.

References hpgs_i18n(), hpgs_set_error(), hpgs_reader_st::png_dump_count, and hpgs_reader_st::png_dump_filename.

Referenced by main().

Here is the caller graph for this function:

◆ hpgs_reader_set_std_pen_colors()

HPGS_INTERNAL_API void hpgs_reader_set_std_pen_colors ( hpgs_reader reader,
int  i0,
int  n 
)

Definition at line 175 of file hpgssetup.c.

References hpgs_reader_st::pen_colors, and std_pen_colors.

Referenced by hpgs_reader_do_PC().

Here is the caller graph for this function:

◆ hpgs_reader_showpage()

◆ hpgs_reader_stamp()

HPGS_API int hpgs_reader_stamp ( hpgs_reader reader,
const hpgs_bbox bb,
const char *  stamp,
const char *  encoding,
double  stamp_size 
)

This call is deprecated, use hpgs_device_stamp instead.

Definition at line 847 of file hpgsreader.c.

References hpgs_reader_st::device, and hpgs_device_stamp().

◆ hpgs_reader_stroke()

HPGS_INTERNAL_API int hpgs_reader_stroke ( hpgs_reader reader)