memory bug fixes
This commit is contained in:
@ -22,7 +22,7 @@ namespace ams
|
||||
int res;
|
||||
if(this!=&other)
|
||||
{
|
||||
res = this->resize(Nx,Ny);
|
||||
res = this->resize(other.Nx,other.Ny);
|
||||
if(res==amsimage_success)
|
||||
{
|
||||
imglib4::amsimage_plane_copy(
|
||||
@ -55,7 +55,7 @@ namespace ams
|
||||
int res;
|
||||
if(this!=&other)
|
||||
{
|
||||
res = this->resize(Nx,Ny);
|
||||
res = this->resize(other.Nx,other.Ny);
|
||||
if(res==amsimage_success)
|
||||
{
|
||||
imglib4::amsimage_plane_copy(
|
||||
@ -630,8 +630,8 @@ namespace ams
|
||||
Ix = I%dx;
|
||||
Iy = I/dx;
|
||||
|
||||
Ia = (Ix + x0) + (Iy + y0)*imgto->Ny;
|
||||
Ib = Ix + Iy*imgfrom->Ny;
|
||||
Ia = (Ix + x0) + (Iy + y0)*imgto->Nx;
|
||||
Ib = Ix + Iy*imgfrom->Nx;
|
||||
|
||||
v1 = imgto->data[Ia];
|
||||
v2 = imgfrom->data[Ib];
|
||||
|
@ -613,8 +613,8 @@ namespace ams
|
||||
Ix = I%dx;
|
||||
Iy = I/dx;
|
||||
|
||||
Ia = (Ix + x0) + (Iy + y0)*imgto->Ny;
|
||||
Ib = Ix + Iy*imgfrom->Ny;
|
||||
Ia = (Ix + x0) + (Iy + y0)*imgto->Nx;
|
||||
Ib = Ix + Iy*imgfrom->Nx;
|
||||
|
||||
r1 = imgto->data[0 + 4*Ia];
|
||||
g1 = imgto->data[1 + 4*Ia];
|
||||
|
@ -546,13 +546,13 @@ void amsfloatimage_region_castcopy2_tf(
|
||||
bi = (int)(datafrom[2 + 4*Ib]*255.0);
|
||||
ai = (int)(datafrom[3 + 4*Ib]*255.0);
|
||||
ri = (ri<0) ? 0 : ri;
|
||||
gi = (ri<0) ? 0 : gi;
|
||||
bi = (ri<0) ? 0 : bi;
|
||||
ai = (ri<0) ? 0 : ai;
|
||||
gi = (gi<0) ? 0 : gi;
|
||||
bi = (bi<0) ? 0 : bi;
|
||||
ai = (ai<0) ? 0 : ai;
|
||||
ri = (ri>255) ? 255 : ri;
|
||||
gi = (ri>255) ? 255 : gi;
|
||||
bi = (ri>255) ? 255 : bi;
|
||||
ai = (ri>255) ? 255 : ai;
|
||||
gi = (gi>255) ? 255 : gi;
|
||||
bi = (bi>255) ? 255 : bi;
|
||||
ai = (ai>255) ? 255 : ai;
|
||||
|
||||
datato[0 + 4*Ia] = (uint8_t)ri;
|
||||
datato[1 + 4*Ia] = (uint8_t)gi;
|
||||
|
@ -6,10 +6,10 @@ int main(int argc, char* argv[])
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
//amscppimglib4_test1();
|
||||
//amscppimglib4_test2();
|
||||
amscppimglib4_test1();
|
||||
amscppimglib4_test2();
|
||||
amscppimglib4_bitplane_alloc_tests();
|
||||
//amscppimglib4_image_alloc_tests();
|
||||
amscppimglib4_image_alloc_tests();
|
||||
|
||||
|
||||
return ret;
|
||||
|
Reference in New Issue
Block a user