com.sksamuel.scrimage

MutableAwtImage

class MutableAwtImage extends AwtImage

Contains methods that operate on an AWT BufferedImage by mutating the buffer in place. All methods in this class should return Unit as they operate on the underlying image.

This class cannot contain methods that result in a change canvas size, as there is no way to resize a java image once it has been created (and rightly so).

Attributes
protected
Linear Supertypes
AwtImage, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. MutableAwtImage
  2. AwtImage
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new MutableAwtImage(awt: BufferedImage)

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def argb: Array[Array[Int]]

    Returns the ARGB components for all pixels in this image

    Returns the ARGB components for all pixels in this image

    returns

    an array containing ARGB components in that order.

    Definition Classes
    AwtImage
  7. def argb(x: Int, y: Int): Array[Int]

    Returns the ARGB components for the pixel at the given coordinates

    Returns the ARGB components for the pixel at the given coordinates

    x

    the x coordinate of the pixel component to grab

    y

    the y coordinate of the pixel component to grab

    returns

    an array containing ARGB components in that order.

    Definition Classes
    AwtImage
  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. lazy val center: (Int, Int)

    The centre coordinates for the image as an (x, y) tuple.

    The centre coordinates for the image as an (x, y) tuple.

    Definition Classes
    AwtImage
  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def col(x: Int): Array[Pixel]

    returns

    the pixels for the column identified by the x co-ordinate. 0 indexed.

    Definition Classes
    AwtImage
  12. def color(x: Int, y: Int): RGBColor

    Returns the color at the given coordinates.

    Returns the color at the given coordinates.

    returns

    the RGBColor value at the coords

    Definition Classes
    AwtImage
  13. def colours: Set[RGBColor]

    Returns a set of the distinct colours used in this image.

    Returns a set of the distinct colours used in this image.

    returns

    the set of distinct Colors

    Definition Classes
    AwtImage
  14. def contains(color: Color): Boolean

    Returns true if a pixel with the given color exists

    Returns true if a pixel with the given color exists

    color

    the pixel colour to look for.

    returns

    true if there exists at least one pixel that has the given pixels color

    Definition Classes
    AwtImage
  15. def contrastInPlace(factor: Double): Unit

    Attributes
    protected
  16. def count(p: (Pixel) ⇒ Boolean): Int

    Counts the number of pixels that are true for the given predicate

    Counts the number of pixels that are true for the given predicate

    p

    a predicate

    returns

    the number of pixels that evaluated true

    Definition Classes
    AwtImage
  17. def count(color: Color): Int

    Counts the number of pixels with the given colour.

    Counts the number of pixels with the given colour.

    color

    the colour to detect.

    returns

    the number of pixels that matched the colour of the given pixel

    Definition Classes
    AwtImage
  18. lazy val count: Int

    Returns the number of pixels in the image.

    Returns the number of pixels in the image.

    returns

    the number of pixels

    Definition Classes
    AwtImage
  19. lazy val dimensions: (Int, Int)

    A tuple of the (width, height)

    A tuple of the (width, height)

    Definition Classes
    AwtImage
  20. def empty: AwtImage

    Returns a new AWT BufferedImage with the same dimensions and same AWT type.

    Returns a new AWT BufferedImage with the same dimensions and same AWT type. The data is uninitialized.

    Definition Classes
    AwtImage
  21. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  22. def equals(other: Any): Boolean

    Definition Classes
    AwtImage → AnyRef → Any
  23. def exists(p: (Pixel) ⇒ Boolean): Boolean

    Returns true if the predicate is true for at least one pixel on the image.

    Returns true if the predicate is true for at least one pixel on the image.

    p

    a predicate

    returns

    true if p holds for at least one pixel

    Definition Classes
    AwtImage
  24. def fastScaleAwt(targetWidth: Int, targetHeight: Int): BufferedImage

    Returns a new AWT Image scaled using nearest-neighbour.

    Returns a new AWT Image scaled using nearest-neighbour.

    Attributes
    protected[com.sksamuel.scrimage]
    Definition Classes
    AwtImage
  25. def fastScaleScrimage(targetWidth: Int, targetHeight: Int): BufferedImage

    Attributes
    protected[com.sksamuel.scrimage]
    Definition Classes
    AwtImage
  26. def fillInPlace(color: Color): Unit

    Fills all pixels the given color on the existing image.

    Fills all pixels the given color on the existing image.

    Attributes
    protected[com.sksamuel.scrimage]
  27. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  28. def forall(f: (Int, Int, Pixel) ⇒ Boolean): Boolean

    Returns true if the predicate is true for all pixels in the image.

    Returns true if the predicate is true for all pixels in the image.

    f

    a predicate function that accepts 3 parameters - the x,y coordinate and the pixel at that coordinate

    returns

    true if f holds for at least one pixel

    Definition Classes
    AwtImage
  29. def foreach(f: (Int, Int, Pixel) ⇒ Unit): Unit

    Executes the given side effecting function on each pixel.

    Executes the given side effecting function on each pixel.

    f

    a function that accepts 3 parameters - the x,y coordinate and the pixel at that coordinate

    Definition Classes
    AwtImage
  30. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  31. def hashCode(): Int

    Definition Classes
    AwtImage → AnyRef → Any
  32. lazy val height: Int

    Definition Classes
    AwtImage
  33. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  34. def iterator: Iterator[Pixel]

    Returns the pixels of the image as an iterator.

    Returns the pixels of the image as an iterator. The iterator is the most efficient way to lazily iterator over the pixels as the pixels will only be fetched from the raster as needed.

    returns

    the iterator

    Definition Classes
    AwtImage
  35. def mapInPlace(f: (Int, Int, Pixel) ⇒ Pixel): Unit

    Maps the pixels of this image into another image by applying the given function to each pixel.

    Maps the pixels of this image into another image by applying the given function to each pixel.

    The function accepts three parameters: x,y,p where x and y are the coordinates of the pixel being transformed and p is the pixel at that location.

    f

    the function to transform pixel x,y with existing value p into new pixel value p' (p prime)

    Attributes
    protected[com.sksamuel.scrimage]
  36. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  37. final def notify(): Unit

    Definition Classes
    AnyRef
  38. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  39. def offset(x: Int, y: Int): Int

    Definition Classes
    AwtImage
  40. def overlayInPlace(overlay: BufferedImage, x: Int = 0, y: Int = 0): Unit

    Applies the given image over the current buffer.

    Applies the given image over the current buffer.

    Attributes
    protected[com.sksamuel.scrimage]
  41. def patch(x: Int, y: Int, patchWidth: Int, patchHeight: Int): Array[Pixel]

    Definition Classes
    AwtImage
  42. def patches(patchWidth: Int, patchHeight: Int): IndexedSeq[() ⇒ Array[Pixel]]

    Returns all the patches of a given size in the image, assuming pixel alignment (no subpixel extraction).

    Returns all the patches of a given size in the image, assuming pixel alignment (no subpixel extraction).

    The patches are returned as a sequence of pixel matrices closures

    Definition Classes
    AwtImage
  43. def pixel(p: (Int, Int)): Pixel

    Returns the pixel at the given coordinate.

    Returns the pixel at the given coordinate.

    p

    the pixel as an integer tuple

    returns

    the pixel

    Definition Classes
    AwtImage
  44. def pixel(x: Int, y: Int): Pixel

    Returns the pixel at the given coordinates.

    Returns the pixel at the given coordinates.

    x

    the x coordinate of the pixel to grab

    y

    the y coordinate of the pixel to grab

    returns

    the Pixel at the location

    Definition Classes
    AwtImage
  45. def pixels(x: Int, y: Int, w: Int, h: Int): Array[Pixel]

    Returns a rectangular region within the given boundaries as a single dimensional array of integers.

    Returns a rectangular region within the given boundaries as a single dimensional array of integers.

    Eg, pixels(10, 10, 30, 20) would result in an array of size 600 with the first row of the region in indexes 0,..,29, second row 30,..,59 etc.

    x

    the start x coordinate

    y

    the start y coordinate

    w

    the width of the region

    h

    the height of the region

    returns

    an Array of pixels for the region

    Definition Classes
    AwtImage
  46. def pixels: Array[Pixel]

    Returns all the pixels for the image

    Returns all the pixels for the image

    returns

    an array of pixels for this image

    Definition Classes
    AwtImage
  47. lazy val points: Seq[(Int, Int)]

    Definition Classes
    AwtImage
  48. lazy val radius: Int

    The radius of the image defined as the centre to the corners.

    The radius of the image defined as the centre to the corners.

    Definition Classes
    AwtImage
  49. lazy val ratio: Double

    returns

    Returns the aspect ratio for this image.

    Definition Classes
    AwtImage
  50. def removetrans(color: java.awt.Color): Unit

    Attributes
    protected[com.sksamuel.scrimage]
  51. def rescaleInPlace(factor: Double): Unit

    Mutates this image by scaling all pixel values by the given factor (brightness in other words).

    Mutates this image by scaling all pixel values by the given factor (brightness in other words).

    Attributes
    protected
  52. def rgb: Array[Array[Int]]

    Definition Classes
    AwtImage
  53. def rgb(x: Int, y: Int): Array[Int]

    Definition Classes
    AwtImage
  54. def rotate(angle: Double): BufferedImage

    Returns a new AWT Image rotated with the given angle (in degrees)

    Returns a new AWT Image rotated with the given angle (in degrees)

    Attributes
    protected[com.sksamuel.scrimage]
    Definition Classes
    AwtImage
  55. def row(y: Int): Array[Pixel]

    returns

    the pixels in the row identified by the y coordinate. 0 indexed.

    Definition Classes
    AwtImage
  56. def scale(targetWidth: Int, targetHeight: Int, scale: Scale): BufferedImage

    Attributes
    protected[com.sksamuel.scrimage]
    Definition Classes
    AwtImage
  57. def setPixel(x: Int, y: Int, pixel: Pixel): Unit

  58. def subpixel(x: Double, y: Double): Int

    Uses linear interpolation to get a sub-pixel.

    Uses linear interpolation to get a sub-pixel.

    Legal values for x and y are in [0, width) and [0, height), respectively.

    Definition Classes
    AwtImage
  59. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  60. def toNewBufferedImage(type: Int = awt.getType): BufferedImage

    Returns a new AWT BufferedImage from this image.

    Returns a new AWT BufferedImage from this image.

    type

    the type of buffered image to create, if not specified then defaults to the current image type

    returns

    a new, non-shared, BufferedImage with the same data as this Image.

    Definition Classes
    AwtImage
  61. def toString(): String

    Definition Classes
    AwtImage → AnyRef → Any
  62. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  63. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  64. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  65. lazy val width: Int

    Definition Classes
    AwtImage

Inherited from AwtImage

Inherited from AnyRef

Inherited from Any

Ungrouped