ScummVM API documentation
Graphics Namespace Reference

Classes

class  AmigaFont
 
class  BaseMacWindow
 
struct  BdfBoundingBox
 
class  BdfFont
 
struct  BdfFontData
 
class  BgiFont
 
class  Big5Font
 
class  BlendBlit
 
class  BlendBlitImpl_Base
 
struct  BorderOffsets
 
struct  ColorComponent
 
struct  ColorComponent< 0 >
 
struct  ColorComponent< 1 >
 
struct  ColorComponent< 2 >
 
struct  ColorComponent< 3 >
 
struct  ColorComponent< 4 >
 
struct  ColorComponent< 5 >
 
struct  ColorComponent< 6 >
 
struct  ColorComponent< 7 >
 
struct  ColorComponent< 8 >
 
struct  ColorMasks
 
struct  ColorMasks< 1555 >
 
struct  ColorMasks< 4444 >
 
struct  ColorMasks< 555 >
 
struct  ColorMasks< 5551 >
 
struct  ColorMasks< 565 >
 
struct  ColorMasks< 888 >
 
struct  ColorMasks< 8888 >
 
struct  ColorMasks<-8888 >
 
class  ColorQuantizer
 Class for selecting a good palette from a large number of colors. More...
 
class  Cursor
 
class  CursorManager
 
class  DosFont
 
struct  DrawStep
 
struct  FloatPoint
 
class  FloodFill
 
class  Font
 
struct  FontInfo
 
class  FontKorean
 
class  FontKoreanBase
 
class  FontKoreanSVM
 
class  FontKoreanWansung
 
class  FontManager
 
class  FrameLimiter
 
class  ImageArchive
 
class  MacButton
 
class  MacCursor
 
class  MacDialog
 
struct  MacDialogButton
 
class  MacFont
 
struct  MacFONTdata
 
class  MacFontFamily
 
class  MacFONTFont
 
class  MacFontManager
 
struct  MacFontRun
 
struct  MacGlyph
 
class  MacMenu
 
struct  MacMenuData
 
struct  MacMenuItem
 
struct  MacMenuSubMenu
 
struct  MacPlotData
 
class  MacPopUp
 
class  MacText
 
class  MacTextCanvas
 
struct  MacTextLine
 
struct  MacTextTableRow
 
class  MacTextWindow
 
class  MacWidget
 
class  MacWindow
 
class  MacWindowBorder
 
class  MacWindowManager
 
class  ManagedSurface
 
struct  Mode
 
struct  ModeWithFormat
 
class  NinePatchBitmap
 
struct  NinePatchMark
 
class  NinePatchSide
 
class  Palette
 Simple class for handling a palette data. More...
 
class  PaletteLookup
 
class  PixelBuffer
 
struct  PixelFormat
 
class  Primitives
 
class  Renderer
 
struct  RendererTypeDescription
 
class  RowReader
 
class  RowWriter
 
class  Screen
 
struct  SelectedText
 
struct  Surface
 
struct  SurfaceDeleter
 
class  SVGBitmap
 
struct  TransformStruct
 
class  TransformTools
 
struct  TTFMap
 
class  VectorRenderer
 
class  VectorRendererAA
 
class  VectorRendererSpec
 
struct  WinCursorGroup
 
class  WinFont
 
struct  WinFontDirEntry
 
class  YUVToRGBManager
 
struct  ZoomBox
 

Typedefs

typedef Common::Array< const byte * > MacPatterns
 
typedef void(* FastBlitFunc) (byte *, const byte *, const uint, const uint, const uint, const uint)
 
typedef byte LarryScaleColor
 
typedef Common::Array< MacDialogButton * > MacDialogButtonArray
 
typedef Common::Array< MacMenuItem * > ItemArray
 
typedef Common::Array< ModeModeList
 
typedef Common::Array< ModeWithFormatModeWithFormatList
 
typedef void(VectorRenderer::* DrawingFunctionCallback) (const Common::Rect &, const Graphics::DrawStep &)
 

Enumerations

enum  TextAlign {
  kTextAlignInvalid, kTextAlignStart, kTextAlignLeft, kTextAlignCenter,
  kTextAlignEnd, kTextAlignRight
}
 
