77 std::pair<unsigned int,unsigned int>
aspect()
const ;
93 void text(
const std::string & s ,
int x ,
int y ,
Gr::Colour c ) ;
120 void clear(
bool white =
false ) ;
126 enum Stereo { left , right , normal } ;
127 void stereo( Stereo mode = normal ) ;
133 void operator=(
const Canvas & ) ;
134 unsigned long pixel(
const Gr::Colour & c_in )
const ;
135 unsigned long pixel(
const Gr::Colour & c_in , Stereo stereo_mode )
const ;
143 unique_ptr<GX::ColourMap> m_colour_map ;
144 unsigned int m_aspect_top ;
145 unsigned int m_aspect_bottom ;
149 Canvas::Stereo m_stereo_mode ;
Gr::Colour colour(unsigned int n) const
Returns a colour from the palette.
A window class that is-a GX::Drawable and a GX::EventHandler.
A class for xclient-side images that are drawn locally and then blitted to the xserver.
void fastpoint(int x, int y, Gr::Colour c)
Draws a pixel quickly, assuming a client-side image and no stereo.
void point(int x, int y, Gr::Colour c)
Draws a single pixel.
void lineDown(int x, int y_first, int y_last, const Gr::Colour &c)
Draws a vertical line.
Canvas(GX::Window &, int dx=0, int dy=0, int colours=0, bool server_side=false)
Constructor.
void clear(bool white=false)
Clears the canvas to black (or white).
void blit()
Blits the canvas contents to the window.
void lineAcross(int y, int x_first, int x_last, const Gr::Colour &c)
Draws a horizontal line.
A simple rgb colour structure.
std::pair< unsigned int, unsigned int > aspect() const
Returns the canvas aspect ratio as a fraction (normally about 0.7).
int colours() const
Returns the number of colours, as passed in to the ctor.
A pixmap class for xserver-side images.
bool fastable() const
Returns true if fastpoint() can be used rather than point().
Gr::Colour white() const
Returns white.
int dx() const
Returns the canvas width in pixels.
Gr::Colour readPoint(int x, int y) const
Reads a pixel.
void line(int x0, int y0, int x1, int y1, Gr::Colour c)
Draws a line.
void drawFastPoint(int x, int y, unsigned long p)
Draws a point fast.
void text(const std::string &s, int x, int y, Gr::Colour c)
Draws a single-line text string at the given position.
A drawing surface that is embedded in a window.
cc_t cc() const
Returns a combined-component value that incorporates the r(), g() and b() values. ...
int dy() const
Returns the canvas height in pixels.
Gr::Colour black() const
Returns black.
void stereo(Stereo mode=normal)
Sets the left/right stereo mode for subsequent line() and point() drawing operations.