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

SCM Repository

[sml3d] View of /src/common/sml3d-type-util-sig.sml
ViewVC logotype

View of /src/common/sml3d-type-util-sig.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 16 - (download) (annotate)
Mon Feb 18 17:38:18 2008 UTC (11 years, 11 months ago) by jhr
Original Path: src/opengl/gl-type-util-sig.sml
File size: 1768 byte(s)
  add iterators.
(* gl-type-util-sig.sml
 *
 * COPYRIGHT (c) 2006 John Reppy (http://www.cs.uchicago.edu/~jhr)
 * All rights reserved.
 *)

signature GL_TYPE_UTIL =
  sig

    include GL_TYPES

  (* pack tuples as records *)
    val packv2 : ('a * 'a)		-> 'a vec2
    val packv3 : ('a * 'a * 'a)		-> 'a vec3
    val packv4 : ('a * 'a * 'a * 'a)	-> 'a vec4

    val packt2 : ('a * 'a)		-> 'a tex2
    val packt3 : ('a * 'a * 'a)		-> 'a tex3
    val packt4 : ('a * 'a * 'a * 'a)	-> 'a tex4

    val packc3 : ('a * 'a * 'a)		-> 'a rgb
    val packc4 : ('a * 'a * 'a * 'a)	-> 'a rgba

  (* unpack records as tuples *)
    val unpackv2 : 'a vec2 -> ('a * 'a)
    val unpackv3 : 'a vec3 -> ('a * 'a * 'a)
    val unpackv4 : 'a vec4 -> ('a * 'a * 'a * 'a)

    val unpackt2 : 'a tex2 -> ('a * 'a)
    val unpackt3 : 'a tex3 -> ('a * 'a * 'a)
    val unpackt4 : 'a tex4 -> ('a * 'a * 'a * 'a)

    val unpackc3 : 'a rgb  -> ('a * 'a * 'a)
    val unpackc4 : 'a rgba -> ('a * 'a * 'a * 'a)

  (* iterators *)
    fun mapv2 : ('a -> 'b) -> 'a vec2 -> 'b vec2
    fun mapv3 : ('a -> 'b) -> 'a vec3 -> 'b vec3
    fun mapv4 : ('a -> 'b) -> 'a vec4 -> 'b vec4

    fun mapt2 : ('a -> 'b) -> 'a tex2 -> 'b tex2
    fun mapt3 : ('a -> 'b) -> 'a tex3 -> 'b tex3
    fun mapt4 : ('a -> 'b) -> 'a tex4 -> 'b tex4

    fun mapc3 : ('a -> 'b) -> 'a rgb -> 'b rgb
    fun mapc4 : ('a -> 'b) -> 'a rgba -> 'b rgba

    fun appv2 : ('a -> unit) -> 'a vec2 -> unit
    fun appv3 : ('a -> unit) -> 'a vec3 -> unit
    fun appv4 : ('a -> unit) -> 'a vec4 -> unit

    fun appt2 : ('a -> unit) -> 'a tex2 -> unit
    fun appt3 : ('a -> unit) -> 'a tex3 -> unit
    fun appt4 : ('a -> unit) -> 'a tex4 -> unit

    fun appc3 : ('a -> unit) -> 'a rgb -> unit
    fun appc4 : ('a -> unit) -> 'a rgba -> unit

  end

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