enum  WordWrapMode { kWordWrapDefault = 0, kWordWrapEvenWidthLines = 1 << 0, kWordWrapOnExplicitNewLines = 1 << 1, kWordWrapAllowTrailingWhitespace = 1 << 2 }
 
enum  MacButtonType { kRound, kCheckBox, kRadio }
 
enum  CheckBoxType { kCBNormal, kCBInsetBlack, kCBFilledBlack }
 
enum  { kMacDialogQuitRequested = -2 }
 
enum  {
  kMacFontNonStandard = -1, kMacFontSystem = 0, kMacFontApplication = 1, kMacFontNewYork = 2,
  kMacFontGeneva = 3, kMacFontMonaco = 4, kMacFontVenice = 5, kMacFontLondon = 6,
  kMacFontAthens = 7, kMacFontSanFrancisco = 8, kMacFontToronto = 9, kMacFontCairo = 11,
  kMacFontLosAngeles = 12, kMacFontZapfDingbats = 13, kMacFontBookman = 14, kMacFontHelveticaNarrow = 15,
  kMacFontPalatino = 16, kMacFontZapfChancery = 18, kMacFontTimes = 20, kMacFontHelvetica = 21,
  kMacFontCourier = 22, kMacFontSymbol = 23, kMacFontTaliesin = 24, kMacFontAvantGarde = 33,
  kMacFontNewCenturySchoolbook = 34, kMacFontChicago = 16383, kMacFontOsaka = 16384, kMacFontBookMinchoM = 16396,
  kMacFontMonoGothic = 16433, kMacFontMonoMing = 16435, kMacFontOsakaMono = 16436, kMacFontMediumGothic = 16640,
  kMacFontMing = 16641, kMacFontHeiseiMincho = 16700, kMacFontHeiseiKakuGothic = 16701
}
 
enum  {
  kMacFontRegular, kMacFontBold = 1, kMacFontItalic = 2, kMacFontUnderline = 4,
  kMacFontOutline = 8, kMacFontShadow = 16, kMacFontCondense = 32, kMacFontExtend = 64
}
 
enum  { kWindowBorderActive = 1 << 0, kWindowBorderTitle = 1 << 1, kWindowBorderScrollbar = 1 << 2, kWindowBorderMaxFlag = 1 << 3 }
 
enum  { kBorderScroll = 1000 }
 
enum  { kWinBorderWin95Scrollbar = kBorderScroll + 0x00, kWindowBorderWin95NoBorderScrollbar, kWindowBorderMacOSNoBorderScrollbar }
 
enum  ColorDistanceMethod { kColorDistanceEuclidean, kColorDistanceNaive, kColorDistanceRedmean }
 
enum  RendererType : uint32 { kRendererTypeDefault = 0, kRendererTypeOpenGL = 1, kRendererTypeOpenGLShaders = 2, kRendererTypeTinyGL = 4 }
 
enum  DitherMethod {
  kDitherNaive, kDitherFloyd, kDitherAtkinson, kDitherBurkes,
  kDitherFalseFloyd, kDitherSierra, kDitherSierraTwoRow, kDitherSierraLite,
  kDitherStucki, kDitherJarvis
}
 
enum  TSpriteBlendMode {
  BLEND_UNKNOWN = -1, BLEND_NORMAL = 0, BLEND_ADDITIVE = 1, BLEND_SUBTRACTIVE = 2,
  BLEND_MULTIPLY = 3, NUM_BLEND_MODES
}
 
enum  AlphaType { ALPHA_OPAQUE = 0, ALPHA_BINARY = 1, ALPHA_FULL = 2 }
 
enum  FLIP_FLAGS {
  FLIP_NONE = 0, FLIP_H = 1, FLIP_V = 2, FLIP_HV = FLIP_H | FLIP_V,
  FLIP_VH = FLIP_H | FLIP_V
}
 The possible flipping parameters for the blit method. More...
 

Functions

void copyBlit (byte *dst, const byte *src, const uint dstPitch, const uint srcPitch, const uint w, const uint h, const uint bytesPerPixel)
 
bool keyBlit (byte *dst, const byte *src, const uint dstPitch, const uint srcPitch, const uint w, const uint h, const uint bytesPerPixel, const uint32 key)
 
bool maskBlit (byte *dst, const byte *src, const byte *mask, const uint dstPitch, const uint srcPitch, const uint maskPitch, const uint w, const uint h, const uint bytesPerPixel)
 
