Adapter for managing and manipulating a bitmap. This class provides methods for common image processing tasks such as copying, scaling, and transforming.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class JVMBufferAdapter
Members list
Value members
Abstract methods
Copies a portion of the image defined by a top-left corner and dimensions.
Copies a portion of the image defined by a top-left corner and dimensions.
Value parameters
- height
-
Height of the portion to copy.
- topLeftX
-
X-coordinate of the top-left corner.
- topLeftY
-
Y-coordinate of the top-left corner.
- width
-
Width of the portion to copy.
Attributes
- Returns
-
A new
BufferAdapter
instance containing the copied portion of the image.
Creates a new BufferAdapter
instance that is a transformed version of the current buffer. The transformation is applied using an AffineTransformation
. The canvas can optionally be resized based on the transformation.
Creates a new BufferAdapter
instance that is a transformed version of the current buffer. The transformation is applied using an AffineTransformation
. The canvas can optionally be resized based on the transformation.
Value parameters
- backgroundColor
-
The background color to use when clearing the canvas if resizing is necessary. Defaults to
DefaultBackgroundColor
. - transformation
-
The
AffineTransformation
to apply to the image.
Attributes
- Returns
-
A new
BufferAdapter
instance containing the transformed image.
Creates a deep copy of the current BufferAdapter
instance, drawing the current buffer onto a new one.
Creates a deep copy of the current BufferAdapter
instance, drawing the current buffer onto a new one.
Attributes
- Returns
-
A new
BufferAdapter
instance that is a copy of the current one.
Retrieves the color at a specified pixel location in the buffer.
Retrieves the color at a specified pixel location in the buffer.
Value parameters
- x
-
The x-coordinate of the pixel.
- y
-
The y-coordinate of the pixel.
Attributes
- Returns
-
The
Color
of the pixel at the specified coordinates.
Scales the image to a target width and height.
Scales the image to a target width and height.
Value parameters
- targetHeight
-
The target height for the scaled image.
- targetWidth
-
The target width for the scaled image.
Attributes
- Returns
-
A new
BufferAdapter
instance containing the scaled image.
Sets the colors of the image from a sequence of Color
objects.
Sets the colors of the image from a sequence of Color
objects.
Value parameters
- colors
-
A sequence of
Color
objects to be applied to the image. The sequence must have exactly width * height items.
Attributes
Sets the color of a pixel at a specified location in the buffer.
Sets the color of a pixel at a specified location in the buffer.
Value parameters
- color
-
The
Color
to set the pixel to. - x
-
The x-coordinate of the pixel.
- y
-
The y-coordinate of the pixel.
Attributes
Concrete methods
Copies a portion of the image defined by two corners: top-left and bottom-right.
Copies a portion of the image defined by two corners: top-left and bottom-right.
Value parameters
- bottom
-
Y-coordinate of the bottom-right corner.
- left
-
X-coordinate of the top-left corner.
- right
-
X-coordinate of the bottom-right corner.
- top
-
Y-coordinate of the top-left corner.
Attributes
- Returns
-
A new
BufferAdapter
instance containing the copied portion of the image.
Merges this Buffer with another Buffer using a specified pixel merging function.
Merges this Buffer with another Buffer using a specified pixel merging function.
Value parameters
- another
-
The other BufferAdapter to merge with.
- pixelMerger
-
A function that takes two colors and returns a merged color.
Attributes
- Returns
-
A new
BufferAdapter
instance representing the merged image.