Write a PostScript file. More...
#include <vul_psfile.h>
Public Types | |
enum | paper_type { US_NORMAL, A4, B5, A3, US_LEGAL, ELEVEN_BY_SEVENTEEN, FOUR_BY_FIVE, THIRTY_FIVE_mm } |
enum | paper_orientation { PORTRAIT, LANDSCAPE } |
enum | paper_layout { CENTER, MAX } |
Public Member Functions | |
vul_psfile (char const *filename, bool debug_output=false) | |
Default constructor. | |
~vul_psfile () | |
Destructor. | |
operator bool () | |
void | set_paper_type (vul_psfile::paper_type type) |
void | set_paper_layout (vul_psfile::paper_layout layout) |
void | set_paper_orientation (vul_psfile::paper_orientation o) |
void | set_reduction_factor (int rf) |
void | set_scale_x (float sx) |
set the horizontal scaling (in percent); no scaling is 100. | |
void | set_scale_y (float sy) |
set the vertical scaling (in percent); no scaling is 100. | |
void | set_fg_color (float r, float g, float b) |
void | set_bg_color (float r, float g, float b) |
void | set_line_width (float f_width) |
float | line_width () const |
void | print_greyscale_image (unsigned char *data, int sizex, int sizey) |
Write 8 bit grey scale image. | |
void | print_color_image (unsigned char *data, int sizex, int sizey) |
Write 24 bit colour image. | |
void | line (float x1, float y1, float x2, float y2) |
Add a line between the given points to the Postscript file. | |
void | point (float x, float y, float point_size=0) |
Add a point at the given coordinates to the Postscript file. | |
void | ellipse (float x, float y, float a_axis, float b_axis, int angle=0) |
Add an ellipse to the Postscript file. | |
void | circle (float x, float y, float radius) |
Add a circle with the given centre point and radius to the Postscript file. | |
void | reset_bounding_box () |
Rewrite output bounding box parameters. | |
Protected Member Functions | |
void | set_min_max_xy (float x, float y) |
Set Bounding Box Min and Max x, y. | |
void | set_min_max_xy (int x, int y) |
Set Bounding Box Min and Max x, y. | |
bool | set_parameters (int sizex, int sizey) |
Set ox, oy , iw, ih, iwf, ihf parameters for PostScript file use. | |
void | postscript_header () |
PostScript file header. Automatically called by the constructor. | |
void | graphic_header () |
Set graphic coordinate (translate and rotate to local coordinate). | |
void | sobj_rgb_params (char const *str, bool filled) |
Utility program used in point(), line(), ellipse() and circle(). | |
void | print_graphics_prolog () |
the defined procedure for PostScript script use. | |
Private Member Functions | |
void | compute_bounding_box () |
Recalculate bounding box and scale x and y (if necessary). | |
void | reset_postscript_header () |
Reset PostScript header file. | |
void | image_translate_and_scale () |
Set Image translate and scale. | |
void | object_translate_and_scale () |
Set object translate and scale. | |
void | done () |
Private Attributes | |
vcl_ofstream | output_filestream |
float | fg_r |
float | fg_g |
float | fg_b |
float | bg_r |
float | bg_g |
float | bg_b |
float | line_width_ |
float | scale_x |
float | scale_y |
int | ox |
int | oy |
int | iw |
int | ih |
double | iwf |
double | ihf |
double | psizex |
double | psizey |
double | pos_inx |
double | pos_iny |
int | width |
int | height |
vcl_string | filename |
paper_type | printer_paper_type |
paper_orientation | printer_paper_orientation |
paper_layout | printer_paper_layout |
int | reduction_factor |
bool | doneps |
int | min_x |
int | min_y |
int | max_x |
int | max_y |
int | box_width |
int | box_height |
vcl_streampos | translate_pos |
vcl_streampos | sobj_t_pos |
vcl_streampos | header_pos |
bool | graphics_prolog_exists |
bool | exist_image |
bool | exist_objs |
Write a PostScript file.
Definition at line 19 of file vul_psfile.h.
Definition at line 34 of file vul_psfile.h.
Definition at line 31 of file vul_psfile.h.
Definition at line 22 of file vul_psfile.h.
vul_psfile::vul_psfile | ( | char const * | filename, |
bool | debug_output = false |
||
) |
Default constructor.
Definition at line 51 of file vul_psfile.cxx.
vul_psfile::~vul_psfile | ( | ) |
Destructor.
Definition at line 85 of file vul_psfile.cxx.
void vul_psfile::circle | ( | float | x, |
float | y, | ||
float | radius | ||
) |
Add a circle with the given centre point and radius to the Postscript file.
Definition at line 640 of file vul_psfile.cxx.
void vul_psfile::compute_bounding_box | ( | ) | [private] |
Recalculate bounding box and scale x and y (if necessary).
Definition at line 122 of file vul_psfile.cxx.
void vul_psfile::done | ( | ) | [private] |
Definition at line 1000 of file vul_psfile.cxx.
void vul_psfile::ellipse | ( | float | x, |
float | y, | ||
float | a_axis, | ||
float | b_axis, | ||
int | angle = 0 |
||
) |
Add an ellipse to the Postscript file.
Definition at line 614 of file vul_psfile.cxx.
void vul_psfile::graphic_header | ( | ) | [protected] |
Set graphic coordinate (translate and rotate to local coordinate).
Definition at line 464 of file vul_psfile.cxx.
void vul_psfile::image_translate_and_scale | ( | ) | [private] |
Set Image translate and scale.
Definition at line 479 of file vul_psfile.cxx.
void vul_psfile::line | ( | float | x1, |
float | y1, | ||
float | x2, | ||
float | y2 | ||
) |
Add a line between the given points to the Postscript file.
Definition at line 584 of file vul_psfile.cxx.
float vul_psfile::line_width | ( | ) | const [inline] |
Definition at line 53 of file vul_psfile.h.
void vul_psfile::object_translate_and_scale | ( | ) | [private] |
Set object translate and scale.
Definition at line 499 of file vul_psfile.cxx.
vul_psfile::operator bool | ( | ) | [inline] |
Definition at line 40 of file vul_psfile.h.
void vul_psfile::point | ( | float | x, |
float | y, | ||
float | point_size = 0 |
||
) |
Add a point at the given coordinates to the Postscript file.
Definition at line 600 of file vul_psfile.cxx.
void vul_psfile::postscript_header | ( | ) | [protected] |
PostScript file header. Automatically called by the constructor.
PostScript file header.
Definition at line 533 of file vul_psfile.cxx.
void vul_psfile::print_color_image | ( | unsigned char * | data, |
int | sizex, | ||
int | sizey | ||
) |
Write 24 bit colour image.
Definition at line 311 of file vul_psfile.cxx.
void vul_psfile::print_graphics_prolog | ( | ) | [protected] |
the defined procedure for PostScript script use.
Definition at line 657 of file vul_psfile.cxx.
void vul_psfile::print_greyscale_image | ( | unsigned char * | data, |
int | sizex, | ||
int | sizey | ||
) |
Write 8 bit grey scale image.
Definition at line 222 of file vul_psfile.cxx.
void vul_psfile::reset_bounding_box | ( | ) |
Rewrite output bounding box parameters.
Definition at line 96 of file vul_psfile.cxx.
void vul_psfile::reset_postscript_header | ( | ) | [private] |
Reset PostScript header file.
Definition at line 552 of file vul_psfile.cxx.
void vul_psfile::set_bg_color | ( | float | r, |
float | g, | ||
float | b | ||
) | [inline] |
Definition at line 51 of file vul_psfile.h.
void vul_psfile::set_fg_color | ( | float | r, |
float | g, | ||
float | b | ||
) | [inline] |
Definition at line 50 of file vul_psfile.h.
void vul_psfile::set_line_width | ( | float | f_width | ) | [inline] |
Definition at line 52 of file vul_psfile.h.
void vul_psfile::set_min_max_xy | ( | float | x, |
float | y | ||
) | [protected] |
Set Bounding Box Min and Max x, y.
Definition at line 200 of file vul_psfile.cxx.
void vul_psfile::set_min_max_xy | ( | int | x, |
int | y | ||
) | [protected] |
Set Bounding Box Min and Max x, y.
Definition at line 212 of file vul_psfile.cxx.
void vul_psfile::set_paper_layout | ( | vul_psfile::paper_layout | layout | ) | [inline] |
Definition at line 43 of file vul_psfile.h.
void vul_psfile::set_paper_orientation | ( | vul_psfile::paper_orientation | o | ) | [inline] |
Definition at line 44 of file vul_psfile.h.
void vul_psfile::set_paper_type | ( | vul_psfile::paper_type | type | ) | [inline] |
Definition at line 42 of file vul_psfile.h.
bool vul_psfile::set_parameters | ( | int | sizex, |
int | sizey | ||
) | [protected] |
Set ox, oy , iw, ih, iwf, ihf parameters for PostScript file use.
Definition at line 517 of file vul_psfile.cxx.
void vul_psfile::set_reduction_factor | ( | int | rf | ) | [inline] |
Definition at line 45 of file vul_psfile.h.
void vul_psfile::set_scale_x | ( | float | sx | ) | [inline] |
set the horizontal scaling (in percent); no scaling is 100.
Definition at line 47 of file vul_psfile.h.
void vul_psfile::set_scale_y | ( | float | sy | ) | [inline] |
set the vertical scaling (in percent); no scaling is 100.
Definition at line 49 of file vul_psfile.h.
void vul_psfile::sobj_rgb_params | ( | char const * | str, |
bool | filled | ||
) | [protected] |
float vul_psfile::bg_b [private] |
Definition at line 97 of file vul_psfile.h.
float vul_psfile::bg_g [private] |
Definition at line 97 of file vul_psfile.h.
float vul_psfile::bg_r [private] |
Definition at line 97 of file vul_psfile.h.
int vul_psfile::box_height [private] |
Definition at line 113 of file vul_psfile.h.
int vul_psfile::box_width [private] |
Definition at line 113 of file vul_psfile.h.
bool vul_psfile::doneps [private] |
Definition at line 110 of file vul_psfile.h.
bool vul_psfile::exist_image [private] |
Definition at line 122 of file vul_psfile.h.
bool vul_psfile::exist_objs [private] |
Definition at line 123 of file vul_psfile.h.
float vul_psfile::fg_b [private] |
Definition at line 96 of file vul_psfile.h.
float vul_psfile::fg_g [private] |
Definition at line 96 of file vul_psfile.h.
float vul_psfile::fg_r [private] |
Definition at line 96 of file vul_psfile.h.
vcl_string vul_psfile::filename [private] |
Definition at line 105 of file vul_psfile.h.
bool vul_psfile::graphics_prolog_exists [private] |
Definition at line 121 of file vul_psfile.h.
vcl_streampos vul_psfile::header_pos [private] |
Definition at line 119 of file vul_psfile.h.
int vul_psfile::height [private] |
Definition at line 104 of file vul_psfile.h.
int vul_psfile::ih [private] |
Definition at line 100 of file vul_psfile.h.
double vul_psfile::ihf [private] |
Definition at line 101 of file vul_psfile.h.
int vul_psfile::iw [private] |
Definition at line 100 of file vul_psfile.h.
double vul_psfile::iwf [private] |
Definition at line 101 of file vul_psfile.h.
float vul_psfile::line_width_ [private] |
Definition at line 98 of file vul_psfile.h.
int vul_psfile::max_x [private] |
Definition at line 112 of file vul_psfile.h.
int vul_psfile::max_y [private] |
Definition at line 112 of file vul_psfile.h.
int vul_psfile::min_x [private] |
Definition at line 111 of file vul_psfile.h.
int vul_psfile::min_y [private] |
Definition at line 111 of file vul_psfile.h.
vcl_ofstream vul_psfile::output_filestream [private] |
Definition at line 94 of file vul_psfile.h.
int vul_psfile::ox [private] |
Definition at line 100 of file vul_psfile.h.
int vul_psfile::oy [private] |
Definition at line 100 of file vul_psfile.h.
double vul_psfile::pos_inx [private] |
Definition at line 103 of file vul_psfile.h.
double vul_psfile::pos_iny [private] |
Definition at line 103 of file vul_psfile.h.
paper_layout vul_psfile::printer_paper_layout [private] |
Definition at line 108 of file vul_psfile.h.
Definition at line 107 of file vul_psfile.h.
paper_type vul_psfile::printer_paper_type [private] |
Definition at line 106 of file vul_psfile.h.
double vul_psfile::psizex [private] |
Definition at line 102 of file vul_psfile.h.
double vul_psfile::psizey [private] |
Definition at line 102 of file vul_psfile.h.
int vul_psfile::reduction_factor [private] |
Definition at line 109 of file vul_psfile.h.
float vul_psfile::scale_x [private] |
Definition at line 99 of file vul_psfile.h.
float vul_psfile::scale_y [private] |
Definition at line 99 of file vul_psfile.h.
vcl_streampos vul_psfile::sobj_t_pos [private] |
Definition at line 118 of file vul_psfile.h.
vcl_streampos vul_psfile::translate_pos [private] |
Definition at line 117 of file vul_psfile.h.
int vul_psfile::width [private] |
Definition at line 104 of file vul_psfile.h.