PpmImageFormat

eu.joaocosta.minart.graphics.image.ppm.PpmImageFormat
See thePpmImageFormat companion object

Image format and writer for PGM/PPM files.

Supports reading P2, P3, P5 and P6 PGM/PPM files with a 8 bit color range and stores data as P6 PPM files with a 8 bit color range.

Attributes

Companion
object
Graph
Supertypes
trait ImageWriter
trait ImageReader
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

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

Loads an image from a byte array.

Loads an image from a byte array.

Value parameters

data

Byte array

Attributes

Returns

Either a RamSurface with the image data or an error string

Inherited from:
ImageReader
final def loadImage(is: InputStream): Either[String, RamSurface]

Loads an image from an InputStream.

Loads an image from an InputStream.

Value parameters

is

InputStream with the image data

Attributes

Returns

Either a RamSurface with the image data or an error string

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

Loads an image from a Resource.

Loads an image from a Resource.

Value parameters

resource

Resource with the image data

Attributes

Returns

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

Inherited from:
ImageReader
final def storeImage(surface: Surface, os: OutputStream): Either[String, Unit]

Stores a surface to an OutputStream.

Stores a surface to an OutputStream.

Value parameters

os

OutputStream where to store the data

surface

Surface to store

Attributes

Returns

Either unit or an error string

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

Stores a surface to a Resource.

Stores a surface to a Resource.

Value parameters

resource

Resource where to store the data

surface

Surface to store

Attributes

Returns

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

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

Returns the image data as a byte array.

Returns the image data as a byte array.

Value parameters

surface

Surface to convert

Attributes

Returns

Either an array with the image data or an error string

Inherited from:
ImageWriter