Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /branches/vis12/src/compiler/fields/index-ctl.sml
ViewVC logotype

View of /branches/vis12/src/compiler/fields/index-ctl.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3072 - (download) (annotate)
Sun Mar 15 16:33:00 2015 UTC (4 years, 3 months ago) by jhr
File size: 637 byte(s)
  working on border control
(* index-ctl.sml
 *
 * COPYRIGHT (c) 2015 The Diderot Project (http://diderot-language.cs.uchicago.edu)
 * All rights reserved.
 *
 * Border controls that can be implemented in terms of remapping image indices.
 *)

structure IndexCtl =
  struct

    datatype ctl
      = Clamp		(* clamp indices to image dimensions *)
      | Mirror		(* reflect indices at border *)
      | Wrap		(* wrap indices at border *)

    fun toString Clamp = "Clamp"
      | toString Mirror = "Mirror"
      | toString Wrap = "Wrap"

    fun same (c1 : ctl, c2) = (c1 = c2)

    fun hash Clamp = 0w17
      | hash Mirror = 0w23
      | hash Wrap = 0w37

  end

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