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:
45
rtengine/labimage.cc
Normal file
45
rtengine/labimage.cc
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user