Pipette and "On Preview Widgets" branch. See issue 227
The pipette part is already working quite nice but need to be finished. The widgets part needs more work...
This commit is contained in:
38
rtengine/labimage.cc
Normal file
38
rtengine/labimage.cc
Normal file
@@ -0,0 +1,38 @@
|
||||
#include "labimage.h"
|
||||
#include <memory.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 () {
|
||||
|
||||
if (!fromImage) {
|
||||
delete [] L;
|
||||
delete [] a;
|
||||
delete [] b;
|
||||
delete [] data;
|
||||
}
|
||||
}
|
||||
|
||||
void LabImage::CopyFrom(LabImage *Img){
|
||||
memcpy(data, Img->data, W*H*3*sizeof(float));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user