bool crossBlit (byte *dst, const byte *src, const uint dstPitch, const uint srcPitch, const uint w, const uint h, const Graphics::PixelFormat &dstFmt, const Graphics::PixelFormat &srcFmt)
 
bool crossKeyBlit (byte *dst, const byte *src, const uint dstPitch, const uint srcPitch, const uint w, const uint h, const Graphics::PixelFormat &dstFmt, const Graphics::PixelFormat &srcFmt, const uint32 key)
 
bool crossMaskBlit (byte *dst, const byte *src, const byte *mask, const uint dstPitch, const uint srcPitch, const uint maskPitch, const uint w, const uint h, const Graphics::PixelFormat &dstFmt, const Graphics::PixelFormat &srcFmt)
 
bool crossBlitMap (byte *dst, const byte *src, const uint dstPitch, const uint srcPitch, const uint w, const uint h, const uint bytesPerPixel, const uint32 *map)
 
bool crossKeyBlitMap (byte *dst, const byte *src, const uint dstPitch, const uint srcPitch, const uint w, const uint h, const uint bytesPerPixel, const uint32 *map, const uint32 key)
 
bool crossMaskBlitMap (byte *dst, const byte *src, const byte *mask, const uint dstPitch, const uint srcPitch, const uint maskPitch, const uint w, const uint h, const uint bytesPerPixel, const uint32 *map)
 
bool alphaBlit (byte *dst, const byte *src, const uint dstPitch, const uint srcPitch, const uint w, const uint h, const Graphics::PixelFormat &dstFmt, const Graphics::PixelFormat &srcFmt, const byte flip, const byte aMod)
 
bool alphaKeyBlit (byte *dst, const byte *src, const uint dstPitch, const uint srcPitch, const uint w, const uint h, const Graphics::PixelFormat &dstFmt, const Graphics::PixelFormat &srcFmt, const uint32 key, const byte flip, const byte aMod)
 
bool alphaMaskBlit (byte *dst, const byte *src, const byte *mask, const uint dstPitch, const uint srcPitch, const uint maskPitch, const uint w, const uint h, const Graphics::PixelFormat &dstFmt, const Graphics::PixelFormat &srcFmt, const byte flip, const byte aMod)
 
bool alphaBlitMap (byte *dst, const byte *src, const uint dstPitch, const uint srcPitch, const uint w, const uint h, const Graphics::PixelFormat &dstFmt, const uint32 *map, const byte flip, const byte aMod)
 
bool alphaKeyBlitMap (byte *dst, const byte *src, const uint dstPitch, const uint srcPitch, const uint w, const uint h, const Graphics::PixelFormat &dstFmt, const uint32 *map, const uint32 key, const byte flip, const byte aMod)
 
bool alphaMaskBlitMap (byte *dst, const byte *src, const byte *mask, const uint dstPitch, const uint srcPitch, const uint maskPitch, const uint w, const uint h, const Graphics::PixelFormat &dstFmt, const uint32 *map, const byte flip, const byte aMod)
 
FastBlitFunc getFastBlitFunc (const PixelFormat &dstFmt, const PixelFormat &srcFmt)
 
bool scaleBlit (byte *dst, const byte *src, const uint dstPitch, const uint srcPitch, const uint dstW, const uint dstH, const uint srcW, const uint srcH, const Graphics::PixelFormat &fmt, const byte flip=0)
 
bool scaleBlitBilinear (byte *dst, const byte *src, const uint dstPitch, const uint srcPitch, const uint dstW, const uint dstH, const uint srcW, const uint srcH, const Graphics::PixelFormat &fmt, const byte flip=0)
 
bool rotoscaleBlit (byte *dst, const byte *src, const uint dstPitch, const uint srcPitch, const uint dstW, const uint dstH, const uint srcW, const uint srcH, const Graphics::PixelFormat &fmt, const TransformStruct &transform, const Common::Point &newHotspot)
 
bool rotoscaleBlitBilinear (byte *dst, const byte *src, const uint dstPitch, const uint srcPitch, const uint dstW, const uint dstH, const uint srcW, const uint srcH, const Graphics::PixelFormat &fmt, const TransformStruct &transform, const Common::Point &newHotspot)
 
