Reduce peak memory usage of queue processing, Issue 2527
This commit is contained in:
@@ -24,7 +24,23 @@ namespace rtengine {
|
||||
class LabImage {
|
||||
private:
|
||||
bool fromImage;
|
||||
void allocLab(int w, int 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;
|
||||
};
|
||||
public:
|
||||
int W, H;
|
||||
float * data;
|
||||
@@ -38,6 +54,16 @@ public:
|
||||
//Copies image data in Img into this instance.
|
||||
void CopyFrom(LabImage *Img);
|
||||
void getPipetteData (float &L, float &a, float &b, int posX, int posY, int squareSize);
|
||||
void deleteLab( ) {
|
||||
if (!fromImage) {
|
||||
delete [] L;
|
||||
delete [] a;
|
||||
delete [] b;
|
||||
delete [] data;
|
||||
}
|
||||
}
|
||||
void reallocLab( ) { allocLab(W,H); };
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user