void setFuncPointers ();
int closestColor ( const RGB& color) const;
virtual void beginDraw () {} // lock memory virtual void endDraw () {} // unlock memory
void * pixelAddr ( const int x, const int y ) const {
return x + y * bytesPerScanLine + (char *) data;
}
void setClipRect ( const Rect& r) {
ctipRect = r;
}
void setOrg ( const Point& p ) {
org = p;
}
void setFont ( Font * fnt) {
curFont = fnt;
}
void setColor (int fg ) {
color = fg;
}
void setBkColor (int bkColor)
{
Компьютерная графика. Полигональные модели
backColor = bkColor;
}
void setRop (int rop = RO_COPY ) rasterOp = rop;
int getRop () return rasterOp;
}
Rect getClipRect () return clipRect;
Point getOrg () return org;
void drawFrame (const Rect& r);
void scroll (const Rect& area, const Point& dst);
int getPixel (int x, int y )
return (this->*getPixelAddr)( x, y );
void drawPixel (int x, int y, int color) (this->*drawPixelAddr)( x, y, color )r
void drawLine (int x1, int y1, int x2, int y2 ) (this->*drawLineAddr)( x1, y1, x2, y2 );
void drawChar (int x, int y, int ch ) {
(this->*drawCharAddr)( x, y, ch );
void drawString (int x, int y, const char * str) (this->*drawStringAddr)( x, y, str);
}
void drawBar (int x1, int y1, int x2, int y2 ) (this->*drawBarAddr)( x1, y1, x2, y2 );
void copy ( Surface& dstSurface, const Rect& srcRect, const Point& dst)
{
4. Работа с основными графическими устройствами
(this->*copyAddr)( dstSurface, srcRect, dst );
}
void copyTransp ( Surface& dstSurface, const Rect& srcRect,
const Point& dst, int transpColor )
{
(this->*copyTranspAddr)( dstSurface, srcRect, dst, transpColor );
void copy ( Surface& dstSurface, const Point& dstPoint )
(this->*copyAddr) ( dstSurface, Rect ( 0, 0, width-1, height-1 ), dstPoint );
void copyTransp (Surface& dstSurface,
const Point& dstPoint, int transpColor)
(this->*copyTranspAddr) ( dstSurface, Rect(0,0,width-1,height-1),
dstPoint, transpColor );