Wt::SDLPixelFormat Class Reference

#include <sdlpixelformat.h>

Collaboration diagram for Wt::SDLPixelFormat:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SDLPixelFormat (SDL_PixelFormat *pf)
 copy constructor
SDLPixelFormatoperator= (SDL_PixelFormat *pf)
 assign operator
 operator const SDL_PixelFormat * () const
 operator SDL_PixelFormat * ()
const SDLPalette palette () const
int bitsPerPixel () const
int bytesPerPixel () const
int redMask () const
int greenMask () const
int blueMask () const
int alphaMask () const
int redShift () const
int greenShift () const
int blueShift () const
int alphaShift () const
int redLoss () const
int greenLoss () const
int blueLoss () const
int alphaLoss () const
int transparentPixelValue () const
int alpha () const
SDLColor mapToColor (int v) const
int mapToPixelValue (const SDLColor &c) const
SDLColor transparentColor () const

Private Member Functions

 SDLPixelFormat ()
 private constructor

Private Attributes

SDL_PixelFormat * sdl_pixelformat

Detailed Description

Note:
SDLPixelFormat encapsulates a pointer and not the direct struct as opposed to SDLRect, SDLColor.

Definition at line 36 of file sdlpixelformat.h.


Constructor & Destructor Documentation

Wt::SDLPixelFormat::SDLPixelFormat ( SDL_PixelFormat *  pf  )  [inline]

copy constructor

Definition at line 39 of file sdlpixelformat.h.

00040             : sdl_pixelformat(pf) {
00041         assert(sizeof(SDLPixelFormat) == sizeof(SDL_PixelFormat*));
00042     }

Wt::SDLPixelFormat::SDLPixelFormat (  )  [inline, private]

private constructor

Definition at line 135 of file sdlpixelformat.h.

00135 {}


Member Function Documentation

int Wt::SDLPixelFormat::alpha (  )  const [inline]

Definition at line 123 of file sdlpixelformat.h.

References sdl_pixelformat.

Referenced by Wt::SDLSurface::alpha().

00123                       {
00124         return sdl_pixelformat->alpha;
00125     }

int Wt::SDLPixelFormat::alphaLoss (  )  const [inline]

Definition at line 115 of file sdlpixelformat.h.

References sdl_pixelformat.

00115                           {
00116         return sdl_pixelformat->Aloss;
00117     }

int Wt::SDLPixelFormat::alphaMask (  )  const [inline]

Definition at line 83 of file sdlpixelformat.h.

References sdl_pixelformat.

Referenced by Wt::SDLSurface::resize().

00083                           {
00084         return sdl_pixelformat->Amask;
00085     }

int Wt::SDLPixelFormat::alphaShift (  )  const [inline]

Definition at line 99 of file sdlpixelformat.h.

References sdl_pixelformat.

00099                            {
00100         return sdl_pixelformat->Ashift;
00101     }

int Wt::SDLPixelFormat::bitsPerPixel (  )  const [inline]

Definition at line 63 of file sdlpixelformat.h.

References sdl_pixelformat.

Referenced by Wt::SDLSurface::depth(), Wt::SDLSurface::resize(), and Wt::SDLDisplay::resize().

00063                              {
00064         return sdl_pixelformat->BitsPerPixel;
00065     }

int Wt::SDLPixelFormat::blueLoss (  )  const [inline]

Definition at line 111 of file sdlpixelformat.h.

References sdl_pixelformat.

00111                          {
00112         return sdl_pixelformat->Bloss;
00113     }

int Wt::SDLPixelFormat::blueMask (  )  const [inline]

Definition at line 79 of file sdlpixelformat.h.

References sdl_pixelformat.

Referenced by Wt::SDLSurface::resize().

00079                          {
00080         return sdl_pixelformat->Bmask;
00081     }

int Wt::SDLPixelFormat::blueShift (  )  const [inline]

Definition at line 95 of file sdlpixelformat.h.

References sdl_pixelformat.

Referenced by Wt::SDLSurface::readPixel24bpp(), and Wt::SDLSurface::writePixel24bpp().

00095                           {
00096         return sdl_pixelformat->Bshift;
00097     }

int Wt::SDLPixelFormat::bytesPerPixel (  )  const [inline]

Definition at line 67 of file sdlpixelformat.h.

References sdl_pixelformat.

Referenced by Wt::SDLSurface::numBytes(), and Wt::SDLSurface::pixelOffset().

00067                               {
00068         return sdl_pixelformat->BytesPerPixel;
00069     }

int Wt::SDLPixelFormat::greenLoss (  )  const [inline]

Definition at line 107 of file sdlpixelformat.h.

References sdl_pixelformat.

00107                           {
00108         return sdl_pixelformat->Gloss;
00109     }

int Wt::SDLPixelFormat::greenMask (  )  const [inline]

Definition at line 75 of file sdlpixelformat.h.

References sdl_pixelformat.

Referenced by Wt::SDLSurface::resize().

00075                           {
00076         return sdl_pixelformat->Gmask;
00077     }

int Wt::SDLPixelFormat::greenShift (  )  const [inline]

Definition at line 91 of file sdlpixelformat.h.

