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

SCM Repository

[diderot] Diff of /branches/vis12/src/compiler/fields/image-info.sml
ViewVC logotype

Diff of /branches/vis12/src/compiler/fields/image-info.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 239, Fri Aug 6 00:36:04 2010 UTC revision 284, Fri Aug 13 20:39:04 2010 UTC
# Line 8  Line 8 
8    
9  structure ImageInfo : sig  structure ImageInfo : sig
10    
11      (* Image samples are tensors of some raw representation type *)
12        type sample_ty = (int list * RawTypes.ty)
13    
14      datatype info = ImgInfo of {      datatype info = ImgInfo of {
15              id : OS.FileSys.file_id,            (* ID of image file *)              id : OS.FileSys.file_id,            (* ID of image file *)
16              dim : int,                          (* dimension of space *)              dim : int,                          (* dimension of space *)
17              ty : RawTypes.ty,                   (* types of scalar samples *)              ty : sample_ty,                     (* types of image samples *)
18              origin : FloatLit.float list,       (* center of first sample *)              origin : FloatLit.float list,       (* center of first sample *)
19              sizes : int list                    (* number of samples along each axis *)              sizes : int list                    (* number of samples along each axis *)
20            }            }
# Line 29  Line 32 
32    
33    end = struct    end = struct
34    
35      (* Image samples are tensors of some raw representation type *)
36        type sample_ty = (int list * RawTypes.ty)
37    
38      datatype info = ImgInfo of {      datatype info = ImgInfo of {
39              id : OS.FileSys.file_id,            (* ID of image file *)              id : OS.FileSys.file_id,            (* ID of image file *)
40              dim : int,                          (* dimension of space *)              dim : int,                          (* dimension of space *)
41              ty : RawTypes.ty,                   (* types of scalar samples *)              ty : sample_ty,                     (* types of image samples *)
42              origin : FloatLit.float list,       (* center of first sample *)              origin : FloatLit.float list,       (* center of first sample *)
43              sizes : int list                    (* number of samples along each axis *)              sizes : int list                    (* number of samples along each axis *)
44            }            }
# Line 47  Line 53 
53            fun set (r, v) = (r := SOME v)            fun set (r, v) = (r := SOME v)
54            fun get (tag, r) = (case !r of NONE => raise Fail("missing "^tag) | SOME v => v)            fun get (tag, r) = (case !r of NONE => raise Fail("missing "^tag) | SOME v => v)
55            val ty = ref NONE            val ty = ref NONE
56              val totalDim = ref NONE
57            val dim = ref NONE            val dim = ref NONE
58            fun doValue ("type", v) = set(ty, RawTypes.fromString v)            fun doValue ("type", v) = set(ty, RawTypes.fromString v)
59              | doValue ("dimension", v) = ()              | doValue ("dimension", v) = set (totalDim, valOf(Int.fromString v))
60              | doValue ("space dimension", v) = set (dim, valOf(Int.fromString v))              | doValue ("space dimension", v) = set (dim, valOf(Int.fromString v))
61              | doValue ("sizes", v) = ()              | doValue ("sizes", v) = ()
62              | doValue ("space directions", v) = ()              | doValue ("space directions", v) = ()
# Line 65  Line 72 
72              ImgInfo{              ImgInfo{
73                  id = OS.FileSys.fileId fileName,                  id = OS.FileSys.fileId fileName,
74                  dim = get ("space dimension", dim),                  dim = get ("space dimension", dim),
75                  ty = get ("type", ty),  (* FIXME: in general, the type is a tensor of raw values *)
76                    ty = ([], get ("type", ty)),
77                  origin = [],    (* FIXME *)                  origin = [],    (* FIXME *)
78                  sizes = []      (* FIXME *)                  sizes = []      (* FIXME *)
79                }                }

Legend:
Removed from v.239  
changed lines
  Added in v.284

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