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

SCM Repository

[diderot] View of /trunk/src/compiler/fields/raw-types.sml
ViewVC logotype

View of /trunk/src/compiler/fields/raw-types.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 239 - (download) (annotate)
Fri Aug 6 00:36:04 2010 UTC (9 years ago) by jhr
File size: 916 byte(s)
  Working on image-info input
(* raw-types.sml
 *
 * COPYRIGHT (c) 2010 The Diderot Project (http://diderot.cs.uchicago.edu)
 * All rights reserved.
 *
 * This file defines the representation of the raw scalar types used to
 * define image data in the NRRD file format.
 *)

structure RawTypes =
  struct

  (* raw numeric types as supported by NRRD *)
    datatype ty
      = RT_Int8 | RT_UInt8
      | RT_Int16 | RT_UInt16
      | RT_Int32 | RT_UInt32
      | RT_Int64 | RT_UInt64
      | RT_Float | RT_Double

    fun fromString ty = (case ty
	   of "signed char" => RT_Int8
	    | "unsigned char" => RT_UInt8
	    | "short" => RT_Int16
	    | "unsigned short" => RT_UInt16
	    | "int" => RT_Int32
	    | "unsigned int" => RT_UInt32
	    | "long long int" => RT_Int64
	    | "unsigned long long int" => RT_UInt64
	    | "float" => RT_Float
	    | "double" => RT_Double
	    | _ => raise Fail("unknown raw type "^ty)
	  (* end case *))

  end

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