com.sksamuel.scrimage

ImageLike

trait ImageLike[R] extends AnyRef

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

Abstract Value Members

  1. abstract def copy: Image

    Creates a new image with the same data as this image.

    Creates a new image with the same data as this image. Any operations to the copied image will not write back to the original. Images can be copied multiple times as well as copies copied etc.

    returns

    A copy of this image.

  2. abstract def empty: 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

  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.

  4. abstract def fit(targetWidth: Int, targetHeight: Int, color: Color, scaleMethod: ScaleMethod, position: Position): R

  5. abstract def height: Int

  6. abstract def map(f: (Int, Int, Int) ⇒ Int): R

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

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

    The function accepts three parameters: x,y,p where x and y are the coordinates of the pixel being transformed and p is the current pixel value in ABGR format.

    f

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

    returns

  7. abstract def padTo(targetWidth: Int, targetHeight: Int, color: Color = X11Colorlist.White): R

    Creates a new image which is the result of this image padded to the canvas size specified.

    Creates a new image which is the result of this image padded to the canvas size specified. If this image is already larger than the specified pad then the sizes of the existing image will be used instead.

    Eg, requesting a pad of 200,200 on an image of 250,300 will result in keeping the 250,300.

    Eg2, requesting a pad of 300,300 on an image of 400,250 will result in the width staying at 400 and the height padded to 300.

    targetWidth

    the size of the output canvas width

    targetHeight

    the size of the output canvas height

    color

    the background of the padded area.

    returns

    A new image that is the result of the padding

  8. abstract def pixel(x: Int, y: Int): Int

    Returns the pixel at the given coordinates as a integer in ARGB format.

    Returns the pixel at the given coordinates as a integer in ARGB format.

    x

    the x coordinate of the pixel to grab

    y

    the y coordinate of the pixel to grab

    returns

    the ARGB value of the pixel

  9. abstract def pixels: Array[Int]

  10. abstract def resizeTo(targetWidth: Int, targetHeight: Int, position: Position, background: Color = X11Colorlist.White): R

  11. abstract def scaleTo(targetWidth: Int, targetHeight: Int, scaleMethod: ScaleMethod = Bicubic): R

    Scale will resize the canvas and scale the image to match.

    Scale will resize the canvas and scale the image to match. This is like a "image resize" in Photoshop.

    targetWidth

    the target width

    targetHeight

    the target width

    scaleMethod

    the type of scaling method to use.

    returns

    a new Image that is the result of scaling this image

  12. abstract def width: Int

  13. abstract def clear(color: Color = X11Colorlist.White): Image

    Clears all image data to the given color

    Clears all image data to the given color

    Annotations
    @deprecated
    Deprecated

    (Since version 1.4) use filled

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.

  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.

  8. final def asInstanceOf[T0]: T0

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

  10. def clone(): AnyRef

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

  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 of the pixel

  13. def colours: Set[Color]

    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

  14. 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

  15. def count: Int

    Returns the number of pixels in the image.

    Returns the number of pixels in the image.

    returns

    the number of pixels

  16. lazy val dimensions: (Int, Int)

  17. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  18. def equals(obj: Any): Boolean

    Definition Classes
    ImageLike → AnyRef → Any
  19. def exists(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

  20. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  21. def fitToHeight(targetHeight: Int, color: Color = X11Colorlist.White, scaleMethod: ScaleMethod = Bicubic, position: Position = Center): R

  22. def fitToWidth(targetWidth: Int, color: Color = X11Colorlist.White, scaleMethod: ScaleMethod = Bicubic, position: Position = Center): R

  23. def forall(f: (Int, Int, Int) ⇒ Boolean): Boolean

  24. def foreach(f: (Int, Int, Int) ⇒ Unit): Unit

  25. final def getClass(): Class[_]

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

    Definition Classes
    AnyRef → Any
  27. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  28. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  31. def pad(size: Int, color: Color = X11Colorlist.White): R

    Creates a new image which is the result of this image padded with the given number of pixels on each edge.

    Creates a new image which is the result of this image padded with the given number of pixels on each edge.

    Eg, requesting a pad of 30 on an image of 250,300 will result in a new image with a canvas size of 310,360

    size

    the number of pixels to add on each edge

    color

    the background of the padded area.

    returns

    A new image that is the result of the padding

  32. def pixel(p: (Int, Int)): Int

    Returns the pixel at the given coordinates as a integer in RGB format.

    Returns the pixel at the given coordinates as a integer in RGB format.

    p

    the pixel as an integer tuple

    returns

    the ARGB value of the pixel

  33. def pixels(x: Int, y: Int, w: Int, h: Int): Array[Int]

    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

  34. lazy val points: Seq[(Int, Int)]

  35. lazy val radius: Int

  36. lazy val ratio: Double

    returns

    Returns the aspect ratio for this image.

  37. def resize(scaleFactor: Double, position: Position = Center, background: Color = X11Colorlist.White): R

    Resize will resize the canvas, it will not scale the image.

    Resize will resize the canvas, it will not scale the image. This is like a "canvas resize" in Photoshop.

    scaleFactor

    the scaleFactor. 1 retains original size. 0.5 is half. 2 double. etc

    position

    where to position the original image after the canvas size change. Defaults to centre.

    background

    the color to use for expande background areas. Defaults to White.

    returns

    a new Image that is the result of resizing the canvas.

  38. def resizeToHeight(targetHeight: Int, position: Position = Center, background: Color = X11Colorlist.White): R

    Resize will resize the canvas, it will not scale the image.

    Resize will resize the canvas, it will not scale the image. This is like a "canvas resize" in Photoshop.

    position

    where to position the original image after the canvas size change

    returns

    a new Image that is the result of resizing the canvas.

  39. def resizeToWidth(targetWidth: Int, position: Position = Center, background: Color = X11Colorlist.White): R

    Resize will resize the canvas, it will not scale the image.

    Resize will resize the canvas, it will not scale the image. This is like a "canvas resize" in Photoshop.

    position

    where to position the original image after the canvas size change

    returns

    a new Image that is the result of resizing the canvas.

  40. def rgb: Array[Array[Int]]

  41. def rgb(x: Int, y: Int): Array[Int]

  42. def row(y: Int): Array[Int]

  43. def scale(scaleFactor: Double, scaleMethod: ScaleMethod = Bicubic): R

    Scale will resize the canvas and the image.

    Scale will resize the canvas and the image. This is like a "image resize" in Photoshop.

    scaleFactor

    the target increase or decrease. 1 is the same as original.

    scaleMethod

    the type of scaling method to use.

    returns

    a new Image that is the result of scaling this image

  44. def scaleToHeight(targetHeight: Int, scaleMethod: ScaleMethod = Bicubic): R

    Scale will resize the canvas and scale the image to match.

    Scale will resize the canvas and scale the image to match. This is like a "image resize" in Photoshop.

    This overloaded version of scale will scale the image so that the new image has a height that matches the given targetHeight and the same aspect ratio as the original.

    Eg, an image of 200,300 with a scaleToHeight of 450 will result in a scaled image of 300,450

    targetHeight

    the target height

    scaleMethod

    the type of scaling method to use.

    returns

    a new Image that is the result of scaling this image

  45. def scaleToWidth(targetWidth: Int, scaleMethod: ScaleMethod = Bicubic): R

    Scale will resize the canvas and scale the image to match.

    Scale will resize the canvas and scale the image to match. This is like a "image resize" in Photoshop.

    This overloaded version of scale will scale the image so that the new image has a width that matches the given targetWidth and the same aspect ratio as the original.

    Eg, an image of 200,300 with a scaleToWidth of 400 will result in a scaled image of 400,600

    targetWidth

    the target width

    scaleMethod

    the type of scaling method to use.

    returns

    a new Image that is the result of scaling this image

  46. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  47. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped