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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3886 - (download) (annotate)
Fri May 20 15:10:11 2016 UTC (3 years, 5 months ago) by jhr
File size: 774 byte(s)
working on merge
(* index-ctl.sml
 *
 * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
 *
 * COPYRIGHT (c) 2015 The University of Chicago
 * All rights reserved.
 *
 * Border controls that can be implemented in terms of remapping image indices.
 *)

structure IndexCtl =
  struct

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

  (* NOTE: these strings should match the names of the member functions in image.cxx *)
    fun toString Clamp = "clamp"
      | toString Mirror = "mirror"
      | toString Wrap = "wrap"

    fun same (c1 : t, 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