References sdl_pixelformat.

Referenced by Wt::SDLSurface::readPixel24bpp(), and Wt::SDLSurface::writePixel24bpp().

00091                            {
00092         return sdl_pixelformat->Gshift;
00093     }

SDLColor Wt::SDLPixelFormat::mapToColor ( int  v  )  const

Definition at line 25 of file sdlpixelformat.cpp.

References sdl_pixelformat.

Referenced by Wt::SDLSurface::pixelColor(), and transparentColor().

00025                                                {
00026     Uint8 r, g, b, a;
00027     //SDL breakage
00028     SDL_PixelFormat *f = const_cast<SDL_PixelFormat *>(sdl_pixelformat);
00029     SDL_GetRGBA(v, f, &r, &g, &b, &a);
00030 
00031     return SDLColor(r, g, b, a);
00032 }

int Wt::SDLPixelFormat::mapToPixelValue ( const SDLColor c  )  const

Definition at line 34 of file sdlpixelformat.cpp.

References Wt::SDLColor::alpha(), Wt::SDLColor::blue(), Wt::SDLColor::green(), Wt::SDLColor::red(), and sdl_pixelformat.

00034                                                            {
00035     //SDL breakage
00036     SDL_PixelFormat *f = const_cast<SDL_PixelFormat *>(sdl_pixelformat);
00037     return SDL_MapRGBA(f, c.red(), c.green(), c.blue(), c.alpha());
00038 }

Here is the call graph for this function:

Wt::SDLPixelFormat::operator const SDL_PixelFormat * (  )  const [inline]

Definition at line 51 of file sdlpixelformat.h.

References sdl_pixelformat.

00051                                              {
00052         return sdl_pixelformat;
00053     }

Wt::SDLPixelFormat::operator SDL_PixelFormat * (  )  [inline]

Definition at line 55 of file sdlpixelformat.h.

References sdl_pixelformat.

00055                                   {
00056         return sdl_pixelformat;
00057     }

SDLPixelFormat& Wt::SDLPixelFormat::operator= ( SDL_PixelFormat *  pf  )  [inline]

assign operator

Definition at line 45 of file sdlpixelformat.h.

References sdl_pixelformat.

00045                                                    {
00046         sdl_pixelformat = pf;
00047         return *this;
00048     }

const SDLPalette Wt::SDLPixelFormat::palette (  )  const [inline]

Definition at line 59 of file sdlpixelformat.h.

References sdl_pixelformat.

Referenced by Wt::SDLSurface::color(), Wt::SDLSurface::isGrayscale(), Wt::SDLSurface::numColors(), and Wt::SDLSurface::setNumColors().

00059                                      {
00060         return sdl_pixelformat->palette;
00061     }

int Wt::SDLPixelFormat::redLoss (  )  const [inline]

Definition at line 103 of file sdlpixelformat.h.

References sdl_pixelformat.

00103                         {
00104         return sdl_pixelformat->Rloss;
00105     }

int Wt::SDLPixelFormat::redMask (  )  const [inline]

Definition at line 71 of file sdlpixelformat.h.

References sdl_pixelformat.

Referenced by Wt::SDLSurface::resize().

00071                         {
00072         return sdl_pixelformat->Rmask;
00073     }

int Wt::SDLPixelFormat::redShift (  )  const [inline]

Definition at line 87 of file sdlpixelformat.h.

References sdl_pixelformat.

Referenced by Wt::SDLSurface::readPixel24bpp(), and Wt::SDLSurface::writePixel24bpp().

00087                          {
00088         return sdl_pixelformat->Rshift;
00089     }

SDLColor Wt::SDLPixelFormat::transparentColor (  )  const

Definition at line 40 of file sdlpixelformat.cpp.

References mapToColor(), and sdl_pixelformat.

Referenced by Wt::SDLSurface::transparentColor().

00040                                                 {
00041     return mapToColor(sdl_pixelformat->colorkey);
00042 }

Here is the call graph for this function:

int Wt::SDLPixelFormat::transparentPixelValue (  )  const [inline]

Definition at line 119 of file sdlpixelformat.h.

References sdl_pixelformat.

Referenced by Wt::SDLSurface::blitAlphaCopy().

00119                                       {
00120         return sdl_pixelformat->colorkey;
00121     }


Member Data Documentation

SDL_PixelFormat* Wt::SDLPixelFormat::sdl_pixelformat [private]

Definition at line 137 of file sdlpixelformat.h.

Referenced by alpha(), alphaLoss(), alphaMask(), alphaShift(), bitsPerPixel(), blueLoss(), blueMask(), blueShift(), bytesPerPixel(), greenLoss(), greenMask(), greenShift(), mapToColor(), mapToPixelValue(), operator const SDL_PixelFormat *(), operator SDL_PixelFormat *(), operator=(), palette(), redLoss(), redMask(), redShift(), transparentColor(), and transparentPixelValue().


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

Generated Fri Jul 28 19:32:49 2006.
Copyright © 1998-2003 by the respective authors.

This document is licensed under the terms of the GNU Free Documentation License and may be freely distributed under the conditions given by this license.