bool applyColorKey (byte *dst, const byte *src, const uint dstPitch, const uint srcPitch, const uint w, const uint h, const Graphics::PixelFormat &format, const bool overwriteAlpha, const uint8 rKey, const uint8 gKey, const uint8 bKey, const uint8 rNew, const uint8 gNew, const uint8 bNew)
 
bool setAlpha (byte *dst, const byte *src, const uint dstPitch, const uint srcPitch, const uint w, const uint h, const Graphics::PixelFormat &format, const bool skipTransparent, const uint8 alpha)
 
TextAlign convertTextAlignH (TextAlign alignH, bool rtl)
 
void larryScale (int srcWidth, int srcHeight, LarryScaleColor transparentColor, RowReader &rowReader, int dstWidth, int dstHeight, RowWriter &rowWriter)
 
int getStringWidth (MacFontRun &format, const Common::U32String &str)
 
const Common::U32String::value_type * readHex (uint16 *res, const Common::U32String::value_type *s, int len)
 
template<int bitFormat>
PixelFormat createPixelFormat ()
 
ManagedSurfacerenderPM5544 (int width, int height)
 
void downscaleAllByHalf (const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height, int gBits=565)
 
void downscaleSurfaceByHalf (Surface *out, const Surface *in, const byte *palette)
 
bool checkThumbnailHeader (Common::SeekableReadStream &in)
 
bool skipThumbnail (Common::SeekableReadStream &in)
 
bool loadThumbnail (Common::SeekableReadStream &in, Graphics::Surface *&thumbnail, bool skipThumbnail=false)
 
bool createThumbnail (Graphics::Surface &thumb)
 
bool saveThumbnail (Common::WriteStream &out)
 
bool saveThumbnail (Common::WriteStream &out, const Graphics::Surface &thumb)
 
bool createScreenShot (Graphics::Surface &surf)
 
Graphics::Surfacescale (const Graphics::Surface &srcImage, int xSize, int ySize)
 
VectorRenderercreateRenderer (int mode)
 
CursormakeDefaultWinCursor ()
 
CursormakeBusyWinCursor ()
 
CursorloadWindowsCursorFromDIB (Common::SeekableReadStream &stream, uint16 hotspotX, uint16 hotspotY)
 

Variables

const int OPCODE_END = 0
 
const int OPCODE_DOSCAN = 1
 
const int OPCODE_MOVE = 2
 
const int OPCODE_DRAW = 3
 
const byte macEGADither [16][4]
 
const byte macGammaCorrectionLookUp [256]
 
constexpr int PALETTE_COUNT = 256
 
constexpr int PALETTE_SIZE = (256 * 3)
 
const int32 kDefaultZoomX = 100
 
const int32 kDefaultZoomY = 100
 
const uint32 kDefaultRgbaMod = 0xFFFFFFFF
 
const int32 kDefaultHotspotX = 0
 
const int32 kDefaultHotspotY = 0
 
const int32 kDefaultOffsetX = 0
 
const int32 kDefaultOffsetY = 0
 
const int32 kDefaultAngle = 0
 

Detailed Description

This is the namespace of the AGDS engine.

Status of this engine: In Progress

Games using this engine:

  • Black Mirror (Windows)

Enumeration Type Documentation

◆ ColorDistanceMethod

Enumerator
kColorDistanceEuclidean 

Non-Weighted distance.

kColorDistanceNaive 

Weighted red 30%, green 50%, blue 20%.

kColorDistanceRedmean 

Common low-cost approximation.

◆ FLIP_FLAGS

The possible flipping parameters for the blit method.

Enumerator
FLIP_NONE 

The image will not be flipped.

FLIP_H 

The image will be flipped at the horizontal axis.

FLIP_V 

The image will be flipped at the vertical axis.

FLIP_HV 

The image will be flipped at the horizontal and vertical axis.

FLIP_VH 

The image will be flipped at the horizontal and vertical axis.

Function Documentation

◆ larryScale()

void Graphics::larryScale ( int  srcWidth,
int  srcHeight,
LarryScaleColor  transparentColor,
RowReader rowReader,
int  dstWidth,
int  dstHeight,
RowWriter rowWriter 
)
Parameters
srcWidthThe width, in pixels, of the original image
srcHeightThe height, in pixels, of the original image
transparentColorThe transparent color. Used for outline detection.
rowReaderAn object with a callback method for reading the lines of the original image
dstWidthThe width, in pixels, of the scaled target image
dstHeightThe height, in pixels, of the scaled target image
rowWriterAn object with a callback method accepting the lines of the target image

