Plane

eu.joaocosta.minart.graphics.Plane
See thePlane companion object
trait Plane extends (Int, Int) => Color

A procedurally generated infinite surface.

Can be clipped to create a surface.

Attributes

Companion
object
Graph
Supertypes
trait (Int, Int) => Color
class Object
trait Matchable
class Any
Self type

Members list

Value members

Abstract methods

def getPixel(x: Int, y: Int): Color

Returns the color at position (x, y).

Returns the color at position (x, y).

Attributes

Concrete methods

def apply(x: Int, y: Int): Color

Returns the color at position (x, y).

Returns the color at position (x, y).

Attributes

def clip(cx: Int, cy: Int, cw: Int, ch: Int): SurfaceView

Clips this plane to a chosen rectangle

Clips this plane to a chosen rectangle

Value parameters

ch

clip height

cw

clip width

cx

leftmost pixel on the surface

cy

topmost pixel on the surface

Attributes

final def coflatMap(f: Plane => Color): Plane

Coflatmaps this plane with a Plane => Color function. Effectively, each pixel of the new plane is computed from a translated plane, which can be used to implement convolutions.

Coflatmaps this plane with a Plane => Color function. Effectively, each pixel of the new plane is computed from a translated plane, which can be used to implement convolutions.

Attributes

final def contramap(f: (Int, Int) => (Int, Int)): Plane

Contramaps the positions from this plane.

Contramaps the positions from this plane.

Attributes

def contramapMatrix(matrix: Matrix): MatrixPlane

Contramaps this plane using a matrix instead of a function.

Contramaps this plane using a matrix instead of a function.

This method can be chained multiple times efficiently.

Note that this is contramaping. The operation is applied as [a b c] [dx] = [sx] [d e f] [dy] [sy] [0 0 1] [ 1] [ 1]

Where (sx,sy) are the positions in the original plane and (dx, dy) are the positions in the new plane.

This means that you need to invert the transformations to use the common transformation matrices.

For example, the matrix:

[2 0 0] [dx] = [sx] [0 2 0] [dy] [sy] [0 0 1] [ 1] [ 1]

Will scale down the image, not scale up.

Attributes

final def flatMap(f: Color => Plane): Plane

Flatmaps this plane

Flatmaps this plane

Attributes

final def flipH: Plane

Flips a plane horizontally.

Flips a plane horizontally.

Attributes

final def flipV: Plane

Flips a plane vertically.

Flips a plane vertically.

Attributes

final def invertColor: Plane

Inverts a plane color.

Inverts a plane color.

Attributes

final def map(f: Color => Color): Plane

Maps the colors from this plane.

Maps the colors from this plane.

Attributes

final def overlay(that: Surface, blendMode: BlendMode)(x: Int, y: Int): Plane

Overlays a surface on top of this plane.

Overlays a surface on top of this plane.

Similar to MutableSurface#blit, but for surface views and planes.

Value parameters

blendMode

blend strategy to use

that

surface to overlay

x

leftmost pixel on the destination plane

y

topmost pixel on the destination plane

Attributes

final def rotate(theta: Double): Plane

Rotates a plane by a certain angle (clockwise).

Rotates a plane by a certain angle (clockwise).

Attributes

final def scale(sx: Double, sy: Double): Plane

Scales a plane.

Scales a plane.

Attributes

final def scale(s: Double): Plane

Scales a plane.

Scales a plane.

Attributes

final def shear(sx: Double, sy: Double): Plane

Shears a plane.

Shears a plane.

Attributes

final def toRamSurface(width: Int, height: Int): RamSurface

Converts this plane to a RAM surface, assuming (0, 0) as the top-left corner.

Converts this plane to a RAM surface, assuming (0, 0) as the top-left corner.

Value parameters

height

surface height

width

surface width

Attributes

final def toSurfaceView(width: Int, height: Int): SurfaceView

Converts this plane to a surface view, assuming (0, 0) as the top-left corner.

Converts this plane to a surface view, assuming (0, 0) as the top-left corner.

Value parameters

height

surface view height

width

surface view width

Attributes

final def translate(dx: Double, dy: Double): Plane

Translates a plane.

Translates a plane.

Attributes

final def transpose: Plane

Transposes a plane (switches the x and y coordinates).

Transposes a plane (switches the x and y coordinates).

Attributes

final def zipWith(that: Plane, f: (Color, Color) => Color): Plane

Combines this plane with another by combining their colors with the given function.

Combines this plane with another by combining their colors with the given function.

Attributes

final def zipWith(that: Surface, f: (Color, Color) => Color): SurfaceView

Combines this plane with a surface by combining their colors with the given function.

Combines this plane with a surface by combining their colors with the given function.

Attributes

Inherited methods

def curried: T1 => T2 => R

Attributes

Inherited from:
Function2
override def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Function2 -> Any
Inherited from:
Function2
def tupled: ((T1, T2)) => R

Attributes

Inherited from:
Function2