PpmCanvas

class PpmCanvas() extends SurfaceBackedCanvas

A low level Canvas implementation that outputs the image in the PPM format to the stdout. This canvas doesn't support fetching the keyboard input.

trait SurfaceBackedCanvas
trait LowLevelCanvas
trait AutoCloseable
trait Canvas
trait MutableSurface
trait Surface
class Object
trait Matchable
class Any

Value members

Constructors

def this(settings: Settings)

Concrete methods

def changeSettings(newSettings: Settings): Unit
def clear(buffers: Set[Buffer]): Unit
def getKeyboardInput(): KeyboardInput
def getPointerInput(): PointerInput
def redraw(): Unit
def unsafeInit(newSettings: Settings): Unit

Inherited methods

override def blit(that: Surface, mask: Option[Color])(x: Int, y: Int, cx: Int, cy: Int, cw: Int, ch: Int): Unit
Definition Classes
SurfaceBackedCanvas -> MutableSurface
Inherited from:
SurfaceBackedCanvas
def close(): Unit

Destroys the canvas window.

Destroys the canvas window.

Calling any operation on this canvas after calling close without calling init() has an undefined behavior.

Inherited from:
LowLevelCanvas
def fill(color: Color): Unit
Inherited from:
SurfaceBackedCanvas
def getPixel(x: Int, y: Int): Option[Color]

Gets the color from the this surface. This operation can be perfomance intensive, so it might be worthwile to either use getPixels to fetch multiple pixels at the same time or to implement this operation on the application code.

Gets the color from the this surface. This operation can be perfomance intensive, so it might be worthwile to either use getPixels to fetch multiple pixels at the same time or to implement this operation on the application code.

Value parameters:
x

pixel x position

y

pixel y position

Returns:

pixel color

Inherited from:
Surface
def getPixels(): Vector[Array[Color]]
Inherited from:
SurfaceBackedCanvas
def height: Int
Inherited from:
Canvas
def init(settings: Settings): Unit

Creates the canvas window.

Creates the canvas window.

Rendering operations can only be called after calling this.

Returns:

canvas object linked to the created window

Inherited from:
LowLevelCanvas

Checks if the window is created or if it has been destroyed

Checks if the window is created or if it has been destroyed

Inherited from:
LowLevelCanvas
def putPixel(x: Int, y: Int, color: Color): Unit
Inherited from:
SurfaceBackedCanvas
def settings: Settings
Inherited from:
LowLevelCanvas
final def toRamSurface(): RamSurface

Copies this surface into a new surface stored in RAM

Copies this surface into a new surface stored in RAM

Inherited from:
Surface
def unsafeGetPixel(x: Int, y: Int): Color
Inherited from:
SurfaceBackedCanvas
def view: SurfaceView

Returns a view over this surface.

Returns a view over this surface.

Operations performed on a view are executed in a defered fashion.

Inherited from:
Surface
def width: Int
Inherited from:
Canvas

Deprecated and Inherited methods

@deprecated("Use blit instead")
def blitWithMask(that: Surface, mask: Color)(x: Int, y: Int, cx: Int, cy: Int, cw: Int, ch: Int): Unit

Draws a surface on top of this surface and masks the pixels with a certain color.

Draws a surface on top of this surface and masks the pixels with a certain color.

Value parameters:
ch

clip height of the source surface

cw

clip width of the source surface

cx

leftmost pixel on the source surface

cy

topmost pixel on the source surface

mask

color to usa as a mask

that

surface to draw

x

leftmost pixel on the destination surface

y

topmost pixel on the destination surface

Deprecated
Inherited from:
MutableSurface

Concrete fields

protected var surface: RamSurface