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 clear(color: Color = Color.WHITE): Image

    Clears all image data to the given color

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

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

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

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

  6. abstract def foreach(f: (Int, Int, Int) ⇒ Unit): Unit

  7. abstract def height: Int

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

  9. abstract def pixels: Array[Int]

  10. abstract def resizeTo(targetWidth: Int, targetHeight: Int, position: Position, background: Color = Color.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 writer[T <: ImageWriter](format: Format[T]): T

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

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def count(pixel: Int): Int

    Counts the number of pixels with the given colour.

    Counts the number of pixels with the given colour.

    pixel

    the colour to detect.

    returns

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

  9. def dimensions: (Int, Int)

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

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

    Definition Classes
    ImageLike → AnyRef → Any
  12. def exists(pixel: Int): Boolean

    pixel

    the pixel colour to look for.

    returns

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

  13. def finalize(): Unit

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

  15. def fitToWidth(targetWidth: Int, color: Color = java.awt.Color.WHITE, scaleMethod: ScaleMethod = Bicubic, position: Position = Center): R

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

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

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

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

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

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

    Definition Classes
    AnyRef
  22. lazy val points: Seq[(Int, Int)]

  23. def ratio: Double

    returns

    Returns the aspect ratio for this image.

  24. def resize(scaleFactor: Double, position: Position = Center, background: Color = Color.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.

  25. def resizeToHeight(targetHeight: Int, position: Position = Center, background: Color = Color.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.

  26. def resizeToWidth(targetWidth: Int, position: Position = Center, background: Color = Color.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.

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

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

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

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

    Definition Classes
    AnyRef
  31. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. def write(out: OutputStream, format: Format[_ <: ImageWriter]): Unit

  36. def write(out: OutputStream): Unit

  37. def write(file: File, format: Format[_ <: ImageWriter]): Unit

  38. def write(file: File): Unit

  39. def write(path: String, format: Format[_ <: ImageWriter]): Unit

  40. def write(path: String): Unit

  41. def write(format: Format[_ <: ImageWriter]): Array[Byte]

  42. def write: Array[Byte]

Inherited from AnyRef

Inherited from Any

Ungrouped