smile.pictures

package smile.pictures

Members list

Type members

Classlikes

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
class AnimatedPicture(val frames: Seq[DrawableElement], val frameDelays: Seq[Int], val currentFrameIndex: Int, val lastFrameTime: Long) extends PictureElement

Represents an animated picture, consisting of a sequence of frames (PictureElements) and their display durations.

Represents an animated picture, consisting of a sequence of frames (PictureElements) and their display durations.

Value parameters

currentFrameIndex

The index of the currently displayed frame.

frameDelays

A sequence of integers representing the delay in milliseconds before showing the next frame.

frames

A sequence of PictureElement instances representing the frames of the animation.

lastFrameTime

The system time in milliseconds when the last frame was set. Defaults to the current system time.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
class Arc(pos: Pos, val width: Double, val height: Double, val startAngle: Double, val arcAngle: Double, val rotationAngle: Double, val fillStyle: Option[FillStyle], val strokeStyle: Option[StrokeStyle]) extends VectorGraphic

Represents an arc, a part of a circle or ellipse, defined by its center position, width, height, start angle, arc angle, and optional fill and stroke styles.

Represents an arc, a part of a circle or ellipse, defined by its center position, width, height, start angle, arc angle, and optional fill and stroke styles.

Value parameters

arcAngle

The angular extent of the arc in degrees.

fillStyle

Optional fill style for the arc.

height

The height of the arc in pixels.

pos

The center point of the arc.

rotationAngle

The rotation angle of the arc in degrees, affecting its orientation.

startAngle

The start angle of the arc in degrees.

strokeStyle

Optional stroke style defining the arc's outline appearance.

width

The width of the arc in pixels.

Attributes

Supertypes
class Object
trait Matchable
class Any
Show all
object Bitmap

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

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

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
Bitmap.type
class Bitmap(val buffer: BufferAdapter[_], bounds: Bounds) extends DrawableElement

Represents a bitmap image, capable of holding and manipulating pixel data.

Represents a bitmap image, capable of holding and manipulating pixel data.

Value parameters

bounds

The boundaries of the bitmap.

buffer

The underlying buffer storing pixel data.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Show all
object Circle

Factory object for creating circles.

Factory object for creating circles.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Circle.type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Bitmap
class Arc
class Point
class Polygon
class Text
Show all
object Ellipse

Factory object for creating ellipses.

Factory object for creating ellipses.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Ellipse.type
case class FillStyle(paint: Paint)

Represents the fill style for drawing operations.

Represents the fill style for drawing operations.

Value parameters

paint

The paint (single color or gradient) used for the fill.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Line

Factory object for creating lines.

Factory object for creating lines.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Line.type
object Pentagon

Factory object for creating polygons.

Factory object for creating polygons.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Pentagon.type
class Picture(val elements: Seq[PictureElement], val viewport: Option[Viewport]) extends Transformable[Picture]

Represents a picture composed of various graphical elements and an optional viewport.

Represents a picture composed of various graphical elements and an optional viewport.

Value parameters

elements

A sequence of PictureElement instances that make up the picture.

viewport

An optional viewport that defines the visible area of the picture.

Attributes

Supertypes
class Object
trait Matchable
class Any

Represents a basic element within a picture, capable of undergoing transformations such as translation, scaling, and rotation. This trait is a foundational component for all graphical elements that can be part of a picture.

Represents a basic element within a picture, capable of undergoing transformations such as translation, scaling, and rotation. This trait is a foundational component for all graphical elements that can be part of a picture.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Bitmap
class Arc
class Point
class Polygon
class Text
Show all
class Point(pos: Pos, val color: Color) extends VectorGraphic

Represents a graphical point with a specified position and color.

Represents a graphical point with a specified position and color.

Value parameters

color

The color of the point.

pos

The position of the point.

Attributes

Supertypes
class Object
trait Matchable
class Any
Show all
Known subtypes
class Polygon(pos: Pos, val points: Seq[Pos], val fillStyle: Option[FillStyle], val strokeStyle: Option[StrokeStyle]) extends VectorGraphic

