casa
5.7.0-16
|
Low level interface between PSPixelCanvas{ColorTable} and PostScript. More...
#include <PSDriver.h>
Classes | |
struct | PageInfo |
The PageInfo struct is used internally to supply descriptions of the various page types. More... | |
class | PSInfo |
PSInfo is used to supply comment fields for the PostScript header and other information that needs to be available when the PSDriver object is created. More... | |
class | PSState |
Holds our copy of the current transformation matrix. More... | |
Public Member Functions | |
PSDriver () | |
Generic PostScript. More... | |
PSDriver (std::ostream &out) | |
PSDriver (const char *filename) | |
PSDriver (std::ostream &out, const MediaSize, const Layout=PORTRAIT, PSInfo *info=NULL) | |
PSDriver (const casacore::String &fname, const MediaSize, const Layout=PORTRAIT, PSInfo *info=NULL) | |
PSDriver (const char *fname, const MediaSize, const Layout=PORTRAIT, PSInfo *info=NULL) | |
PSDriver (std::ostream &out, const Dimension dim, const float x0, const float y0, const float x1, const float y1, const Layout=PORTRAIT, PSInfo *info=NULL) | |
PSDriver (const casacore::String &outname, const Dimension dim, const float x0, const float y0, const float x1, const float y1, const Layout=PORTRAIT, PSInfo *info=NULL) | |
PSDriver (const casacore::String &outname, const MediaSize, const Dimension dim, const float x0, const float y0, const float x1, const float y1, const Layout=PORTRAIT, PSInfo *info=NULL) | |
PSDriver (const char *outname, const Dimension dim, const float x0, const float y0, const float x1, const float y1, const Layout=PORTRAIT, PSInfo *info=NULL) | |
~PSDriver () | |
void | setColorSpace (const ColorSpace) |
Set/get desired color space. More... | |
ColorSpace | colorSpace () const |
void | setColor (const float rh, const float gs, const float bv) |
Set current color used for text and vectors. More... | |
void | setColor (const float color) |
Set color value for indexed and gray scale modes. More... | |
void | setBackgroundColor (const float rh, const float gs, const float bv, const ColorSpace=RGB) |
Color to be used for dashes. More... | |
void | setBackgroundColor (const float color, const ColorSpace=INDEXED) |
Set color value for indexed and gray scale modes. More... | |
void | setIndexColor (const float indx) |
Change color space then set color. More... | |
void | setRGBColor (const float r, const float g, const float b) |
void | setHSVColor (const float h, const float s, const float v) |
void | setHSBColor (const float h, const float s, const float b) |
void | storeColors (const int start, const int len, const float *r, const float *g, const float *b) |
Load color tables with contents of a, b & c. More... | |
void | storeColorValues (const int len, const int *indexes, const float *a, const float *b, const float *c) |
Scatter load the colortable. More... | |
void | storeColor (const int index, const float r, const float g, const float b) |
Store 1 color. More... | |
void | setLinearRamps (const int ncolors) |
Load linear ramps (0..1.0) into the first ncolors entries. More... | |
void | translate (const float x, const float y) |
Current transform matrix is changed by the given values, not replaced. More... | |
void | scale (const float x, const float y) |
Change scale by x/y. More... | |
void | rotate (const float degrees) |
Rotate by # degrees. More... | |
void | setDashLength (const float length) |
Set the length of dashes. More... | |
void | drawImage (const float x0, const float y0, const int width, const int height, const float xsize, const float ysize, const casacore::uShort *data, const int bpc=0, const ColorSpace=INDEXED, const int imageopts=0) |
void | gsave () |
Save/restore graphics state. More... | |
void | grestore () |
void | setLineStyle (const LineStyle) |
void | lineWidth (const float w) |
w = 1.0 means 0.005". More... | |
void | moveTo (const float x, const float y) |
void | lineTo (const float x, const float y, const int stroke=1) |
void | drawPolygon (const int len, const float *x, const float *y, const int fill=0) |
void | drawPolyline (const int len, const float *x, const float *y, const int close=0, const int fill=0) |
void | drawLine (const float x0, const float y0, const float x1, const float y1) |
void | drawLines (const int len, const float *x1, const float *y1, const float *x2, const float *y2) |
void | drawRectangle (const float x0, const float y0, const float x1, const float y1, const int fill=0) |
void | drawFilledRectangle (const float x0, const float y0, const float x1, const float y1) |
void | drawPoint (const float x, const float y, const float radius=1.0) |
void | drawPoints (const int len, const float *x, const float *y, const float radius=1.0) |
void | drawColoredPoints (const int len, const float *x, const float *y, const float *colors, const float radius=1.0) |
void | drawText (const float x, const float y, const char *str, const TextAlign algn=AlignBottomLeft, const float angle=0) |
br><strong>Caution:</strong><em> PSDriver just passes the name to the output file; It can't know whether the font really exists on the output device; | |
void | setFont (const char *fn) |
void | findFont (const char *fn, const float scale) |
Use font with supplied scaling. More... | |
void | setDefaultFontScale (const float scl) |
Set/Get font scaling used with setFont. More... | |
float | getDefaultFontScale () const |
void | pageSize (float &width, float &height, const casacore::Bool userCoords=true) |
casacore::Bool | getBoundingBox (float &x0, float &y0, float &x1, float &y1, const casacore::Bool userCoords=true) const |
Return bounding box. More... | |
casacore::Bool | haveBoundingBox () const |
Returns true if bounding box size was given to the constructor. More... | |
void | comment (const char *) |
Put a comment in the output file. More... | |
void | comment (const casacore::String &) |
void | pushMatrix () |
Push/pop transform matrix. More... | |
void | popMatrix () |
void | newPage () |
void | flush () |
Flush the output. More... | |
void | finish () |
Done. More... | |
void | clipRect (const float x0, const float y0, const float width, const float height) |
Set clipping rectangle. More... | |
void | toPoints (const float xin, const float yin, float &xout, float &yout, const casacore::Bool absolute=true) const |
Do forward or reverse transformation on a point. More... | |
void | fromPoints (const float xin, const float yin, float &xout, float &yout, const casacore::Bool absolute=true) const |
const char * | dimensionToString () const |
Dimension | dimension () const |
casacore::Bool | isEPS () const |
Is the output EPS? Portrait? More... | |
casacore::Bool | isPortrait () const |
Static Public Member Functions | |
static int | bytesToAscii85 (const char *in, const int inlength, char *out) |
static int | uShorts8ToAscii85 (const casacore::uShort *in, const int inlength, char *out) |
static int | uShorts12ToAscii85 (const casacore::uShort *in, const int width, const int height, char *out) |
Converts in to ASCII85 bytes using only lower 12 bits of each integer. More... | |
static char * | encodeUShorts (const int width, const int height, int &bpc, const casacore::uShort *data, int &outlen) |
Encode data as ASCII85 chars. More... | |
static float | pointsToInches (const float in) |
Miscellaneous functions to convert between typical scalings. More... | |
static float | pointsToMM (const float in) |
static float | inchesToPoints (const float in) |
static float | mmToPoints (const float in) |
static float | toPoints (const float in, const Dimension indem) |
static float | fromPoints (const float in, const Dimension indem) |
static const char * | dimensionToString (const PSDriver::Dimension dim) |
Return a string representation of a dimension. More... | |
static const PSDriver::PageInfo * | pageInfo (const PSDriver::MediaSize) |
Given a paper type, return a pointer to its description. More... | |
static const PSDriver::PageInfo * | getPageInfo (const int indx) |
Return page description for index indx. More... | |
static const PSDriver::PageInfo * | lookupPageInfo (const char *name) |
Lookup for a page description using the name field. More... | |
static int | numPageTypes () |
Private Types | |
enum | { STATESTACKLENGTH } |
Length of internal state(transform) stack. More... | |
Private Member Functions | |
void | newPath () |
void | stroke () |
void | closePath () |
void | init (std::ostream &output, const ColorSpace cs, const PageInfo *, const Layout, PSInfo *) |
void | initname (const casacore::String &name, const ColorSpace cs, const PageInfo *, const Layout, PSInfo *) |
void | bbCheck (const float x, const float y, const casacore::Bool userCoords=true) |
Compare x/y to current bounding box. More... | |
void | bbCheck () |
void | setCurrXY (const float x, const float y, const casacore::Bool userCoords=true) |
void | getCurrXY (float &x, float &y, const casacore::Bool userCoords=true) |
void | startDocument () |
void | emitHeader () |
Code writers. More... | |
void | emitProlog () |
void | emitTrailer () |
void | emitShowPage (const int force=0) |
void | emitPageNum () |
void | emitSetup () |
void | emitColorSpace (const ColorSpace) |
void | emitLineStyle (const LineStyle) |
void | emitDashLength (const float length) |
void | emitLineWidth (const float w) |
void | emitMoveTo (const float x, const float y) |
void | emitLineTo (const float x, const float y, const int stroke=1) |
void | emitPolyline (const int len, const float *x, const float *y, const int close, const int fill) |
void | emitPolygon (const int len, const float *x, const float *y, const int fill) |
void | emitLine (const float x0, const float y0, const float x1, const float y1) |
void | emitLines (const int len, const float *x1, const float *y1, const float *x2, const float *y2) |
void | emitRectangle (const float x, const float y, const float width, const float height, const int fill) |
void | emitPoint (const float x, const float y, const float radius=1.0) |
void | emitPoints (const int len, const float *x, const float *y, const float radius=1.0) |
void | emitRotate (const float degrees) |
Rotate by degrees. More... | |
void | emitScale (const float x, const float y) |
Scale. More... | |
void | emitTranslate (const float x, const float y) |
Change origin. More... | |
void | emitFindFont (const char *fn, const float scale) |
void | emitText (const float x, const float y, const char *str, const TextAlign=AlignBottomLeft, const float angle=0) |
Draw text starting at point x, y. More... | |
void | emitString (const char *str) |
Just throw a string on the stack and leave it there. More... | |
void | emitImage (const float matrix[6], const int width, const int height, const int bpc, const int smooth, const char *ascii85, const int len, const ColorSpace=INDEXED) |
Draw a width x height PS image. More... | |
void | emitStoreColors (const int start, const int len, const float *a, const float *b, const float *c) |
Load color tables with contents of a, b & c. More... | |
void | emitStoreColorValues (const int len, const int *indexes, const float *a, const float *b, const float *c) |
Load color tables given an array of colors and their corresponding indexes. More... | |
void | emitStoreColors (const int color, const int start, const int len, const float *ary) |
Internal helper function. More... | |
void | emitStoreColor (const int index, const float r, const float g, const float b) |
Load one value into color table. More... | |
void | emitSetColor (const ColorSpace cs, const int index) |
Set curren`t color. More... | |
void | emitSetColor (const ColorSpace cs, const float a, const float b, const float c) |
void | emitSetLinearRamps (const int ncolors) |
Load color first ncolors entries in the tables with linear ramps scaled 0..1. More... | |
void | emitGSave () |
void | emitGRestore () |
void | emitPushMatrix () |
void | emitPopMatrix () |
void | emitClipRect (const float x0, const float y0, const float width, const float height) |
void | emitBackgroundColor (const float a, const float b, const float c, const ColorSpace cs) |
void | emitBoundingBox () |
Write value of bounding box to output. More... | |
void | pushState () |
void | popState () |
Private Attributes | |
int | statestackindex_ |
PSState | state_ |
PSState | statestack_ [STATESTACKLENGTH] |
std::ostream * | out |
std::fstream * | mystream_ |
ColorSpace | colorSpace_ |
Dimension | dimension_ |
casacore::Bool | portrait_ |
casacore::Bool | eps_ |
LineStyle | lineStyle_ |
float | defaultFontSize_ |
float | xscale_ |
float | yscale_ |
float | bbx0_ |
Bounding box in points. More... | |
float | bby0_ |
float | bbx1_ |
float | bby1_ |
casacore::Bool | boxCheck0_ |
casacore::Bool | haveBoundingBox_ |
casacore::Bool | checkBoundingBox_ |
float | xll_ |
user coords. More... | |
float | yll_ |
float | xur_ |
float | yur_ |
float | clipXll_ |
Clipping rectangle in points. More... | |
float | clipXur_ |
float | clipYll_ |
float | clipYur_ |
unsigned int | pageNum_ |
int | finished_ |
PSInfo * | info_ |
Low level interface between PSPixelCanvas{ColorTable} and PostScript.
Internal
PSDriver takes graphics requests from PSPixelCanvas and PSPixelCanvasColorTable and generates PostScript code. It might be thought of as playing an analogous role to what Xlib does for the X11PixelCanvas{ColorTable}. It could be used separately, but mostly programers will just create a PSDriver object to pass to PSPixelCanvas{ColorTable}.
While there are many constructors, PSDrivers will probably most frequently be created using something like:
If it were desired to use RGB colormode rather than INDEXED, the following could be added.
PSDriver is logically split into two sections. The 'upper' level contains public functions, such as drawLine(). These do various amounts of bookkeeping, such as bounding box calculations, then call the 'lower' level routines, typically with names starting with emit. (eg. emitLine() in this example).
There are many public routines that will rarely be called from outside of PSDriver. Typical of these are the various xxxToAscii85 routines that are used internally to generate image data.
does not currently explicitly throw any exceptions.
Notes:
Definition at line 109 of file PSDriver.h.
typedef struct casa::PSDriver::PageInfo casa::PSDriver::pageinfo_ |
The PageInfo struct is used internally to supply descriptions of the various page types.
anonymous enum |
Constants describing the the length of the indexed color table and the number of bits per color component.
Enumerator | |
---|---|
NUMCOLORS | |
BITSPERCOMPONENT |
Definition at line 116 of file PSDriver.h.
|
private |
Length of internal state(transform) stack.
Enumerator | |
---|---|
STATESTACKLENGTH |
Definition at line 764 of file PSDriver.h.
The various color spaces PSDriver knows about.
Enumerator | |
---|---|
UNKNOWNSPACE | |
INDEXED | |
GRAY | |
RGB | |
HSV | |
HSB |
Definition at line 112 of file PSDriver.h.
Enumerator | |
---|---|
POINTS | |
INCHES | |
MM |
Definition at line 117 of file PSDriver.h.
Enumerator | |
---|---|
NOIMGOPTS | |
SMOOTH |
Definition at line 128 of file PSDriver.h.
Enumerator | |
---|---|
PORTRAIT | |
LANDSCAPE | |
EPS | |
EPS_PORTRAIT | |
EPS_LANDSCAPE |
Definition at line 118 of file PSDriver.h.
Different line types that can be drawn.
Enumerator | |
---|---|
UNKNOWNSTYPE | |
SOLID | |
DASHED | |
DASHDASH |
Definition at line 114 of file PSDriver.h.
Definition at line 130 of file PSDriver.h.
Enumerator | |
---|---|
AlignCenter | |
AlignLeft | |
AlignTop | |
AlignRight | |
AlignBottom | |
AlignTopLeft | |
AlignTopRight | |
AlignBottomLeft | |
AlignBottomRight |
Definition at line 148 of file PSDriver.h.
casa::PSDriver::PSDriver | ( | ) |
Generic PostScript.
Arguments to the various constructors:
INDEXED, PORTRAIT to a default file.
casa::PSDriver::PSDriver | ( | std::ostream & | out | ) |
casa::PSDriver::PSDriver | ( | const char * | filename | ) |
casa::PSDriver::PSDriver | ( | std::ostream & | out, |
const MediaSize | , | ||
const Layout | = PORTRAIT , |
||
PSInfo * | info = NULL |
||
) |
casa::PSDriver::PSDriver | ( | const casacore::String & | fname, |
const MediaSize | , | ||
const Layout | = PORTRAIT , |
||
PSInfo * | info = NULL |
||
) |
casa::PSDriver::PSDriver | ( | const char * | fname, |
const MediaSize | , | ||
const Layout | = PORTRAIT , |
||
PSInfo * | info = NULL |
||
) |
casa::PSDriver::PSDriver | ( | std::ostream & | out, |
const Dimension | dim, | ||
const float | x0, | ||
const float | y0, | ||
const float | x1, | ||
const float | y1, | ||
const Layout | = PORTRAIT , |
||
PSInfo * | info = NULL |
||
) |
casa::PSDriver::PSDriver | ( | const casacore::String & | outname, |
const Dimension | dim, | ||
const float | x0, | ||
const float | y0, | ||
const float | x1, | ||
const float | y1, | ||
const Layout | = PORTRAIT , |
||
PSInfo * | info = NULL |
||
) |
casa::PSDriver::PSDriver | ( | const casacore::String & | outname, |
const MediaSize | , | ||
const Dimension | dim, | ||
const float | x0, | ||
const float | y0, | ||
const float | x1, | ||
const float | y1, | ||
const Layout | = PORTRAIT , |
||
PSInfo * | info = NULL |
||
) |
casa::PSDriver::PSDriver | ( | const char * | outname, |
const Dimension | dim, | ||
const float | x0, | ||
const float | y0, | ||
const float | x1, | ||
const float | y1, | ||
const Layout | = PORTRAIT , |
||
PSInfo * | info = NULL |
||
) |
casa::PSDriver::~PSDriver | ( | ) |
|
private |
Compare x/y to current bounding box.
x and y are in current user coordinates unless userCoords is false in which case they have already been transformed.
|
private |
|
static |
Routines to encode non negative binary numbers in ASCII85 format. There will be upto 5/4 as many output characters as input bytes. Returns the number of bytes written to out.
void casa::PSDriver::clipRect | ( | const float | x0, |
const float | y0, | ||
const float | width, | ||
const float | height | ||
) |
Set clipping rectangle.
Subsequent calls can only make the clipping rectangle smaller.
|
private |
|
inline |
Definition at line 256 of file PSDriver.h.
References colorSpace_.
void casa::PSDriver::comment | ( | const char * | ) |
Put a comment in the output file.
The comment may include newlines.
void casa::PSDriver::comment | ( | const casacore::String & | ) |
|
inline |
Definition at line 538 of file PSDriver.h.
References dimension_.
|
static |
Return a string representation of a dimension.
|
inline |
Definition at line 535 of file PSDriver.h.
References dimension_.
void casa::PSDriver::drawColoredPoints | ( | const int | len, |
const float * | x, | ||
const float * | y, | ||
const float * | colors, | ||
const float | radius = 1.0 |
||
) |
void casa::PSDriver::drawFilledRectangle | ( | const float | x0, |
const float | y0, | ||
const float | x1, | ||
const float | y1 | ||
) |
void casa::PSDriver::drawImage | ( | const float | x0, |
const float | y0, | ||
const int | width, | ||
const int | height, | ||
const float | xsize, | ||
const float | ysize, | ||
const casacore::uShort * | data, | ||
const int | bpc = 0 , |
||
const ColorSpace | = INDEXED , |
||
const int | imageopts = 0 |
||
) |
void casa::PSDriver::drawLine | ( | const float | x0, |
const float | y0, | ||
const float | x1, | ||
const float | y1 | ||
) |
void casa::PSDriver::drawLines | ( | const int | len, |
const float * | x1, | ||
const float * | y1, | ||
const float * | x2, | ||
const float * | y2 | ||
) |
void casa::PSDriver::drawPoint | ( | const float | x, |
const float | y, | ||
const float | radius = 1.0 |
||
) |
void casa::PSDriver::drawPoints | ( | const int | len, |
const float * | x, | ||
const float * | y, | ||
const float | radius = 1.0 |
||
) |
void casa::PSDriver::drawPolygon | ( | const int | len, |
const float * | x, | ||
const float * | y, | ||
const int | fill = 0 |
||
) |
void casa::PSDriver::drawPolyline | ( | const int | len, |
const float * | x, | ||
const float * | y, | ||
const int | close = 0 , |
||
const int | fill = 0 |
||
) |
void casa::PSDriver::drawRectangle | ( | const float | x0, |
const float | y0, | ||
const float | x1, | ||
const float | y1, | ||
const int | fill = 0 |
||
) |
void casa::PSDriver::drawText | ( | const float | x, |
const float | y, | ||
const char * | str, | ||
const TextAlign | algn = AlignBottomLeft , |
||
const float | angle = 0 |
||
) |
br><strong>Caution:</strong><em> PSDriver just passes the name to the output file;
It can't know whether the font really exists on the output device;
Set font using current font scaling.
Display a line of text. Tabs, newlines, etc. are not handled.
|
private |
|
private |
Write value of bounding box to output.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Code writers.
|
private |
Draw a width x height PS image.
matrix casacore::Matrix to convert between user & image space. width, height size of input image in pixels. bpc bits per color component. (8 or 12) smooth 0 - no smoothing, 1 - smooth pixels. ghostscript may core dump if not 0. ascii85 data encoded as ASCII85 chars. len length of data array.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Rotate by degrees.
|
private |
Scale.
(new scale = <old scale>="">*<new scale>="">.
|
private |
Set curren`t color.
|
private |
|
private |
Load color first ncolors entries in the tables with linear ramps scaled 0..1.
|
private |
|
private |
|
private |
Load one value into color table.
|
private |
Load color tables with contents of a, b & c.
Typically, a holds red, b holds green & c holds blue. Values should be in the range (0..1).
|
private |
Internal helper function.
|
private |
Load color tables given an array of colors and their corresponding indexes.
Much more effecient if indexes are consecutive.
|
private |
Just throw a string on the stack and leave it there.
|
private |
Draw text starting at point x, y.
Newlines, tabs, etc. are not handled.
|
private |
|
private |
Change origin.
|
static |
Encode data as ASCII85 chars.
casacore::Function return is an array of chars. (use delete [] to free). outlen is set to the number of bytes in the array. On input, if bpc is 8, data is treated as containing 1 byte per element. If bpc is 12, data is assumed to contain 12 bits/element. If bpc is 0, the array is scanned. On return, bpc is set the the value actually used.
void casa::PSDriver::findFont | ( | const char * | fn, |
const float | scale | ||
) |
Use font with supplied scaling.
void casa::PSDriver::finish | ( | ) |
Done.
Called by the destructor.
void casa::PSDriver::flush | ( | ) |
Flush the output.
|
static |
|
inline |
Definition at line 526 of file PSDriver.h.
References casa::PSDriver::PSState::fromPoints(), and state_.
casacore::Bool casa::PSDriver::getBoundingBox | ( | float & | x0, |
float & | y0, | ||
float & | x1, | ||
float & | y1, | ||
const casacore::Bool | userCoords = true |
||
) | const |
Return bounding box.
Return is true if a bounding box was declared initially. Otherwise, false and the current value of the bounding box will be returned. If userCoords is true, values are in current user coordinates. Otherwise, transformed coords.
|
inlineprivate |
Definition at line 619 of file PSDriver.h.
References casa::PSDriver::PSState::getXY(), and state_.
|
inline |
Definition at line 414 of file PSDriver.h.
References defaultFontSize_.
|
static |
Return page description for index indx.
void casa::PSDriver::grestore | ( | ) |
void casa::PSDriver::gsave | ( | ) |
Save/restore graphics state.
|
inline |
Returns true if bounding box size was given to the constructor.
Definition at line 438 of file PSDriver.h.
References haveBoundingBox_.
|
inlinestatic |
Definition at line 507 of file PSDriver.h.
|
private |
|
private |
|
inline |
|
inline |
Definition at line 547 of file PSDriver.h.
References portrait_.
void casa::PSDriver::lineTo | ( | const float | x, |
const float | y, | ||
const int | stroke = 1 |
||
) |
void casa::PSDriver::lineWidth | ( | const float | w | ) |
w = 1.0 means 0.005".
|
static |
Lookup for a page description using the name field.
|
inlinestatic |
Definition at line 510 of file PSDriver.h.
void casa::PSDriver::moveTo | ( | const float | x, |
const float | y | ||
) |
void casa::PSDriver::newPage | ( | ) |
|
private |
|
static |
|
static |
Given a paper type, return a pointer to its description.
void casa::PSDriver::pageSize | ( | float & | width, |
float & | height, | ||
const casacore::Bool | userCoords = true |
||
) |
Return page size (drawable area - margins). If userCoords is true, values are in current user coordinates. Otherwise, they are in transformed coordinates (points).
|
inlinestatic |
Miscellaneous functions to convert between typical scalings.
Definition at line 501 of file PSDriver.h.
|
inlinestatic |
Definition at line 504 of file PSDriver.h.
void casa::PSDriver::popMatrix | ( | ) |
|
private |
void casa::PSDriver::pushMatrix | ( | ) |
Push/pop transform matrix.
|
private |
void casa::PSDriver::rotate | ( | const float | degrees | ) |
Rotate by # degrees.
void casa::PSDriver::scale | ( | const float | x, |
const float | y | ||
) |
Change scale by x/y.
void casa::PSDriver::setBackgroundColor | ( | const float | rh, |
const float | gs, | ||
const float | bv, | ||
const ColorSpace | = RGB |
||
) |
Color to be used for dashes.
void casa::PSDriver::setBackgroundColor | ( | const float | color, |
const ColorSpace | = INDEXED |
||
) |
Set color value for indexed and gray scale modes.
void casa::PSDriver::setColor | ( | const float | rh, |
const float | gs, | ||
const float | bv | ||
) |
Set current color used for text and vectors.
Only the first argument is used for indexed & gray. For Indexed mode, color should be in the range (0..ncolors-1) where ncolors is the number of colors in the table. color is truncated to an integer. For the others, color should be in the range (0..1).
void casa::PSDriver::setColor | ( | const float | color | ) |
Set color value for indexed and gray scale modes.
If called when not in indexed or gray modes, the same value is used for all three components.
void casa::PSDriver::setColorSpace | ( | const ColorSpace | ) |
Set/get desired color space.
(Default is INDEXED).
|
inlineprivate |
Definition at line 615 of file PSDriver.h.
References casa::PSDriver::PSState::setXY(), and state_.
void casa::PSDriver::setDashLength | ( | const float | length | ) |
Set the length of dashes.
void casa::PSDriver::setDefaultFontScale | ( | const float | scl | ) |
Set/Get font scaling used with setFont.
void casa::PSDriver::setFont | ( | const char * | fn | ) |
void casa::PSDriver::setHSBColor | ( | const float | h, |
const float | s, | ||
const float | b | ||
) |
Referenced by setHSVColor().
|
inline |
Definition at line 280 of file PSDriver.h.
References setHSBColor().
void casa::PSDriver::setIndexColor | ( | const float | indx | ) |
Change color space then set color.
void casa::PSDriver::setLinearRamps | ( | const int | ncolors | ) |
Load linear ramps (0..1.0) into the first ncolors entries.
void casa::PSDriver::setLineStyle | ( | const LineStyle | ) |
void casa::PSDriver::setRGBColor | ( | const float | r, |
const float | g, | ||
const float | b | ||
) |
|
private |
void casa::PSDriver::storeColor | ( | const int | index, |
const float | r, | ||
const float | g, | ||
const float | b | ||
) |
Store 1 color.
void casa::PSDriver::storeColors | ( | const int | start, |
const int | len, | ||
const float * | r, | ||
const float * | g, | ||
const float * | b | ||
) |
Load color tables with contents of a, b & c.
Typically, a holds red, b holds green & c holds blue. Values should be in the range (0..1). May be called anytime, but values are only used in INDEXED mode. Start is starting index in the color table. Len is the number of entries to set.
void casa::PSDriver::storeColorValues | ( | const int | len, |
const int * | indexes, | ||
const float * | a, | ||
const float * | b, | ||
const float * | c | ||
) |
Scatter load the colortable.
Much more effecient if indexes are consecutive.
|
private |
|
static |
|
inline |
Do forward or reverse transformation on a point.
If absolute is false, the translations aren't done.
Definition at line 520 of file PSDriver.h.
References state_, and casa::PSDriver::PSState::toPoints().
void casa::PSDriver::translate | ( | const float | x, |
const float | y | ||
) |
Current transform matrix is changed by the given values, not replaced.
Change origin to x/y.
|
static |
Converts in to ASCII85 bytes using only lower 12 bits of each integer.
Out must be at least 1.75*inlength rounded up to a multiple of 5 bytes long. (<1.5bytes/entry>*<inlength entries>="">*<1.25 expansion>). If inlength is odd, a 0 valued entry will be implicitly added.
|
static |
|
private |
Bounding box in points.
Definition at line 778 of file PSDriver.h.
|
private |
Definition at line 779 of file PSDriver.h.
|
private |
Definition at line 778 of file PSDriver.h.
|
private |
Definition at line 779 of file PSDriver.h.
|
private |
Definition at line 780 of file PSDriver.h.
|
private |
Definition at line 782 of file PSDriver.h.
|
private |
Clipping rectangle in points.
Definition at line 789 of file PSDriver.h.
|
private |
Definition at line 789 of file PSDriver.h.
|
private |
Definition at line 790 of file PSDriver.h.
|
private |
Definition at line 790 of file PSDriver.h.
|
private |
Definition at line 770 of file PSDriver.h.
Referenced by colorSpace().
|
private |
Definition at line 775 of file PSDriver.h.
Referenced by getDefaultFontScale().
|
private |
Definition at line 771 of file PSDriver.h.
Referenced by dimension(), and dimensionToString().
|
private |
Definition at line 773 of file PSDriver.h.
Referenced by isEPS().
|
private |
Definition at line 793 of file PSDriver.h.
|
private |
Definition at line 781 of file PSDriver.h.
Referenced by haveBoundingBox().
|
private |
Definition at line 794 of file PSDriver.h.
|
private |
Definition at line 774 of file PSDriver.h.
|
private |
Definition at line 769 of file PSDriver.h.
|
private |
Definition at line 768 of file PSDriver.h.
|
private |
Definition at line 792 of file PSDriver.h.
|
private |
Definition at line 772 of file PSDriver.h.
Referenced by isPortrait().
|
private |
Definition at line 766 of file PSDriver.h.
Referenced by fromPoints(), getCurrXY(), setCurrXY(), and toPoints().
|
private |
Definition at line 767 of file PSDriver.h.
|
private |
Definition at line 765 of file PSDriver.h.
|
private |
|
private |
Definition at line 776 of file PSDriver.h.
|
private |
Definition at line 786 of file PSDriver.h.
|
private |
Definition at line 785 of file PSDriver.h.
|
private |
Definition at line 776 of file PSDriver.h.
|
private |
Definition at line 786 of file PSDriver.h.