GSurface Class Reference

Base class API for graphics operations. More...

#include <Gdc2.h>

Inheritance diagram for GSurface:

GMemDC GPrintDC GScreenDC GImageList

List of all members.

Public Member Functions

virtual bool HasAlpha ()
 Returns true if this Surface has an alpha channel.
virtual bool HasAlpha (bool b)
 Creates or destroys the alpha channel for this surface.
bool DrawOnAlpha ()
 Returns true if we are drawing on the alpha channel.
bool DrawOnAlpha (bool Draw)
 True if you want to edit the alpha channel rather than the colour bits.
GSurfaceAlphaDC ()
 Returns the surface of the alpha channel.
virtual COLOUR Colour ()
 Gets the current colour.
virtual COLOUR Colour (COLOUR c, int Bits=0)
 Sets the current colour.
virtual int Op ()
 Gets the current blending mode in operation.
virtual int Op (int Op)
virtual int X ()
 Gets the width in pixels.
virtual int Y ()
 Gets the height in pixels.
virtual int GetLine ()
 Gets the length of a scanline in bytes.
virtual int DpiX ()
 Returns the horizontal resolution of the device.
virtual int DpiY ()
 Returns the vertical resolution of the device.
virtual int GetBits ()
 Gets the bits per pixel.
virtual int PixelSize ()
 Gets the bytes per pixels.
virtual class GScreenDCIsScreen ()
 Returns true if the surface is on the screen.
virtual bool IsPrint ()
 Returns true if the surface is for printing.
virtual uchar * operator[] (int y)
 Returns a pointer to the start of a scanline, or NULL if not available.
virtual void GetOrigin (int &x, int &y)
 Gets the surface origin.
virtual void SetOrigin (int x, int y)
 Sets the surface origin.
virtual void Set (int x, int y)
 Sets a pixel with the current colour.
virtual COLOUR Get (int x, int y)
 Gets a pixel (doesn't work on some types of image, i.e. GScreenDC).
virtual void HLine (int x1, int x2, int y)
 Draw a horizontal line in the current colour.
virtual void VLine (int x, int y1, int y2)
 Draw a vertical line in the current colour.
virtual void Line (int x1, int y1, int x2, int y2)
 Draw a line in the current colour.
virtual void Circle (double cx, double cy, double radius)
 Stroke a circle in the current colour.
virtual void FilledCircle (double cx, double cy, double radius)
 Fill a circle in the current colour.
virtual void Arc (double cx, double cy, double radius, double start, double end)
 Stroke an arc in the current colour.
virtual void FilledArc (double cx, double cy, double radius, double start, double end)
 Fill an arc in the current colour.
virtual void Ellipse (double cx, double cy, double x, double y)
 Stroke an ellipse in the current colour.
virtual void FilledEllipse (double cx, double cy, double x, double y)
 Fill an ellipse in the current colour.
virtual void Box (int x1, int y1, int x2, int y2)
 Stroke a rectangle in the current colour.
virtual void Box (GRect *a=NULL)
 Stroke a rectangle in the current colour.
virtual void Rectangle (int x1, int y1, int x2, int y2)
 Fill a rectangle in the current colour.
virtual void Rectangle (GRect *a=NULL)
 Fill a rectangle in the current colour.
virtual void Blt (int x, int y, GSurface *Src, GRect *a=NULL)
 Copy an image onto the surface.
virtual void StretchBlt (GRect *d, GSurface *Src, GRect *s)
 Not implemented.
virtual void Polygon (int Points, GdcPt2 *Data)
 Fill a polygon in the current colour.
virtual void Bezier (int Threshold, GdcPt2 *Pt)
 Stroke a bezier in the current colour.
virtual void FloodFill (int x, int y, int Mode, COLOUR Border=0, GRect *Bounds=NULL)
 Flood fill in the current colour (doesn't work on a GScreenDC).

Friends

class GFilter
class GView
class GWindow


Detailed Description

Base class API for graphics operations.

Member Function Documentation

void GSurface::Blt ( int  x,
int  y,
GSurface Src,
GRect a = NULL 
) [virtual]

void GSurface::Box ( GRect a = NULL  )  [virtual]

Stroke a rectangle in the current colour.

Parameters:
a  The rectangle, or NULL to stroke the edge of the entire surface

Reimplemented in GScreenDC.

References HLine(), GRect::Normal(), Set(), VLine(), X(), GRect::x1, GRect::x2, Y(), GRect::y1, and GRect::y2.

COLOUR GSurface::Colour ( COLOUR  c,
int  Bits = 0 
) [virtual]

Sets the current colour.

Parameters:
c  The new colour
Bits  The bit depth of the new colour or 0 to indicate the depth is the same as the current Surface

Reimplemented in GScreenDC.

References GApplicator::c, CBit(), and GetBits().

void GSurface::FloodFill ( int  x,
int  y,
int  Mode,
COLOUR  Border = 0,
GRect Bounds = NULL 
) [virtual]

Flood fill in the current colour (doesn't work on a GScreenDC).

Parameters:
x  Start x coordinate
y  Start y coordinate
Mode  Use GDC_FILL_TO_DIFFERENT, GDC_FILL_TO_BORDER or GDC_FILL_NEAR
Border  Fill colour
Bounds  The bounds of the filled area or NULL if you don't care

Reimplemented in GScreenDC.

References GDC_FILL_NEAR, GDC_FILL_TO_BORDER, GDC_FILL_TO_DIFFERENT, GRect::Union(), GRect::x1, GRect::x2, GRect::y1, and GRect::y2.

int GSurface::Op ( int  Op  )  [virtual]

Sets the current blending mode in operation

See also:
GDC_SET, GDC_AND, GDC_OR, GDC_XOR and GDC_ALPHA

Reimplemented in GScreenDC.

References Colour(), DrawOnAlpha(), GDC_SET, and GApplicator::GetOp().

void GSurface::Rectangle ( GRect a = NULL  )  [virtual]

Fill a rectangle in the current colour.

Parameters:
a  The rectangle, or NULL to fill the entire surface

Reimplemented in GScreenDC.

References GRect::Bound(), GRect::Normal(), GApplicator::Rectangle(), GApplicator::SetPtr(), GRect::Valid(), GRect::X(), GRect::x1, GRect::Y(), GRect::y1, and GRect::ZOff().


The documentation for this class was generated from the following files:

Generated on Wed Dec 1 15:41:04 2010 for Lgi by  doxygen 1.5.7.1