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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/cxx-util/gen-load-nrrd.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/cxx-util/gen-load-nrrd.sml

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

revision 3888, Fri May 20 22:06:33 2016 UTC revision 3894, Sun May 22 14:51:27 2016 UTC
# Line 8  Line 8 
8    
9  structure GenLoadNrrd : sig  structure GenLoadNrrd : sig
10    
11    (* loadImage (lhs, info, name)    (* loadImage (lhs, dim, name)
12     *    returns code to load an image from a Nrrd file, where "lhs" is the l-value to hold     *    returns code to load an image from a Nrrd file, where "lhs" is the l-value to hold
13     *    the image, "info" specifies information about the image format, and "name" specifies     *    the image, "dim" specifies the dimension of the image format, and "name" specifies
14     *    the file name.  The generated code check the status of the load attempt and will     *    the file name.  The generated code check the status of the load attempt and will
15     *    return "true" (i.e., error) if the load fails.     *    return "true" (i.e., error) if the load fails.
16     *)     *)
17      val loadImage : CLang.exp * ImageInfo.info * CLang.exp -> CLang.stm      val loadImage : CLang.exp * int * CLang.exp -> CLang.stm
18    
19    (* setImage (lhs, info, nrrd)    (* setImage (lhs, info, nrrd)
20     *    returns code to initialize an image from a Nrrd, where "lhs" is the l-value to hold     *    returns code to initialize an image from a Nrrd, where "lhs" is the l-value to hold
21     *    the image, "info" specifies information about the image format, and "nrrd" specifies     *    the image, "dim" specifies the dimension of the image format, and "nrrd" specifies
22     *    the nrrd.  The generated code check the status of the initialization and will     *    the nrrd.  The generated code check the status of the initialization and will
23     *    return "true" (i.e., error) if the load fails.     *    return "true" (i.e., error) if the load fails.
24     *)     *)
25      val setImage : CLang.exp * ImageInfo.info * CLang.exp -> CLang.stm      val setImage : CLang.exp * int * CLang.exp -> CLang.stm
26    
27      val loadSeqFromFile : CLang.exp * APITypes.t * CLang.exp -> CLang.stm      val loadSeqFromFile : CLang.exp * APITypes.t * CLang.exp -> CLang.stm
28      val loadSeq : CLang.exp * APITypes.t * CLang.exp -> CLang.stm      val loadSeq : CLang.exp * APITypes.t * CLang.exp -> CLang.stm
# Line 35  Line 35 
35    
36      val wrldPrefixTy = CL.T_Ptr(CL.T_Named "WorldBase")      val wrldPrefixTy = CL.T_Ptr(CL.T_Named "WorldBase")
37    
38      fun doImage imageFn (lhs, info, arg) = let      fun doImage imageFn (lhs, dim, arg) = let
           val dim = ImageInfo.dim info  
39            val loadExp = CL.mkApply(imageFn dim, [            val loadExp = CL.mkApply(imageFn dim, [
40                    CL.mkCast(wrldPrefixTy, CL.mkVar "wrld"),                    CL.mkCast(wrldPrefixTy, CL.mkVar "wrld"),
41                    arg,                    arg,
# Line 63  Line 62 
62                        in                        in
63                          (nDims, [dimInit], CL.mkVar "_dims", Ty.realTy)                          (nDims, [dimInit], CL.mkVar "_dims", Ty.realTy)
64                        end                        end
65                    | Ty.SeqTy ty' => raise Fail "loading sequences of type not supported yet"                    | Ty.SeqTy(ty', _) => raise Fail(concat[
66                            "loading sequences of type ", Ty.toString ty', " not supported yet"
67                          ])
68                    | _ => (0, [], CL.mkInt 0, elemTy)                    | _ => (0, [], CL.mkInt 0, elemTy)
69                  (* end case *))                  (* end case *))
70            in CL.mkBlock (            in CL.mkBlock (

Legend:
Removed from v.3888  
changed lines
  Added in v.3894

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