Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Surface Class Reference

#include <surface.h>

Inheritance diagram for Surface:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 Surface (SDL_Surface *surface)
 Surface (const SDLmm::Surface &other)
 Surface ()
Surface Duplicate () const
void newFromBGI (void *img)
 Creates an image from an BGI image structure.
void * toBGI () const
void FillTransparent ()
void read (tnstream &stream)
void readImageFile (tnstream &stream)
void write (tnstream &stream) const
void strech (int width, int height)
void writeDefaultPixelFormat (tnstream &stream)
void assignDefaultPalette ()
 assigns the default ASC palette to the surface (only for 8 Bit surfaces)
void assignPalette (SDL_Color *colors, int startColor=0, int colorNum=256)
void detectColorKey (bool RLE=false)
 tries to automatically detect the color key of the surface
bool isTransparent (SDLmm::Color col) const
void ColorKey2AlphaChannel ()
bool hasAlpha ()
int getMemoryFootprint () const
SDL_Surface * getBaseSurface ()
const SDL_Surface * getBaseSurface () const
 ~Surface ()

Static Public Member Functions

static Surface createSurface (int width, int height, SDLmm::Color color=255)
static Surface createSurface (int width, int height, int depth, SDLmm::Color color=0xff0000ff)
static Surface Wrap (SDL_Surface *surface)
static void SetScreen (SDL_Surface *screen)
static void readDefaultPixelFormat (tnstream &stream)

Static Public Attributes

static const Uint32 transparent = 0
static const Uint32 opaque = 255l

Protected Member Functions

virtual int getDepthFormat ()
void convert ()

Constructor & Destructor Documentation

Surface::Surface SDL_Surface *  surface  )  [explicit]
 

Definition at line 145 of file graphics/surface.cpp.

References convert().

Surface::Surface const SDLmm::Surface &  other  ) 
 

Definition at line 198 of file graphics/surface.cpp.

References convert().

Surface::Surface  )  [inline]
 

Definition at line 69 of file surface.h.

Referenced by Wrap().

Surface::~Surface  ) 
 

Definition at line 524 of file graphics/surface.cpp.


Member Function Documentation

void Surface::assignDefaultPalette  ) 
 

assigns the default ASC palette to the surface (only for 8 Bit surfaces)

Definition at line 422 of file graphics/surface.cpp.

References pal.

Referenced by copy2screen(), createSurface(), loadASCFieldImageArray(), MapDisplayPG::MapDisplayPG(), read(), Vehicletype::runTextIO(), and strech().

void Surface::assignPalette SDL_Color *  colors,
int  startColor = 0,
int  colorNum = 256
 

Definition at line 437 of file graphics/surface.cpp.

void Surface::ColorKey2AlphaChannel  ) 
 

Definition at line 727 of file graphics/surface.cpp.

References transparent.

Referenced by loadASCFieldImageArray().

void Surface::convert  )  [protected]
 

Definition at line 151 of file graphics/surface.cpp.

References createSurface().

Referenced by read(), readImageFile(), and Surface().

Surface Surface::createSurface int  width,
int  height,
int  depth,
SDLmm::Color  color = 0xff0000ff
[static]
 

Definition at line 387 of file graphics/surface.cpp.

References assert, and assignDefaultPalette().

Surface Surface::createSurface int  width,
int  height,
SDLmm::Color  color = 255
[static]
 

Definition at line 380 of file graphics/surface.cpp.

Referenced by applyLegacyFieldMask(), GuiFunctions::buildGuiIcon(), convert(), MapDisplayPG::createMovementBufferSurface(), VehicleTypeBaseWidget::display(), BuildingItem::display(), TechWidget::display(), BuildingTypeBaseWidget::display(), MapComponent::displayClip(), StoringPosition::eventMouseMotion(), GuiFunctions::generate_gui_build_icon(), Vehicle::getImage(), Building::getImage(), initASCGraphicSubsystem(), loadASCFieldImageArray(), BuildingType::runTextIO(), MapDisplayPG::setNewZoom(), StoringPosition::StoringPosition(), ASCImageArrayProperty::toString(), and WholeMapRenderer::WholeMapRenderer().

void Surface::detectColorKey bool  RLE = false  ) 
 

tries to automatically detect the color key of the surface

Definition at line 486 of file graphics/surface.cpp.

References hasAlpha().

Referenced by applyFieldMask(), applyLegacyFieldMask(), loadASCFieldImageArray(), rotateSurface(), and strech().

Surface Surface::Duplicate  )  const
 

Definition at line 85 of file graphics/surface.cpp.

References nullParam.

Referenced by OverviewMapHolder::drawNextField().

void Surface::FillTransparent  ) 
 

Definition at line 412 of file graphics/surface.cpp.

Referenced by BuildingItem::display().

const SDL_Surface* Surface::getBaseSurface  )  const [inline]
 

Definition at line 117 of file surface.h.

SDL_Surface* Surface::getBaseSurface  )  [inline]
 

Definition at line 116 of file surface.h.

