com.sksamuel.scrimage

AwtImage

abstract class AwtImage[R] extends PixelOps[R] with InPlaceOperations[R]

A skeleton implementation of read only operations based on a backing AWT image.

Linear Supertypes
InPlaceOperations[R], PixelOps[R], AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. AwtImage
  2. InPlaceOperations
  3. PixelOps
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new AwtImage(awt: BufferedImage)

Abstract Value Members

  1. abstract def blank: Image

    Creates an empty Image with the same dimensions of this image.

    Creates an empty Image with the same dimensions of this image.

    returns

    a new Image that is a clone of this image but with uninitialized data

    Definition Classes
    PixelOps
  2. abstract def fill(color: Color): R

    Sets all pixels on this image to be the given color.

    Sets all pixels on this image to be the given color.

    returns

    The result of the pixels set to the given color.

    Definition Classes
    InPlaceOperations
  3. abstract def filter(filter: Filter): R

    Creates a copy of this image with the given filter applied.

    Creates a copy of this image with the given filter applied. The original (this) image is unchanged.

    filter

    the filter to apply. See com.sksamuel.scrimage.Filter.

    returns

    A new image with the given filter applied.

    Definition Classes
    InPlaceOperations
  4. abstract def map(f: (Int, Int, Pixel) ⇒ Pixel): R

    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)

    returns

    Definition Classes
    InPlaceOperations

Concrete 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
    PixelOps
  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
    PixelOps
  8. final def asInstanceOf[T0]: T0

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

    Returns the centre coordinates for the image.

    Returns the centre coordinates for the image.

    Definition Classes
    PixelOps
  10. def clone(): AnyRef

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

    Definition Classes
    PixelOps
  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
    PixelOps
  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
    PixelOps
  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
    PixelOps
  15. def copy: Image

    Create a new Image which is a copy of this image.

    Create a new Image which is a copy of this image. Any operations on the new image do not write back to the original.

    returns

    A copy of this image.

    Definition Classes
    AwtImagePixelOps
  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
    PixelOps
  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
    PixelOps
  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
    PixelOps
  19. lazy val dimensions: (Int, Int)

    Definition Classes
    PixelOps
  20. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    PixelOps → AnyRef → Any
  22. def exists(p: (Pixel) ⇒ Boolean): Boolean

    Returns true if the predicate holds on the image

    Returns true if the predicate holds on the image

    p

    a predicate

    returns

    true if p holds for at least one pixel

    Definition Classes
    PixelOps
  23. def fastscale(targetWidth: Int, targetHeight: Int): Image

    Attributes
    protected[com.sksamuel.scrimage]
  24. def fillpx(color: Color): Unit

    Attributes
    protected
  25. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  26. def flip(tx: AffineTransform): BufferedImage

    Attributes
    protected[com.sksamuel.scrimage]
  27. def flipX: R

    Flips this image horizontally.

    Flips this image horizontally.

    returns

    The result of flipping this image horizontally.

    Definition Classes
    AwtImageInPlaceOperations
  28. def flipY: R

    Flips this image vertically.

    Flips this image vertically.

    returns

    The result of flipping this image vertically.

    Definition Classes
    AwtImageInPlaceOperations
  29. def forall(f: (Int, Int, Pixel) ⇒ Boolean): Boolean

    Definition Classes
    PixelOps
  30. def foreach(f: (Int, Int, Pixel) ⇒ Unit): Unit

    Definition Classes
    PixelOps
  31. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  32. def graphics: Graphics2D

    Attributes
    protected[com.sksamuel.scrimage]
  33. def hashCode(): Int

    Definition Classes
    PixelOps → AnyRef → Any
  34. lazy val height: Int

    Definition Classes
    AwtImagePixelOps
  35. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  36. 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
    AwtImagePixelOps
  37. 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)

    returns

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

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

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

    Definition Classes
    AnyRef
  41. def op(op: BufferedImageOp): Image

    Attributes
    protected[com.sksamuel.scrimage]
  42. def overlayInPlace(overlayImage: Image, x: Int = 0, y: Int = 0): Unit

    Attributes
    protected[com.sksamuel.scrimage]
  43. final 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
    AwtImagePixelOps
  44. 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
    PixelOps
  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
    PixelOps
  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
    PixelOps
  47. lazy val points: Seq[(Int, Int)]

    Definition Classes
    PixelOps
  48. lazy val radius: Int

    Definition Classes
    PixelOps
  49. lazy val ratio: Double

    returns

    Returns the aspect ratio for this image.

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

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

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

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

    Definition Classes
    PixelOps
  54. def rotate(angle: Double): Image

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

    Definition Classes
    PixelOps
  56. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  57. def toNewBufferedImage: BufferedImage

    Returns a new AWT BufferedImage from this image using the same AWT type.

    Returns a new AWT BufferedImage from this image using the same AWT type.

    returns

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

  58. def toString(): String

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

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

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

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

    Definition Classes
    AwtImagePixelOps

Inherited from InPlaceOperations[R]

Inherited from PixelOps[R]

Inherited from AnyRef

Inherited from Any

Ungrouped