Bitmap

smile.pictures.Bitmap
See theBitmap companion class
object Bitmap

Companion object for the Bitmap class, providing factory methods for creating Bitmap instances.

Attributes

Companion
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Bitmap.type

Members list

Type members

Types

type LocationToColorGenerator = (Int, Int) => Color

A type alias for functions generating colors based on pixel locations.

A type alias for functions generating colors based on pixel locations.

Attributes

Value members

Concrete methods

def apply(width: Int, height: Int, contentGenerator: LocationToColorGenerator): Bitmap

Creates a Bitmap of specified dimensions using a function to generate pixel colors.

Creates a Bitmap of specified dimensions using a function to generate pixel colors.

Value parameters

contentGenerator

A function to generate colors for each pixel based on its location.

height

The height of the bitmap.

width

The width of the bitmap.

Attributes

Returns

A new Bitmap instance.

def apply(width: Int, height: Int, colors: Seq[Color]): Bitmap

Creates a Bitmap from a sequence of colors, assuming row-wise population.

Creates a Bitmap from a sequence of colors, assuming row-wise population.

Value parameters

colors

A sequence of colors to populate the bitmap.

height

The height of the bitmap.

width

The width of the bitmap.

Attributes

Returns

A new Bitmap instance.

def apply(sourceResourcePath: String): Bitmap

Loads a Bitmap from a resource path.

Loads a Bitmap from a resource path.

Value parameters

sourceResourcePath

The path to the source image resource.

Attributes

Returns

A new Bitmap instance loaded from the specified path.

def apply(elements: PictureElement*): Bitmap

Creates a Bitmap from a collection of picture elements.

Creates a Bitmap from a collection of picture elements.

Value parameters

elements

A collection of PictureElement instances to render into a bitmap.

Attributes

Returns

A Bitmap representing the rendered picture elements.

def apply(picture: Picture): Bitmap

Creates a Bitmap from a Picture.

Creates a Bitmap from a Picture.

Value parameters

picture

The Picture to render into a bitmap.

Attributes

Returns

A Bitmap representing the rendered picture.

Concrete fields

val Empty: Bitmap