X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=utilities%2FCxImage%2Fximatran.cpp;h=dd635cf1185368b1a81311688bd02b540c21916f;hb=22aac696ea46e2e4f989d8893bcb978f63715aef;hp=d3aac0182ae0e0532080d1c4c72e4abcf7c110e7;hpb=8786715f17744e1a8d97bdf4fec517d443875bb0;p=clitk.git diff --git a/utilities/CxImage/ximatran.cpp b/utilities/CxImage/ximatran.cpp index d3aac01..dd635cf 100644 --- a/utilities/CxImage/ximatran.cpp +++ b/utilities/CxImage/ximatran.cpp @@ -282,12 +282,12 @@ bool CxImage::RotateLeft(CxImage* iDst) for (ys = 0; ys < newHeight; ys+=RBLOCK) { if (head.biBitCount==24) { //RGB24 optimized pixel access: - for (x = xs; x < min(newWidth, xs+RBLOCK); x++){ //do rotation + for (x = xs; x < __min(newWidth, xs+RBLOCK); x++){ //do rotation info.nProgress = (long)(100*x/newWidth); x2=newWidth-x-1; dstPtr = (BYTE*) imgDest.BlindGetPixelPointer(x,ys); srcPtr = (BYTE*) BlindGetPixelPointer(ys, x2); - for (y = ys; y < min(newHeight, ys+RBLOCK); y++){ + for (y = ys; y < __min(newHeight, ys+RBLOCK); y++){ //imgDest.SetPixelColor(x, y, GetPixelColor(y, x2)); *(dstPtr) = *(srcPtr); *(dstPtr+1) = *(srcPtr+1); @@ -298,19 +298,19 @@ bool CxImage::RotateLeft(CxImage* iDst) }//for x } else { //anything else than 24bpp (and 1bpp): palette - for (x = xs; x < min(newWidth, xs+RBLOCK); x++){ + for (x = xs; x < __min(newWidth, xs+RBLOCK); x++){ info.nProgress = (long)(100*x/newWidth); // x2=newWidth-x-1; - for (y = ys; y < min(newHeight, ys+RBLOCK); y++){ + for (y = ys; y < __min(newHeight, ys+RBLOCK); y++){ imgDest.SetPixelIndex(x, y, BlindGetPixelIndex(y, x2)); }//for y }//for x }//if (version selection) #if CXIMAGE_SUPPORT_ALPHA if (AlphaIsValid()) { - for (x = xs; x < min(newWidth, xs+RBLOCK); x++){ + for (x = xs; x < __min(newWidth, xs+RBLOCK); x++){ x2=newWidth-x-1; - for (y = ys; y < min(newHeight, ys+RBLOCK); y++){ + for (y = ys; y < __min(newHeight, ys+RBLOCK); y++){ imgDest.AlphaSet(x,y,BlindAlphaGet(y, x2)); }//for y }//for x @@ -323,9 +323,9 @@ bool CxImage::RotateLeft(CxImage* iDst) imgDest.info.rSelectionBox.right = newWidth-info.rSelectionBox.bottom; imgDest.info.rSelectionBox.bottom = info.rSelectionBox.left; imgDest.info.rSelectionBox.top = info.rSelectionBox.right; - for (x = xs; x < min(newWidth, xs+RBLOCK); x++){ + for (x = xs; x < __min(newWidth, xs+RBLOCK); x++){ x2=newWidth-x-1; - for (y = ys; y < min(newHeight, ys+RBLOCK); y++){ + for (y = ys; y < __min(newHeight, ys+RBLOCK); y++){ imgDest.SelectionSet(x,y,BlindSelectionGet(y, x2)); }//for y }//for x @@ -427,12 +427,12 @@ bool CxImage::RotateRight(CxImage* iDst) for (ys = 0; ys < newHeight; ys+=RBLOCK) { if (head.biBitCount==24) { //RGB24 optimized pixel access: - for (y = ys; y < min(newHeight, ys+RBLOCK); y++){ + for (y = ys; y < __min(newHeight, ys+RBLOCK); y++){ info.nProgress = (long)(100*y/newHeight); // y2=newHeight-y-1; dstPtr = (BYTE*) imgDest.BlindGetPixelPointer(xs,y); srcPtr = (BYTE*) BlindGetPixelPointer(y2, xs); - for (x = xs; x < min(newWidth, xs+RBLOCK); x++){ + for (x = xs; x < __min(newWidth, xs+RBLOCK); x++){ //imgDest.SetPixelColor(x, y, GetPixelColor(y2, x)); *(dstPtr) = *(srcPtr); *(dstPtr+1) = *(srcPtr+1); @@ -443,19 +443,19 @@ bool CxImage::RotateRight(CxImage* iDst) }//for y } else { //anything else than BW & RGB24: palette - for (y = ys; y < min(newHeight, ys+RBLOCK); y++){ + for (y = ys; y < __min(newHeight, ys+RBLOCK); y++){ info.nProgress = (long)(100*y/newHeight); // y2=newHeight-y-1; - for (x = xs; x < min(newWidth, xs+RBLOCK); x++){ + for (x = xs; x < __min(newWidth, xs+RBLOCK); x++){ imgDest.SetPixelIndex(x, y, BlindGetPixelIndex(y2, x)); }//for x }//for y }//if #if CXIMAGE_SUPPORT_ALPHA if (AlphaIsValid()){ - for (y = ys; y < min(newHeight, ys+RBLOCK); y++){ + for (y = ys; y < __min(newHeight, ys+RBLOCK); y++){ y2=newHeight-y-1; - for (x = xs; x < min(newWidth, xs+RBLOCK); x++){ + for (x = xs; x < __min(newWidth, xs+RBLOCK); x++){ imgDest.AlphaSet(x,y,BlindAlphaGet(y2, x)); }//for x }//for y @@ -468,9 +468,9 @@ bool CxImage::RotateRight(CxImage* iDst) imgDest.info.rSelectionBox.right = info.rSelectionBox.top; imgDest.info.rSelectionBox.bottom = newHeight-info.rSelectionBox.right; imgDest.info.rSelectionBox.top = newHeight-info.rSelectionBox.left; - for (y = ys; y < min(newHeight, ys+RBLOCK); y++){ + for (y = ys; y < __min(newHeight, ys+RBLOCK); y++){ y2=newHeight-y-1; - for (x = xs; x < min(newWidth, xs+RBLOCK); x++){ + for (x = xs; x < __min(newWidth, xs+RBLOCK); x++){ imgDest.SelectionSet(x,y,BlindSelectionGet(y2, x)); }//for x }//for y @@ -588,10 +588,10 @@ bool CxImage::Rotate(float angle, CxImage* iDst) newP4.x = (float)(p4.x*cos_angle - p4.y*sin_angle); newP4.y = (float)(p4.x*sin_angle + p4.y*cos_angle); - leftTop.x = min(min(newP1.x,newP2.x),min(newP3.x,newP4.x)); - leftTop.y = min(min(newP1.y,newP2.y),min(newP3.y,newP4.y)); - rightBottom.x = max(max(newP1.x,newP2.x),max(newP3.x,newP4.x)); - rightBottom.y = max(max(newP1.y,newP2.y),max(newP3.y,newP4.y)); + leftTop.x = __min(__min(newP1.x,newP2.x),__min(newP3.x,newP4.x)); + leftTop.y = __min(__min(newP1.y,newP2.y),__min(newP3.y,newP4.y)); + rightBottom.x = __max(__max(newP1.x,newP2.x),__max(newP3.x,newP4.x)); + rightBottom.y = __max(__max(newP1.y,newP2.y),__max(newP3.y,newP4.y)); leftBottom.x = leftTop.x; leftBottom.y = rightBottom.y; rightTop.x = rightBottom.x; @@ -720,10 +720,10 @@ bool CxImage::Rotate2(float angle, }//if //(read new dimensions from location of corners) - float minx = (float) min(min(newp[0].x,newp[1].x),min(newp[2].x,newp[3].x)); - float miny = (float) min(min(newp[0].y,newp[1].y),min(newp[2].y,newp[3].y)); - float maxx = (float) max(max(newp[0].x,newp[1].x),max(newp[2].x,newp[3].x)); - float maxy = (float) max(max(newp[0].y,newp[1].y),max(newp[2].y,newp[3].y)); + float minx = (float) __min(__min(newp[0].x,newp[1].x),__min(newp[2].x,newp[3].x)); + float miny = (float) __min(__min(newp[0].y,newp[1].y),__min(newp[2].y,newp[3].y)); + float maxx = (float) __max(__max(newp[0].x,newp[1].x),__max(newp[2].x,newp[3].x)); + float maxy = (float) __max(__max(newp[0].y,newp[1].y),__max(newp[2].y,newp[3].y)); int newWidth = (int) floor(maxx-minx+0.5f); int newHeight= (int) floor(maxy-miny+0.5f); float ssx=((maxx+minx)- ((float) newWidth-1))/2.0f; //start for x @@ -983,12 +983,12 @@ bool CxImage::Resample(long newx, long newy, int mode, CxImage* iDst) if (info.nEscape) break; fY = y * yScale; ifY = (int)fY; - ifY1 = min(ymax, ifY+1); + ifY1 = __min(ymax, ifY+1); dy = fY - ifY; for(long x=0; x