28 #ifndef TRIALDISPLAY_PSDRIVER_H
29 #define TRIALDISPLAY_PSDRIVER_H
172 void For(
const char *);
177 void Title(
const char *);
188 void setMargins(
const float lm,
const float rm,
189 const float tm,
const float bm,
195 float &tm,
float &bm);
233 const float x0,
const float y0,
234 const float x1,
const float y1,
237 const float x0,
const float y0,
238 const float x1,
const float y1,
242 const float x0,
const float y0,
243 const float x1,
const float y1,
246 const float x0,
const float y0,
247 const float x1,
const float y1,
266 void setColor(
const float rh,
const float gs,
const float bv);
279 void setRGBColor(
const float r,
const float g,
const float b);
283 void setHSBColor(
const float h,
const float s,
const float b);
292 const float *r,
const float *g,
const float *b);
296 const float *a,
const float *b,
const float *
c);
299 const float r,
const float g,
const float b);
308 void translate(
const float x,
const float y);
310 void scale(
const float x,
const float y);
312 void rotate(
const float degrees);
349 void drawImage(
const float x0,
const float y0,
350 const int width,
const int height,
351 const float xsize,
const float ysize,
354 const int imageopts=0);
371 void moveTo(
const float x,
const float y);
372 void lineTo(
const float x,
const float y,
const int stroke=1);
374 void drawPolygon(
const int len,
const float *x,
const float *y,
376 void drawPolyline(
const int len,
const float *x,
const float *y,
377 const int close=0,
const int fill=0);
378 void drawLine(
const float x0,
const float y0,
379 const float x1,
const float y1);
380 void drawLines(
const int len,
const float *x1,
const float *y1,
381 const float *x2,
const float *y2);
383 const float x1,
const float y1,
const int fill=0);
385 const float x1,
const float y1);
386 void drawPoint(
const float x,
const float y,
const float radius=1.0);
387 void drawPoints(
const int len,
const float *x,
const float *y,
388 const float radius=1.0);
390 const float *colors,
const float radius=1.0);
401 void drawText(
const float x,
const float y,
const char *str,
403 const float angle = 0);
426 void pageSize(
float &width,
float &height,
460 void clipRect(
const float x0,
const float y0,
461 const float width,
const float height);
476 const int inlength,
char *
out);
486 const int height,
char *
out);
495 static char *
encodeUShorts(
const int width,
const int height,
505 return in*(25.4/72.0);
511 return in*(72./25.4);
521 float &xout,
float &yout,
527 float &xout,
float &yout,
594 void drawImage(
const float imagematrix[6],
595 const int width,
const int height,
636 void emitMoveTo(
const float x,
const float y);
638 void emitPolyline(
const int len,
const float *x,
const float *y,
639 const int close,
const int fill);
640 void emitPolygon(
const int len,
const float *x,
const float *y,
642 void emitLine(
const float x0,
const float y0,
643 const float x1,
const float y1);
644 void emitLines(
const int len,
const float *x1,
const float *y1,
645 const float *x2,
const float *y2);
647 const float width,
const float height,
649 void emitPoint(
const float x,
const float y,
const float radius=1.0);
650 void emitPoints(
const int len,
const float *x,
const float *y,
651 const float radius=1.0);
655 void emitScale(
const float x,
const float y);
662 void emitText(
const float x,
const float y,
const char *str,
664 const float angle = 0);
677 const int width,
const int height,
const int bpc,
678 const int smooth,
const char *ascii85,
const int len,
684 const float *a,
const float *b,
const float *
c);
688 const float *a,
const float *b,
const float *
c);
695 const float r,
const float g,
const float b);
699 const float a,
const float b,
const float c);
708 const float width,
const float height);
720 void scale(
const float x,
const float y);
721 void translate(
const float x,
const float y);
722 void rotate(
const float degrees);
724 inline void toPoints(
const float xin,
const float yin,
725 float &xout,
float &yout,
727 xout = (float)(
a_*xin +
c_*yin);
728 yout = (float)(
b_*xin +
d_*yin);
737 float &xout,
float &yout,
739 xout = (float)(
ai_*xin +
ci_*yin);
740 yout = (float)(
bi_*xin +
di_*yin);
750 void setXY(
const float x,
const float y,
PSDriver::Dimension dimension
void rotate(const float degrees)
Rotate by # degrees.
void setRGBColor(const float r, const float g, const float b)
void setHSBColor(const float h, const float s, const float b)
void emitShowPage(const int force=0)
static float fromPoints(const float in, const Dimension indem)
void emitScale(const float x, const float y)
Scale.
void setHSVColor(const float h, const float s, const float v)
void drawPoints(const int len, const float *x, const float *y, const float radius=1.0)
void drawLine(const float x0, const float y0, const float x1, const float y1)
void setLinearRamps(const int ncolors)
Load linear ramps (0..1.0) into the first ncolors entries.
static int numPageTypes()
void lineTo(const float x, const float y, const int stroke=1)
ColorSpace colorSpace() const
casacore::String comment_
struct casa::PSDriver::PageInfo pageinfo_
The PageInfo struct is used internally to supply descriptions of the various page types...
Low level interface between PSPixelCanvas{ColorTable} and PostScript.
void setFont(const char *fn)
Holds our copy of the current transformation matrix.
void emitPolygon(const int len, const float *x, const float *y, const int fill)
void storeColorValues(const int len, const int *indexes, const float *a, const float *b, const float *c)
Scatter load the colortable.
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.
void init(std::ostream &output, const ColorSpace cs, const PageInfo *, const Layout, PSInfo *)
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 w...
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.
void emitStoreColor(const int index, const float r, const float g, const float b)
Load one value into color table.
void setXY(const float x, const float y, const casacore::Bool userCoords=true)
Set/Get the current position.
void setDashLength(const float length)
Set the length of dashes.
PSState statestack_[STATESTACKLENGTH]
void emitRectangle(const float x, const float y, const float width, const float height, const int fill)
void fromPoints(const float xin, const float yin, float &xout, float &yout, const casacore::Bool absolute=true) const
[ x y 1 ] = [ x' y' 1] * inverse(CTM);
const casacore::String & Creator() const
const char * dimensionToString() const
void drawColoredPoints(const int len, const float *x, const float *y, const float *colors, const float radius=1.0)
void emitPoint(const float x, const float y, const float radius=1.0)
static float toPoints(const float in, const Dimension indem)
void setCurrXY(const float x, const float y, const casacore::Bool userCoords=true)
void emitColorSpace(const ColorSpace)
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the if a human readable name(i.e."black").In many places throughout the plotter
void emitBackgroundColor(const float a, const float b, const float c, const ColorSpace cs)
void emitLines(const int len, const float *x1, const float *y1, const float *x2, const float *y2)
casacore::Bool haveBoundingBox() const
Returns true if bounding box size was given to the constructor.
void drawPoint(const float x, const float y, const float radius=1.0)
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.
casacore::Bool haveBoundingBox_
static const PSDriver::PageInfo * getPageInfo(const int indx)
Return page description for index indx.
void toPoints(const float xin, const float yin, float &xout, float &yout, const casacore::Bool absolute=true) const
[ x' y' 1 ] = [ x y 1] * CTM
The PageInfo struct is used internally to supply descriptions of the various page types...
static const PSDriver::PageInfo * lookupPageInfo(const char *name)
Lookup for a page description using the name field.
void translate(const float x, const float y)
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)
ABSTRACT CLASSES Deliberately vague to be general enough to allow for many different types of data
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.
reference point aligned to center of text
casacore::String creator_
void emitLine(const float x0, const float y0, const float x1, const float y1)
void emitHeader()
Code writers.
void initname(const casacore::String &name, const ColorSpace cs, const PageInfo *, const Layout, PSInfo *)
reference point aligned to bottom right corner of text
const casacore::String & Comment() const
void lineWidth(const float w)
w = 1.0 means 0.005".
void emitClipRect(const float x0, const float y0, const float width, const float height)
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.
void gsave()
Save/restore graphics state.
void findFont(const char *fn, const float scale)
Use font with supplied scaling.
void storeColor(const int index, const float r, const float g, const float b)
Store 1 color.
void scale(const float x, const float y)
void moveTo(const float x, const float y)
LineStyle
Different line types that can be drawn.
void emitLineWidth(const float w)
static const PSDriver::PageInfo * pageInfo(const PSDriver::MediaSize)
Given a paper type, return a pointer to its description.
void emitMoveTo(const float x, const float y)
const casacore::String & Title() const
reference point aligned to top right corner of text
LatticeExprNode length(const LatticeExprNode &expr, const LatticeExprNode &axis)
2-argument function to get the length of an axis.
void fromPoints(const float xin, const float yin, float &xout, float &yout, const casacore::Bool absolute=true) const
void smooth(CalSet< casacore::Complex > &cs, const casacore::String &smtype, const casacore::Double &smtime, casacore::Vector< casacore::Int > selfields)
Globals.
static float pointsToInches(const float in)
Miscellaneous functions to convert between typical scalings.
PSDriver()
Generic PostScript.
void rotate(const float degrees)
reference point aligned to center ot top edge of text
The following lists the known media types (paper sizes).
void getCurrXY(float &x, float &y, const casacore::Bool userCoords=true)
reference point aligned to center of right edge of text
void emitSetColor(const ColorSpace cs, const int index)
Set curren`t color.
static float inchesToPoints(const float in)
casacore::Bool checkBoundingBox_
void drawPolygon(const int len, const float *x, const float *y, const int fill=0)
bool Bool
Define the standard types used by Casacore.
PSDriver::MediaSize media
float getDefaultFontScale() const
static int bytesToAscii85(const char *in, const int inlength, char *out)
casacore::Bool isEPS() const
Is the output EPS? Portrait?
void drawPolyline(const int len, const float *x, const float *y, const int close=0, const int fill=0)
void emitTranslate(const float x, const float y)
Change origin.
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.
static float pointsToMM(const float in)
void emitLineStyle(const LineStyle)
void emitSetLinearRamps(const int ncolors)
Load color first ncolors entries in the tables with linear ramps scaled 0..1.
static int uShorts8ToAscii85(const casacore::uShort *in, const int inlength, char *out)
void emitBoundingBox()
Write value of bounding box to output.
void clipRect(const float x0, const float y0, const float width, const float height)
Set clipping rectangle.
void emitRotate(const float degrees)
Rotate by degrees.
void getXY(float &x, float &y, const casacore::Bool userCoords=true)
void setIndexColor(const float indx)
Change color space then set color.
ColorSpace
The various color spaces PSDriver knows about.
casacore::Bool getBoundingBox(float &x0, float &y0, float &x1, float &y1, const casacore::Bool userCoords=true) const
Return bounding box.
static float mmToPoints(const float in)
void setMargins(const float lm, const float rm, const float tm, const float bm, const Dimension dim=PSDriver::INCHES)
void emitLineTo(const float x, const float y, const int stroke=1)
void emitDashLength(const float length)
reference point aligned to center of bottom edge of text
void pushMatrix()
Push/pop transform matrix.
void drawLines(const int len, const float *x1, const float *y1, const float *x2, const float *y2)
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.
void flush()
Flush the output.
void emitFindFont(const char *fn, const float scale)
const Double c
Fundamental physical constants (SI units):
casacore::Bool getMargins(float &lm, float &rm, float &tm, float &bm)
If setMargins has been called, returns true and the margin values.
casacore::Bool haveMargins_
void emitPolyline(const int len, const float *x, const float *y, const int close, const int fill)
String: the storage and methods of handling collections of characters.
float clipXll_
Clipping rectangle in points.
static char * encodeUShorts(const int width, const int height, int &bpc, const casacore::uShort *data, int &outlen)
Encode data as ASCII85 chars.
void translate(const float x, const float y)
Current transform matrix is changed by the given values, not replaced.
void setColorSpace(const ColorSpace)
Set/get desired color space.
float bbx0_
Bounding box in points.
void scale(const float x, const float y)
Change scale by x/y.
void drawFilledRectangle(const float x0, const float y0, const float x1, const float y1)
void setBackgroundColor(const float rh, const float gs, const float bv, const ColorSpace=RGB)
Color to be used for dashes.
casacore::Bool boxCheck0_
casacore::Bool isPortrait() const
void operator=(const PSState &)
void emitString(const char *str)
Just throw a string on the stack and leave it there.
void setLineStyle(const LineStyle)
const casacore::String & For() const
void emitPoints(const int len, const float *x, const float *y, const float radius=1.0)
reference point aligned to center of left edge of text
PSInfo is used to supply comment fields for the PostScript header and other information that needs to...
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the color(i.e.,"000000"for black) and
void pageSize(float &width, float &height, const casacore::Bool userCoords=true)
USERPAGE is used internally.
reference point aligned to top left corner of text
void comment(const char *)
Put a comment in the output file.
Dimension dimension() const
void setColor(const float rh, const float gs, const float bv)
Set current color used for text and vectors.
void drawRectangle(const float x0, const float y0, const float x1, const float y1, const int fill=0)
void setDefaultFontScale(const float scl)
Set/Get font scaling used with setFont.
reference point aligned to bottom left corner of text