Pixmap

php\gdx\graphics\Pixmap

Class Pixmap

Methods


__construct($width, $height, $format)
Parameters:
  • $widthint
  • $heightint
  • $formatstring - - Alpha, Intensity, LuminanceAlpha, RGB565, RGBA4444, RGB888, RGBA8888
static ofFile($fileHandle)
Parameters:
Returns:

string

setColor($redOrColor, $g, $b, $a)
Parameters:
  • $redOrColordouble, int
  • $gdouble - (optional)
  • $bdouble - (optional)
  • $adouble - (optional)
fill()
drawLine($x, $y, $x2, $y2)
Parameters:
  • $xint
  • $yint
  • $x2int
  • $y2int
drawRectangle($x, $y, $width, $height)
Parameters:
  • $xint
  • $yint
  • $widthint
  • $heightint
drawPixmap($pixmap, $x, $y, $srcx, $srcy, $srcWidth, $srcHeight)
Parameters:
  • $pixmapphp\gdx\graphics\Pixmap
  • $xint
  • $yint
  • $srcxint - (optional)
  • $srcyint - (optional)
  • $srcWidthint - (optional)
  • $srcHeightint - (optional)
fillRectangle($x, $y, $width, $height)
Parameters:
  • $xint
  • $yint
  • $widthint
  • $heightint
drawCircle($x, $y, $radius)
Parameters:
  • $xint
  • $yint
  • $radiusint
fillCircle($x, $y, $radius)
Parameters:
  • $xint
  • $yint
  • $radiusint
fillTriangle($x1, $y1, $x2, $y2, $x3, $y3)
Parameters:
  • $x1int
  • $y1int
  • $x2int
  • $y2int
  • $x3int
  • $y3int
getPixel($x, $y)
Parameters:
  • $xint
  • $yint
Returns:

int The pixel color in RGBA8888 format.

getWidth()
Returns:int
getHeight()
Returns:int
dispose()
drawPixel($x, $y, $color)
Parameters:
  • $xint
  • $yint
  • $colorint - (optional)
getGLFormat()
Returns:int one of GL_ALPHA, GL_RGB, GL_RGBA, GL_LUMINANCE, or GL_LUMINANCE_ALPHA.
getGLInternalFormat()
Returns:int one of GL_ALPHA, GL_RGB, GL_RGBA, GL_LUMINANCE, or GL_LUMINANCE_ALPHA.
getGLType()
Returns:int one of GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_4_4_4_4
getFormat()
Returns:string
getBlending()
Returns:string None, SourceOver
static setBlending($blending)

Sets the type of Blending to be used for all operations. Default is ‘SourceOver’

Parameters:
  • $blendingstring
static setFilter($filter)

Filters to be used with Pixmap.drawPixmap(Pixmap, int, int, int, int, int, int, int, int).

Parameters:
  • $filterstring - NearestNeighbour, BiLinear