// Purpose: interface of various wxGraphics* classes
// Author: wxWidgets team
// RCS-ID: $Id$
-// Licence: wxWindows license
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
/**
};
/**
- Anti-aliasing modes used by wxGraphicsContext::SetAntialisingMode
+ Anti-aliasing modes used by wxGraphicsContext::SetAntialiasMode().
*/
enum wxAntialiasMode
{
wxANTIALIAS_DEFAULT,
};
+/**
+ Interpolation quality used by wxGraphicsContext::SetInterpolationQuality().
+ */
+enum wxInterpolationQuality
+{
+ /** default interpolation, based on type of context, in general medium quality */
+ wxINTERPOLATION_DEFAULT,
+ /** no interpolation */
+ wxINTERPOLATION_NONE,
+ /** fast interpolation, suited for interactivity */
+ wxINTERPOLATION_FAST,
+ /** better quality */
+ wxINTERPOLATION_GOOD,
+ /** best quality, not suited for interactivity */
+ wxINTERPOLATION_BEST
+};
+
/**
Compositing is done using Porter-Duff compositions
(see http://keithp.com/~keithp/porterduff/p253-porter.pdf) with
- wxGraphicsContext::SetCompositionMode
+ wxGraphicsContext::SetCompositionMode().
The description give a short equation on how the values of a resulting
pixel are calculated.
*/
enum wxCompositionMode
{
+ /**
+ Indicates invalid or unsupported composition mode.
+
+ This value can't be passed to wxGraphicsContext::SetCompositionMode().
+
+ @since 2.9.2
+ */
+ wxCOMPOSITION_INVALID = -1,
wxCOMPOSITION_CLEAR, /**< @e R = 0 */
wxCOMPOSITION_SOURCE, /**< @e R = S */
wxCOMPOSITION_OVER, /**< @e R = @e S + @e D*(1 - @e Sa) */
wxCOMPOSITION_DEST_OUT, /**< @e R = @e D*(1 - @e Sa) */
wxCOMPOSITION_DEST_ATOP, /**< @e R = @e S*(1 - @e Da) + @e D*@e Sa */
wxCOMPOSITION_XOR, /**< @e R = @e S*(1 - @e Da) + @e D*(1 - @e Sa) */
- wxCOMPOSITION_ADD, /**< @e R = @e S + @e D */
+ wxCOMPOSITION_ADD /**< @e R = @e S + @e D */
};
*/
static wxGraphicsContext* Create(const wxPrinterDC& dc);
+ /**
+ Creates a wxGraphicsContext from a wxEnhMetaFileDC.
+
+ This function, as wxEnhMetaFileDC class itself, is only available only
+ under MSW.
+
+ @see wxGraphicsRenderer::CreateContext()
+ */
+ static wxGraphicsContext* Create(const wxEnhMetaFileDC& dc);
+
/**
Clips drawings to the specified region.
*/
/**
Creates a native brush with a radial gradient.
- The brush originats at (@a xo, @a yc) and ends on a circle around
+ The brush originates at (@a xo, @a yc) and ends on a circle around
(@a xc, @a yc) with the given @a radius.
The gradient may be specified either by its start and end colours @a
virtual void StrokeLines(size_t n, const wxPoint2DDouble* beginPoints,
const wxPoint2DDouble* endPoints);
/**
- Stroke disconnected lines from begin to end points, fastest method
- available for this purpose.
+ Stroke lines connecting all the points.
+
+ Unlike the other overload of this function, this method draws a single
+ polyline and not a number of disconnected lines.
*/
virtual void StrokeLines(size_t n, const wxPoint2DDouble* points);
*/
virtual wxAntialiasMode GetAntialiasMode() const ;
+ /**
+ Sets the interpolation quality, returns true if it supported
+ */
+ virtual bool SetInterpolationQuality(wxInterpolationQuality interpolation) = 0;
+
+ /**
+ Returns the current interpolation quality
+ */
+ virtual wxInterpolationQuality GetInterpolationQuality() const;
+
/**
Sets the compositing operator, returns true if it supported
*/
@param col The colour of this stop. Note that the alpha component of
the colour is honoured thus allowing the background colours to
partially show through the gradient.
- @param pos The stop position, must be in [0, 1) range with 0 being the
- beginning and 1 the end of the gradient (but it doesn't make sense
- to create a stop at position 1 because it would never be visible
- anyhow).
+ @param pos The stop position, must be in [0, 1] range with 0 being the
+ beginning and 1 the end of the gradient.
*/
- wxGraphicsGradientStop(wxColour col, float pos);
+ wxGraphicsGradientStop(wxColour col = wxTransparentColour, float pos = 0.);
/// Return the stop colour.
const wxColour& GetColour() const;
/**
Change the stop position.
- @param pos The new position, must always be in [0, 1) range.
+ @param pos The new position, must always be in [0, 1] range.
*/
void SetPosition(float pos);
};
*/
virtual wxGraphicsContext* CreateContext(const wxPrinterDC& dc) = 0 ;
+ /**
+ Creates a wxGraphicsContext from a wxEnhMetaFileDC.
+
+ This function, as wxEnhMetaFileDC class itself, is only available only
+ under MSW.
+ */
+ virtual wxGraphicsContext* CreateContext(const wxEnhMetaFileDC& dc) = 0;
+
/**
Creates a native brush from a wxBrush.
*/