ImageReader

eu.joaocosta.minart.graphics.image.ImageReader

Image reader with a low-level implementation on how to load an image.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait BmpImageReader[ByteSeq]
class BmpImageFormat[R, W]
trait PpmImageReader[ByteSeq]
class PpmImageFormat[R, W]
trait QoiImageReader[Container]
class QoiImageFormat[R, W]

Members list

Concise view

Value members

Abstract methods

def loadImage(is: InputStream): Either[String, RamSurface]

Loads an image from an InputStream.

Loads an image from an InputStream.

Attributes

is

InputStream with the image data

Returns:

Either a RamSurface with the image data or an error string

Concrete methods

def fromByteArray(data: Array[Byte]): Either[String, RamSurface]

Loads an image from a byte array.

Loads an image from a byte array.

Attributes

data

Byte array

Returns:

Either a RamSurface with the image data or an error string

def loadImage(resource: Resource): Try[Either[String, RamSurface]]

Loads an image from a Resource.

Loads an image from a Resource.

Attributes

resource

Resource with the image data

Returns:

Either a RamSurface with the image data or an error string, inside a Try capturing the IO exceptions