ImageWriter

eu.joaocosta.minart.graphics.image.ImageWriter

Image writer with a low-level implementation on how to store an image.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait BmpImageWriter[ByteSeq]
class BmpImageFormat[R, W]
trait PpmImageWriter[ByteSeq]
class PpmImageFormat[R, W]
trait QoiImageWriter[ByteSeq]
class QoiImageFormat[R, W]

Members list

Concise view

Value members

Abstract methods

def storeImage(surface: Surface, os: OutputStream): Either[String, Unit]

Stores a surface to an OutputStream.

Stores a surface to an OutputStream.

Attributes

os

OutputStream where to store the data

surface

Surface to store

Returns:

Either unit or an error string

Concrete methods

def storeImage(surface: Surface, resource: Resource): Try[Either[String, Unit]]

Stores a surface to a Resource.

Stores a surface to a Resource.

Attributes

resource

Resource where to store the data

surface

Surface to store

Returns:

Either unit or an error string, inside a Try capturing the IO exceptions

def toByteArray(surface: Surface): Either[String, Array[Byte]]

Returns the image data as a byte array.

Returns the image data as a byte array.

Attributes

surface

Surface to convert

Returns:

Either an array with the image data or an error string