Reapplied Hombres patch (revision c006f93a5f) as it got lost on the way.
This commit is contained in:
42
rtengine/labimage.cc
Normal file
42
rtengine/labimage.cc
Normal file
@@ -0,0 +1,42 @@
|
||||
#include <labimage.h>
|
||||
namespace rtengine {
|
||||
|
||||
LabImage::LabImage (int w, int h) : fromImage(false), W(w), H(h) {
|
||||
|
||||
L = new unsigned short*[H];
|
||||
for (int i=0; i<H; i++)
|
||||
L[i] = new unsigned short[W];
|
||||
|
||||
a = new short*[H];
|
||||
for (int i=0; i<H; i++)
|
||||
a[i] = new short[W];
|
||||
|
||||
b = new short*[H];
|
||||
for (int i=0; i<H; i++)
|
||||
b[i] = new short[W];
|
||||
}
|
||||
|
||||
LabImage::LabImage (Image16* im) {
|
||||
|
||||
W = im->width;
|
||||
H = im->height;
|
||||
L = im->r;
|
||||
a = (short**) im->g;
|
||||
b = (short**) im->b;
|
||||
fromImage = true;
|
||||
}
|
||||
|
||||
LabImage::~LabImage () {
|
||||
|
||||
if (!fromImage) {
|
||||
for (int i=0; i<H; i++) {
|
||||
delete [] L[i];
|
||||
delete [] a[i];
|
||||
delete [] b[i];
|
||||
}
|
||||
delete [] L;
|
||||
delete [] a;
|
||||
delete [] b;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user