RamSurface

eu.joaocosta.minart.graphics.RamSurface
final class RamSurface(val dataBuffer: Vector[Array[Color]]) extends MutableSurface

A mutable surface stored in RAM.

Attributes

data

the raw data that backs this surface

Graph
Supertypes
trait Surface
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Constructors

def this(colors: Seq[Seq[Color]])
def this(width: Int, height: Int, color: Color)

Concrete methods

def fillRegion(x: Int, y: Int, w: Int, h: Int, color: Color): Unit

Fill part of the surface with a certain color.

Fill part of the surface with a certain color.

Attributes

color

Color to fill the surface with

h

region height

w

region width

x

leftmost pixel on the destination surface

y

topmost pixel on the destination surface

override def getPixels(): Vector[Array[Color]]

Returns the pixels from this surface. This operation can be perfomance intensive, so it might be worthwile to implement this operation on the application code.

Returns the pixels from this surface. This operation can be perfomance intensive, so it might be worthwile to implement this operation on the application code.

Attributes

Returns:

color matrix

Definition Classes
def putPixel(x: Int, y: Int, color: Color): Unit

Put a pixel in the surface with a certain color.

Put a pixel in the surface with a certain color.

Attributes

color

Color to apply to the pixel

x

pixel x position

y

pixel y position

Gets the color from the this surface in an unsafe way.

Gets the color from the this surface in an unsafe way.

This operation is unsafe: reading a out of bounds pixel has undefined behavior. You should only use this if the performance of getPixel and getPixels are not acceptable.

Attributes

x

pixel x position

y

pixel y position

Returns:

pixel color

Inherited methods

def blit(that: Surface, mask: Option[Color])(x: Int, y: Int, cx: Int, cy: Int, cw: Int, ch: Int): Unit

Draws a surface on top of this surface.

Draws a surface on top of this surface.

Attributes

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 use as a mask (pixels with this color won't be merged)

that

surface to draw

x

leftmost pixel on the destination surface

y

topmost pixel on the destination surface

Inherited from:
MutableSurface
def fill(color: Color): Unit

Fill the whole surface with a certain color.

Fill the whole surface with a certain color.

Attributes

color

Color to fill the surface with

Inherited from:
MutableSurface
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.

Attributes

x

pixel x position

y

pixel y position

Returns:

pixel color

Inherited from:
Surface

Copies this surface into a new surface stored in RAM.

Copies this surface into a new surface stored in RAM.

Attributes

Inherited from:
Surface

Returns a view over this surface.

Returns a view over this surface.

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

Attributes

Inherited from:
Surface

Concrete fields

val height: Int

The surface height.

The surface height.

Attributes

val width: Int

The surface width.

The surface width.

Attributes