Referenced by AmmoTransferWindow::AmmoTransferWindow(), CargoDialog::CargoDialog(), copy2screen(), TextRenderer::eval_command(), StoringPosition::eventBlit(), StoringPosition::eventMouseMotion(), getMemoryFootprint(), InternalAmmoTransferWindow::InternalAmmoTransferWindow(), VisibilityLayer::paintSingleField(), ASCGUI_Window::parsePanelASCTXT(), WholeMapRenderer::renderVisibility(), VehicleTypeRenderer::renderWidget(), ASCGUI_Window::setImage(), StartupScreen::StartupScreen(), UnitInfoDialog::UnitInfoDialog(), and WeaponInfoPanel::WeaponInfoPanel().

virtual int Surface::getDepthFormat  )  [inline, protected, virtual]
 

Reimplemented in TypedSurface< colorDepth >.

Definition at line 120 of file surface.h.

int Surface::getMemoryFootprint  )  const
 

Definition at line 709 of file graphics/surface.cpp.

References getBaseSurface().

Referenced by Vehicletype::getMemoryFootprint(), TerrainType::Weather::getMemoryFootprint(), and BuildingType::getMemoryFootprint().

bool Surface::hasAlpha  ) 
 

Definition at line 469 of file graphics/surface.cpp.

Referenced by applyLegacyFieldMask(), and detectColorKey().

bool Surface::isTransparent SDLmm::Color  col  )  const
 

Definition at line 508 of file graphics/surface.cpp.

References opaque.

Referenced by OverviewMapImage::create().

void Surface::newFromBGI void *  img  ) 
 

Creates an image from an BGI image structure.

void Surface::read tnstream stream  ) 
 

Definition at line 265 of file graphics/surface.cpp.

References assignDefaultPalette(), convert(), trleheader::id, trleheader::rle, trleheader::size, surfaceVersion, uncompress_rlepict(), trleheader::x, and trleheader::y.

Referenced by GraphicSetManager_Base::loadData(), Vehicletype::read(), TerrainType::Weather::read(), ObjectType::read(), and BuildingType::read().

void Surface::readDefaultPixelFormat tnstream stream  )  [static]
 

Definition at line 205 of file graphics/surface.cpp.

References readSDLPixelFormat().

void Surface::readImageFile tnstream stream  ) 
 

Definition at line 373 of file graphics/surface.cpp.

References convert(), and SDL_RWFromStream().

Referenced by CargoDialog::CargoDialog(), and UnitInfoDialog::UnitInfoDialog().

void Surface::SetScreen SDL_Surface *  screen  )  [static]
 

Definition at line 78 of file graphics/surface.cpp.

Referenced by ASC_PG_App::InitScreen().

void Surface::strech int  width,
int  height
 

Definition at line 450 of file graphics/surface.cpp.

References assignDefaultPalette(), detectColorKey(), and SDL_StretchSurface().

Referenced by GraphicSetManager_Base::loadData(), Vehicletype::runTextIO(), and Weathercast::Weathercast().

void * Surface::toBGI  )  const
 

Definition at line 695 of file graphics/surface.cpp.

References asc_malloc(), and imagesize().

static Surface Surface::Wrap SDL_Surface *  surface  )  [inline, static]
 

Definition at line 76 of file surface.h.

References Surface().

Referenced by MapDisplayPG::blitInternalSurface(), MapDisplayPG::displayMovementStep(), Emboss::eventBlit(), MainScreenWidget::eventBlit(), DamageBarWidget::eventBlit(), GraphWidget::eventBlit(), SelectionItemWidget::eventDraw(), ExperienceOverview::eventDraw(), DiplomaticModeChooser< SelectionType >::eventDraw(), MapDisplayPG::MapDisplayPG(), Weathercast::painter(), OverviewMapPanel::painter(), WeaponInfoLine::painter(), DashboardPanel::painter(), AttackPanel::painter(), and Weathercast::paintWeatherArea().

void Surface::write tnstream stream  )  const
 

Definition at line 218 of file graphics/surface.cpp.

References surfaceVersion, tnstream::writeChar(), tnstream::writedata(), tnstream::writeInt(), and tnstream::writeWord().

Referenced by Vehicletype::write(), TerrainType::Weather::write(), and BuildingType::write().

void Surface::writeDefaultPixelFormat tnstream stream  ) 
 

Definition at line 211 of file graphics/surface.cpp.


Member Data Documentation

const Uint32 Surface::opaque = 255l [static]
 

Definition at line 66 of file surface.h.

Referenced by ColorMerger_AlphaMerge< 4 >::assign(), ColorConverter< 1, 4 >::convert(), OverviewMapImage::create(), hasTransparency(), and isTransparent().

const Uint32 Surface::transparent = 0 [static]
 

Definition at line 65 of file surface.h.

Referenced by ColorMerger_AlphaMerge< 4 >::assign(), OverviewMapHolder::clear(), ColorKey2AlphaChannel(), ColorConverter< 1, 4 >::convert(), OverviewMapImage::create(), Vehicle::getImage(), Building::getImage(), imageEmpty(), snowify(), ColorTransform_PlayerTrueColHSV< pixelsize >::transform(), WholeMapRenderer::WholeMapRenderer(), and writePNGtrim().


The documentation for this class was generated from the following files:
Generated on Tue Jun 24 02:21:12 2008 for Advanced Strategic Command by  doxygen 1.4.2