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

SCM Repository

[sml3d] View of /trunk/sml3d/src/raw-data/image-sig.sml
ViewVC logotype

View of /trunk/sml3d/src/raw-data/image-sig.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 659 - (download) (annotate)
Sat Jan 2 04:50:37 2010 UTC (10 years ago) by jhr
File size: 1615 byte(s)
  Factor out support for low-level C data into separate library.  This library
  is used by both the OpenCL and OpenGL libraries.
(* image-sig.sml
 *
 * COPYRIGHT (c) 2010 John Reppy (http://cs.uchicago.edu/~jhr)
 * All rights reserved.
 *
 * Basic operations on 1D, 2D, and 3D images.  Images overlay a structure (e.g., width
 * and height) on a linear data buffer.  Note that the data buffer is shared, not copied,
 * which means that modifications to it will be reflected in the image.  For use by both
 * OpenGL and OpenCL programs.
 *)

signature IMAGE =
  sig

    type 'a buffer = 'a DataBuffer.buffer

    type 'a image1D	(* 1D images *)
    type 'a image2D	(* 2D images *)
    type 'a image3D	(* 3D images *)

  (** 1D images **)
    val image1D : {wid : int, data : 'a buffer} -> 'a image1D
    val width1D : 'a image1D -> int
    val data1D : 'a image1D -> 'a buffer
    val get1D : 'a image1D * int -> 'a
    val set1D : 'a image1D * int * 'a -> unit

  (** 2D images **)
    val image2D : {wid : int, ht : int, data : 'a buffer} -> 'a image2D
    val width2D : 'a image2D -> int
    val height2D : 'a image2D -> int
    val data2D : 'a image2D -> 'a buffer
    val get2D : 'a image2D * int * int -> 'a			(* args: (img, r, c) *)
    val set2D : 'a image2D * int * int * 'a -> unit		(* args: (img, r, c) *)

  (** 3D images **)
    val image3D : {wid : int, ht : int, depth : int, data : 'a buffer} -> 'a image3D
    val width3D : 'a image3D -> int
    val height3D : 'a image3D -> int
    val depth3D : 'a image3D -> int
    val data3D : 'a image3D -> 'a buffer
    val get3D : 'a image3D * int * int * int -> 'a		(* args: (img, d, r, c) *)
    val set3D : 'a image3D * int * int * int * 'a -> unit	(* args: (img, d, r, c) *)

  end

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