Copying float branch into default (apart from metadata tunneling, which oduis needs to re-enable n line 278 of simpleprocess.cc). I copied rtengine into default and patched things up, so this branch should have the rtgui of default and the rtengine of float.

This commit is contained in:
Emil Martinec
2011-04-06 20:40:30 -05:00
commit b4b8c0602f
675 changed files with 143701 additions and 0 deletions

45
rtengine/labimage.cc Normal file
View File

@@ -0,0 +1,45 @@
#include <labimage.h>
namespace rtengine {
LabImage::LabImage (int w, int h) : fromImage(false), W(w), H(h) {
L = new float*[H];
a = new float*[H];
b = new float*[H];
data = new float [W*H*3];
float * index = data;
for (int i=0; i<H; i++)
L[i] = index + i*W;
index+=W*H;
for (int i=0; i<H; i++)
a[i] = index + i*W;
index+=W*H;
for (int i=0; i<H; i++)
b[i] = index + i*W;
}
LabImage::LabImage (Image16* im) {
W = im->width;
H = im->height;
for (int i=0; i<H; i++)
for (int j=0; j<W; j++) {
L[i][j] = im->r[i][j];
a[i][j] = im->g[i][j];
b[i][j] = im->b[i][j];
}
fromImage = true;
}
LabImage::~LabImage () {
if (!fromImage) {
delete [] L;
delete [] a;
delete [] b;
delete [] data;
}
}
}