#include <OSDLBackBufferedWidget.h>
Inheritance diagram for OSDL::Video::TwoDimensional::BackBufferedWidget:
Hence when a BackBufferedWidget has to be redrawn whereas this widget itself did not change (this happen for example whenever one of its subwidgets changes), instead of triggering a new rendering from scratch of this widget, its own cached rendering (which is cached in the inherited surface, called here the back-buffer) is blitted directly to the overall surface (the surface this back-buffered widget owns) and the usual mechanism for subwidgets apply, so that they are rendered on this latter surface.
The role of the inherited and the owned surfaces should not be reversed, since the current organization allows to use all the inherited drawing primitives without any modification : they apply directly to the inherited back-buffer surface, which is the source surface from which the overall one is created.
Caching the own rendering of a widget in a back-buffer is especially useful whenever this rendering demands resources, for example when complex text is to be rendered.
To repeat for the sake of clarity, rendering specific to this widget is done in the so-called 'back-buffer' (which is stored in the inherited surface), as opposed to the 'overall' owned surface which refers to this widget and all its subwidgets.
Definition at line 69 of file OSDLBackBufferedWidget.h.
Public Types | |
enum | BaseColorMode { BackgroundColor, Colorkey, None, NotInitialized } |
Describes the available modes for handling the base color of a widget. More... | |
enum | DisplayType { BackBuffer, ClassicalScreenSurface, OpenGLScreenSurface } |
Describes the display type of a surface :. More... | |
Public Member Functions | |
BackBufferedWidget (Surface &container, const Point2D &relativePosition, Length width, Length height, BaseColorMode baseColorMode, Pixels::ColorDefinition baseColor, const std::string &title="", bool minMaximizable=true, bool draggable=true, bool wrappable=true, bool closable=true) throw ( VideoException ) | |
Creates a new back-buffered Widget. | |
virtual | ~BackBufferedWidget () throw () |
Basic virtual destructor. | |
virtual void | resize (Length newWidth, Length newHeight, bool ignored=false) throw () |
Resizes both this widget and its back-buffer so that their new dimensions are the specified ones. | |
virtual void | setBaseColorMode (BaseColorMode newBaseColorMode, Pixels::ColorDefinition newBaseColor) throw ( VideoException ) |
Sets the current base color mode and base color, for both surfaces (back-buffer and overall). | |
virtual void | redraw () throw () |
Redraws this widget, by updating itself (if necessary) and then updating its sub-widgets, by blitting all of them (this widget, then all sub-widgets from bottom to top) to the back-buffer and then blitting the resulting back-buffer in the parent container of this widget. | |
virtual void | redrawInternal () throw () |
This method manages this widget so that no useless internal rendering is performed. | |
virtual void | redrawBackBuffer () throw () |
Basic do-nothing redraw method for the actual internal rendering into the back-buffer (the inherited surface). | |
Surface & | getWidgetRenderTarget () throw () |
Returns the surface that should be targeted by widgets having to blit their renderings to their container. | |
virtual const std::string | toString (Ceylan::VerbosityLevels level=Ceylan::high) const throw () |
Returns an user-friendly description of the state of this object. | |
virtual void | setWidth (Length newWidth) throw () |
Sets the current width of this widget. | |
virtual void | setHeight (Length newHeight) throw () |
Sets the current height of this widget. | |
virtual BaseColorMode | getBaseColorMode () const throw () |
Returns the current base color mode. | |
virtual Pixels::ColorDefinition | getBaseColor () const throw () |
Returns the current base color. | |
virtual void | setDecorationStatus (bool newDecorationStatus) throw () |
Sets the current decoration status, so that this widget will have decorations or not after this method is called. | |
virtual const UprightRectangle & | getClientArea () const throw () |
Returns an upright rectangle which describes the client area, in widget referential. | |
virtual bool | clean () throw () |
Cleans the widget by blanking it with a background color, or a colorkey, or does nothing, depending on base color mode being respectively BackgroundColor, or Colorkey, or None. | |
virtual void | beNotifiedOf (const Ceylan::Event &newEvent) throw () |
Notifies this widget of a new event whose source is its container. | |
virtual void | setRedrawState (bool needsToBeRedrawn) throw () |
Sets redraw state. | |
virtual Clonable & | clone () const throw ( Ceylan::ClonableException ) |
Clones this Surface : creates a new Surface, exact copy of this Surface, but with no data shared with it at all. | |
virtual SDL_Surface & | getSDLSurface () const throw () |
Returns the SDL surface corresponding to that surface. | |
virtual void | setSDLSurface (SDL_Surface &newSurface, DisplayType displayType=BackBuffer) throw () |
Sets this surface so that it corresponds to the supplied SDL surface. | |
virtual DisplayType | getDisplayType () const throw () |
Returns the display type (back-buffer, screen, etc. | |
virtual void | setDisplayType (DisplayType newDisplayType) throw () |
Sets the new display type (back-buffer, screen, etc. | |
virtual Ceylan::Flags | getFlags () const throw () |
Returns the flags caracterizing this surface. | |
virtual void | setFlags (Ceylan::Flags newFlags) throw () |
Sets the flags caracterizing this surface. | |
virtual void | convertToDisplay (bool alphaChannelWanted=true) throw ( VideoException ) |
Converts the internal surface to the pixel format of the display, so that any blit of this surface to the screen is quicker. | |
virtual void | setAlpha (Ceylan::Flags flags, Pixels::ColorElement newAlpha) throw ( VideoException ) |
Adjusts the alpha properties of the surface : sets the per-surface alpha value and/or enables or disables alpha blending. | |
virtual void | setColorKey (Ceylan::Flags flags, Pixels::PixelColor keyPixelColor) throw ( VideoException ) |
Sets the color key (transparent pixel) in a blittable surface, and enables or disables RLE blit acceleration. | |
virtual void | setColorKey (Ceylan::Flags flags, Pixels::ColorDefinition keyColorDef) throw ( VideoException ) |
Sets the color key (transparent pixel) in a blittable surface, and enables or disables RLE blit acceleration. | |
virtual void | convertFromColorKeyToAlphaChannel () throw ( VideoException ) |
Converts this surface, which must use a color key, so that it uses an alpha channel instead. | |
virtual bool | setPalette (Palette &newPalette, ColorCount startingColorIndex=0, ColorCount numberOfColors=0, Ceylan::Flags targettedPalettes=Palette::Logical|Palette::Physical) throw () |
Sets this surface's palette thanks to specified one. | |
virtual PixelFormat & | getPixelFormat () const throw () |
Returns this surface's pixel format. | |
virtual void | setPixelFormat (PixelFormat &newFormat) throw () |
Sets this surface's pixel format. | |
virtual Pitch | getPitch () const throw () |
Returns this surface's pitch. | |
virtual void | setPitch (Pitch newPitch) throw () |
Sets this surface's pitch. | |
virtual Length | getWidth () const throw () |
Returns this Surface's width. | |
virtual Length | getHeight () const throw () |
Returns this Surface's height. | |
virtual BitsPerPixel | getBitsPerPixel () const throw () |
Returns this surface's color depth, bits per pixel. | |
virtual void | setBitsPerPixel (BitsPerPixel newBitsPerPixel) throw () |
Sets this surface's color depth, bits per pixel. | |
virtual BytesPerPixel | getBytesPerPixel () const throw () |
Returns this surface's overall color depth, bytes per pixel. | |
virtual void | setBytesPerPixel (BytesPerPixel newBytesPerPixel) throw () |
Sets this surface's color depth, bytes per pixel. | |
virtual void * | getPixels () const throw () |
Returns this surface's video buffer, i.e. | |
virtual void | setPixels (void *newPixels) throw () |
Sets this surface's video buffer, i.e. | |
virtual bool | fill (Pixels::ColorDefinition colorDef=Pixels::Black) throw () |
Fills this surface with specified color. | |
virtual bool | clear () throw () |
Clears the screen. | |
virtual Surface & | flipVertical () const throw () |
Returns the result of a vertical flip of this source surface : the result will contain the original image mirrored according to a vertical line splitting this surface into a left and right area of equal size. | |
virtual Surface & | flipHorizontal () const throw () |
Returns the result of an horizontal flip of this source surface : the result will contain the original image mirrored according to an horizontal line splitting this surface into a top and bottom area of equal size. | |
virtual std::string | describePixelAt (Coordinate x, Coordinate y) throw () |
Returns a textual description of the pixel of this surface located at [x;y]. | |
virtual Pixels::PixelColor | getPixelColorAt (Coordinate x, Coordinate y) const throw ( VideoException ) |
Returns the pixel color of one particular pixel of this surface, located at [x;y], encoded according to the pixel format of this surface. | |
virtual Pixels::ColorDefinition | getColorDefinitionAt (Coordinate x, Coordinate y) const throw ( VideoException ) |
Returns the color definition of one particular pixel of this surface, located at [x;y]. | |
virtual void | putRGBAPixelAt (Coordinate x, Coordinate y, ColorElement red, ColorElement green, ColorElement blue, ColorElement alpha=AlphaOpaque, bool blending=true, bool clipping=true, bool locking=false) throw ( VideoException ) |
Sets the pixel at [x;y] of this surface to the given color, specified as separate RGBA coordinates. | |
virtual void | putColorDefinitionAt (Coordinate x, Coordinate y, ColorDefinition colorDef, bool blending=true, bool clipping=true, bool locking=false) throw ( VideoException ) |
Sets the pixel at [x;y] of this surface to the given color, specified as a color definition (set of RGBA coordinates). | |
virtual void | putPixelColorAt (Coordinate x, Coordinate y, PixelColor convertedColor, ColorElement alpha, bool blending=true, bool clipping=true, bool locking=false) throw ( VideoException ) |
Sets the pixel at [x;y] of this surface to the given color, specified as an already converted RGBA color. | |
virtual bool | setAlphaForColor (Pixels::ColorDefinition colorDef, Pixels::ColorElement newAlpha) throw () |
virtual bool | drawHorizontalLine (Coordinate xStart, Coordinate xStop, Coordinate y, Pixels::ColorElement red, Pixels::ColorElement green, Pixels::ColorElement blue, Pixels::ColorElement alpha=Pixels::AlphaOpaque) throw () |
Draws an horizontal line ranging from point (xStart;y), included, to point (xStop;y), included if and only if endpoint drawing mode is set, with specified RGBA color, in this surface. | |
virtual bool | drawHorizontalLine (Coordinate xStart, Coordinate xStop, Coordinate y, Pixels::PixelColor actualColor) throw () |
Draws an horizontal line ranging from point (xStart;y), included, to point (xStop;y), included if and only if endpoint drawing mode is set, with specified actual RGBA pixel color, in this surface. | |
virtual bool | drawHorizontalLine (Coordinate xStart, Coordinate xStop, Coordinate y, Pixels::ColorDefinition colorDef=Pixels::White) throw () |
Draws an horizontal line ranging from point (xStart;y), included, to point (xStop;y), included if and only if endpoint drawing mode is set, with specified RGBA color, in this surface. | |
virtual bool | drawVerticalLine (Coordinate x, Coordinate yStart, Coordinate yStop, Pixels::ColorElement red, Pixels::ColorElement green, Pixels::ColorElement blue, Pixels::ColorElement alpha=Pixels::AlphaOpaque) throw () |
Draws a vertical line ranging from point (x;yStart), included, to point (x;yStop), included if and only if endpoint drawing mode is set, with specified RGBA color, in this surface. | |
virtual bool | drawVerticalLine (Coordinate x, Coordinate yStart, Coordinate yStop, Pixels::ColorDefinition colorDef=Pixels::White) throw () |
Draws a vertical line ranging from point (x;yStart), included, to point (x;yStop), included if and only if endpoint drawing mode is set, with specified RGBA color, in this surface. | |
virtual bool | drawLine (Coordinate xStart, Coordinate yStart, Coordinate xStop, Coordinate yStop, Pixels::ColorElement red, Pixels::ColorElement green, Pixels::ColorElement blue, Pixels::ColorElement alpha=Pixels::AlphaOpaque) throw () |
Draws a line in this surface, ranging from point (xStart;yStart), included, to point (xStop;yStop), included if and only if endpoint drawing mode is set, with specified RGBA color. | |
virtual bool | drawLine (Coordinate xStart, Coordinate yStart, Coordinate xStop, Coordinate yStop, Pixels::ColorDefinition=Pixels::White) throw () |
Draws a line in this surface, ranging from point (xStart;yStart), included, to point (xStop;yStop), included if and only if endpoint drawing mode is set, with specified RGBA color. | |
virtual bool | drawCross (const TwoDimensional::Point2D ¢er, Pixels::ColorDefinition colorDef=Pixels::White, Length squareEdge=5) throw () |
Draws a cross centered in center, included in a square whose length of edge is squareEdge. | |
virtual bool | drawCross (Coordinate xCenter, Coordinate yCenter, Pixels::ColorDefinition colorDef=Pixels::White, Length squareEdge=5) throw () |
Draws a cross centered in center, included in a square whose length of edge is squareEdge. | |
virtual bool | drawEdges (Pixels::ColorDefinition edgeColor=Pixels::White, Length edgeWidth=1) throw () |
Draws the edges of this surface, with specified color and edge width. | |
virtual bool | drawBox (const UprightRectangle &rectangle, Pixels::ColorElement red, Pixels::ColorElement green, Pixels::ColorElement blue, Pixels::ColorElement alpha=Pixels::AlphaOpaque, bool filled=true) throw () |
Draws a box with specified RGBA color. | |
virtual bool | drawBox (const UprightRectangle &rectangle, Pixels::ColorDefinition colorDef=Pixels::White, bool filled=true) throw () |
Draws a box with specified RGBA color. | |
virtual bool | drawCircle (Coordinate xCenter, Coordinate yCenter, Length radius, Pixels::ColorElement red, Pixels::ColorElement green, Pixels::ColorElement blue, Pixels::ColorElement alpha=Pixels::AlphaOpaque, bool filled=true, bool blended=true) throw () |
Draws a circle whose center is (xCenter,yCenter) of specified radius, with specified RGBA color, on this surface. | |
virtual bool | drawCircle (Coordinate xCenter, Coordinate yCenter, Length radius, Pixels::ColorDefinition colorDef=Pixels::White, bool filled=true, bool blended=true) throw () |
Draws a circle whose center is (xCenter,yCenter) of specified radius, with specified RGBA color, on this surface. | |
virtual bool | drawDiscWithEdge (Coordinate xCenter, Coordinate yCenter, Length outerRadius, Length innerRadius, Pixels::ColorDefinition ringColorDef=Pixels::Blue, Pixels::ColorDefinition discColorDef=Pixels::White, bool blended=true) throw () |
Draws a disc whose center is (xCenter,yCenter), of specified radius (totalRadius), filled with specified color discColorDef, with a ring in it, on its border, i.e. | |
virtual bool | drawEllipse (Coordinate xCenter, Coordinate yCenter, Length horizontalRadius, Length verticalRadius, Pixels::ColorElement red, Pixels::ColorElement green, Pixels::ColorElement blue, Pixels::ColorElement alpha=Pixels::AlphaOpaque, bool filled=true) throw () |
Draws an ellipse whose center is (xCenter,yCenter), with specified horizontal and vertical radii, with specified RGBA color, on this surface. | |
virtual bool | drawEllipse (Coordinate xCenter, Coordinate yCenter, Length horizontalRadius, Length verticalRadius, Pixels::ColorDefinition colorDef, bool filled=true) throw () |
Draws an ellipse whose center is (xCenter,yCenter), with specified horizontal and vertical radii, with specified RGBA color, on this surface. | |
virtual bool | drawPie (Coordinate xCenter, Coordinate yCenter, Length radius, Ceylan::Maths::AngleInDegrees angleStart, Ceylan::Maths::AngleInDegrees angleStop, Pixels::ColorElement red, Pixels::ColorElement green, Pixels::ColorElement blue, Pixels::ColorElement alpha=Pixels::AlphaOpaque) throw () |
Draws a polygon-based filled pie whose center is (xCenter,yCenter) of specified radius, with specified RGBA color, on this surface, starting from angleStart, stopping to angleStop, both expressed in degrees. | |
virtual bool | drawPie (Coordinate xCenter, Coordinate yCenter, Length radius, Ceylan::Maths::AngleInDegrees angleStart, Ceylan::Maths::AngleInDegrees angleStop, Pixels::ColorDefinition colorDef) throw () |
Draws a polygon-based filled pie whose center is (xCenter,yCenter) of specified radius, with specified RGBA color, on this surface, starting from angleStart, stopping to angleStop. | |
virtual bool | drawTriangle (Coordinate x1, Coordinate y1, Coordinate x2, Coordinate y2, Coordinate x3, Coordinate y3, Pixels::ColorElement red, Pixels::ColorElement green, Pixels::ColorElement blue, Pixels::ColorElement alpha=Pixels::AlphaOpaque, bool filled=true) throw () |
Draws a triangle defined by specified three points, with specified RGBA color, on this surface. | |
virtual bool | drawTriangle (Coordinate x1, Coordinate y1, Coordinate x2, Coordinate y2, Coordinate x3, Coordinate y3, Pixels::ColorDefinition colorDef, bool filled=true) throw () |
Draws a triangle defined by specified three points, with specified RGBA color, on this surface. | |
virtual bool | drawTriangle (const TwoDimensional::Point2D &p1, const TwoDimensional::Point2D &p2, const TwoDimensional::Point2D &p3, Pixels::ColorElement red, Pixels::ColorElement green, Pixels::ColorElement blue, Pixels::ColorElement alpha=Pixels::AlphaOpaque, bool filled=true) throw () |
Draws a triangle defined by specified three points, with specified RGBA color, on this surface. | |
virtual bool | drawTriangle (const TwoDimensional::Point2D &p1, const TwoDimensional::Point2D &p2, const TwoDimensional::Point2D &p3, Pixels::ColorDefinition colorDef, bool filled=true) throw () |
Draws a triangle defined by specified three points, with specified RGBA color, on this surface. | |
virtual bool | drawPolygon (const std::list< TwoDimensional::Point2D * > summits, Coordinate x, Coordinate y, Pixels::ColorElement red, Pixels::ColorElement green, Pixels::ColorElement blue, Pixels::ColorElement alpha=Pixels::AlphaOpaque, bool filled=true) throw () |
Draws a polygon defined by specified list of points, with specified RGBA color, on specified surface. | |
virtual bool | drawPolygon (const std::list< TwoDimensional::Point2D * > summits, Coordinate x, Coordinate y, Pixels::ColorDefinition colorDef, bool filled=true) throw () |
Draws a polygon defined by specified list of points, with specified RGBA color, on specified surface. | |
virtual bool | drawGrid (Length columnStride=20, Length rowStride=20, Pixels::ColorDefinition lineColor=Pixels::White, bool fillBackground=false, Pixels::ColorDefinition backgroundColor=Pixels::Black) throw () |
Draws a grid, with specified space between columns and rows and specified colors. | |
virtual bool | printText (const std::string &text, Coordinate x, Coordinate y, Pixels::ColorElement red, Pixels::ColorElement green, Pixels::ColorElement blue, Pixels::ColorElement alpha=Pixels::AlphaOpaque) throw () |
Prints specified string on this surface, with specified color, taking as upper left corner specified coordinates. | |
virtual bool | printText (const std::string &text, Coordinate x, Coordinate y, ColorDefinition colorDef=Pixels::White) throw () |
Prints specified string on this surface, with specified color, taking as upper left corner specified coordinates. | |
virtual bool | blitTo (Surface &targetSurface) const throw ( VideoException ) |
Blits this surface onto specified surface. | |
virtual bool | blitTo (Surface &targetSurface, Coordinate x, Coordinate y) const throw ( VideoException ) |
Blits this surface onto specified surface. | |
virtual bool | blitTo (Surface &targetSurface, const TwoDimensional::Point2D &location) const throw ( VideoException ) |
Blits this surface onto specified surface. | |
virtual bool | blitTo (Surface &targetSurface, const TwoDimensional::UprightRectangle &sourceRectangle, const TwoDimensional::Point2D &destinationLocation) const throw ( VideoException ) |
Blits this surface onto specified surface. | |
virtual Surface & | zoom (Ceylan::Maths::Real abscissaZoomFactor, Ceylan::Maths::Real ordinateZoomFactor, bool antialiasing=true) const throw ( VideoException ) |
Returns a newly created surface, obtained from this surface after a zoom of given factors. | |
virtual Surface & | rotoZoom (Ceylan::Maths::AngleInDegrees angle, Ceylan::Maths::Real zoomFactor, bool antialiasing=true) const throw ( VideoException ) |
Returns a newly created surface, obtained from this surface after a rotation of given angle and a zoom of given factor. | |
virtual Surface & | rotoZoom (Ceylan::Maths::AngleInDegrees angle, Ceylan::Maths::Real abscissaZoomFactor, Ceylan::Maths::Real ordinateZoomFactor, bool antialiasing=true) const throw ( VideoException ) |
Returns a newly created surface, obtained from this surface after a rotation of given angle and zooms of given factors. | |
virtual UprightRectangle & | getClippingArea () const throw () |
Returns this surface's clipping area, expressed thanks to an UprightRectangle. | |
virtual void | setClippingArea (UprightRectangle &newClippingArea) throw () |
Sets this surface's clipping area, expressed thanks to an UprightRectangle, whose ownership is left to the caller. | |
virtual void | loadImage (const std::string &filename, bool blitOnly=false, bool convertToDisplayFormat=true, bool convertWithAlpha=true) throw ( TwoDimensional::ImageException ) |
Loads an image, whose format will be auto-detected, from specified file, into this surface. | |
virtual void | loadJPG (const std::string &filename, bool blitOnly=false, bool convertToDisplayFormat=true, bool convertWithAlpha=true) throw ( TwoDimensional::ImageException ) |
Loads a JPEG image from specified file into this surface. | |
virtual void | loadPNG (const std::string &filename, bool blitOnly=false, bool convertToDisplayFormat=true, bool convertWithAlpha=true) throw ( TwoDimensional::ImageException ) |
Loads a PNG image from specified file into this surface. | |
virtual void | loadBMP (const std::string &filename, bool blitOnly=false, bool convertToDisplayFormat=true, bool convertWithAlpha=true) throw ( TwoDimensional::ImageException ) |
Loads a BMP image from specified file into this surface. | |
virtual void | loadGIF (const std::string &filename, bool blitOnly=false, bool convertToDisplayFormat=true, bool convertWithAlpha=true) throw ( TwoDimensional::ImageException ) |
Loads a GIF image from specified file into this surface. | |
virtual void | loadLBM (const std::string &filename, bool blitOnly=false, bool convertToDisplayFormat=true, bool convertWithAlpha=true) throw ( TwoDimensional::ImageException ) |
Loads a LBM image from specified file into this surface. | |
virtual void | loadPCX (const std::string &filename, bool blitOnly=false, bool convertToDisplayFormat=true, bool convertWithAlpha=true) throw ( TwoDimensional::ImageException ) |
Loads a PCX image from specified file into this surface. | |
virtual void | loadPNM (const std::string &filename, bool blitOnly=false, bool convertToDisplayFormat=true, bool convertWithAlpha=true) throw ( TwoDimensional::ImageException ) |
Loads a PNM image from specified file into this surface. | |
virtual void | loadTGA (const std::string &filename, bool blitOnly=false, bool convertToDisplayFormat=true, bool convertWithAlpha=true) throw ( TwoDimensional::ImageException ) |
Loads a TGA image from specified file into this surface. | |
virtual void | loadXPM (const std::string &filename, bool blitOnly=false, bool convertToDisplayFormat=true, bool convertWithAlpha=true) throw ( TwoDimensional::ImageException ) |
Loads a XPM image from specified file into this surface. | |
virtual void | savePNG (const std::string &filename, bool overwrite=true) throw ( TwoDimensional::ImageException ) |
Saves the current content of this surface into a PNG file. | |
virtual void | saveBMP (const std::string &filename, bool overwrite=true) throw ( TwoDimensional::ImageException ) |
Saves the current content of this surface into a BMP file. | |
virtual void | update () throw ( VideoException ) |
Updates the display with this surface, which will be automatically set in an up-to-date state if necessary, so that it is fully redrawn, including its widgets. | |
virtual void | updateRectangles (const std::list< UprightRectangle * > &listRects) throw ( VideoException ) |
Updates the part of this surface corresponding to the specified list of rectangles. | |
virtual void | updateRectangle (const UprightRectangle &rect) throw ( VideoException ) |
Updates the part of this surface corresponding to specified rectangle. | |
virtual void | updateRectangle (Coordinate x, Coordinate y, Length width, Length height) throw ( VideoException ) |
Updates the part of this surface corresponding to specified rectangle. | |
virtual bool | getRedrawState () const throw () |
Returns the current need for redraw state. | |
virtual bool | isInternalSurfaceAvailable () const throw () |
Tells whether the internal SDL surface is void or not. | |
virtual void | addWidget (TwoDimensional::Widget &widget) throw ( VideoException ) |
Registers specified widget to this surface, and put it at top level. | |
virtual void | putWidgetToFront (TwoDimensional::Widget &widget) throw ( VideoException ) |
Changes stacking inside this container surface so that specified widget is put to front. | |
virtual void | putWidgetToBack (TwoDimensional::Widget &widget) throw ( VideoException ) |
Changes stacking inside this container surface so that specified widget is put to back. | |
virtual void | centerMousePosition () throw () |
Centers in the middle of the screen the position of the mouse cursor, by generating a mouse motion event. | |
virtual void | setMousePosition (Coordinate newX=0, Coordinate newY=0) throw () |
Sets the position of the mouse cursor, by generating a mouse motion event. | |
virtual bool | mustBeLocked () const throw () |
Tells whether this surface has to be locked before modifying it. | |
virtual Ceylan::System::Size | getSizeInMemory () const throw () |
Returns the approximate size in memory, in bytes, currently taken by this object. | |
virtual bool | displayData (const Ceylan::Maths::IntegerData *dataArray, Ceylan::Uint32 dataCount, Pixels::ColorDefinition pencilColor, Pixels::ColorDefinition captionColor, Pixels::ColorDefinition backgroundColor, const std::string &caption="", const UprightRectangle *inBox=0) throw () |
Displays specified set of data, defined by dataArray, an array of dataCount IntegerData elements, as a curve drawn with pencilColor, on a background whose color is backgroundColor. | |
virtual Point2D | getUpperLeftCorner () const throw () |
Returns this UprightRectangle's upper left corner. | |
virtual void | setUpperLeftCorner (Point2D &newUpperLeftCorner) throw () |
Sets this UprightRectangle's upper left corner, width and height do not change. | |
virtual Coordinate | getUpperLeftAbscissa () const throw () |
Returns directly the abscissa of upper left corner. | |
virtual void | setUpperLeftAbscissa (Coordinate newAbscissa) throw () |
Sets directly the abscissa of the upper left corner of this rectangle. | |
virtual Coordinate | getUpperLeftOrdinate () const throw () |
Returns directly the ordinate of upper left corner. | |
virtual void | setUpperLeftOrdinate (Coordinate newOrdinate) throw () |
Sets directly the ordinate of the upper left corner of this rectangle. | |
virtual Point2D | getLowerRightCorner () const throw () |
Returns this UprightRectangle's lower right corner. | |
virtual void | setLowerRightCorner (Point2D &newLowerRightCorner) throw ( VideoException) |
Sets directly the lower right corner of this rectangle. | |
virtual Coordinate | getLowerRightAbscissa () const throw () |
Returns directly the abscissa of lower right corner. | |
virtual void | setLowerRightAbscissa (Coordinate newAbscissa) throw ( VideoException ) |
Sets directly the abscissa of the lower right corner of this rectangle. | |
virtual Coordinate | getLowerRightOrdinate () const throw () |
Returns directly the ordinate of lower right corner. | |
virtual void | setLowerRightOrdinate (Coordinate newOrdinate) throw ( VideoException ) |
Sets directly the ordinate of the lower right corner of this rectangle. | |
virtual bool | draw (Surface &target, Pixels::ColorElement red, Pixels::ColorElement blue, Pixels::ColorElement green, Pixels::ColorElement alpha=Pixels::AlphaOpaque, bool filled=true) const throw () |
Draws this UprightRectangle to specified surface with specified RGBA color. | |
virtual bool | draw (Surface &target, Pixels::ColorDefinition colorDef=Pixels::White, bool filled=true) const throw () |
Draws this UprightRectangle to specified surface with specified RGBA color. | |
virtual bool | drawWithRoundedCorners (Surface &target, Length edgeWidth=3, Pixels::ColorDefinition edgeColorDef=Pixels::White, Pixels::ColorDefinition backgroundColorDef=Pixels::Transparent) const throw () |
Draws this UprightRectangle to specified surface with rounded corners, drawn with specified color, above a background of specified color. | |
virtual Length | computeRadiusForRoundRectangle (Length edgeWidth) const throw ( VideoException ) |
Computes the preferred radius of round corners for this rectangle, with the specified edge width. | |
virtual SDL_Rect * | toSDLRect () const throw ( VideoException ) |
Static Public Member Functions | |
static Pixels::ColorDefinition | GetEdgeColor () throw () |
Returns the current default edge color for all new widgets. | |
static void | SetEdgeColor (Pixels::ColorDefinition edgeColorDef) throw () |
Sets the edge color for all new widgets. | |
static Surface & | LoadImage (const std::string &filename, bool convertToDisplayFormat=true, bool convertWithAlpha=true) throw ( TwoDimensional::ImageException ) |
Surface factory : creates a new Surface instance from specified image file. | |
static std::string | InterpretFlags (Ceylan::Flags flags) throw () |
Outputs a textual description of the given surface flags. | |
Static Public Attributes | |
static const Ceylan::Flags | Software |
Indicates that a surface is to be stored in system memory. | |
static const Ceylan::Flags | Hardware |
Indicates that a surface is to be stored in video memory. | |
static const Ceylan::Flags | AsynchronousBlit |
Indicates that a surface should use asynchronous blits if possible. | |
static const Ceylan::Flags | ExclusivePalette |
Indicates that a surface should have an exclusive palette. | |
static const Ceylan::Flags | HardwareAcceleratedBlit |
Indicates that a surface is to use hardware-accelerated blits. | |
static const Ceylan::Flags | ColorkeyBlit |
Indicates that a surface is to use colorkey blits. | |
static const Ceylan::Flags | RLEColorkeyBlit |
Indicates that a surface is to use RLE-accelerated colorkey blits. | |
static const Ceylan::Flags | AlphaBlendingBlit |
Indicates that a surface is to use alpha blending blits. | |
static const Ceylan::Flags | Preallocated |
Indicates that a surface is to use preallocated memory. | |
static const Ceylan::Flags | RLEColorkeyBlitAvailable |
Indicates that RLE colorkey blit is actually accelerated (read-only). | |
static const Ceylan::Flags | AnyPixelFormat |
Indicates that a display surface may use any pixel format. | |
static const Ceylan::Flags | DoubleBuffered |
Indicates that a display surface is to be double buffered. | |
static const Ceylan::Flags | FullScreen |
Indicates that a display surface is to be full screen, not windowed. | |
static const Ceylan::Flags | OpenGL |
Indicates that a display surface should have an OpenGL context. | |
static const Ceylan::Flags | Resizable |
Indicates that a display surface is to be resizable. | |
static const Length | graphAbscissaOffset |
Offset used when drawing curve in a container. | |
static const Length | graphOrdinateOffset |
Offset used when drawing curve in a container. | |
static const Length | captionAbscissaOffset |
Offset used when printing caption in a container. | |
static const Length | captionOrdinateOffset |
Offset used when printing caption in a container. | |
Protected Types | |
typedef Ceylan::Sint16 | Offset |
Offset of a Surface. | |
Protected Member Functions | |
virtual void | setBackBufferRedrawState (bool needsToBeRedrawn) throw () |
Sets the need for redraw state for the back-buffer. | |
virtual bool | getBackBufferRedrawState () const throw () |
Returns the current need for redraw state for the back-buffer. | |
virtual void | updateDecorationFlag () throw () |
Updates the decoration flag, depending on the various services requested. | |
virtual void | updateClientArea () throw () |
Updates client area with regard to current decoration status. | |
virtual Surface & | getContainer () throw () |
Returns this widget's container surface. | |
virtual const Surface & | getConstContainer () const throw () |
Returns this widget's container surface as a 'const' object. | |
virtual void | drawFundamentals (Surface &targetSurface) throw () |
Draws the fundamental parts of a widget : widget area cleaned accordingly to the current base color mode, and edges are drawn. | |
virtual bool | isDecorated () const throw () |
Tells whether this widget is decorated. | |
virtual void | drawDecorations (Surface &targetSurface) throw () |
Draws the decorations for this widget to specified surface. | |
virtual void | preUnlock () throw () |
Effective unlocking of the surface. | |
virtual void | postLock () throw () |
Effective locking of the surface. | |
Offset | getOffset () const throw () |
Returns this surface's offset. | |
void | setOffset (Offset offset) throw () |
Sets this surface's offset. | |
virtual void | flush () throw () |
Releases internal SDL surface. | |
virtual void | inconsistencyDetected (const std::string &message) const throw () |
Triggered when an abnormal inconsistency is detected between OSDL's surface state and its back-end counterpart. | |
Protected Attributes | |
Surface * | _overallSurface |
The overall surface where this widget (thanks to the back-buffer) and all its sub-widget tree will be rendered. | |
Point2D | _upperLeftCorner |
This widget's upper left corner, relatively to its container. | |
UprightRectangle | _clientArea |
The rectangular client area, defined in the referential of this widget. | |
bool | _decorated |
Tells whether this widget rendering should include decorations. | |
std::string | _title |
This Widget's title. | |
bool | _minMaximizable |
Tells whether this widget can be minimized and maximized by the user. | |
bool | _draggable |
Tells whether this widget can be dragged by the user. | |
bool | _wrappable |
Tells whether this widget can be wrapped by the user, hiding the whole widget but its decoration. | |
bool | _closable |
Tells whether this widget can be closed by the user. | |
bool | _hasFocus |
Tells whether this widget has currently the focus (i.e. | |
BaseColorMode | _baseColorMode |
Tells whether a background color, color-keying or nothing special shall be used for this widget. | |
Pixels::ColorDefinition | _baseColor |
Stores the base color of this widget, which is either used as a background color or a colorkey, depending on '_baseColorMode'. | |
Pixels::PixelColor | _actualBaseColor |
The base color, converted to this widget current pixel format, inherited from container. | |
SDL_Surface * | _surface |
This internal structure also contains private fields not used here. | |
DisplayType | _displayType |
Tells what is the display type of this surface. | |
bool | _mustBeLocked |
Tells whether this surface must be locked before modifying it. | |
Coordinate | _x |
Upper left corner's abscissa (horizontal coordinate). | |
Coordinate | _y |
Upper left corner's ordinate (vertical coordinate). | |
Static Protected Attributes | |
static Pixels::ColorDefinition | _EdgeColor |
Color of widget edges. | |
static Pixels::ColorDefinition | _TitleColor |
Color of widget title. | |
static Text::HorizontalAlignment | _TitleHorizontalAlignment |
Defines how a widget title should be horizontally aligned (default : Center). | |
static Text::VerticalAlignment | _TitleVerticalAlignment |
Defines how a widget title should be vertically aligned. | |
static Length | _ClientOffsetWidth |
Default width offset for client area relative to widget vertical edges. | |
static Length | _ClientOffsetHeight |
Default height offset for client area relative to widget horizontal edges. | |
static Coordinate | _TitleOffsetAbscissa |
Default abscissa offset relative to widget upper left corner used to print widget title with left alignment. | |
static Coordinate | _TitleOffsetOrdinate |
Default ordinate offset relative to widget upper left corner used to print widget title. | |
static Coordinate | _TitleBarOffsetOrdinate |
Default ordinate offset relative to widget upper left corner used to draw widget title bar. | |
static std::string | _DefaultTitle |
Default title to be used when a titleless widget has however to be rendered decorated. | |
Private Member Functions | |
BackBufferedWidget (const BackBufferedWidget &source) throw () | |
Copy constructor made private to ensure that it will never be called. | |
BackBufferedWidget & | operator= (const BackBufferedWidget &source) throw () |
Assignment operator made private to ensure that it will never be called. | |
Private Attributes | |
bool | _needsBackBufferRedraw |
Tells whether the internal rendering of this widget should be updated. |
typedef Ceylan::Sint16 OSDL::Video::Surface::Offset [protected, inherited] |
enum OSDL::Video::TwoDimensional::Widget::BaseColorMode [inherited] |
Describes the available modes for handling the base color of a widget.
Hence the base color can be the background color of a widget ('BackgroundColor'), or the color key to be used if automatic color-keying is activated ('Colorkey'). The base color can be ignored thanks to 'None'.
The 'NotInitialized' value is only to be used in constructors.
Definition at line 144 of file OSDLWidget.h.
enum OSDL::Video::Surface::DisplayType [inherited] |
Describes the display type of a surface :.
Definition at line 197 of file OSDLSurface.h.
OSDL::Video::TwoDimensional::BackBufferedWidget::BackBufferedWidget | ( | Surface & | container, | |
const Point2D & | relativePosition, | |||
Length | width, | |||
Length | height, | |||
BaseColorMode | baseColorMode, | |||
Pixels::ColorDefinition | baseColor, | |||
const std::string & | title = "" , |
|||
bool | minMaximizable = true , |
|||
bool | draggable = true , |
|||
bool | wrappable = true , |
|||
bool | closable = true | |||
) | throw ( VideoException ) |
Creates a new back-buffered Widget.
Its container, which is always a surface (since Widgets are themselves specialized surfaces) will own this widget, therefore will deallocate it when appropriate.
Most of the widget attributes, such as bits per pixel, will be deduced from the corresponding attributes of the container surface.
container | this Widget's container surface, to which it will automatically be subscribed to, as an EventListener for redraw operations. | |
relativePosition | tells where the upper-left corner of the widget is located inside its container. | |
width | this widget's width, in pixels. | |
height | this widget's height, in pixels. | |
baseColorMode | is the chosen mode for base color. | |
baseColor | is the base color of the widget. | |
title | the title which may be drawn, if non empty, on the top of the widget. | |
minMaximizable | tells whether the widget can be minimized or maximized by the user. | |
draggable | tells whether the widget can be dragged by the user. | |
wrappable | tells whether the widget can be wrapped (only the widget decoration is displayed) by the user. | |
closable | tells whether the widget can be closed by the user. |
VideoException | if an error occured. |
Parent surface cannot be 'const' since the widget may issue redraw triggers for example.
BackBufferedWidget::~BackBufferedWidget | ( | ) | throw () [virtual] |
Basic virtual destructor.
Definition at line 85 of file OSDLBackBufferedWidget.cc.
References _overallSurface.
OSDL::Video::TwoDimensional::BackBufferedWidget::BackBufferedWidget | ( | const BackBufferedWidget & | source | ) | throw () [explicit, private] |
Copy constructor made private to ensure that it will never be called.
The compiler should complain whenever this undefined constructor is called, implicitly or not.
void BackBufferedWidget::resize | ( | Length | newWidth, | |
Length | newHeight, | |||
bool | ignored = false | |||
) | throw () [virtual] |
Resizes both this widget and its back-buffer so that their new dimensions are the specified ones.
If the new dimensions are the same as the current ones, then nothing special will be done, surfaces stay as they are. Otherwise, they will be resized and their content will be lost, replaced by a pure black surface. The 'needs redraw' attribute will be set to true, both for the widget itself and for its back-buffer, and the client area will be updated.
newWidth | the new width. | |
newHeight | the new height. | |
ignored | is ignored. |
Reimplemented from OSDL::Video::TwoDimensional::Widget.
Definition at line 100 of file OSDLBackBufferedWidget.cc.
References OSDL::Video::TwoDimensional::Widget::resize().
void BackBufferedWidget::setBaseColorMode | ( | BaseColorMode | newBaseColorMode, | |
Pixels::ColorDefinition | newBaseColor | |||
) | throw ( VideoException ) [virtual] |
Sets the current base color mode and base color, for both surfaces (back-buffer and overall).
Based on previous values, only the necessary operations will be performed. For example, setting the same colorkey twice will activate the key only once.
newBaseColorMode | the new base color mode. | |
newBaseColor | the new base color. |
VideoException | if a change in color-keing failed. |
Reimplemented from OSDL::Video::TwoDimensional::Widget.
Definition at line 115 of file OSDLBackBufferedWidget.cc.
References OSDL::Video::Pixels::areEqual(), and OSDL::Video::Pixels::convertColorDefinitionToPixelColor().
void BackBufferedWidget::redraw | ( | ) | throw () [virtual] |
Redraws this widget, by updating itself (if necessary) and then updating its sub-widgets, by blitting all of them (this widget, then all sub-widgets from bottom to top) to the back-buffer and then blitting the resulting back-buffer in the parent container of this widget.
Reimplemented from OSDL::Video::TwoDimensional::Widget.
Definition at line 204 of file OSDLBackBufferedWidget.cc.
References _overallSurface, OSDL::Video::TwoDimensional::Widget::_upperLeftCorner, OSDL::Video::Surface::blitTo(), OSDL::Video::TwoDimensional::Widget::getContainer(), OSDL::Video::Surface::getRedrawState(), getWidgetRenderTarget(), OSDL::Video::Surface::redraw(), and OSDL::Video::Pixels::toString().
void BackBufferedWidget::redrawInternal | ( | ) | throw () [virtual] |
This method manages this widget so that no useless internal rendering is performed.
If however the main surface has to be updated, then the overriden 'redrawBackBuffer' will be called.
Reimplemented from OSDL::Video::TwoDimensional::Widget.
Definition at line 249 of file OSDLBackBufferedWidget.cc.
References OSDL::Video::TwoDimensional::Widget::_baseColor, _overallSurface, OSDL::Video::Surface::blitTo(), OSDL::Video::TwoDimensional::Widget::Colorkey, OSDL::Video::Surface::fill(), getBackBufferRedrawState(), OSDL::Video::TwoDimensional::Widget::getBaseColorMode(), redrawBackBuffer(), OSDL::Video::TwoDimensional::Widget::setRedrawState(), and OSDL::Video::Pixels::toString().
void BackBufferedWidget::redrawBackBuffer | ( | ) | throw () [virtual] |
Basic do-nothing redraw method for the actual internal rendering into the back-buffer (the inherited surface).
All overriding implementations must set the '_needsBackbufferRedraw' attribute to false when the redraw succeeded (otherwise numerous useless redraws would be performed), and should convert the resulting cached surface to display pixel format to avoid multiple useless conversions to this display format.
Reimplemented in OSDL::Video::TwoDimensional::TextWidget.
Definition at line 320 of file OSDLBackBufferedWidget.cc.
References setBackBufferRedrawState().
Referenced by redrawInternal().
Surface & BackBufferedWidget::getWidgetRenderTarget | ( | ) | throw () |
Returns the surface that should be targeted by widgets having to blit their renderings to their container.
For back-buffered widgets, the render target is not the instance itself (it would modify the private back-buffer of this widget) but the overall owned surface : subwidgets should only be blitted into this overall surface, and should not affect the back-buffer.
Reimplemented from OSDL::Video::Surface.
Definition at line 346 of file OSDLBackBufferedWidget.cc.
References _overallSurface.
Referenced by redraw().
const string BackBufferedWidget::toString | ( | Ceylan::VerbosityLevels | level = Ceylan::high |
) | const throw () [virtual] |
Returns an user-friendly description of the state of this object.
level | the requested verbosity level. |
Reimplemented from OSDL::Video::TwoDimensional::Widget.
Reimplemented in OSDL::Video::TwoDimensional::TextWidget.
Definition at line 356 of file OSDLBackBufferedWidget.cc.
References OSDL::Video::Pixels::toString().
void BackBufferedWidget::setBackBufferRedrawState | ( | bool | needsToBeRedrawn | ) | throw () [protected, virtual] |
Sets the need for redraw state for the back-buffer.
Definition at line 376 of file OSDLBackBufferedWidget.cc.
Referenced by OSDL::Video::TwoDimensional::TextWidget::redrawBackBuffer(), and redrawBackBuffer().
bool BackBufferedWidget::getBackBufferRedrawState | ( | ) | const throw () [protected, virtual] |
Returns the current need for redraw state for the back-buffer.
Definition at line 396 of file OSDLBackBufferedWidget.cc.
References _needsBackBufferRedraw.
Referenced by redrawInternal().
BackBufferedWidget& OSDL::Video::TwoDimensional::BackBufferedWidget::operator= | ( | const BackBufferedWidget & | source | ) | throw () [private] |
Assignment operator made private to ensure that it will never be called.
The compiler should complain whenever this undefined operator is called, implicitly or not.
void Widget::setWidth | ( | Length | newWidth | ) | throw () [virtual, inherited] |
Sets the current width of this widget.
If the new width is different from the current one, triggers a resize that will invalidate this widget rendering : 'needs redraw' will be true afterwards.
The client area will be automatically adjusted.
Reimplemented from OSDL::Video::Surface.
Definition at line 143 of file OSDLWidget.cc.
void Widget::setHeight | ( | Length | newHeight | ) | throw () [virtual, inherited] |
Sets the current height of this widget.
If the new height is different from the current one, triggers a resize that will invalidate this widget rendering : 'needs redraw' will be true afterwards.
The client area will be automatically adjusted.
Reimplemented from OSDL::Video::Surface.
Definition at line 151 of file OSDLWidget.cc.
Referenced by OSDL::Video::TwoDimensional::TextWidget::redrawBackBuffer().
Widget::BaseColorMode Widget::getBaseColorMode | ( | ) | const throw () [virtual, inherited] |
Returns the current base color mode.
Definition at line 179 of file OSDLWidget.cc.
References OSDL::Video::TwoDimensional::Widget::_baseColorMode.
Referenced by redrawInternal().
Pixels::ColorDefinition Widget::getBaseColor | ( | ) | const throw () [virtual, inherited] |
Returns the current base color.
Definition at line 257 of file OSDLWidget.cc.
References OSDL::Video::TwoDimensional::Widget::_baseColor.
void Widget::setDecorationStatus | ( | bool | newDecorationStatus | ) | throw () [virtual, inherited] |
Sets the current decoration status, so that this widget will have decorations or not after this method is called.
newDecorationStatus | the new decoration status. |
Definition at line 266 of file OSDLWidget.cc.
const UprightRectangle & Widget::getClientArea | ( | ) | const throw () [virtual, inherited] |
Returns an upright rectangle which describes the client area, in widget referential.
Client area is the total usable area that is left for this widget specific renderings.
Definition at line 275 of file OSDLWidget.cc.
References OSDL::Video::TwoDimensional::Widget::_clientArea.
bool Widget::clean | ( | ) | throw () [virtual, inherited] |
Cleans the widget by blanking it with a background color, or a colorkey, or does nothing, depending on base color mode being respectively BackgroundColor, or Colorkey, or None.
Definition at line 284 of file OSDLWidget.cc.
References OSDL::Video::TwoDimensional::Widget::_baseColor, OSDL::Video::TwoDimensional::Widget::_baseColorMode, OSDL::Video::TwoDimensional::Widget::BackgroundColor, OSDL::Video::TwoDimensional::Widget::Colorkey, OSDL::Video::Surface::fill(), OSDL::Video::TwoDimensional::Widget::None, and OSDL::Video::TwoDimensional::Widget::NotInitialized.
void Widget::beNotifiedOf | ( | const Ceylan::Event & | newEvent | ) | throw () [virtual, inherited] |
Notifies this widget of a new event whose source is its container.
Definition at line 320 of file OSDLWidget.cc.
void Widget::setRedrawState | ( | bool | needsToBeRedrawn | ) | throw () [virtual, inherited] |
Sets redraw state.
Reimplemented from OSDL::Video::Surface.
Definition at line 345 of file OSDLWidget.cc.
References OSDL::Video::Surface::setRedrawState().
Referenced by OSDL::Video::TwoDimensional::Widget::redrawInternal(), and redrawInternal().
Pixels::ColorDefinition Widget::GetEdgeColor | ( | ) | throw () [static, inherited] |
Returns the current default edge color for all new widgets.
Definition at line 523 of file OSDLWidget.cc.
References OSDL::Video::TwoDimensional::Widget::_EdgeColor.
void Widget::SetEdgeColor | ( | Pixels::ColorDefinition | edgeColorDef | ) | throw () [static, inherited] |
Sets the edge color for all new widgets.
edgeColorDef | the color definition of the edges. |
Definition at line 531 of file OSDLWidget.cc.
void Widget::updateDecorationFlag | ( | ) | throw () [protected, virtual, inherited] |
Updates the decoration flag, depending on the various services requested.
Definition at line 544 of file OSDLWidget.cc.
References OSDL::Video::TwoDimensional::Widget::_closable, OSDL::Video::TwoDimensional::Widget::_decorated, OSDL::Video::TwoDimensional::Widget::_draggable, OSDL::Video::TwoDimensional::Widget::_minMaximizable, OSDL::Video::TwoDimensional::Widget::_title, and OSDL::Video::TwoDimensional::Widget::_wrappable.
void Widget::updateClientArea | ( | ) | throw () [protected, virtual, inherited] |
Updates client area with regard to current decoration status.
Reimplemented in OSDL::Video::TwoDimensional::TextWidget.
Definition at line 556 of file OSDLWidget.cc.
References OSDL::Video::TwoDimensional::Widget::_clientArea, OSDL::Video::TwoDimensional::Widget::_ClientOffsetHeight, OSDL::Video::TwoDimensional::Widget::_ClientOffsetWidth, OSDL::Video::TwoDimensional::Widget::_decorated, OSDL::Video::TwoDimensional::Widget::_TitleBarOffsetOrdinate, OSDL::Video::Surface::getHeight(), OSDL::Video::Surface::getWidth(), OSDL::Video::TwoDimensional::UprightRectangle::setHeight(), OSDL::Video::TwoDimensional::UprightRectangle::setUpperLeftAbscissa(), OSDL::Video::TwoDimensional::UprightRectangle::setUpperLeftOrdinate(), and OSDL::Video::TwoDimensional::UprightRectangle::setWidth().
Referenced by OSDL::Video::TwoDimensional::TextWidget::updateClientArea().
Surface & Widget::getContainer | ( | ) | throw () [protected, virtual, inherited] |
Returns this widget's container surface.
Definition at line 590 of file OSDLWidget.cc.
References OSDL::Video::Pixels::toString().
Referenced by OSDL::Video::TwoDimensional::Widget::redraw(), and redraw().
const Surface & Widget::getConstContainer | ( | ) | const throw () [protected, virtual, inherited] |
Returns this widget's container surface as a 'const' object.
This 'const' method is useful so that calling method (ex : toString) can remain 'const' as well.
Definition at line 618 of file OSDLWidget.cc.
References OSDL::Video::Pixels::toString().
void Widget::drawFundamentals | ( | Surface & | targetSurface | ) | throw () [protected, virtual, inherited] |
Draws the fundamental parts of a widget : widget area cleaned accordingly to the current base color mode, and edges are drawn.
Definition at line 646 of file OSDLWidget.cc.
Referenced by OSDL::Video::TwoDimensional::TextWidget::redrawBackBuffer(), and OSDL::Video::TwoDimensional::Widget::redrawInternal().
bool Widget::isDecorated | ( | ) | const throw () [protected, virtual, inherited] |
Tells whether this widget is decorated.
Definition at line 660 of file OSDLWidget.cc.
References OSDL::Video::TwoDimensional::Widget::_decorated.
void Widget::drawDecorations | ( | Surface & | targetSurface | ) | throw () [protected, virtual, inherited] |
Draws the decorations for this widget to specified surface.
targetSurface | must be specified since decorations are not always to be rendered directly on widget surface : for instance for back-buffered widgets, another surface is targeted. |
Definition at line 668 of file OSDLWidget.cc.
References OSDL::Video::TwoDimensional::Text::BasicFontCharacterHeight, OSDL::Video::TwoDimensional::Text::BasicFontCharacterWidth, OSDL::Video::TwoDimensional::Text::Bottom, OSDL::Video::TwoDimensional::Text::HeightCentered, OSDL::Video::TwoDimensional::Text::Left, OSDL::Video::TwoDimensional::Text::Right, OSDL::Video::TwoDimensional::Text::Top, and OSDL::Video::TwoDimensional::Text::WidthCentered.
Referenced by OSDL::Video::TwoDimensional::TextWidget::redrawBackBuffer(), and OSDL::Video::TwoDimensional::Widget::redrawInternal().
Clonable & Surface::clone | ( | ) | const throw ( Ceylan::ClonableException ) [virtual, inherited] |
Clones this Surface : creates a new Surface, exact copy of this Surface, but with no data shared with it at all.
The display type of the clone will be back-buffer.
VideoException | on failure, such as the impossibility of creating the new surface, or to blit the former one. |
Definition at line 316 of file OSDLSurface.cc.
References OSDL::Video::Surface::_surface, OSDL::Video::Surface::BackBuffer, OSDL::Utils::getBackendLastError(), OSDL::Video::Surface::getBitsPerPixel(), OSDL::Video::Pixels::getCurrentColorMasks(), OSDL::Video::Surface::getFlags(), OSDL::Video::Surface::getHeight(), OSDL::Video::Surface::getPixelFormat(), OSDL::Video::Surface::getWidth(), OSDL::Video::Surface::Surface(), and OSDL::Video::Pixels::toString().
SDL_Surface & Surface::getSDLSurface | ( | ) | const throw () [virtual, inherited] |
Returns the SDL surface corresponding to that surface.
This surface keeps ownership of the returned SDL surface.
Definition at line 387 of file OSDLSurface.cc.
References OSDL::Video::Surface::_surface.
Referenced by OSDL::Video::TwoDimensional::Text::TrueTypeFont::basicRenderUnicodeGlyph(), OSDL::Video::Overlay::Overlay(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderLatin1Text(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderUnicodeText(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderUTF8Text(), OSDL::Video::VideoModule::setWindowIcon(), and OSDL::Video::VideoModule::toggleFullscreen().
void Surface::setSDLSurface | ( | SDL_Surface & | newSurface, | |
DisplayType | displayType = BackBuffer | |||
) | throw () [virtual, inherited] |
Sets this surface so that it corresponds to the supplied SDL surface.
newSurface | the new surface to be managed | |
displayType | tells whether this new surface is a backbuffer or a screen surface. |
Definition at line 396 of file OSDLSurface.cc.
Surface::DisplayType Surface::getDisplayType | ( | ) | const throw () [virtual, inherited] |
Returns the display type (back-buffer, screen, etc.
) of this Surface.
Definition at line 409 of file OSDLSurface.cc.
References OSDL::Video::Surface::_displayType.
void Surface::setDisplayType | ( | DisplayType | newDisplayType | ) | throw () [virtual, inherited] |
Sets the new display type (back-buffer, screen, etc.
) of this surface.
Definition at line 417 of file OSDLSurface.cc.
Ceylan::Flags Surface::getFlags | ( | ) | const throw () [virtual, inherited] |
Returns the flags caracterizing this surface.
Definition at line 425 of file OSDLSurface.cc.
References OSDL::Video::Surface::_surface.
Referenced by OSDL::Video::Surface::clone(), and OSDL::Video::Surface::convertFromColorKeyToAlphaChannel().
virtual void OSDL::Video::Surface::setFlags | ( | Ceylan::Flags | newFlags | ) | throw () [virtual, inherited] |
Sets the flags caracterizing this surface.
void Surface::convertToDisplay | ( | bool | alphaChannelWanted = true |
) | throw ( VideoException ) [virtual, inherited] |
Converts the internal surface to the pixel format of the display, so that any blit of this surface to the screen is quicker.
The backend must already be initialized.
alphaChannelWanted | tells whether this converted surface should have an alpha channel after this call. |
VideoException | if no internal surface is available, if the conversion failed or if there is not enough memory. |
Definition at line 442 of file OSDLSurface.cc.
Referenced by OSDL::Video::TwoDimensional::Text::FixedFont::basicRenderLatin1Glyph(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::basicRenderUnicodeGlyph(), OSDL::Video::Surface::convertFromColorKeyToAlphaChannel(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderLatin1Text(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderUnicodeText(), and OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderUTF8Text().
virtual void OSDL::Video::Surface::setAlpha | ( | Ceylan::Flags | flags, | |
Pixels::ColorElement | newAlpha | |||
) | throw ( VideoException ) [virtual, inherited] |
Adjusts the alpha properties of the surface : sets the per-surface alpha value and/or enables or disables alpha blending.
flags | can be an OR'd combination of the following two options, one of these options, or 0 (none) : | |
newAlpha | is the per-surface alpha value. A surface needs not to have an alpha channel to use per-surface alpha, and blitting can still be accelerated with Surface::RLEColorkeyBlit. |
The per-surface alpha value of 128 is considered a special case and is optimised, so it is much faster than other per-surface values.
virtual void OSDL::Video::Surface::setColorKey | ( | Ceylan::Flags | flags, | |
Pixels::PixelColor | keyPixelColor | |||
) | throw ( VideoException ) [virtual, inherited] |
Sets the color key (transparent pixel) in a blittable surface, and enables or disables RLE blit acceleration.
RLE acceleration can substantially speed up blitting of images with large horizontal runs of transparent pixels (i.e. pixels that match the key value). The key must be defined accoring to the same pixel format as the surface.
flag | can be a OR'ed combination :
|
keyPixelColor,the | pixel color of the key. Pixels::convertColorDefinitionToPixelColor is often useful for obtaining a correct value for the color key. |
Referenced by OSDL::Video::TwoDimensional::Text::FixedFont::basicRenderLatin1Glyph(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::basicRenderUnicodeGlyph(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderLatin1Text(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderUnicodeText(), and OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderUTF8Text().
virtual void OSDL::Video::Surface::setColorKey | ( | Ceylan::Flags | flags, | |
Pixels::ColorDefinition | keyColorDef | |||
) | throw ( VideoException ) [virtual, inherited] |
Sets the color key (transparent pixel) in a blittable surface, and enables or disables RLE blit acceleration.
RLE acceleration can substantially speed up blitting of images with large horizontal runs of transparent pixels (i.e. pixels that match the key value). The key must be defined accoring to the same pixel format as the surface.
flag | can be a OR'ed combination :
|
keyColorDef | the color definition of the color key. |
void Surface::convertFromColorKeyToAlphaChannel | ( | ) | throw ( VideoException ) [virtual, inherited] |
Converts this surface, which must use a color key, so that it uses an alpha channel instead.
This method uses 'convertToDisplay'.
VideoException | if no internal surface is available, if it does not use color key, if the conversion failed or if there is not enough memory. |
Definition at line 504 of file OSDLSurface.cc.
References OSDL::Video::Surface::ColorkeyBlit, OSDL::Video::Surface::convertToDisplay(), OSDL::Video::Surface::getFlags(), and OSDL::Video::Surface::toString().
virtual bool OSDL::Video::Surface::setPalette | ( | Palette & | newPalette, | |
ColorCount | startingColorIndex = 0 , |
|||
ColorCount | numberOfColors = 0 , |
|||
Ceylan::Flags | targettedPalettes = Palette::Logical|Palette::Physical | |||
) | throw () [virtual, inherited] |
Sets this surface's palette thanks to specified one.
newPalette | the palette from which new color definitions should be taken. | |
startingColorIndex | the color-definition index in newPalette from which color definitions will be taken. | |
numberOfColors | the number of colors that should be copied, starting from startingColorIndex. If zero, all remaining color definitions from newPalette will be taken. | |
targettedPalettes | a flag which tells whether logical palette, physical one or both (OR'ed) should be updated. |
Pixels::PixelFormat & Surface::getPixelFormat | ( | ) | const throw () [virtual, inherited] |
Returns this surface's pixel format.
Definition at line 552 of file OSDLSurface.cc.
References OSDL::Video::Surface::_surface.
Referenced by OSDL::Video::TwoDimensional::Text::FixedFont::basicRenderLatin1Glyph(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::basicRenderUnicodeGlyph(), OSDL::Video::Surface::clone(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderLatin1Text(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderUnicodeText(), and OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderUTF8Text().
void Surface::setPixelFormat | ( | PixelFormat & | newFormat | ) | throw () [virtual, inherited] |
Pitch Surface::getPitch | ( | ) | const throw () [virtual, inherited] |
Returns this surface's pitch.
Definition at line 692 of file OSDLSurface.cc.
References OSDL::Video::Surface::_surface.
void Surface::setPitch | ( | Pitch | newPitch | ) | throw () [virtual, inherited] |
Length Surface::getWidth | ( | ) | const throw () [virtual, inherited] |
Returns this Surface's width.
Reimplemented from OSDL::Video::TwoDimensional::UprightRectangle.
Definition at line 708 of file OSDLSurface.cc.
References OSDL::Video::Surface::_surface.
Referenced by OSDL::Video::Surface::centerMousePosition(), OSDL::Video::Surface::clone(), OSDL::Video::TwoDimensional::TextWidget::redrawBackBuffer(), OSDL::Video::TwoDimensional::Widget::updateClientArea(), and OSDL::Video::TwoDimensional::TextWidget::updateClientArea().
Length Surface::getHeight | ( | ) | const throw () [virtual, inherited] |
Returns this Surface's height.
Reimplemented from OSDL::Video::TwoDimensional::UprightRectangle.
Definition at line 724 of file OSDLSurface.cc.
References OSDL::Video::Surface::_surface.
Referenced by OSDL::Video::Surface::centerMousePosition(), OSDL::Video::Surface::clone(), OSDL::Video::TwoDimensional::TextWidget::redrawBackBuffer(), OSDL::Video::TwoDimensional::Widget::updateClientArea(), and OSDL::Video::TwoDimensional::TextWidget::updateClientArea().
BitsPerPixel Surface::getBitsPerPixel | ( | ) | const throw () [virtual, inherited] |
Returns this surface's color depth, bits per pixel.
Definition at line 830 of file OSDLSurface.cc.
References OSDL::Video::Surface::_surface.
Referenced by OSDL::Video::Surface::clone().
void Surface::setBitsPerPixel | ( | BitsPerPixel | newBitsPerPixel | ) | throw () [virtual, inherited] |
Sets this surface's color depth, bits per pixel.
Definition at line 838 of file OSDLSurface.cc.
BytesPerPixel Surface::getBytesPerPixel | ( | ) | const throw () [virtual, inherited] |
Returns this surface's overall color depth, bytes per pixel.
Definition at line 848 of file OSDLSurface.cc.
References OSDL::Video::Surface::_surface.
void Surface::setBytesPerPixel | ( | BytesPerPixel | newBytesPerPixel | ) | throw () [virtual, inherited] |
Sets this surface's color depth, bytes per pixel.
Definition at line 856 of file OSDLSurface.cc.
void * Surface::getPixels | ( | ) | const throw () [virtual, inherited] |
Returns this surface's video buffer, i.e.
its whole set of pixels.
Definition at line 866 of file OSDLSurface.cc.
References OSDL::Video::Surface::_surface.
void Surface::setPixels | ( | void * | newPixels | ) | throw () [virtual, inherited] |
Sets this surface's video buffer, i.e.
its whole set of pixels.
Definition at line 875 of file OSDLSurface.cc.
bool Surface::fill | ( | Pixels::ColorDefinition | colorDef = Pixels::Black |
) | throw () [virtual, inherited] |
Fills this surface with specified color.
Can be used for blanking a surface, if the background color is chosen.
colorDef | the color definition of the fill color. |
Definition at line 570 of file OSDLSurface.cc.
References OSDL::Video::Pixels::toString().
Referenced by OSDL::Video::TwoDimensional::Text::FixedFont::basicRenderLatin1Glyph(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::basicRenderUnicodeGlyph(), OSDL::Video::TwoDimensional::Widget::clean(), OSDL::Video::Surface::clear(), OSDL::Video::TwoDimensional::TextWidget::redrawBackBuffer(), redrawInternal(), OSDL::Video::TwoDimensional::Text::Font::renderLatin1MultiLineText(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderLatin1Text(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderUnicodeText(), and OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderUTF8Text().
bool Surface::clear | ( | ) | throw () [virtual, inherited] |
Clears the screen.
This method performs a mere 'fill' with pure black.
Definition at line 590 of file OSDLSurface.cc.
References OSDL::Video::Pixels::Black, and OSDL::Video::Surface::fill().
Surface & Surface::flipVertical | ( | ) | const throw () [virtual, inherited] |
Returns the result of a vertical flip of this source surface : the result will contain the original image mirrored according to a vertical line splitting this surface into a left and right area of equal size.
Something looking as '>' would be flipped into '<'.
Definition at line 598 of file OSDLSurface.cc.
References OSDL::Video::Surface::_surface, and OSDL::Video::Surface::Surface().
Surface & Surface::flipHorizontal | ( | ) | const throw () [virtual, inherited] |
Returns the result of an horizontal flip of this source surface : the result will contain the original image mirrored according to an horizontal line splitting this surface into a top and bottom area of equal size.
Something looking as '^' would be flipped into 'v'.
Definition at line 640 of file OSDLSurface.cc.
References OSDL::Video::Surface::_surface, and OSDL::Video::Surface::Surface().
string Surface::describePixelAt | ( | Coordinate | x, | |
Coordinate | y | |||
) | throw () [virtual, inherited] |
Returns a textual description of the pixel of this surface located at [x;y].
x | the abscissa of the pixel. | |
y | the ordinate of the pixel. |
Definition at line 675 of file OSDLSurface.cc.
References OSDL::Video::Pixels::toString().
Referenced by OSDL::Video::TwoDimensional::drawDiscWithEdge().
Pixels::PixelColor Surface::getPixelColorAt | ( | Coordinate | x, | |
Coordinate | y | |||
) | const throw ( VideoException ) [virtual, inherited] |
Returns the pixel color of one particular pixel of this surface, located at [x;y], encoded according to the pixel format of this surface.
Definition at line 888 of file OSDLSurface.cc.
References OSDL::Video::Pixels::getPixelColor().
Pixels::ColorDefinition Surface::getColorDefinitionAt | ( | Coordinate | x, | |
Coordinate | y | |||
) | const throw ( VideoException ) [virtual, inherited] |
Returns the color definition of one particular pixel of this surface, located at [x;y].
If this surface has no alpha coordinate, then the fourth color coordinate of the returned definition will be AlphaOpaque.
No clipping is performed, the surface should have been previously locked if necessary.
Definition at line 897 of file OSDLSurface.cc.
References OSDL::Video::Pixels::convertPixelColorToColorDefinition(), and OSDL::Video::Pixels::getPixelColor().
void Surface::putRGBAPixelAt | ( | Coordinate | x, | |
Coordinate | y, | |||
ColorElement | red, | |||
ColorElement | green, | |||
ColorElement | blue, | |||
ColorElement | alpha = AlphaOpaque , |
|||
bool | blending = true , |
|||
bool | clipping = true , |
|||
bool | locking = false | |||
) | throw ( VideoException ) [virtual, inherited] |
Sets the pixel at [x;y] of this surface to the given color, specified as separate RGBA coordinates.
x | the abscissa of the point to change. | |
y | the ordinate of the point to change. | |
red | the red color coordinate. | |
green | the green color coordinate. | |
blue | the blue color coordinate. | |
alpha | the alpha color coordinate. | |
blending | tells whether the alpha channel must be taken into account, resulting to alpha blending with the destination pixel. If false, the exact specified color will be put in target pixel, instead of being blended with it. | |
clipping | tells whether point location is checked against surface bounds. If clipping is activated and the pixel is outside, nothing is done. | |
locking | tells whether this primitive should take $ care of locking / unlocking the surface (not recommended on a per pixel basis, because of lock overhead) |
VideoException | if a problem occurs with a lock operation. |
OSDL::Video::Pixels::put.
Definition at line 908 of file OSDLSurface.cc.
References OSDL::Video::Pixels::putRGBAPixel().
void Surface::putColorDefinitionAt | ( | Coordinate | x, | |
Coordinate | y, | |||
ColorDefinition | colorDef, | |||
bool | blending = true , |
|||
bool | clipping = true , |
|||
bool | locking = false | |||
) | throw ( VideoException ) [virtual, inherited] |
Sets the pixel at [x;y] of this surface to the given color, specified as a color definition (set of RGBA coordinates).
x | the abscissa of the point to change. | |
y | the ordinate of the point to change. | |
colorDef | the RGBA color definition of the put pixel. | |
blending | tells whether the alpha channel must be taken into account, resulting to alpha blending with the destination pixel. If false, the exact specified color will be put in target pixel, instead of being blended with it. | |
clipping | tells whether point location is checked against surface bounds. If clipping is activated and the pixel is outside, nothing is done. | |
locking | tells whether this primitive should take care of locking / unlocking the surface (not recommended on a per pixel basis because of lock overhead) |
VideoException | if a problem occurs with a lock operation. |
OSDL::Video::Pixels::put
Definition at line 921 of file OSDLSurface.cc.
References OSDL::Video::Pixels::putRGBAPixel().
void Surface::putPixelColorAt | ( | Coordinate | x, | |
Coordinate | y, | |||
PixelColor | convertedColor, | |||
ColorElement | alpha, | |||
bool | blending = true , |
|||
bool | clipping = true , |
|||
bool | locking = false | |||
) | throw ( VideoException ) [virtual, inherited] |
Sets the pixel at [x;y] of this surface to the given color, specified as an already converted RGBA color.
alpha | the alpha coordinate of the pixel to be put with full precision : the alpha encoded in the converted color may not be reliable. | |
blending | tells whether the alpha channel must be taken into account, resulting to alpha blending with the destination pixel. If false, the exact specified color will be put in target pixel, instead of being blended with it. | |
clipping | tells whether point location is checked against surface bounds. If clipping is activated and the pixel is outside, nothing is done. | |
locking | tells whether this primitive should take care of locking / unlocking the surface (not recommended on a per pixel basis, because of lock overhead). |
Definition at line 932 of file OSDLSurface.cc.
References OSDL::Video::Pixels::putPixelColor().
bool Surface::setAlphaForColor | ( | Pixels::ColorDefinition | colorDef, | |
Pixels::ColorElement | newAlpha | |||
) | throw () [virtual, inherited] |
Definition at line 944 of file OSDLSurface.cc.
References OSDL::Video::Pixels::areEqual(), OSDL_DEBUG_PIXEL, and OSDL::Video::Pixels::toString().
Referenced by OSDL::Video::TwoDimensional::drawDiscWithEdge().
bool Surface::drawHorizontalLine | ( | Coordinate | xStart, | |
Coordinate | xStop, | |||
Coordinate | y, | |||
Pixels::ColorElement | red, | |||
Pixels::ColorElement | green, | |||
Pixels::ColorElement | blue, | |||
Pixels::ColorElement | alpha = Pixels::AlphaOpaque | |||
) | throw () [virtual, inherited] |
Draws an horizontal line ranging from point (xStart;y), included, to point (xStop;y), included if and only if endpoint drawing mode is set, with specified RGBA color, in this surface.
Clipping is performed.
This line will be antialiased if antialias mode is set.
VideoModule::GetEndPointDrawState, VideoModule::GetAntiAliasingState
Definition at line 1041 of file OSDLSurface.cc.
References OSDL::Video::TwoDimensional::Line::drawHorizontal().
bool Surface::drawHorizontalLine | ( | Coordinate | xStart, | |
Coordinate | xStop, | |||
Coordinate | y, | |||
Pixels::PixelColor | actualColor | |||
) | throw () [virtual, inherited] |
Draws an horizontal line ranging from point (xStart;y), included, to point (xStop;y), included if and only if endpoint drawing mode is set, with specified actual RGBA pixel color, in this surface.
Clipping is performed.
This line will be antialiased if antialias mode is set.
VideoModule::GetEndPointDrawState, VideoModule::GetAntiAliasingState
Definition at line 1052 of file OSDLSurface.cc.
References OSDL::Video::TwoDimensional::Line::drawHorizontal().
bool Surface::drawHorizontalLine | ( | Coordinate | xStart, | |
Coordinate | xStop, | |||
Coordinate | y, | |||
Pixels::ColorDefinition | colorDef = Pixels::White | |||
) | throw () [virtual, inherited] |
Draws an horizontal line ranging from point (xStart;y), included, to point (xStop;y), included if and only if endpoint drawing mode is set, with specified RGBA color, in this surface.
Clipping is performed.
This line will be antialiased if antialias mode is set.
VideoModule::GetEndPointDrawState, VideoModule::GetAntiAliasingState
Definition at line 1061 of file OSDLSurface.cc.
References OSDL::Video::TwoDimensional::Line::drawHorizontal().
bool Surface::drawVerticalLine | ( | Coordinate | x, | |
Coordinate | yStart, | |||
Coordinate | yStop, | |||
Pixels::ColorElement | red, | |||
Pixels::ColorElement | green, | |||
Pixels::ColorElement | blue, | |||
Pixels::ColorElement | alpha = Pixels::AlphaOpaque | |||
) | throw () [virtual, inherited] |
Draws a vertical line ranging from point (x;yStart), included, to point (x;yStop), included if and only if endpoint drawing mode is set, with specified RGBA color, in this surface.
Clipping is performed.
This line will be antialiased if antialias mode is set.
VideoModule::GetEndPointDrawState, VideoModule::GetAntiAliasingState
Definition at line 1071 of file OSDLSurface.cc.
References OSDL::Video::TwoDimensional::Line::drawVertical().
bool Surface::drawVerticalLine | ( | Coordinate | x, | |
Coordinate | yStart, | |||
Coordinate | yStop, | |||
Pixels::ColorDefinition | colorDef = Pixels::White | |||
) | throw () [virtual, inherited] |
Draws a vertical line ranging from point (x;yStart), included, to point (x;yStop), included if and only if endpoint drawing mode is set, with specified RGBA color, in this surface.
Clipping is performed.
This line will be antialiased if antialias mode is set.
VideoModule::GetEndPointDrawState, VideoModule::GetAntiAliasingState.
Definition at line 1082 of file OSDLSurface.cc.
References OSDL::Video::TwoDimensional::Line::drawVertical().
bool Surface::drawLine | ( | Coordinate | xStart, | |
Coordinate | yStart, | |||
Coordinate | xStop, | |||
Coordinate | yStop, | |||
Pixels::ColorElement | red, | |||
Pixels::ColorElement | green, | |||
Pixels::ColorElement | blue, | |||
Pixels::ColorElement | alpha = Pixels::AlphaOpaque | |||
) | throw () [virtual, inherited] |
Draws a line in this surface, ranging from point (xStart;yStart), included, to point (xStop;yStop), included if and only if endpoint drawing mode is set, with specified RGBA color.
Clipping is performed.
This line will be antialiased if antialias mode is set.
VideoModule::GetEndPointDrawState, VideoModule::GetAntiAliasingState
Definition at line 1092 of file OSDLSurface.cc.
References OSDL::Video::TwoDimensional::Line::draw().
bool Surface::drawLine | ( | Coordinate | xStart, | |
Coordinate | yStart, | |||
Coordinate | xStop, | |||
Coordinate | yStop, | |||
Pixels::ColorDefinition | = Pixels::White | |||
) | throw () [virtual, inherited] |
Draws a line in this surface, ranging from point (xStart;yStart), included, to point (xStop;yStop), included if and only if endpoint drawing mode is set, with specified RGBA color.
Clipping is performed.
This line will be antialiased if antialias mode is set.
VideoModule::GetEndPointDrawState, VideoModule::GetAntiAliasingState
Definition at line 1104 of file OSDLSurface.cc.
References OSDL::Video::TwoDimensional::Line::draw().
bool Surface::drawCross | ( | const TwoDimensional::Point2D & | center, | |
Pixels::ColorDefinition | colorDef = Pixels::White , |
|||
Length | squareEdge = 5 | |||
) | throw () [virtual, inherited] |
Draws a cross centered in center, included in a square whose length of edge is squareEdge.
Locks surface if needed.
Clipping is performed.
This cross will be antialiased if antialias mode is set.
Definition at line 1114 of file OSDLSurface.cc.
References OSDL::Video::TwoDimensional::Line::drawCross().
bool Surface::drawCross | ( | Coordinate | xCenter, | |
Coordinate | yCenter, | |||
Pixels::ColorDefinition | colorDef = Pixels::White , |
|||
Length | squareEdge = 5 | |||
) | throw () [virtual, inherited] |
Draws a cross centered in center, included in a square whose length of edge is squareEdge.
Locks surface if needed.
Clipping is performed.
This cross will be antialiased if antialias mode is set.
Definition at line 1123 of file OSDLSurface.cc.
References OSDL::Video::TwoDimensional::Line::drawCross().
bool Surface::drawEdges | ( | Pixels::ColorDefinition | edgeColor = Pixels::White , |
|
Length | edgeWidth = 1 | |||
) | throw () [virtual, inherited] |
Draws the edges of this surface, with specified color and edge width.
edgeColor | the color of edges. | |
edgeWidth | the width of edges. |
Clipping is performed.
Definition at line 1132 of file OSDLSurface.cc.
virtual bool OSDL::Video::Surface::drawBox | ( | const UprightRectangle & | rectangle, | |
Pixels::ColorElement | red, | |||
Pixels::ColorElement | green, | |||
Pixels::ColorElement | blue, | |||
Pixels::ColorElement | alpha = Pixels::AlphaOpaque , |
|||
bool | filled = true | |||
) | throw () [virtual, inherited] |
Draws a box with specified RGBA color.
filled | tells whether the drawn rectangle should be filled with specified color, or if only its sides should be drawn. |
virtual bool OSDL::Video::Surface::drawBox | ( | const UprightRectangle & | rectangle, | |
Pixels::ColorDefinition | colorDef = Pixels::White , |
|||
bool | filled = true | |||
) | throw () [virtual, inherited] |
Draws a box with specified RGBA color.
rectangle | the box to fill | |
colorDef | the fill color | |
filled | tells whether the drawn rectangle should be filled with specified color, or if only its sides should be drawn. |
bool Surface::drawCircle | ( | Coordinate | xCenter, | |
Coordinate | yCenter, | |||
Length | radius, | |||
Pixels::ColorElement | red, | |||
Pixels::ColorElement | green, | |||
Pixels::ColorElement | blue, | |||
Pixels::ColorElement | alpha = Pixels::AlphaOpaque , |
|||
bool | filled = true , |
|||
bool | blended = true | |||
) | throw () [virtual, inherited] |
Draws a circle whose center is (xCenter,yCenter) of specified radius, with specified RGBA color, on this surface.
filled | tells whether the circle should be filled (disc). | |
blended | tells whether, for each pixel of disc, the specified color should be blended with the one of the target pixel (if true), or if the specified color should replace the former one, regardless of any blending (if false). Note that only discs may be drawn without being blended : circles are always blended. |
Clipping is performed.
A circle will be antialiased if antialias mode is set.
Definition at line 1192 of file OSDLSurface.cc.
References OSDL::Video::TwoDimensional::drawCircle().
Referenced by OSDL::Video::TwoDimensional::drawDiscWithEdge().
bool Surface::drawCircle | ( | Coordinate | xCenter, | |
Coordinate | yCenter, | |||
Length | radius, | |||
Pixels::ColorDefinition | colorDef = Pixels::White , |
|||
bool | filled = true , |
|||
bool | blended = true | |||
) | throw () [virtual, inherited] |
Draws a circle whose center is (xCenter,yCenter) of specified radius, with specified RGBA color, on this surface.
filled | tells whether the circle should be filled (disc). | |
blended | tells whether, for each pixel of disc, the specified color should be blended with the one of the target pixel (if true), or if the specified color should replace the former one, regardless of any blending (if false). Note that only discs may be drawn without being blended : circles are always blended. |
Clipping is performed.
A circle will be antialiased if antialias mode is set.
Definition at line 1204 of file OSDLSurface.cc.
References OSDL::Video::TwoDimensional::drawCircle().
bool Surface::drawDiscWithEdge | ( | Coordinate | xCenter, | |
Coordinate | yCenter, | |||
Length | outerRadius, | |||
Length | innerRadius, | |||
Pixels::ColorDefinition | ringColorDef = Pixels::Blue , |
|||
Pixels::ColorDefinition | discColorDef = Pixels::White , |
|||
bool | blended = true | |||
) | throw () [virtual, inherited] |
Draws a disc whose center is (xCenter,yCenter), of specified radius (totalRadius), filled with specified color discColorDef, with a ring in it, on its border, i.e.
starting from innerRadius to totalRadius, colored with ringColorDef, on this surface.
xCenter | the abscissa of the center of the disc. | |
yCenter | the ordinate of the center of the disc. | |
outerRadius | the overall disc radius, including the border ring. | |
innerRadius,the | radius from which the ring is drawn, until totalRadius is reached. | |
ringColorDef | the ring color, the color of the border of this disk. | |
discColorDef | the inner color of the disc. | |
blended | tells whether, for each pixel of the edged disc, the specified color should be blended with the one of the target pixel (if true), or if the specified color should replace the former one, regardless of any blending (if false). |
Locks surface if needed, cipping is performed, disc will be antialiased if antialias mode is set.
Definition at line 1215 of file OSDLSurface.cc.
References OSDL::Video::TwoDimensional::drawDiscWithEdge().
bool Surface::drawEllipse | ( | Coordinate | xCenter, | |
Coordinate | yCenter, | |||
Length | horizontalRadius, | |||
Length | verticalRadius, | |||
Pixels::ColorElement | red, | |||
Pixels::ColorElement | green, | |||
Pixels::ColorElement | blue, | |||
Pixels::ColorElement | alpha = Pixels::AlphaOpaque , |
|||
bool | filled = true | |||
) | throw () [virtual, inherited] |
Draws an ellipse whose center is (xCenter,yCenter), with specified horizontal and vertical radii, with specified RGBA color, on this surface.
filled | tells whether the ellipse should be filled. |
Clipping is performed.
An unfilled ellipse will be antialiased if antialias mode is set.
Definition at line 1227 of file OSDLSurface.cc.
References OSDL::Video::TwoDimensional::drawEllipse().
bool Surface::drawEllipse | ( | Coordinate | xCenter, | |
Coordinate | yCenter, | |||
Length | horizontalRadius, | |||
Length | verticalRadius, | |||
Pixels::ColorDefinition | colorDef, | |||
bool | filled = true | |||
) | throw () [virtual, inherited] |
Draws an ellipse whose center is (xCenter,yCenter), with specified horizontal and vertical radii, with specified RGBA color, on this surface.
filled | tells whether the ellipse should be filled. |
Clipping is performed.
An unfilled ellipse will be antialiased if antialias mode is set.
Definition at line 1239 of file OSDLSurface.cc.
References OSDL::Video::TwoDimensional::drawEllipse().
bool Surface::drawPie | ( | Coordinate | xCenter, | |
Coordinate | yCenter, | |||
Length | radius, | |||
Ceylan::Maths::AngleInDegrees | angleStart, | |||
Ceylan::Maths::AngleInDegrees | angleStop, | |||
Pixels::ColorElement | red, | |||
Pixels::ColorElement | green, | |||
Pixels::ColorElement | blue, | |||
Pixels::ColorElement | alpha = Pixels::AlphaOpaque | |||
) | throw () [virtual, inherited] |
Draws a polygon-based filled pie whose center is (xCenter,yCenter) of specified radius, with specified RGBA color, on this surface, starting from angleStart, stopping to angleStop, both expressed in degrees.
xCenter | the abscissa of the center of the pie. | |
yCenter | the ordinate of the center of the pie. | |
radius | the radius of the pie. | |
angleStart | the starting angle of the pie, in degrees. | |
angleStop | the stopping angle of the pie, in degrees. | |
red | the red color coordinate of fill color. | |
green | the green color coordinate of fill color. | |
blue | the blue color coordinate of fill color. | |
alpha | the alpha color coordinate of fill color. |
Clipping is performed.
Definition at line 1251 of file OSDLSurface.cc.
References OSDL::Video::TwoDimensional::drawPie().
bool Surface::drawPie | ( | Coordinate | xCenter, | |
Coordinate | yCenter, | |||
Length | radius, | |||
Ceylan::Maths::AngleInDegrees | angleStart, | |||
Ceylan::Maths::AngleInDegrees | angleStop, | |||
Pixels::ColorDefinition | colorDef | |||
) | throw () [virtual, inherited] |
Draws a polygon-based filled pie whose center is (xCenter,yCenter) of specified radius, with specified RGBA color, on this surface, starting from angleStart, stopping to angleStop.
xCenter | the abscissa of the center of the pie. | |
yCenter | the ordinate of the center of the pie. | |
radius | the radius of the pie. | |
angleStart | the starting angle of the pie, in degrees. | |
angleStop | the stopping angle of the pie, in degrees. | |
colorDef | the color definition of fill color. |
Clipping is performed.
Definition at line 1264 of file OSDLSurface.cc.
References OSDL::Video::TwoDimensional::drawPie().
bool Surface::drawTriangle | ( | Coordinate | x1, | |
Coordinate | y1, | |||
Coordinate | x2, | |||
Coordinate | y2, | |||
Coordinate | x3, | |||
Coordinate | y3, | |||
Pixels::ColorElement | red, | |||
Pixels::ColorElement | green, | |||
Pixels::ColorElement | blue, | |||
Pixels::ColorElement | alpha = Pixels::AlphaOpaque , |
|||
bool | filled = true | |||
) | throw () [virtual, inherited] |
Draws a triangle defined by specified three points, with specified RGBA color, on this surface.
filled | tells whether the triangle should be filled (disc). |
Clipping is performed.
Will be antialiased if antialias mode is set.
Definition at line 1277 of file OSDLSurface.cc.
References OSDL::Video::TwoDimensional::drawTriangle().
bool Surface::drawTriangle | ( | Coordinate | x1, | |
Coordinate | y1, | |||
Coordinate | x2, | |||
Coordinate | y2, | |||
Coordinate | x3, | |||
Coordinate | y3, | |||
Pixels::ColorDefinition | colorDef, | |||
bool | filled = true | |||
) | throw () [virtual, inherited] |
Draws a triangle defined by specified three points, with specified RGBA color, on this surface.
filled | tells whether the triangle should be filled (disc). |
Clipping is performed.
Will be antialiased if antialias mode is set.
Definition at line 1291 of file OSDLSurface.cc.
References OSDL::Video::TwoDimensional::drawTriangle().
bool Surface::drawTriangle | ( | const TwoDimensional::Point2D & | p1, | |
const TwoDimensional::Point2D & | p2, | |||
const TwoDimensional::Point2D & | p3, | |||
Pixels::ColorElement | red, | |||
Pixels::ColorElement | green, | |||
Pixels::ColorElement | blue, | |||
Pixels::ColorElement | alpha = Pixels::AlphaOpaque , |
|||
bool | filled = true | |||
) | throw () [virtual, inherited] |
Draws a triangle defined by specified three points, with specified RGBA color, on this surface.
filled | tells whether the triangle should be filled (disc). |
Clipping is performed.
Will be antialiased if antialias mode is set.
Definition at line 1303 of file OSDLSurface.cc.
References OSDL::Video::TwoDimensional::drawTriangle().
bool Surface::drawTriangle | ( | const TwoDimensional::Point2D & | p1, | |
const TwoDimensional::Point2D & | p2, | |||
const TwoDimensional::Point2D & | p3, | |||
Pixels::ColorDefinition | colorDef, | |||
bool | filled = true | |||
) | throw () [virtual, inherited] |
Draws a triangle defined by specified three points, with specified RGBA color, on this surface.
filled | tells whether the triangle should be filled (disc). |
Clipping is performed.
Will be antialiased if antialias mode is set.
Definition at line 1317 of file OSDLSurface.cc.
References OSDL::Video::TwoDimensional::drawTriangle().
virtual bool OSDL::Video::Surface::drawPolygon | ( | const std::list< TwoDimensional::Point2D * > | summits, | |
Coordinate | x, | |||
Coordinate | y, | |||
Pixels::ColorElement | red, | |||
Pixels::ColorElement | green, | |||
Pixels::ColorElement | blue, | |||
Pixels::ColorElement | alpha = Pixels::AlphaOpaque , |
|||
bool | filled = true | |||
) | throw () [virtual, inherited] |
Draws a polygon defined by specified list of points, with specified RGBA color, on specified surface.
summits | could be a 'const' list of 'const' Point2D pointers, but the STL would not be able to match it with mostly used argument 'const list of Point2D non-const pointers'. | |
x | the abscissa the polygon should be translated of, on screen. | |
y | the ordinate the polygon should be translated of, on screen. | |
filled | tells whether the polygon should be filled. |
Clipping is performed.
Will be antialiased if antialias mode is set.
virtual bool OSDL::Video::Surface::drawPolygon | ( | const std::list< TwoDimensional::Point2D * > | summits, | |
Coordinate | x, | |||
Coordinate | y, | |||
Pixels::ColorDefinition | colorDef, | |||
bool | filled = true | |||
) | throw () [virtual, inherited] |
Draws a polygon defined by specified list of points, with specified RGBA color, on specified surface.
summits | could be a 'const' list of 'const' Point2D pointers, but the STL would not be able to match it with mostly used argument 'const list of Point2D non-const pointers'. | |
x | the abscissa the polygon should be translated of, on screen. | |
y | the ordinate the polygon should be translated of, on screen. | |
filled | tells whether the polygon should be filled. |
Clipping is performed.
Will be antialiased if antialias mode is set.
bool Surface::drawGrid | ( | Length | columnStride = 20 , |
|
Length | rowStride = 20 , |
|||
Pixels::ColorDefinition | lineColor = Pixels::White , |
|||
bool | fillBackground = false , |
|||
Pixels::ColorDefinition | backgroundColor = Pixels::Black | |||
) | throw () [virtual, inherited] |
Draws a grid, with specified space between columns and rows and specified colors.
columnStride | the number of pixels between two columns. | |
rowStride | the number of pixels between two rows. | |
lineColor | the color of the grid lines. | |
fillBackground | tells whether a background should be filled. | |
backgroundColor | the color of the background, if activated. |
Locks surface if needed.
Definition at line 1353 of file OSDLSurface.cc.
bool Surface::printText | ( | const std::string & | text, | |
Coordinate | x, | |||
Coordinate | y, | |||
Pixels::ColorElement | red, | |||
Pixels::ColorElement | green, | |||
Pixels::ColorElement | blue, | |||
Pixels::ColorElement | alpha = Pixels::AlphaOpaque | |||
) | throw () [virtual, inherited] |
Prints specified string on this surface, with specified color, taking as upper left corner specified coordinates.
Basic font will be used.
Definition at line 1398 of file OSDLSurface.cc.
References OSDL::Video::TwoDimensional::Text::printBasic().
bool Surface::printText | ( | const std::string & | text, | |
Coordinate | x, | |||
Coordinate | y, | |||
ColorDefinition | colorDef = Pixels::White | |||
) | throw () [virtual, inherited] |
Prints specified string on this surface, with specified color, taking as upper left corner specified coordinates.
Basic font will be used.
Definition at line 1409 of file OSDLSurface.cc.
References OSDL::Video::TwoDimensional::Text::printBasic().
bool Surface::blitTo | ( | Surface & | targetSurface | ) | const throw ( VideoException ) [virtual, inherited] |
Blits this surface onto specified surface.
Blits from a RGBA Surface with AlphaBlendingBlit set to another RGBA surface will keep the alpha of the destination surface. This means that you cannot compose two arbitrary RGBA surfaces this way and get the result you would expect from "overlaying" them : the destination alpha will work as a mask. Hence one might set the alpha of the destination surface to targeted value before the blit.
targetSurface | the destination surface this surface will be blitted to, starting at [0;0] in the destination surface : both upper left corners will correspond. |
VideoMemoryLostException | if either of the surfaces was in video memory, and if the video memory was lost : it then should be reloaded with content and re-blitted. Otherwise, if blit went wrong differently, throw a commented VideoException. |
Definition at line 1418 of file OSDLSurface.cc.
Referenced by OSDL::Video::TwoDimensional::Text::TrueTypeFont::blitLatin1Glyph(), OSDL::Video::TwoDimensional::Text::Font::blitLatin1Text(), OSDL::Video::TwoDimensional::drawDiscWithEdge(), OSDL::Video::TwoDimensional::Widget::redraw(), redraw(), OSDL::Video::TwoDimensional::TextWidget::redrawBackBuffer(), redrawInternal(), and OSDL::Video::Surface::resize().
bool Surface::blitTo | ( | Surface & | targetSurface, | |
Coordinate | x, | |||
Coordinate | y | |||
) | const throw ( VideoException ) [virtual, inherited] |
Blits this surface onto specified surface.
Blits from a RGBA Surface with AlphaBlendingBlit set to another RGBA surface will keep the alpha of the destination surface. This means that you cannot compose two arbitrary RGBA surfaces this way and get the result you would expect from "overlaying" them : the destination alpha will work as a mask. Hence one might set the alpha of the destination surface to targeted value before the blit.
targetSurface | the destination surface this surface will be blitted to. | |
x | abscissa of the destination surface where this surface will be blitted. | |
y | ordinate of the destination surface where this surface will be blitted |
VideoMemoryLostException | if either of the surfaces were in video memory, and if the video memory was lost : it then should be reloaded with content and re-blitted. Otherwise, if blit went wrong differently, throw a commented VideoException. |
Definition at line 1426 of file OSDLSurface.cc.
References OSDL::Utils::getBackendLastError(), and OSDL::Video::Pixels::toString().
bool Surface::blitTo | ( | Surface & | targetSurface, | |
const TwoDimensional::Point2D & | location | |||
) | const throw ( VideoException ) [virtual, inherited] |
Blits this surface onto specified surface.
targetSurface | the destination surface this surface will be blitted to. | |
location | the point of the destination surface where this surface will be blitted. |
VideoMemoryLostException | if either of the surfaces was in video memory, and if the video memory was lost : it then should be reloaded with content and re-blitted. Otherwise, if blit went wrong differently, throw a commented VideoException. |
Definition at line 1489 of file OSDLSurface.cc.
bool Surface::blitTo | ( | Surface & | targetSurface, | |
const TwoDimensional::UprightRectangle & | sourceRectangle, | |||
const TwoDimensional::Point2D & | destinationLocation | |||
) | const throw ( VideoException ) [virtual, inherited] |
Blits this surface onto specified surface.
targetSurface | the destination surface this surface will be blitted to. | |
sourceRectangle | a clipping rectangle defining which part of this surface is to be blitted. | |
destinationLocation | the point of the destination surface where this surface will be blitted. |
VideoMemoryLostException | if either of the surfaces were in video memory, and if the video memory was lost : it then should be reloaded with content and re-blitted. |
Definition at line 1499 of file OSDLSurface.cc.
References OSDL::Utils::getBackendLastError().
Surface & Surface::zoom | ( | Ceylan::Maths::Real | abscissaZoomFactor, | |
Ceylan::Maths::Real | ordinateZoomFactor, | |||
bool | antialiasing = true | |||
) | const throw ( VideoException ) [virtual, inherited] |
Returns a newly created surface, obtained from this surface after a zoom of given factors.
If, for this surface, pixel color is not 8 bit or 32 bit, then a 32-bit surface will be internally created and used for the zoom.
Ownership of the returned surface is transferred to the caller, who will have to deallocate it when having finished with it.
The final rendering speed depends first on antialiasing being requested or not, then on resulting surface size.
A surface is returned instead of zooming directly this surface to avoid accumulating rounding errors when zooming multiple times the same image : better use a constant source surface from which zoomed ones are created with various zoom factors than changing the same surface again and again.
abscissaZoomFactor | the zoom factor to be applied on the abscissa axis. If negative, the surface is flipped against this axis. No antialiasing will be performed in this case. | |
ordinateZoomFactor | the zoom factor to be applied on the ordinate axis. If negative, the surface is flipped against this axis. No antialiasing will be performed in this case. | |
antialiasing | if true and if zoom factors are positive, requests antialiasing (fine and expensive interpolation). 8-bit surfaces will never be antialiased. |
Definition at line 1561 of file OSDLSurface.cc.
Surface & Surface::rotoZoom | ( | Ceylan::Maths::AngleInDegrees | angle, | |
Ceylan::Maths::Real | zoomFactor, | |||
bool | antialiasing = true | |||
) | const throw ( VideoException ) [virtual, inherited] |
Returns a newly created surface, obtained from this surface after a rotation of given angle and a zoom of given factor.
If, for this surface, pixel color is not 8 bit or 32 bit, then a 32-bit surface will be internally created and used for the rotozoom.
Ownership of the returned surface is transferred to the caller, who will have to deallocate it when having finished with it.
The final rendering speed depends first on antialiasing being requested or not, then on resulting surface size.
A surface is returned instead of rotating this surface to avoid accumulating rounding errors when rotozooming multiple times the same image : better use a constant source surface from which rotozoomed ones are created with various angles and zoom factors than changing the same surface again and again.
angle | the angle of rotation, in degrees. | |
zoomFactor | the zoom factor to be applied on both surface dimensions. If negative, the surface is rotated of Pi before the angle is applied. No antialiasing will be performed in this case. | |
antialiasing | if true and if zoom factor is positive, requests antialiasing (fine and expensive interpolation). 8-bit surfaces will never be antialiased. |
Definition at line 1585 of file OSDLSurface.cc.
Surface & Surface::rotoZoom | ( | Ceylan::Maths::AngleInDegrees | angle, | |
Ceylan::Maths::Real | abscissaZoomFactor, | |||
Ceylan::Maths::Real | ordinateZoomFactor, | |||
bool | antialiasing = true | |||
) | const throw ( VideoException ) [virtual, inherited] |
Returns a newly created surface, obtained from this surface after a rotation of given angle and zooms of given factors.
If, for this surface, pixel color is not 8 bit or 32 bit, then a 32-bit surface will be internally created and used for the rotozoom.
Ownership of the returned surface is transferred to the caller, who will have to deallocate it when finish with it.
The final rendering speed depends first on antialiasing being requested or not, then on resulting surface size.
A surface is returned instead of rotating this surface to avoid accumulating rounding errors when rotozooming multiple times the same image : better use a constant source surface from which rotozoomed ones are created with various angles and zoom factors than changing the same surface again and again.
angle | the angle of rotation, in degrees. | |
abscissaZoomFactor | the zoom factor to be applied on the abscissa axis. If negative, the surface is flipped against this axis. No antialiasing will be performed in this case. | |
ordinateZoomFactor | the zoom factor to be applied on the ordinate axis. If negative, the surface is flipped against this axis. No antialiasing will be performed in this case. | |
antialiasing | if true and if zoom factors are positive, requests antialiasing (fine and expensive interpolation). 8-bit surfaces will never be antialiased. |
Definition at line 1595 of file OSDLSurface.cc.
UprightRectangle & Surface::getClippingArea | ( | ) | const throw () [virtual, inherited] |
Returns this surface's clipping area, expressed thanks to an UprightRectangle.
Should not be confused with the actual area corresponding to this surface, which is another UprightRectangle.
Definition at line 1621 of file OSDLSurface.cc.
References OSDL::Video::Surface::_surface, and OSDL::Video::TwoDimensional::UprightRectangle::UprightRectangle().
virtual void OSDL::Video::Surface::setClippingArea | ( | UprightRectangle & | newClippingArea | ) | throw () [virtual, inherited] |
Sets this surface's clipping area, expressed thanks to an UprightRectangle, whose ownership is left to the caller.
Should not be confused with the actual area corresponding to this surface, which is another UprightRectangle.
virtual void OSDL::Video::Surface::loadImage | ( | const std::string & | filename, | |
bool | blitOnly = false , |
|||
bool | convertToDisplayFormat = true , |
|||
bool | convertWithAlpha = true | |||
) | throw ( TwoDimensional::ImageException ) [virtual, inherited] |
Loads an image, whose format will be auto-detected, from specified file, into this surface.
This is a Surface factory.
targetSurface | the surface that should correspond to the loaded image. | |
filename | the name of the image file. | |
blitOnly | tells whether the loaded image surface should only be blitted into the supposed already existing internal surface and then be deallocated (if flag is true), or if this loaded surface should simply replace the former one (if flag is false). | |
convertToDisplayFormat | tells whether this loaded image should have its format converted to the screen's format, in order to offer faster blits if ever that surface was to be blitted multiple times to the screen (one-time-for-all conversion). | |
convertWithAlpha | if the conversion to screen format is selected (convertToDisplayFormat is true), tells whether the converted surface should also have an alpha channel. |
Referenced by OSDL::Video::Surface::LoadImage().
virtual void OSDL::Video::Surface::loadJPG | ( | const std::string & | filename, | |
bool | blitOnly = false , |
|||
bool | convertToDisplayFormat = true , |
|||
bool | convertWithAlpha = true | |||
) | throw ( TwoDimensional::ImageException ) [virtual, inherited] |
Loads a JPEG image from specified file into this surface.
targetSurface | the surface that should correspond to the loaded image. | |
filename | the name of the JPEG file. | |
blitOnly | tells whether the loaded image surface should only be blitted into the supposed already existing internal surface and then be deallocated (if flag is true), or if this loaded surface should simply replace the former one (if flag is false). | |
convertToDisplayFormat | tells whether this loaded image should have its format converted to the screen's format, in order to offer faster blits if ever that surface was to be blitted multiple times to the screen (one-time-for-all conversion). | |
convertWithAlpha | if the conversion to screen format is selected (convertToDisplayFormat is true), tells whether the converted surface should also have an alpha channel. |
virtual void OSDL::Video::Surface::loadPNG | ( | const std::string & | filename, | |
bool | blitOnly = false , |
|||
bool | convertToDisplayFormat = true , |
|||
bool | convertWithAlpha = true | |||
) | throw ( TwoDimensional::ImageException ) [virtual, inherited] |
Loads a PNG image from specified file into this surface.
targetSurface | the surface that should correspond to the loaded image. | |
filename | the name of the PNG file. | |
blitOnly | tells whether the loaded image surface should only be blitted into the supposed already existing internal surface and then be deallocated (if flag is true), or if this loaded surface should simply replace the former one (if flag is false). | |
convertToDisplayFormat | tells whether this loaded image should have its format converted to the screen's format, in order to offer faster blits if ever that surface was to be blitted multiple times to the screen (one-time-for-all conversion). | |
convertWithAlpha | if the conversion to screen format is selected (convertToDisplayFormat is true), tells whether the converted surface should also have an alpha channel. |
virtual void OSDL::Video::Surface::loadBMP | ( | const std::string & | filename, | |
bool | blitOnly = false , |
|||
bool | convertToDisplayFormat = true , |
|||
bool | convertWithAlpha = true | |||
) | throw ( TwoDimensional::ImageException ) [virtual, inherited] |
Loads a BMP image from specified file into this surface.
targetSurface | the surface that should correspond to the loaded image. | |
filename | the name of the BMP file. | |
blitOnly | tells whether the loaded image surface should only be blitted into the supposed already existing internal surface and then be deallocated (if flag is true), or if this loaded surface should simply replace the former one (if flag is false). | |
convertToDisplayFormat | tells whether this loaded image should have its format converted to the screen's format, in order to offer faster blits if ever that surface was to be blitted multiple times to the screen (one-time-for-all conversion). | |
convertWithAlpha | if the conversion to screen format is selected (convertToDisplayFormat is true), tells whether the converted surface should also have an alpha channel. |
virtual void OSDL::Video::Surface::loadGIF | ( | const std::string & | filename, | |
bool | blitOnly = false , |
|||
bool | convertToDisplayFormat = true , |
|||
bool | convertWithAlpha = true | |||
) | throw ( TwoDimensional::ImageException ) [virtual, inherited] |
Loads a GIF image from specified file into this surface.
targetSurface | the surface that should correspond to the loaded image. | |
filename | the name of the GIF file. | |
blitOnly | tells whether the loaded image surface should only be blitted into the supposed already existing internal surface and then be deallocated (if flag is true), or if this loaded surface should simply replace the former one (if flag is false). | |
convertToDisplayFormat | tells whether this loaded image should have its format converted to the screen's format, in order to offer faster blits if ever that surface was to be blitted multiple times to the screen (one-time-for-all conversion). | |
convertWithAlpha | if the conversion to screen format is selected (convertToDisplayFormat is true), tells whether the converted surface should also have an alpha channel. |
virtual void OSDL::Video::Surface::loadLBM | ( | const std::string & | filename, | |
bool | blitOnly = false , |
|||
bool | convertToDisplayFormat = true , |
|||
bool | convertWithAlpha = true | |||
) | throw ( TwoDimensional::ImageException ) [virtual, inherited] |
Loads a LBM image from specified file into this surface.
targetSurface | the surface that should correspond to the loaded image. | |
filename | the name of the LBM file. | |
blitOnly | tells whether the loaded image surface should only be blitted into the supposed already existing internal surface and then be deallocated (if flag is true), or if this loaded surface should simply replace the former one (if flag is false). | |
convertToDisplayFormat | tells whether this loaded image should have its format converted to the screen's format, in order to offer faster blits if ever that surface was to be blitted multiple times to the screen (one-time-for-all conversion). | |
convertWithAlpha | if the conversion to screen format is selected (convertToDisplayFormat is true), tells whether the converted surface should also have an alpha channel. |
virtual void OSDL::Video::Surface::loadPCX | ( | const std::string & | filename, | |
bool | blitOnly = false , |
|||
bool | convertToDisplayFormat = true , |
|||
bool | convertWithAlpha = true | |||
) | throw ( TwoDimensional::ImageException ) [virtual, inherited] |
Loads a PCX image from specified file into this surface.
targetSurface | the surface that should correspond to the loaded image. | |
filename | the name of the PCX file. | |
blitOnly | tells whether the loaded image surface should only be blitted into the supposed already existing internal surface and then be deallocated (if flag is true), or if this loaded surface should simply replace the former one (if flag is false). | |
convertToDisplayFormat | tells whether this loaded image should have its format converted to the screen's format, in order to offer faster blits if ever that surface was to be blitted multiple times to the screen (one-time-for-all conversion). | |
convertWithAlpha | if the conversion to screen format is selected (convertToDisplayFormat is true), tells whether the converted surface should also have an alpha channel. |
virtual void OSDL::Video::Surface::loadPNM | ( | const std::string & | filename, | |
bool | blitOnly = false , |
|||
bool | convertToDisplayFormat = true , |
|||
bool | convertWithAlpha = true | |||
) | throw ( TwoDimensional::ImageException ) [virtual, inherited] |
Loads a PNM image from specified file into this surface.
targetSurface | the surface that should correspond to the loaded image. | |
filename | the name of the PNM file. | |
blitOnly | tells whether the loaded image surface should only be blitted into the supposed already existing internal surface and then be deallocated (if flag is true), or if this loaded surface should simply replace the former one (if flag is false). | |
convertToDisplayFormat | tells whether this loaded image should have its format converted to the screen's format, in order to offer faster blits if ever that surface was to be blitted multiple times to the screen (one-time-for-all conversion). | |
convertWithAlpha | if the conversion to screen format is selected (convertToDisplayFormat is true), tells whether the converted surface should also have an alpha channel. |
virtual void OSDL::Video::Surface::loadTGA | ( | const std::string & | filename, | |
bool | blitOnly = false , |
|||
bool | convertToDisplayFormat = true , |
|||
bool | convertWithAlpha = true | |||
) | throw ( TwoDimensional::ImageException ) [virtual, inherited] |
Loads a TGA image from specified file into this surface.
targetSurface | the surface that should correspond to the loaded image. | |
filename | the name of the TGA file. | |
blitOnly | tells whether the loaded image surface should only be blitted into the supposed already existing internal surface and then be deallocated (if flag is true), or if this loaded surface should simply replace the former one (if flag is false). | |
convertToDisplayFormat | tells whether this loaded image should have its format converted to the screen's format, in order to offer faster blits if ever that surface was to be blitted multiple times to the screen (one-time-for-all conversion). | |
convertWithAlpha | if the conversion to screen format is selected (convertToDisplayFormat is true), tells whether the converted surface should also have an alpha channel. |
virtual void OSDL::Video::Surface::loadXPM | ( | const std::string & | filename, | |
bool | blitOnly = false , |
|||
bool | convertToDisplayFormat = true , |
|||
bool | convertWithAlpha = true | |||
) | throw ( TwoDimensional::ImageException ) [virtual, inherited] |
Loads a XPM image from specified file into this surface.
targetSurface | the surface that should correspond to the loaded image. | |
filename | the name of the XPM file. | |
blitOnly | tells whether the loaded image surface should only be blitted into the supposed already existing internal surface and then be deallocated (if flag is true), or if this loaded surface should simply replace the former one (if flag is false). | |
convertToDisplayFormat | tells whether this loaded image should have its format converted to the screen's format, in order to offer faster blits if ever that surface was to be blitted multiple times to the screen (one-time-for-all conversion). | |
convertWithAlpha | if the conversion to screen format is selected (convertToDisplayFormat is true), tells whether the converted surface should also have an alpha channel. |
void Surface::savePNG | ( | const std::string & | filename, | |
bool | overwrite = true | |||
) | throw ( TwoDimensional::ImageException ) [virtual, inherited] |
Saves the current content of this surface into a PNG file.
filename | the name of the PNG file to be created (ex : 'screenshot.png') | |
overwrite | tells whether an existing file filename should be overwritten, or if an exception should be raised. |
Definition at line 1757 of file OSDLSurface.cc.
References OSDL::Video::TwoDimensional::Image::SavePNG().
void Surface::saveBMP | ( | const std::string & | filename, | |
bool | overwrite = true | |||
) | throw ( TwoDimensional::ImageException ) [virtual, inherited] |
Saves the current content of this surface into a BMP file.
filename | the name of the BMP file to create (ex : 'screenshot.bmp') | |
overwrite | tells whether an existing file filename should be overwritten, or if an exception should be raised. |
Definition at line 1766 of file OSDLSurface.cc.
References OSDL::Utils::getBackendLastError().
void Surface::update | ( | ) | throw ( VideoException ) [virtual, inherited] |
Updates the display with this surface, which will be automatically set in an up-to-date state if necessary, so that it is fully redrawn, including its widgets.
If it is a screen surface (either OpenGL or not), it will be updated in order to have the display match the surface buffer. Does nothing more if this surface is not a screen surface.
on hardware that does not support double-buffering, this is equivalent to calling the updateRectangle method with all arguments to zero.
VideoException | if the operation failed, including if this surface is not a screen surface. |
Definition at line 1782 of file OSDLSurface.cc.
References OSDL::Video::Surface::_displayType, OSDL::Video::Surface::_surface, OSDL::Video::Surface::BackBuffer, OSDL::Video::Surface::ClassicalScreenSurface, OSDL::Utils::getBackendLastError(), OSDL::Video::Surface::OpenGLScreenSurface, and OSDL::Video::Surface::redraw().
virtual void OSDL::Video::Surface::updateRectangles | ( | const std::list< UprightRectangle * > & | listRects | ) | throw ( VideoException ) [virtual, inherited] |
Updates the part of this surface corresponding to the specified list of rectangles.
The surface must not be locked when this method is called.
It is advised to call this method only once per frame, since each call has some processing overhead. This is no restriction, since you can pass any number of rectangles each time.
VideoException | if the operation failed, including if this surface is not a screen surface. |
virtual void OSDL::Video::Surface::updateRectangle | ( | const UprightRectangle & | rect | ) | throw ( VideoException ) [virtual, inherited] |
Updates the part of this surface corresponding to specified rectangle.
The surface must not be locked when this method is called.
VideoException | if the operation failed, including if this surface is not a screen surface. |
void Surface::updateRectangle | ( | Coordinate | x, | |
Coordinate | y, | |||
Length | width, | |||
Length | height | |||
) | throw ( VideoException ) [virtual, inherited] |
Updates the part of this surface corresponding to specified rectangle.
If all arguments are equal to zero, the entire surface will be updated.
The surface must not be locked when this method is called.
VideoException | if the operation failed, including if this surface is not a screen surface. |
Definition at line 1901 of file OSDLSurface.cc.
bool Surface::getRedrawState | ( | ) | const throw () [virtual, inherited] |
Returns the current need for redraw state.
Definition at line 1932 of file OSDLSurface.cc.
References OSDL::Video::Surface::_needsRedraw.
Referenced by OSDL::Video::TwoDimensional::Widget::redraw(), OSDL::Video::Surface::redraw(), and redraw().
bool Surface::isInternalSurfaceAvailable | ( | ) | const throw () [virtual, inherited] |
Tells whether the internal SDL surface is void or not.
May be inline.
Definition at line 1997 of file OSDLSurface.cc.
References OSDL::Video::Surface::_surface.
void Surface::addWidget | ( | TwoDimensional::Widget & | widget | ) | throw ( VideoException ) [virtual, inherited] |
Registers specified widget to this surface, and put it at top level.
Definition at line 2005 of file OSDLSurface.cc.
void Surface::putWidgetToFront | ( | TwoDimensional::Widget & | widget | ) | throw ( VideoException ) [virtual, inherited] |
Changes stacking inside this container surface so that specified widget is put to front.
VideoException | if the widget is not a registered one. |
Definition at line 2046 of file OSDLSurface.cc.
void Surface::putWidgetToBack | ( | TwoDimensional::Widget & | widget | ) | throw ( VideoException ) [virtual, inherited] |
Changes stacking inside this container surface so that specified widget is put to back.
VideoException | if the widget is not a registered one. |
Definition at line 2063 of file OSDLSurface.cc.
void Surface::centerMousePosition | ( | ) | throw () [virtual, inherited] |
Centers in the middle of the screen the position of the mouse cursor, by generating a mouse motion event.
Definition at line 2081 of file OSDLSurface.cc.
References OSDL::Video::Surface::getHeight(), OSDL::Video::Surface::getWidth(), and OSDL::Video::Surface::setMousePosition().
void Surface::setMousePosition | ( | Coordinate | newX = 0 , |
|
Coordinate | newY = 0 | |||
) | throw () [virtual, inherited] |
Sets the position of the mouse cursor, by generating a mouse motion event.
Definition at line 2089 of file OSDLSurface.cc.
Referenced by OSDL::Video::Surface::centerMousePosition().
bool Surface::mustBeLocked | ( | ) | const throw () [virtual, inherited] |
Tells whether this surface has to be locked before modifying it.
When using a surface, in general there is no need to use this method because the lock/unlock methods take care of that.
Definition at line 2107 of file OSDLSurface.cc.
References OSDL::Video::Surface::_surface.
Ceylan::System::Size Surface::getSizeInMemory | ( | ) | const throw () [virtual, inherited] |
Returns the approximate size in memory, in bytes, currently taken by this object.
Definition at line 2142 of file OSDLSurface.cc.
References OSDL::Video::Surface::_surface.
virtual bool OSDL::Video::Surface::displayData | ( | const Ceylan::Maths::IntegerData * | dataArray, | |
Ceylan::Uint32 | dataCount, | |||
Pixels::ColorDefinition | pencilColor, | |||
Pixels::ColorDefinition | captionColor, | |||
Pixels::ColorDefinition | backgroundColor, | |||
const std::string & | caption = "" , |
|||
const UprightRectangle * | inBox = 0 | |||
) | throw () [virtual, inherited] |
Displays specified set of data, defined by dataArray, an array of dataCount IntegerData elements, as a curve drawn with pencilColor, on a background whose color is backgroundColor.
The whole display will be scaled vertically to fit into inBox. On the contrary, the abscissa will be used as is.
When choosing the width of the container (inBox), to avoid truncating the graph, add 2*graphAbscissaOffset to the number of samples that describes the curve, and it will fit at best : both left and right boundaries will be taken into account.
Surface & Surface::LoadImage | ( | const std::string & | filename, | |
bool | convertToDisplayFormat = true , |
|||
bool | convertWithAlpha = true | |||
) | throw ( TwoDimensional::ImageException ) [static, inherited] |
Surface factory : creates a new Surface instance from specified image file.
Image format, if supported, is auto-detected.
Definition at line 2463 of file OSDLSurface.cc.
References OSDL::Video::Surface::loadImage().
Referenced by OSDL::Video::OpenGL::GLTexture::GLTexture().
static std::string OSDL::Video::Surface::InterpretFlags | ( | Ceylan::Flags | flags | ) | throw () [static, inherited] |
Outputs a textual description of the given surface flags.
These flags are interpreted as surface flags only.
flags | the surface video settings to interpret. |
void Surface::preUnlock | ( | ) | throw () [protected, virtual, inherited] |
Effective unlocking of the surface.
Nevertheless, only lock/unlock pair should be used by user programs.
Definition at line 2116 of file OSDLSurface.cc.
References OSDL::Video::Surface::_surface.
void Surface::postLock | ( | ) | throw () [protected, virtual, inherited] |
Effective locking of the surface.
Nevertheless, only lock/unlock pair should be used by user programs.
Definition at line 2129 of file OSDLSurface.cc.
References OSDL::Video::Surface::_surface.
Offset Surface::getOffset | ( | ) | const throw () [inline, protected, inherited] |
Returns this surface's offset.
Definition at line 2624 of file OSDLSurface.cc.
References OSDL::Video::Surface::_surface.
void Surface::setOffset | ( | Offset | offset | ) | throw () [inline, protected, inherited] |
void Surface::flush | ( | ) | throw () [protected, virtual, inherited] |
Releases internal SDL surface.
Definition at line 2641 of file OSDLSurface.cc.
References OSDL::Video::Surface::_displayType, OSDL::Video::Surface::_surface, OSDL::Video::Surface::BackBuffer, and OSDL::Video::Surface::inconsistencyDetected().
Referenced by OSDL::Video::Surface::~Surface().
virtual void OSDL::Video::Surface::inconsistencyDetected | ( | const std::string & | message | ) | const throw () [protected, virtual, inherited] |
Triggered when an abnormal inconsistency is detected between OSDL's surface state and its back-end counterpart.
Referenced by OSDL::Video::Surface::flush().
Point2D UprightRectangle::getUpperLeftCorner | ( | ) | const throw () [virtual, inherited] |
Returns this UprightRectangle's upper left corner.
Definition at line 98 of file OSDLUprightRectangle.cc.
References OSDL::Video::TwoDimensional::UprightRectangle::_x, and OSDL::Video::TwoDimensional::UprightRectangle::_y.
void UprightRectangle::setUpperLeftCorner | ( | Point2D & | newUpperLeftCorner | ) | throw () [virtual, inherited] |
Sets this UprightRectangle's upper left corner, width and height do not change.
Definition at line 106 of file OSDLUprightRectangle.cc.
Coordinate UprightRectangle::getUpperLeftAbscissa | ( | ) | const throw () [virtual, inherited] |
Returns directly the abscissa of upper left corner.
Definition at line 117 of file OSDLUprightRectangle.cc.
References OSDL::Video::TwoDimensional::UprightRectangle::_x.
Referenced by OSDL::Video::TwoDimensional::TextWidget::redrawBackBuffer().
void UprightRectangle::setUpperLeftAbscissa | ( | Coordinate | newAbscissa | ) | throw () [virtual, inherited] |
Sets directly the abscissa of the upper left corner of this rectangle.
Definition at line 125 of file OSDLUprightRectangle.cc.
Referenced by OSDL::Video::TwoDimensional::UprightRectangle::drawWithRoundedCorners(), OSDL::Video::TwoDimensional::Widget::updateClientArea(), and OSDL::Video::TwoDimensional::TextWidget::updateClientArea().
Coordinate UprightRectangle::getUpperLeftOrdinate | ( | ) | const throw () [virtual, inherited] |
Returns directly the ordinate of upper left corner.
Definition at line 134 of file OSDLUprightRectangle.cc.
References OSDL::Video::TwoDimensional::UprightRectangle::_y.
Referenced by OSDL::Video::TwoDimensional::TextWidget::redrawBackBuffer().
void UprightRectangle::setUpperLeftOrdinate | ( | Coordinate | newOrdinate | ) | throw () [virtual, inherited] |
Sets directly the ordinate of the upper left corner of this rectangle.
Definition at line 142 of file OSDLUprightRectangle.cc.
Referenced by OSDL::Video::TwoDimensional::UprightRectangle::drawWithRoundedCorners(), OSDL::Video::TwoDimensional::Widget::updateClientArea(), and OSDL::Video::TwoDimensional::TextWidget::updateClientArea().
Point2D UprightRectangle::getLowerRightCorner | ( | ) | const throw () [virtual, inherited] |
Returns this UprightRectangle's lower right corner.
Definition at line 155 of file OSDLUprightRectangle.cc.
References OSDL::Video::TwoDimensional::UprightRectangle::_x, OSDL::Video::TwoDimensional::UprightRectangle::_y, OSDL::Video::TwoDimensional::UprightRectangle::getHeight(), and OSDL::Video::TwoDimensional::UprightRectangle::getWidth().
void UprightRectangle::setLowerRightCorner | ( | Point2D & | newLowerRightCorner | ) | throw ( VideoException) [virtual, inherited] |
Sets directly the lower right corner of this rectangle.
VideoException | if width or height would become negative. |
Definition at line 164 of file OSDLUprightRectangle.cc.
References OSDL::Video::Pixels::toString().
Coordinate UprightRectangle::getLowerRightAbscissa | ( | ) | const throw () [virtual, inherited] |
Returns directly the abscissa of lower right corner.
Definition at line 181 of file OSDLUprightRectangle.cc.
References OSDL::Video::TwoDimensional::UprightRectangle::_x, and OSDL::Video::TwoDimensional::UprightRectangle::getWidth().
void UprightRectangle::setLowerRightAbscissa | ( | Coordinate | newAbscissa | ) | throw ( VideoException ) [virtual, inherited] |
Sets directly the abscissa of the lower right corner of this rectangle.
VideoException | if width or height would become negative. |
Definition at line 189 of file OSDLUprightRectangle.cc.
References OSDL::Video::Pixels::toString().
Coordinate UprightRectangle::getLowerRightOrdinate | ( | ) | const throw () [virtual, inherited] |
Returns directly the ordinate of lower right corner.
Definition at line 205 of file OSDLUprightRectangle.cc.
References OSDL::Video::TwoDimensional::UprightRectangle::_y, and OSDL::Video::TwoDimensional::UprightRectangle::getHeight().
void UprightRectangle::setLowerRightOrdinate | ( | Coordinate | newOrdinate | ) | throw ( VideoException ) [virtual, inherited] |
Sets directly the ordinate of the lower right corner of this rectangle.
VideoException | if width or height would become negative. |
Definition at line 213 of file OSDLUprightRectangle.cc.
References OSDL::Video::Pixels::toString().
bool UprightRectangle::draw | ( | Surface & | target, | |
Pixels::ColorElement | red, | |||
Pixels::ColorElement | blue, | |||
Pixels::ColorElement | green, | |||
Pixels::ColorElement | alpha = Pixels::AlphaOpaque , |
|||
bool | filled = true | |||
) | const throw () [virtual, inherited] |
Draws this UprightRectangle to specified surface with specified RGBA color.
target | the surface to which this rectangle will be rendered. | |
filled | tells whether the drawn rectangle should be filled with specified color, or if only its sides should be drawn. |
Definition at line 265 of file OSDLUprightRectangle.cc.
References OSDL::Video::Pixels::convertRGBAToColorDefinition(), and OSDL::Video::TwoDimensional::Line::draw().
Referenced by OSDL::Video::TwoDimensional::UprightRectangle::drawWithRoundedCorners().
bool UprightRectangle::draw | ( | Surface & | target, | |
Pixels::ColorDefinition | colorDef = Pixels::White , |
|||
bool | filled = true | |||
) | const throw () [virtual, inherited] |
Draws this UprightRectangle to specified surface with specified RGBA color.
target | the surface to which this rectangle will be rendered. | |
filled | tells whether the drawn rectangle should be filled with specified color, or if only its sides should be drawn. |
Definition at line 276 of file OSDLUprightRectangle.cc.
References OSDL::Video::Pixels::convertColorDefinitionToRawPixelColor(), and OSDL::Video::Pixels::toString().
bool UprightRectangle::drawWithRoundedCorners | ( | Surface & | target, | |
Length | edgeWidth = 3 , |
|||
Pixels::ColorDefinition | edgeColorDef = Pixels::White , |
|||
Pixels::ColorDefinition | backgroundColorDef = Pixels::Transparent | |||
) | const throw () [virtual, inherited] |
Draws this UprightRectangle to specified surface with rounded corners, drawn with specified color, above a background of specified color.
The width of the borders can be chosen, and should not be incompatible with the dimensions of this rectangle.
target | the surface to which this rectangle will be rendered. | |
edgeWidth | the width of the edges of this rectangle. | |
edgeColorDef | the color definition of the edges of this rectangle. | |
backgroundColorDef | the color definition of the background of this rectangle. |
Definition at line 323 of file OSDLUprightRectangle.cc.
References OSDL::Video::Surface::AlphaBlendingBlit, OSDL::Video::Pixels::AlphaOpaque, OSDL::Video::Surface::ColorkeyBlit, OSDL::Video::TwoDimensional::UprightRectangle::draw(), OSDL::Video::Pixels::getCurrentColorMasks(), OSDL::Video::Surface::RLEColorkeyBlit, OSDL::Video::Pixels::selectColorDifferentFrom(), OSDL::Video::TwoDimensional::UprightRectangle::setUpperLeftAbscissa(), OSDL::Video::TwoDimensional::UprightRectangle::setUpperLeftOrdinate(), OSDL::Video::TwoDimensional::Point2D::setX(), OSDL::Video::TwoDimensional::Point2D::setY(), OSDL::Video::Surface::Software, and OSDL::Video::Pixels::toString().
Referenced by OSDL::Video::TwoDimensional::TextWidget::redrawBackBuffer().
Length UprightRectangle::computeRadiusForRoundRectangle | ( | Length | edgeWidth | ) | const throw ( VideoException ) [virtual, inherited] |
Computes the preferred radius of round corners for this rectangle, with the specified edge width.
edgeWidth | the edge width to take into account for the radius. |
VideoException | if no radius can fullfill the set of constraints due to this rectangle and the edge width. |
Definition at line 694 of file OSDLUprightRectangle.cc.
References OSDL::Video::Pixels::toString().
Referenced by OSDL::Video::TwoDimensional::TextWidget::updateClientArea().
SDL_Rect * UprightRectangle::toSDLRect | ( | ) | const throw ( VideoException ) [virtual, inherited] |
The overall surface where this widget (thanks to the back-buffer) and all its sub-widget tree will be rendered.
Definition at line 305 of file OSDLBackBufferedWidget.h.
Referenced by getWidgetRenderTarget(), redraw(), redrawInternal(), and ~BackBufferedWidget().
Tells whether the internal rendering of this widget should be updated.
Made private to force the use of get/set methods for child classes, otherwise callback notifications would not be triggered.
Definition at line 323 of file OSDLBackBufferedWidget.h.
Referenced by getBackBufferRedrawState().
Point2D OSDL::Video::TwoDimensional::Widget::_upperLeftCorner [protected, inherited] |
This widget's upper left corner, relatively to its container.
Definition at line 596 of file OSDLWidget.h.
Referenced by OSDL::Video::TwoDimensional::Widget::redraw(), and redraw().
UprightRectangle OSDL::Video::TwoDimensional::Widget::_clientArea [protected, inherited] |
The rectangular client area, defined in the referential of this widget.
This area is the one left for this widget specific renderings (ex : any decorations excluded).
Definition at line 607 of file OSDLWidget.h.
Referenced by OSDL::Video::TwoDimensional::Widget::getClientArea(), OSDL::Video::TwoDimensional::TextWidget::redrawBackBuffer(), OSDL::Video::TwoDimensional::Widget::updateClientArea(), and OSDL::Video::TwoDimensional::TextWidget::updateClientArea().
bool OSDL::Video::TwoDimensional::Widget::_decorated [protected, inherited] |
Tells whether this widget rendering should include decorations.
Definition at line 616 of file OSDLWidget.h.
Referenced by OSDL::Video::TwoDimensional::Widget::isDecorated(), OSDL::Video::TwoDimensional::TextWidget::redrawBackBuffer(), OSDL::Video::TwoDimensional::Widget::redrawInternal(), OSDL::Video::TwoDimensional::Widget::updateClientArea(), and OSDL::Video::TwoDimensional::Widget::updateDecorationFlag().
std::string OSDL::Video::TwoDimensional::Widget::_title [protected, inherited] |
This Widget's title.
Definition at line 620 of file OSDLWidget.h.
Referenced by OSDL::Video::TwoDimensional::Widget::updateDecorationFlag().
bool OSDL::Video::TwoDimensional::Widget::_minMaximizable [protected, inherited] |
Tells whether this widget can be minimized and maximized by the user.
Definition at line 632 of file OSDLWidget.h.
Referenced by OSDL::Video::TwoDimensional::Widget::updateDecorationFlag().
bool OSDL::Video::TwoDimensional::Widget::_draggable [protected, inherited] |
Tells whether this widget can be dragged by the user.
Definition at line 643 of file OSDLWidget.h.
Referenced by OSDL::Video::TwoDimensional::Widget::updateDecorationFlag().
bool OSDL::Video::TwoDimensional::Widget::_wrappable [protected, inherited] |
Tells whether this widget can be wrapped by the user, hiding the whole widget but its decoration.
Definition at line 655 of file OSDLWidget.h.
Referenced by OSDL::Video::TwoDimensional::Widget::updateDecorationFlag().
bool OSDL::Video::TwoDimensional::Widget::_closable [protected, inherited] |
Tells whether this widget can be closed by the user.
Definition at line 666 of file OSDLWidget.h.
Referenced by OSDL::Video::TwoDimensional::Widget::updateDecorationFlag().
bool OSDL::Video::TwoDimensional::Widget::_hasFocus [protected, inherited] |
Tells whether this widget has currently the focus (i.e.
is selected by the user).
Definition at line 676 of file OSDLWidget.h.
BaseColorMode OSDL::Video::TwoDimensional::Widget::_baseColorMode [protected, inherited] |
Tells whether a background color, color-keying or nothing special shall be used for this widget.
Definition at line 687 of file OSDLWidget.h.
Referenced by OSDL::Video::TwoDimensional::Widget::clean(), and OSDL::Video::TwoDimensional::Widget::getBaseColorMode().
Pixels::ColorDefinition OSDL::Video::TwoDimensional::Widget::_baseColor [protected, inherited] |
Stores the base color of this widget, which is either used as a background color or a colorkey, depending on '_baseColorMode'.
Definition at line 698 of file OSDLWidget.h.
Referenced by OSDL::Video::TwoDimensional::Widget::clean(), OSDL::Video::TwoDimensional::Widget::getBaseColor(), OSDL::Video::TwoDimensional::TextWidget::redrawBackBuffer(), and redrawInternal().
Pixels::PixelColor OSDL::Video::TwoDimensional::Widget::_actualBaseColor [protected, inherited] |
The base color, converted to this widget current pixel format, inherited from container.
Definition at line 706 of file OSDLWidget.h.
Pixels::ColorDefinition Widget::_EdgeColor [static, protected, inherited] |
Color of widget edges.
Definition at line 718 of file OSDLWidget.h.
Referenced by OSDL::Video::TwoDimensional::Widget::GetEdgeColor().
Pixels::ColorDefinition Widget::_TitleColor [static, protected, inherited] |
Text::HorizontalAlignment Widget::_TitleHorizontalAlignment [static, protected, inherited] |
Defines how a widget title should be horizontally aligned (default : Center).
Definition at line 729 of file OSDLWidget.h.
Text::VerticalAlignment Widget::_TitleVerticalAlignment [static, protected, inherited] |
Defines how a widget title should be vertically aligned.
(default : Center).
Definition at line 737 of file OSDLWidget.h.
Length Widget::_ClientOffsetWidth [static, protected, inherited] |
Default width offset for client area relative to widget vertical edges.
Definition at line 746 of file OSDLWidget.h.
Referenced by OSDL::Video::TwoDimensional::Widget::updateClientArea().
Length Widget::_ClientOffsetHeight [static, protected, inherited] |
Default height offset for client area relative to widget horizontal edges.
Definition at line 757 of file OSDLWidget.h.
Referenced by OSDL::Video::TwoDimensional::TextWidget::redrawBackBuffer(), and OSDL::Video::TwoDimensional::Widget::updateClientArea().
Coordinate Widget::_TitleOffsetAbscissa [static, protected, inherited] |
Default abscissa offset relative to widget upper left corner used to print widget title with left alignment.
Definition at line 767 of file OSDLWidget.h.
Coordinate Widget::_TitleOffsetOrdinate [static, protected, inherited] |
Default ordinate offset relative to widget upper left corner used to print widget title.
Definition at line 775 of file OSDLWidget.h.
Coordinate Widget::_TitleBarOffsetOrdinate [static, protected, inherited] |
Default ordinate offset relative to widget upper left corner used to draw widget title bar.
Definition at line 783 of file OSDLWidget.h.
Referenced by OSDL::Video::TwoDimensional::TextWidget::redrawBackBuffer(), and OSDL::Video::TwoDimensional::Widget::updateClientArea().
std::string Widget::_DefaultTitle [static, protected, inherited] |
Default title to be used when a titleless widget has however to be rendered decorated.
Definition at line 791 of file OSDLWidget.h.
const Ceylan::Flags Surface::Software [static, inherited] |
Indicates that a surface is to be stored in system memory.
Definition at line 212 of file OSDLSurface.h.
Referenced by OSDL::Video::TwoDimensional::UprightRectangle::drawWithRoundedCorners().
const Ceylan::Flags Surface::Hardware [static, inherited] |
Indicates that a surface is to be stored in video memory.
Definition at line 216 of file OSDLSurface.h.
Referenced by OSDL::Video::TwoDimensional::Text::FixedFont::basicRenderLatin1Glyph(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::basicRenderUnicodeGlyph(), OSDL::Video::TwoDimensional::Text::Font::renderLatin1MultiLineText(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderLatin1Text(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderUnicodeText(), and OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderUTF8Text().
const Ceylan::Flags Surface::AsynchronousBlit [static, inherited] |
Indicates that a surface should use asynchronous blits if possible.
Definition at line 224 of file OSDLSurface.h.
const Ceylan::Flags Surface::ExclusivePalette [static, inherited] |
Indicates that a surface should have an exclusive palette.
Definition at line 228 of file OSDLSurface.h.
const Ceylan::Flags Surface::HardwareAcceleratedBlit [static, inherited] |
Indicates that a surface is to use hardware-accelerated blits.
Definition at line 236 of file OSDLSurface.h.
const Ceylan::Flags Surface::ColorkeyBlit [static, inherited] |
Indicates that a surface is to use colorkey blits.
Definition at line 240 of file OSDLSurface.h.
Referenced by OSDL::Video::TwoDimensional::Text::FixedFont::basicRenderLatin1Glyph(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::basicRenderUnicodeGlyph(), OSDL::Video::Surface::convertFromColorKeyToAlphaChannel(), OSDL::Video::TwoDimensional::UprightRectangle::drawWithRoundedCorners(), OSDL::Video::TwoDimensional::Text::Font::renderLatin1MultiLineText(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderLatin1Text(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderUnicodeText(), and OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderUTF8Text().
const Ceylan::Flags Surface::RLEColorkeyBlit [static, inherited] |
Indicates that a surface is to use RLE-accelerated colorkey blits.
Definition at line 248 of file OSDLSurface.h.
Referenced by OSDL::Video::TwoDimensional::Text::FixedFont::basicRenderLatin1Glyph(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::basicRenderUnicodeGlyph(), OSDL::Video::TwoDimensional::UprightRectangle::drawWithRoundedCorners(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderLatin1Text(), OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderUnicodeText(), and OSDL::Video::TwoDimensional::Text::TrueTypeFont::renderUTF8Text().
const Ceylan::Flags Surface::AlphaBlendingBlit [static, inherited] |
Indicates that a surface is to use alpha blending blits.
Definition at line 252 of file OSDLSurface.h.
Referenced by OSDL::Video::TwoDimensional::UprightRectangle::drawWithRoundedCorners(), and OSDL::Video::OpenGL::GLTexture::upload().
const Ceylan::Flags Surface::Preallocated [static, inherited] |
Indicates that a surface is to use preallocated memory.
Definition at line 255 of file OSDLSurface.h.
const Ceylan::Flags Surface::RLEColorkeyBlitAvailable [static, inherited] |
Indicates that RLE colorkey blit is actually accelerated (read-only).
Definition at line 266 of file OSDLSurface.h.
Referenced by OSDL::Video::OpenGL::GLTexture::upload().
const Ceylan::Flags Surface::AnyPixelFormat [static, inherited] |
Indicates that a display surface may use any pixel format.
Definition at line 281 of file OSDLSurface.h.
const Ceylan::Flags Surface::DoubleBuffered [static, inherited] |
Indicates that a display surface is to be double buffered.
Definition at line 289 of file OSDLSurface.h.
const Ceylan::Flags Surface::FullScreen [static, inherited] |
Indicates that a display surface is to be full screen, not windowed.
Definition at line 297 of file OSDLSurface.h.
const Ceylan::Flags Surface::OpenGL [static, inherited] |
Indicates that a display surface should have an OpenGL context.
Definition at line 305 of file OSDLSurface.h.
const Ceylan::Flags Surface::Resizable [static, inherited] |
const Length Surface::graphAbscissaOffset [static, inherited] |
const Length Surface::graphOrdinateOffset [static, inherited] |
const Length Surface::captionAbscissaOffset [static, inherited] |
const Length Surface::captionOrdinateOffset [static, inherited] |
SDL_Surface* OSDL::Video::Surface::_surface [protected, inherited] |
This internal structure also contains private fields not used here.
Definition at line 3132 of file OSDLSurface.h.
Referenced by OSDL::Video::Surface::clone(), OSDL::Video::Surface::flipHorizontal(), OSDL::Video::Surface::flipVertical(), OSDL::Video::Surface::flush(), OSDL::Video::Surface::getBitsPerPixel(), OSDL::Video::Surface::getBytesPerPixel(), OSDL::Video::Surface::getClippingArea(), OSDL::Video::Surface::getFlags(), OSDL::Video::Surface::getHeight(), OSDL::Video::Surface::getOffset(), OSDL::Video::Surface::getPitch(), OSDL::Video::Surface::getPixelFormat(), OSDL::Video::Surface::getPixels(), OSDL::Video::Surface::getSDLSurface(), OSDL::Video::Surface::getSizeInMemory(), OSDL::Video::Surface::getWidth(), OSDL::Video::Surface::isInternalSurfaceAvailable(), OSDL::Video::Surface::mustBeLocked(), OSDL::Video::Surface::postLock(), OSDL::Video::Surface::preUnlock(), and OSDL::Video::Surface::update().
DisplayType OSDL::Video::Surface::_displayType [protected, inherited] |
Tells what is the display type of this surface.
The display type has to be recorded since :
Definition at line 3146 of file OSDLSurface.h.
Referenced by OSDL::Video::Surface::flush(), OSDL::Video::Surface::getDisplayType(), OSDL::Video::Surface::update(), and OSDL::Video::Surface::~Surface().
bool OSDL::Video::Surface::_mustBeLocked [protected, inherited] |
Tells whether this surface must be locked before modifying it.
Definition at line 3154 of file OSDLSurface.h.
Coordinate OSDL::Video::TwoDimensional::UprightRectangle::_x [protected, inherited] |
Upper left corner's abscissa (horizontal coordinate).
Definition at line 404 of file OSDLUprightRectangle.h.
Referenced by OSDL::Video::TwoDimensional::UprightRectangle::getLowerRightAbscissa(), OSDL::Video::TwoDimensional::UprightRectangle::getLowerRightCorner(), OSDL::Video::TwoDimensional::UprightRectangle::getUpperLeftAbscissa(), OSDL::Video::TwoDimensional::UprightRectangle::getUpperLeftCorner(), and OSDL::Video::TwoDimensional::UprightRectangle::toSDLRect().
Coordinate OSDL::Video::TwoDimensional::UprightRectangle::_y [protected, inherited] |
Upper left corner's ordinate (vertical coordinate).
Definition at line 408 of file OSDLUprightRectangle.h.
Referenced by OSDL::Video::TwoDimensional::UprightRectangle::getLowerRightCorner(), OSDL::Video::TwoDimensional::UprightRectangle::getLowerRightOrdinate(), OSDL::Video::TwoDimensional::UprightRectangle::getUpperLeftCorner(), OSDL::Video::TwoDimensional::UprightRectangle::getUpperLeftOrdinate(), and OSDL::Video::TwoDimensional::UprightRectangle::toSDLRect().