Subsections

 
6.2 OEDepictBase

The Clip* methods are just bounds checking versions of the Draw* methods. Only use the Draw* methods if it is known that the bounds are being obeyed. The methods with the *F suffix take floating point arguments instead of integers. This only matters for formats that can take floating point measurements (eg: postscript), otherwise the default is to round to an integer and call the integer equivalent.

class OEDepictBase

The OEDepictBase abstract base class defines a device-independent interface for common 2D drawing operations, such as drawing points, lines, rectangles and circles.

6.2.1 Clear

void Clear(int col)

Clear the current drawing area to the specified color.

The color argument, col, should be a color handle returned by the OEDepictBase::Color method for this class.

6.2.2 ClipCenterString

virtual void ClipCenterString(int x, int y, const char *str, int c, int dx)
Place a string str of length dx at the co-ordinates x1,y1 in the color c.

6.2.3 ClipCenterStringF

virtual void ClipCenterStringF(float x, float y, const char *str,
                               int c, float dx)
Same as ClipCenterString, but takes floating point values.

6.2.4 ClipLine

void ClipLine(int x1, int y1, int x2, int y2, int c)

Draw a one pixel wide line from the co-ordinates x1,y1 to x2,y2 with color c.

The co-ordinates for this function need not be within the current drawing area, in which case this operation will clip the primitive to the current drawing area.

The color argument, c, should be a color handle returned by the OEDepictBase::Color method for this class.

6.2.5 ClipPoint

void ClipPoint(int x, int y, int c)

Plot a one pixel point at the co-ordinates x,y with color c.

The co-ordinates for this function need not be within the current drawing area, in which case this operation will clip the primitive to the current drawing area.

The color argument, c, should be a color handle returned by the OEDepictBase::Color method for this class.

6.2.6 Color

int Color(unsigned char r, unsigned char g, unsigned char b)

Retrieve (or assign) a suitable color handle (index) for a specified color. The required color is specified by the r, g and b arguments which specify the 8-bit red, green and blue components of the color. The returned value provides the ``color handle'' to be passed to the other drawing functions. The encoding of colour is implementation specific, for example, an index into a color palette for some drivers.

6.2.7 DrawLine

void DrawLine(int x1, int y1, int x2, int y2, int c)

Draw a one pixel wide line from the co-ordinates x1,y1 to x2,y2 with color c.

The co-ordinates for this function must all be within the current drawing area.

The color argument, c, should be a color handle returned by the OEDepictBase::Color method for this class.

6.2.8 DrawPoint

void DrawPoint(int x, int y, int c)

6.2.9 GetXSize

int GetXSize() const

Get the current width of the OEDepictBase in pixels. The dimensions of the OEDepictBase drawing area may be specified either when the class is constructed or by using the OEDepictBase::Resize method.

6.2.10 GetYSize

int GetYSize() const

Get the current height of the OEDepictBase in pixels. The dimensions of the OEDepictBase drawing area may be specified either when the class is constructed or by using the OEDepictBase::Resize method.

6.2.11 Resize

bool Resize(int x, int y)

Attempt resize the current drawing area to the specified dimensions. The x and y arguments denote the required width and height in pixels respectively. This function returns true, if the operation was successful, and false if it failed.

Some OEDepictBase implementations prohibit the resizing once drawing has started. Some implementations attempt to preserve the contents of the current drawing area, whilst others implicitly clear their contents (using OEDepictBase::Clear) upon resizing.