◆ renderPM5544()

ManagedSurface* Graphics::renderPM5544 ( int  width,
int  height 
)

Renders a Philips PM5544 test pattern on a surface with given dimensions

Parameters
widthWidth of the surface
heightHeight of the surface
Returns
Returns ManagedSurface in CLUT8 format with a palette

◆ downscaleAllByHalf()

void Graphics::downscaleAllByHalf ( const uint8 *  srcPtr,
uint32  srcPitch,
uint8 *  dstPtr,
uint32  dstPitch,
int  width,
int  height,
int  gBits = 565 
)

This filter (down)scales the source image by a factor of 1/2. For example, a 320x200 image is scaled to 160x100.

Variable Documentation

◆ macEGADither

const byte Graphics::macEGADither[16][4]
Initial value:
= {
{ 0, 0, 0, 0 },
{ 0, 0, 0, 15 },
{ 0, 0, 15, 0 },
{ 0, 0, 15, 15 },
{ 0, 15, 0, 0 },
{ 0, 15, 0, 15 },
{ 0, 15, 15, 0 },
{ 0, 15, 15, 15 },
{ 15, 0, 0, 0 },
{ 15, 0, 0, 15 },
{ 15, 0, 15, 0 },
{ 15, 0, 15, 15 },
{ 15, 15, 0, 0 },
{ 15, 15, 0, 15 },
{ 15, 15, 15, 0 },
{ 15, 15, 15, 15 }
}

◆ macGammaCorrectionLookUp

const byte Graphics::macGammaCorrectionLookUp[256]
Initial value:
= {
0x00, 0x05, 0x09, 0x0B, 0x0E, 0x10, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1E, 0x20, 0x22, 0x24,
0x25, 0x27, 0x28, 0x2A, 0x2C, 0x2D, 0x2F, 0x30, 0x31, 0x33, 0x34, 0x36, 0x37, 0x38, 0x3A, 0x3B,
0x3C, 0x3E, 0x3F, 0x40, 0x42, 0x43, 0x44, 0x45, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4D, 0x4E, 0x4F,
0x50, 0x51, 0x52, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5E, 0x5F, 0x60, 0x61,
0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71,
0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, 0x80, 0x81,
0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8C, 0x8D, 0x8E, 0x8F,
0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9B, 0x9C, 0x9D,
0x9E, 0x9F, 0xA0, 0xA1, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB,
0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8,
0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBC, 0xBD, 0xBE, 0xBF, 0xC0, 0xC0, 0xC1, 0xC2, 0xC3, 0xC3, 0xC4,
0xC5, 0xC6, 0xC7, 0xC7, 0xC8, 0xC9, 0xCA, 0xCA, 0xCB, 0xCC, 0xCD, 0xCD, 0xCE, 0xCF, 0xD0, 0xD0,
0xD1, 0xD2, 0xD3, 0xD3, 0xD4, 0xD5, 0xD6, 0xD6, 0xD7, 0xD8, 0xD9, 0xD9, 0xDA, 0xDB, 0xDC, 0xDC,
0xDD, 0xDE, 0xDF, 0xDF, 0xE0, 0xE1, 0xE1, 0xE2, 0xE3, 0xE4, 0xE4, 0xE5, 0xE6, 0xE7, 0xE7, 0xE8,
0xE9, 0xE9, 0xEA, 0xEB, 0xEC, 0xEC, 0xED, 0xEE, 0xEE, 0xEF, 0xF0, 0xF1, 0xF1, 0xF2, 0xF3, 0xF3,
0xF4, 0xF5, 0xF5, 0xF6, 0xF7, 0xF8, 0xF8, 0xF9, 0xFA, 0xFA, 0xFB, 0xFC, 0xFC, 0xFD, 0xFE, 0xFF
}

◆ PALETTE_COUNT

constexpr int Graphics::PALETTE_COUNT = 256

Constants available for use in paletted code

◆ kDefaultZoomX

const int32 Graphics::kDefaultZoomX = 100

Contains all the required information that define a transform. Same source sprite + same TransformStruct = Same resulting sprite. Has a number of overloaded constructors to accommodate various argument lists.