Text archives Help
- From: roni@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [Manta] r1823 - trunk/Image
- Date: Mon, 5 Nov 2007 22:32:30 -0700 (MST)
Author: roni
Date: Mon Nov 5 22:32:30 2007
New Revision: 1823
Modified:
trunk/Image/NRRDFile.cc
Log:
I screwed up the last commit, oops. This is the correct version.
As for nrrd and rgbfloat, it looks like before this commit (and the
last one I made), nrrd gave the same error. However, the newly
committed code for the floating point rgb cases is now correct for
padded images.
Modified: trunk/Image/NRRDFile.cc
==============================================================================
--- trunk/Image/NRRDFile.cc (original)
+++ trunk/Image/NRRDFile.cc Mon Nov 5 22:32:30 2007
@@ -105,21 +105,19 @@
pixel_width = 3;
out_nrrd->type = nrrdTypeFloat;
- out_nrrd->data =
- dynamic_cast<SimpleImage<RGBfloatPixel> const *>( image )->getRawData(
which );
-// float *data = new float[pixel_width*width*height];
-// for(int i=0; i<height; i++){
-// for(int j=0; j<width; j++){
-// const RGBfloatPixel p = si->get(j,i,eye);
+ float *data = new float[pixel_width*width*height];
+ for(int i=0; i<height; i++){
+ for(int j=0; j<width; j++){
+ const RGBfloatPixel p = si->get(j,i,eye);
-// data[pixel_width*width*i + pixel_width*j + 0] = p.r;
-// data[pixel_width*width*i + pixel_width*j + 1] = p.g;
-// data[pixel_width*width*i + pixel_width*j + 2] = p.b;
-// }
-// }
+ data[pixel_width*width*i + pixel_width*j + 0] = p.r;
+ data[pixel_width*width*i + pixel_width*j + 1] = p.g;
+ data[pixel_width*width*i + pixel_width*j + 2] = p.b;
+ }
+ }
-// out_nrrd->data = data;
+ out_nrrd->data = data;
}
else if (typeid(*image) == typeid(SimpleImage<RGBAfloatPixel>)) {
- [Manta] r1823 - trunk/Image, roni, 11/06/2007
Archive powered by MHonArc 2.6.16.