|
|
@ -311,12 +311,15 @@ FloatBitMap_t *FloatBitMap_t::QuarterSize(void) const |
|
|
|
|
|
|
|
|
|
|
|
FloatBitMap_t *newbm=new FloatBitMap_t(Width/2,Height/2); |
|
|
|
FloatBitMap_t *newbm=new FloatBitMap_t(Width/2,Height/2); |
|
|
|
for(int y=0;y<Height/2;y++) |
|
|
|
for(int y=0;y<Height/2;y++) |
|
|
|
|
|
|
|
{ |
|
|
|
for(int x=0;x<Width/2;x++) |
|
|
|
for(int x=0;x<Width/2;x++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
for(int c=0;c<4;c++) |
|
|
|
for(int c=0;c<4;c++) |
|
|
|
newbm->Pixel(x,y,c)=((Pixel(x*2,y*2,c)+Pixel(x*2+1,y*2,c)+ |
|
|
|
newbm->Pixel(x,y,c)=((Pixel(x*2,y*2,c)+Pixel(x*2+1,y*2,c)+ |
|
|
|
Pixel(x*2,y*2+1,c)+Pixel(x*2+1,y*2+1,c))/4); |
|
|
|
Pixel(x*2,y*2+1,c)+Pixel(x*2+1,y*2+1,c))/4); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return newbm; |
|
|
|
return newbm; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -326,11 +329,13 @@ FloatBitMap_t *FloatBitMap_t::QuarterSizeBlocky(void) const |
|
|
|
|
|
|
|
|
|
|
|
FloatBitMap_t *newbm=new FloatBitMap_t(Width/2,Height/2); |
|
|
|
FloatBitMap_t *newbm=new FloatBitMap_t(Width/2,Height/2); |
|
|
|
for(int y=0;y<Height/2;y++) |
|
|
|
for(int y=0;y<Height/2;y++) |
|
|
|
|
|
|
|
{ |
|
|
|
for(int x=0;x<Width/2;x++) |
|
|
|
for(int x=0;x<Width/2;x++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
for(int c=0;c<4;c++) |
|
|
|
for(int c=0;c<4;c++) |
|
|
|
newbm->Pixel(x,y,c)=Pixel(x*2,y*2,c); |
|
|
|
newbm->Pixel(x,y,c)=Pixel(x*2,y*2,c); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
return newbm; |
|
|
|
return newbm; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -349,11 +354,14 @@ float FloatBitMap_t::BrightestColor(void) |
|
|
|
{ |
|
|
|
{ |
|
|
|
float ret=0.0; |
|
|
|
float ret=0.0; |
|
|
|
for(int y=0;y<Height;y++) |
|
|
|
for(int y=0;y<Height;y++) |
|
|
|
|
|
|
|
{ |
|
|
|
for(int x=0;x<Width;x++) |
|
|
|
for(int x=0;x<Width;x++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Vector v(Pixel(x,y,0),Pixel(x,y,1),Pixel(x,y,2)); |
|
|
|
Vector v(Pixel(x,y,0),Pixel(x,y,1),Pixel(x,y,2)); |
|
|
|
ret=max(ret,v.Length()); |
|
|
|
ret=max(ret,v.Length()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return ret; |
|
|
|
return ret; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -394,6 +402,7 @@ void FloatBitMap_t::UnLogize(void) |
|
|
|
void FloatBitMap_t::Clear(float r, float g, float b, float alpha) |
|
|
|
void FloatBitMap_t::Clear(float r, float g, float b, float alpha) |
|
|
|
{ |
|
|
|
{ |
|
|
|
for(int y=0;y<Height;y++) |
|
|
|
for(int y=0;y<Height;y++) |
|
|
|
|
|
|
|
{ |
|
|
|
for(int x=0;x<Width;x++) |
|
|
|
for(int x=0;x<Width;x++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Pixel(x,y,0)=r; |
|
|
|
Pixel(x,y,0)=r; |
|
|
@ -401,6 +410,7 @@ void FloatBitMap_t::Clear(float r, float g, float b, float alpha) |
|
|
|
Pixel(x,y,2)=b; |
|
|
|
Pixel(x,y,2)=b; |
|
|
|
Pixel(x,y,3)=alpha; |
|
|
|
Pixel(x,y,3)=alpha; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void FloatBitMap_t::ScaleRGB(float scale_factor) |
|
|
|
void FloatBitMap_t::ScaleRGB(float scale_factor) |
|
|
@ -423,52 +433,61 @@ void FloatBitMap_t::SmartPaste(FloatBitMap_t const &b, int xofs, int yofs, uint3 |
|
|
|
FloatBitMap_t DiffMap1(this); |
|
|
|
FloatBitMap_t DiffMap1(this); |
|
|
|
FloatBitMap_t DiffMap2(this); |
|
|
|
FloatBitMap_t DiffMap2(this); |
|
|
|
FloatBitMap_t DiffMap3(this); |
|
|
|
FloatBitMap_t DiffMap3(this); |
|
|
|
FloatBitMap_t *deltas[4]={&DiffMap0,&DiffMap1,&DiffMap2,&DiffMap3}; |
|
|
|
FloatBitMap_t *deltas[4] = { &DiffMap0, &DiffMap1, &DiffMap2, &DiffMap3}; |
|
|
|
for(int x=0;x<Width;x++) |
|
|
|
for (int x = 0; x < Width; x++) |
|
|
|
for(int y=0;y<Height;y++) |
|
|
|
|
|
|
|
for(int c=0;c<3;c++) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
for(int i=0;i<NDELTAS;i++) |
|
|
|
for (int y = 0; y < Height; y++) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
for (int c = 0; c < 3; c++) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
for (int i = 0; i < NDELTAS; i++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int x1=x+dx[i]; |
|
|
|
int x1 = x + dx[i]; |
|
|
|
int y1=y+dy[i]; |
|
|
|
int y1 = y + dy[i]; |
|
|
|
x1=MAX(0,x1); |
|
|
|
x1 = MAX(0, x1); |
|
|
|
x1=MIN(Width-1,x1); |
|
|
|
x1 = MIN(Width - 1, x1); |
|
|
|
y1=MAX(0,y1); |
|
|
|
y1 = MAX(0, y1); |
|
|
|
y1=MIN(Height-1,y1); |
|
|
|
y1 = MIN(Height - 1, y1); |
|
|
|
float dx1=Pixel(x,y,c)-Pixel(x1,y1,c); |
|
|
|
float dx1 = Pixel(x, y, c) - Pixel(x1, y1, c); |
|
|
|
deltas[i]->Pixel(x,y,c)=dx1; |
|
|
|
deltas[i]->Pixel(x, y, c) = dx1; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
for(int x=1;x<b.Width-1;x++) |
|
|
|
} |
|
|
|
for(int y=1;y<b.Height-1;y++) |
|
|
|
} |
|
|
|
for(int c=0;c<3;c++) |
|
|
|
|
|
|
|
|
|
|
|
for (int x = 1; x < b.Width - 1; x++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
for(int i=0;i<NDELTAS;i++) |
|
|
|
for (int y = 1; y < b.Height - 1; y++) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
for (int c = 0; c < 3; c++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
float diff=b.Pixel(x,y,c)-b.Pixel(x+dx[i],y+dy[i],c); |
|
|
|
for (int i = 0; i < NDELTAS; i++) |
|
|
|
deltas[i]->Pixel(x+xofs,y+yofs,c)=diff; |
|
|
|
{ |
|
|
|
|
|
|
|
float diff = b.Pixel(x, y, c) - b.Pixel(x + dx[i], y + dy[i], c); |
|
|
|
|
|
|
|
deltas[i]->Pixel(x + xofs, y + yofs, c) = diff; |
|
|
|
if (Flags & SPFLAGS_MAXGRADIENT) |
|
|
|
if (Flags & SPFLAGS_MAXGRADIENT) |
|
|
|
{ |
|
|
|
{ |
|
|
|
float dx1=Pixel(x+xofs,y+yofs,c)-Pixel(x+dx[i]+xofs,y+dy[i]+yofs,c); |
|
|
|
float dx1 = Pixel(x + xofs, y + yofs, c) - Pixel(x + dx[i] + xofs, y + dy[i] + yofs, c); |
|
|
|
if (fabs(dx1)>fabs(diff)) |
|
|
|
if (fabs(dx1) > fabs(diff)) |
|
|
|
deltas[i]->Pixel(x+xofs,y+yofs,c)=dx1; |
|
|
|
deltas[i]->Pixel(x + xofs, y + yofs, c) = dx1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// now, calculate modifiability
|
|
|
|
// now, calculate modifiability
|
|
|
|
for(int x=0;x<Width;x++) |
|
|
|
for (int x = 0; x < Width; x++) |
|
|
|
for(int y=0;y<Height;y++) |
|
|
|
{ |
|
|
|
|
|
|
|
for (int y = 0; y < Height; y++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
float modify=0; |
|
|
|
float modify = 0; |
|
|
|
if ( |
|
|
|
if ( (x > xofs + 1) && (x <= xofs + b.Width - 2) && |
|
|
|
(x>xofs+1) && (x<=xofs+b.Width-2) && |
|
|
|
(y > yofs + 1) && (y <= yofs + b.Height - 2)) |
|
|
|
(y>yofs+1) && (y<=yofs+b.Height-2)) |
|
|
|
modify = 1; |
|
|
|
modify=1; |
|
|
|
Alpha(x, y) = modify; |
|
|
|
Alpha(x,y)=modify; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// // now, force a fex pixels in center to be constant
|
|
|
|
// // now, force a fex pixels in center to be constant
|
|
|
|
// int midx=xofs+b.Width/2;
|
|
|
|
// int midx=xofs+b.Width/2;
|
|
|
|
// int midy=yofs+b.Height/2;
|
|
|
|
// int midy=yofs+b.Height/2;
|
|
|
@ -476,10 +495,10 @@ void FloatBitMap_t::SmartPaste(FloatBitMap_t const &b, int xofs, int yofs, uint3 |
|
|
|
// for(int y=midy-10;y<midy+10;y++)
|
|
|
|
// for(int y=midy-10;y<midy+10;y++)
|
|
|
|
// {
|
|
|
|
// {
|
|
|
|
// Alpha(x,y)=0;
|
|
|
|
// Alpha(x,y)=0;
|
|
|
|
// for(int c=0;c<3;c++)
|
|
|
|
// for(int c=0;c < 3;c++)
|
|
|
|
// Pixel(x,y,c)=b.Pixel(x-xofs,y-yofs,c);
|
|
|
|
// Pixel(x,y,c)=b.Pixel(x-xofs,y-yofs,c);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
Poisson(deltas,6000,Flags); |
|
|
|
Poisson(deltas, 6000, Flags); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void FloatBitMap_t::ScaleGradients(void) |
|
|
|
void FloatBitMap_t::ScaleGradients(void) |
|
|
@ -489,57 +508,57 @@ void FloatBitMap_t::ScaleGradients(void) |
|
|
|
FloatBitMap_t DiffMap1(this); |
|
|
|
FloatBitMap_t DiffMap1(this); |
|
|
|
FloatBitMap_t DiffMap2(this); |
|
|
|
FloatBitMap_t DiffMap2(this); |
|
|
|
FloatBitMap_t DiffMap3(this); |
|
|
|
FloatBitMap_t DiffMap3(this); |
|
|
|
FloatBitMap_t *deltas[4]={&DiffMap0,&DiffMap1,&DiffMap2,&DiffMap3}; |
|
|
|
FloatBitMap_t *deltas[4] = { &DiffMap0, &DiffMap1, &DiffMap2, &DiffMap3 |
|
|
|
double gsum=0.0; |
|
|
|
}; |
|
|
|
for(int x=0;x<Width;x++) |
|
|
|
double gsum = 0.0; |
|
|
|
for(int y=0;y<Height;y++) |
|
|
|
for (int x = 0; x < Width; x++) |
|
|
|
for(int c=0;c<3;c++) |
|
|
|
for (int y = 0; y < Height; y++) |
|
|
|
{ |
|
|
|
for (int c = 0; c < 3; c++) |
|
|
|
for(int i=0;i<NDELTAS;i++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
for (int i = 0; i < NDELTAS; i++) |
|
|
|
int x1=x+dx[i]; |
|
|
|
{ |
|
|
|
int y1=y+dy[i]; |
|
|
|
int x1 = x + dx[i]; |
|
|
|
x1=MAX(0,x1); |
|
|
|
int y1 = y + dy[i]; |
|
|
|
x1=MIN(Width-1,x1); |
|
|
|
x1 = MAX(0, x1); |
|
|
|
y1=MAX(0,y1); |
|
|
|
x1 = MIN(Width - 1, x1); |
|
|
|
y1=MIN(Height-1,y1); |
|
|
|
y1 = MAX(0, y1); |
|
|
|
float dx1=Pixel(x,y,c)-Pixel(x1,y1,c); |
|
|
|
y1 = MIN(Height - 1, y1); |
|
|
|
deltas[i]->Pixel(x,y,c)=dx1; |
|
|
|
float dx1 = Pixel(x, y, c) - Pixel(x1, y1, c); |
|
|
|
gsum+=fabs(dx1); |
|
|
|
deltas[i]->Pixel(x, y, c) = dx1; |
|
|
|
|
|
|
|
gsum += fabs(dx1); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// now, reduce gradient changes
|
|
|
|
// now, reduce gradient changes
|
|
|
|
// float gavg=gsum/(Width*Height);
|
|
|
|
// float gavg=gsum/(Width*Height);
|
|
|
|
for(int x=0;x<Width;x++) |
|
|
|
for (int x = 0; x < Width; x++) |
|
|
|
for(int y=0;y<Height;y++) |
|
|
|
for (int y = 0; y < Height; y++) |
|
|
|
for(int c=0;c<3;c++) |
|
|
|
for (int c = 0; c < 3; c++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
for(int i=0;i<NDELTAS;i++) |
|
|
|
for (int i = 0; i < NDELTAS; i++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
float norml=1.1*deltas[i]->Pixel(x,y,c); |
|
|
|
float norml = 1.1 *deltas[i]->Pixel(x, y, c); |
|
|
|
// if (norml<0.0)
|
|
|
|
// if (norml < 0.0)
|
|
|
|
// norml=-pow(-norml,1.2);
|
|
|
|
// norml=-pow(-norml,1.2);
|
|
|
|
// else
|
|
|
|
// else
|
|
|
|
// norml=pow(norml,1.2);
|
|
|
|
// norml=pow(norml,1.2);
|
|
|
|
deltas[i]->Pixel(x,y,c)=norml; |
|
|
|
deltas[i]->Pixel(x, y, c) = norml; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// now, calculate modifiability
|
|
|
|
// now, calculate modifiability
|
|
|
|
for(int x=0;x<Width;x++) |
|
|
|
for (int x = 0; x < Width; x++) |
|
|
|
for(int y=0;y<Height;y++) |
|
|
|
for (int y = 0; y < Height; y++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
float modify=0; |
|
|
|
float modify = 0; |
|
|
|
if ( |
|
|
|
if ( (x > 0) && (x < Width - 1) && |
|
|
|
(x>0) && (x<Width-1) && |
|
|
|
(y) && (y < Height - 1)) |
|
|
|
(y) && (y<Height-1)) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
modify=1; |
|
|
|
modify = 1; |
|
|
|
Alpha(x,y)=modify; |
|
|
|
Alpha(x, y) = modify; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Poisson(deltas,2200,0); |
|
|
|
Poisson(deltas, 2200, 0); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -553,7 +572,9 @@ void FloatBitMap_t::MakeTileable(void) |
|
|
|
// set each pixel=avg-pixel
|
|
|
|
// set each pixel=avg-pixel
|
|
|
|
FloatBitMap_t *cursrc=&rslta; |
|
|
|
FloatBitMap_t *cursrc=&rslta; |
|
|
|
for(int x=1;x<Width-1;x++) |
|
|
|
for(int x=1;x<Width-1;x++) |
|
|
|
|
|
|
|
{ |
|
|
|
for(int y=1;y<Height-1;y++) |
|
|
|
for(int y=1;y<Height-1;y++) |
|
|
|
|
|
|
|
{ |
|
|
|
for(int c=0;c<3;c++) |
|
|
|
for(int c=0;c<3;c++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
DiffMapX.Pixel(x,y,c)=Pixel(x,y,c)-Pixel(x+1,y,c); |
|
|
|
DiffMapX.Pixel(x,y,c)=Pixel(x,y,c)-Pixel(x+1,y,c); |
|
|
@ -586,7 +607,9 @@ void FloatBitMap_t::MakeTileable(void) |
|
|
|
{ |
|
|
|
{ |
|
|
|
float error=0.0; |
|
|
|
float error=0.0; |
|
|
|
for(int x=1;x<Width-1;x++) |
|
|
|
for(int x=1;x<Width-1;x++) |
|
|
|
|
|
|
|
{ |
|
|
|
for(int y=1;y<Height-1;y++) |
|
|
|
for(int y=1;y<Height-1;y++) |
|
|
|
|
|
|
|
{ |
|
|
|
for(int c=0;c<3;c++) |
|
|
|
for(int c=0;c<3;c++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
float desiredx=DiffMapX.Pixel(x,y,c)+cursrc->Pixel(x+1,y,c); |
|
|
|
float desiredx=DiffMapX.Pixel(x,y,c)+cursrc->Pixel(x+1,y,c); |
|
|
@ -597,11 +620,15 @@ void FloatBitMap_t::MakeTileable(void) |
|
|
|
} |
|
|
|
} |
|
|
|
SWAP(cursrc,curdst); |
|
|
|
SWAP(cursrc,curdst); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
// paste result
|
|
|
|
// paste result
|
|
|
|
for(int x=0;x<Width;x++) |
|
|
|
for(int x=0;x<Width;x++) |
|
|
|
for(int y=0;y<Height;y++) |
|
|
|
for(int y=0;y<Height;y++) |
|
|
|
for(int c=0;c<3;c++) |
|
|
|
for(int c=0;c<3;c++) |
|
|
|
Pixel(x,y,c)=curdst->Pixel(x,y,c); |
|
|
|
Pixel(x,y,c)=curdst->Pixel(x,y,c); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -613,15 +640,18 @@ void FloatBitMap_t::GetAlphaBounds(int &minx, int &miny, int &maxx,int &maxy) |
|
|
|
for(y=0;y<Height;y++) |
|
|
|
for(y=0;y<Height;y++) |
|
|
|
if (Alpha(minx,y)) |
|
|
|
if (Alpha(minx,y)) |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
if (y!=Height) |
|
|
|
if (y!=Height) |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for(maxx=Width-1;maxx>=0;maxx--) |
|
|
|
for(maxx=Width-1;maxx>=0;maxx--) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int y; |
|
|
|
int y; |
|
|
|
for(y=0;y<Height;y++) |
|
|
|
for(y=0;y<Height;y++) |
|
|
|
if (Alpha(maxx,y)) |
|
|
|
if (Alpha(maxx,y)) |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
if (y!=Height) |
|
|
|
if (y!=Height) |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
@ -631,6 +661,7 @@ void FloatBitMap_t::GetAlphaBounds(int &minx, int &miny, int &maxx,int &maxy) |
|
|
|
for(x=minx;x<=maxx;x++) |
|
|
|
for(x=minx;x<=maxx;x++) |
|
|
|
if (Alpha(x,miny)) |
|
|
|
if (Alpha(x,miny)) |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
if (x<maxx) |
|
|
|
if (x<maxx) |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
@ -640,6 +671,7 @@ void FloatBitMap_t::GetAlphaBounds(int &minx, int &miny, int &maxx,int &maxy) |
|
|
|
for(x=minx;x<=maxx;x++) |
|
|
|
for(x=minx;x<=maxx;x++) |
|
|
|
if (Alpha(x,maxy)) |
|
|
|
if (Alpha(x,maxy)) |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
if (x<maxx) |
|
|
|
if (x<maxx) |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
@ -666,9 +698,13 @@ void FloatBitMap_t::Poisson(FloatBitMap_t *deltas[4], |
|
|
|
tmp->Poisson(lowdeltas,n_iters*4,flags); |
|
|
|
tmp->Poisson(lowdeltas,n_iters*4,flags); |
|
|
|
// now, propagate results from tmp to us
|
|
|
|
// now, propagate results from tmp to us
|
|
|
|
for(int x=0;x<tmp->Width;x++) |
|
|
|
for(int x=0;x<tmp->Width;x++) |
|
|
|
|
|
|
|
{ |
|
|
|
for(int y=0;y<tmp->Height;y++) |
|
|
|
for(int y=0;y<tmp->Height;y++) |
|
|
|
|
|
|
|
{ |
|
|
|
for(int xi=0;xi<2;xi++) |
|
|
|
for(int xi=0;xi<2;xi++) |
|
|
|
|
|
|
|
{ |
|
|
|
for(int yi=0;yi<2;yi++) |
|
|
|
for(int yi=0;yi<2;yi++) |
|
|
|
|
|
|
|
{ |
|
|
|
if (Alpha(x*2+xi,y*2+yi)) |
|
|
|
if (Alpha(x*2+xi,y*2+yi)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
for(int c=0;c<3;c++) |
|
|
|
for(int c=0;c<3;c++) |
|
|
@ -684,6 +720,10 @@ void FloatBitMap_t::Poisson(FloatBitMap_t *deltas[4], |
|
|
|
for(int i=0;i<NDELTAS;i++) |
|
|
|
for(int i=0;i<NDELTAS;i++) |
|
|
|
delete lowdeltas[i]; |
|
|
|
delete lowdeltas[i]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
FloatBitMap_t work1(this); |
|
|
|
FloatBitMap_t work1(this); |
|
|
|
FloatBitMap_t work2(this); |
|
|
|
FloatBitMap_t work2(this); |
|
|
|
FloatBitMap_t *curdst=&work1; |
|
|
|
FloatBitMap_t *curdst=&work1; |
|
|
|