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

SCM Repository

[diderot] Diff of /branches/vis12/src/lib/common/image.c
ViewVC logotype

Diff of /branches/vis12/src/lib/common/image.c

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

revision 1869, Fri May 11 13:19:14 2012 UTC revision 1870, Fri May 11 17:44:18 2012 UTC
# Line 358  Line 358 
358      img->t = (Diderot_real_t)(-t / s);      img->t = (Diderot_real_t)(-t / s);
359    
360      *imgOut = img;      *imgOut = img;
361        nrrdNix(nin);
362      return DIDEROT_OK;      return DIDEROT_OK;
363  }  }
364    
# Line 371  Line 372 
372          return Diderot_SetImage1D (wrld, nin, imgOut);          return Diderot_SetImage1D (wrld, nin, imgOut);
373  }  }
374    
375    /* free image */
376    Status_t Diderot_FreeImage1D (WorldPrefix_t *wrld, Diderot_image1D_t **imgOut)
377    {
378        FREE ((*imgOut)->data);
379        FREE (*imgOut);
380        return DIDEROT_OK;
381    }
382    
383  Status_t Diderot_SetImage2D (WorldPrefix_t *wrld, Nrrd *nin, Diderot_image2D_t **imgOut)  Status_t Diderot_SetImage2D (WorldPrefix_t *wrld, Nrrd *nin, Diderot_image2D_t **imgOut)
384  {  {
385      Diderot_image2D_t *img = (Diderot_image2D_t *)malloc(sizeof(Diderot_image2D_t));      Diderot_image2D_t *img = (Diderot_image2D_t *)malloc(sizeof(Diderot_image2D_t));
# Line 424  Line 433 
433  //printf("tVec = <%f, %f>\n", ((union2f_t)img->tVec).r[0], ((union2f_t)img->tVec).r[1]);  //printf("tVec = <%f, %f>\n", ((union2f_t)img->tVec).r[0], ((union2f_t)img->tVec).r[1]);
434    
435      *imgOut = img;      *imgOut = img;
436        nrrdNix(nin);
437      return DIDEROT_OK;      return DIDEROT_OK;
438  }  }
439    
# Line 437  Line 447 
447          return Diderot_SetImage2D (wrld, nin, imgOut);          return Diderot_SetImage2D (wrld, nin, imgOut);
448  }  }
449    
450    /* free image */
451    Status_t Diderot_FreeImage2D (WorldPrefix_t *wrld, Diderot_image2D_t **imgOut)
452    {
453        FREE ((*imgOut)->data);
454        FREE (*imgOut);
455        return DIDEROT_OK;
456    }
457    
458  Status_t Diderot_SetImage3D (WorldPrefix_t *wrld, Nrrd *nin, Diderot_image3D_t **imgOut)  Status_t Diderot_SetImage3D (WorldPrefix_t *wrld, Nrrd *nin, Diderot_image3D_t **imgOut)
459  {  {
460    // compute the offset to the first space axis    // compute the offset to the first space axis
# Line 492  Line 510 
510  //printf("tVec = <%f, %f, %f>\n", ((Diderot_union3_t)img->tVec).r[0], ((Diderot_union3_t)img->tVec).r[1], ((Diderot_union3_t)img->tVec).r[2]);  //printf("tVec = <%f, %f, %f>\n", ((Diderot_union3_t)img->tVec).r[0], ((Diderot_union3_t)img->tVec).r[1], ((Diderot_union3_t)img->tVec).r[2]);
511    
512      *imgOut = img;      *imgOut = img;
513        nrrdNix(nin);
514      return DIDEROT_OK;      return DIDEROT_OK;
515  }  }
516    
# Line 504  Line 523 
523      else      else
524          return Diderot_SetImage3D (wrld, nin, imgOut);          return Diderot_SetImage3D (wrld, nin, imgOut);
525  }  }
526    
527    /* free image */
528    Status_t Diderot_FreeImage3D (WorldPrefix_t *wrld, Diderot_image3D_t **imgOut)
529    {
530        FREE ((*imgOut)->data);
531        FREE (*imgOut);
532        return DIDEROT_OK;
533    }

Legend:
Removed from v.1869  
changed lines
  Added in v.1870

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