PieDock 1.4.3
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes

PieDock::Surface Class Reference

#include <Surface.h>

Inheritance diagram for PieDock::Surface:
Inheritance graph
[legend]

List of all members.

Public Types

enum  ColorDepth { Indexed = 8, HighColor = 16, RGB = 24, ARGB = 32 }

Public Member Functions

 Surface (Surface &)
virtual ~Surface ()
unsigned char * getData () const
const int & getWidth () const
const int & getHeight () const
const int & getDepth () const
const int & getBytesPerPixel () const
const int & getBytesPerLine () const
const int & getPadding () const
const int & getSize () const
Surfaceoperator= (Surface &)

Protected Member Functions

 Surface ()
virtual void calculateSize (int, int, int=ARGB)
virtual void allocateData ()
virtual void freeData ()

Protected Attributes

unsigned char * data
int width
int height
int depth
int bytesPerPixel
int bytesPerLine
int padding
int size

Detailed Description

Abstract surface

Author:
Markus Fisch <mf@markusfisch.de>

Constructor & Destructor Documentation

Surface::Surface ( Surface s)

Copy constructor

Parameters:
s- some surface
Surface::~Surface ( ) [virtual]

Free resources

References freeData().

Surface::Surface ( ) [protected]

Initialize virtual surface


Member Function Documentation

void Surface::allocateData ( ) [protected, virtual]

Allocate data for surface

Reimplemented in PieDock::XSurface.

Referenced by PieDock::ArgbSurface::ArgbSurface(), PieDock::PngSurface::load(), and operator=().

void Surface::calculateSize ( int  w,
int  h,
int  d = ARGB 
) [protected, virtual]

Calculate size in bytes of this surface

Parameters:
w- width of surface in pixels
h- height of surface in pixels
d- color depth, bits per pixel (optional)

Referenced by PieDock::ArgbSurface::ArgbSurface(), PieDock::PngSurface::load(), and PieDock::XSurface::XSurface().

void Surface::freeData ( ) [protected, virtual]

Free data of surface

Reimplemented in PieDock::XSurface.

Referenced by PieDock::PngSurface::load(), operator=(), and ~Surface().

Surface & Surface::operator= ( Surface s)

Copy surface

Parameters:
s- some surface

References allocateData(), and freeData().


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