Home My Page Projects Code Snippets Project Openings 3D graphics for Standard ML
Summary Activity SCM

SCM Repository

[sml3d] View of /trunk/sml3d/src/image-io/image-file-io-sig.sml
ViewVC logotype

View of /trunk/sml3d/src/image-io/image-file-io-sig.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 331 - (download) (annotate)
Fri Oct 3 13:31:30 2008 UTC (11 years ago) by jhr
File size: 1981 byte(s)
  Moving toward a uniform IMAGE_FILE_IO API.
(* image-file-io-sig.sml
 *
 * COPYRIGHT (c) 2008 John Reppy (http://cs.uchicago.edu/~jhr)
 * All rights reserved.
 *
 * The standard interface to an image I/O module.  The default behavior of
 * image loaders is to orient the image so that the bottom of the image is
 * the first scan line, which may require flipping the scan-line order while
 * reading or writing.  It is also possible to specify that the image is either
 * flipped (or not) by using the longer version of some operations.
 *)

signature IMAGE_FILE_IO =
  sig

    val name : string		(* file-format name *)
    val suffix : string		(* file suffix *)

  (* the image formats that can be stored using this file format *)
    val supported : ImageIO.image_format list

  (* get information about an image file *)
    val getInfo : string -> {
	    wid : int, ht : int,	(* image dimensions *)
	    topFirst : bool,		(* true, if top-row is first in the file *)
	    fmt : ImageIO.image_format	(* format of image data *)
	  }

  (* read an image buffer, returning a new buffer *)
    val readFile  : string -> ImageIO.image_data
    val readFile' : {file : string, flip : bool} -> ImageIO.image_data

  (* read an image, returning a new image *)
    val readImage  : string -> ImageIO.image
    val readImage' : {file : string, flip : bool} -> ImageIO.image

  (* load an image into an existing buffer; the size and format must match *)
    val loadFile : {file : string, flip : bool, data : ImageIO.image_data} -> unit

  (* load an image into an existing image; the size and format must match *)
    val loadImage : {file : string, flip : bool, img : ImageIO.image} -> unit

  (* write an image buffer *)
    val writeFile  : (string * ImageIO.image_data) -> unit
    val writeFile' : {file : string, flip : bool, data : ImageIO.image_data} -> unit

  (* write an image *)
    val writeImage  : (string * ImageIO.image) -> unit
    val writeImage' : {file : string, flip : bool, img : ImageIO.image} -> unit

  end

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0