Represents a polygon defined by a sequence of points, with optional fill and stroke styles.

Represents a polygon defined by a sequence of points, with optional fill and stroke styles.

Value parameters

fillStyle

Optional fill style for the interior of the polygon.

points

The sequence of points defining the vertices of the polygon.

pos

The position of the polygon. This usually represents the centroid or a specific anchor point.

strokeStyle

Optional stroke style for the outline of the polygon.

Attributes

Supertypes
class Object
trait Matchable
class Any
Show all
object Rectangle

Factory object for creating rectangles.

Factory object for creating rectangles.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Rectangle.type
class ReferencePoint(pos: Pos, val name: String) extends Point

Represents a named reference point in a graphical context. This class can be used to label specific positions within a graphical representation, which can be used as, for example, pivot points.

Represents a named reference point in a graphical context. This class can be used to label specific positions within a graphical representation, which can be used as, for example, pivot points.

Value parameters

name

The name associated with the reference point.

pos

The position of the reference point.

Attributes

Supertypes
class Point
class Object
trait Matchable
class Any
Show all
object StarPentagon

Factory object for creating star-shaped pentagons.

Factory object for creating star-shaped pentagons.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object StrokeStyle

Defines stroke styles for drawing outlines of shapes and paths, providing customization options for the stroke's appearance.

Defines stroke styles for drawing outlines of shapes and paths, providing customization options for the stroke's appearance.

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class StrokeStyle(paint: Paint, width: Double, cap: Cap, join: Join, onTop: Boolean)

Encapsulates the style attributes for stroking operations, including color, line width, and line cap and join styles.

Encapsulates the style attributes for stroking operations, including color, line width, and line cap and join styles.

Value parameters

cap

The cap style of the stroke. Defaults to Square.

join

The join style of the stroke. Defaults to Miter.

paint

The paint (single color or gradient) used for the stroke.

width

The width of the stroke. Defaults to 1.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
class Text(pos: Pos, val customBounds: Option[Bounds], val content: String, val typeface: String, val size: Double, val weight: Int, val fillStyle: Option[FillStyle], val strokeStyle: Option[StrokeStyle]) extends VectorGraphic

Represents a single line of text as a graphical element.

Represents a single line of text as a graphical element.

Value parameters

content

The content of the text.

customBounds

Optional custom bounds for the text.

fillStyle

Optional fill style for the text.

pos

The position of the text.

strokeStyle

Optional stroke style for the text.

typeface

The typeface used for rendering the text.

Attributes

Supertypes
class Object
trait Matchable
class Any
Show all
object Transformable

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
trait Transformable[+TransformableType]

A trait for graphical elements that can undergo transformations like translation, scaling, and rotation.

A trait for graphical elements that can undergo transformations like translation, scaling, and rotation.

Type parameters

TransformableType

The type of the transformable object.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Picture
class Bitmap
class Arc
class Point
class Polygon
class Text
Show all
object Triangle

Factory object for creating triangles.

Factory object for creating triangles.

Provides methods to create equilateral, isosceles, and scalene triangles based on side lengths, height, base length, or specific corner positions.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Triangle.type

A trait for vector graphics, which are picture elements defined in terms of points, lines, and curves. Vector graphics can be filled and/or stroked with specific styles.

A trait for vector graphics, which are picture elements defined in terms of points, lines, and curves. Vector graphics can be filled and/or stroked with specific styles.

Attributes

Supertypes
class Object
trait Matchable
class Any
Show all
Known subtypes
class Arc
class Point
class Polygon
class Text
class Viewport(val boundary: Bounds)

Represents a viewport with a defined boundary. A viewport is a window or a region through which a subset of the larger picture is viewed or displayed.

Represents a viewport with a defined boundary. A viewport is a window or a region through which a subset of the larger picture is viewed or displayed.

Value parameters

boundary

The boundary defining the limits of the viewport.

Attributes

Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

def fill(paint: Paint): Option[FillStyle]
def stroke(paint: Paint, width: Double, round: Boolean): Option[StrokeStyle]