if (r.left<r.right) {r2.left=r.left; r2.right=r.right; } else {r2.left=r.right ; r2.right=r.left; }
if (r.bottom<r.top) {r2.bottom=r.bottom; r2.top=r.top; } else {r2.bottom=r.top ; r2.top=r.bottom; }
- if (info.rSelectionBox.top <= r2.top) info.rSelectionBox.top = max(0L,min(head.biHeight,r2.top+1));
- if (info.rSelectionBox.left > r2.left) info.rSelectionBox.left = max(0L,min(head.biWidth,r2.left));
- if (info.rSelectionBox.right <= r2.right) info.rSelectionBox.right = max(0L,min(head.biWidth,r2.right+1));
- if (info.rSelectionBox.bottom > r2.bottom) info.rSelectionBox.bottom = max(0L,min(head.biHeight,r2.bottom));
+ if (info.rSelectionBox.top <= r2.top) info.rSelectionBox.top = __max(0L,__min(head.biHeight,r2.top+1));
+ if (info.rSelectionBox.left > r2.left) info.rSelectionBox.left = __max(0L,__min(head.biWidth,r2.left));
+ if (info.rSelectionBox.right <= r2.right) info.rSelectionBox.right = __max(0L,__min(head.biWidth,r2.right+1));
+ if (info.rSelectionBox.bottom > r2.bottom) info.rSelectionBox.bottom = __max(0L,__min(head.biHeight,r2.bottom));
- long ymin = max(0L,min(head.biHeight,r2.bottom));
- long ymax = max(0L,min(head.biHeight,r2.top+1));
- long xmin = max(0L,min(head.biWidth,r2.left));
- long xmax = max(0L,min(head.biWidth,r2.right+1));
+ long ymin = __max(0L,__min(head.biHeight,r2.bottom));
+ long ymax = __max(0L,__min(head.biHeight,r2.top+1));
+ long xmin = __max(0L,__min(head.biWidth,r2.left));
+ long xmax = __max(0L,__min(head.biWidth,r2.right+1));
for (long y=ymin; y<ymax; y++)
memset(pSelection + xmin + y * head.biWidth, level, xmax-xmin);
long xcenter = (r.right + r.left)/2;
long ycenter = (r.top + r.bottom)/2;
- if (info.rSelectionBox.left > (xcenter - xradius)) info.rSelectionBox.left = max(0L,min(head.biWidth,(xcenter - xradius)));
- if (info.rSelectionBox.right <= (xcenter + xradius)) info.rSelectionBox.right = max(0L,min(head.biWidth,(xcenter + xradius + 1)));
- if (info.rSelectionBox.bottom > (ycenter - yradius)) info.rSelectionBox.bottom = max(0L,min(head.biHeight,(ycenter - yradius)));
- if (info.rSelectionBox.top <= (ycenter + yradius)) info.rSelectionBox.top = max(0L,min(head.biHeight,(ycenter + yradius + 1)));
+ if (info.rSelectionBox.left > (xcenter - xradius)) info.rSelectionBox.left = __max(0L,__min(head.biWidth,(xcenter - xradius)));
+ if (info.rSelectionBox.right <= (xcenter + xradius)) info.rSelectionBox.right = __max(0L,__min(head.biWidth,(xcenter + xradius + 1)));
+ if (info.rSelectionBox.bottom > (ycenter - yradius)) info.rSelectionBox.bottom = __max(0L,__min(head.biHeight,(ycenter - yradius)));
+ if (info.rSelectionBox.top <= (ycenter + yradius)) info.rSelectionBox.top = __max(0L,__min(head.biHeight,(ycenter + yradius + 1)));
- long xmin = max(0L,min(head.biWidth,xcenter - xradius));
- long xmax = max(0L,min(head.biWidth,xcenter + xradius + 1));
- long ymin = max(0L,min(head.biHeight,ycenter - yradius));
- long ymax = max(0L,min(head.biHeight,ycenter + yradius + 1));
+ long xmin = __max(0L,__min(head.biWidth,xcenter - xradius));
+ long xmax = __max(0L,__min(head.biWidth,xcenter + xradius + 1));
+ long ymin = __max(0L,__min(head.biHeight,ycenter - yradius));
+ long ymax = __max(0L,__min(head.biHeight,ycenter + yradius + 1));
long y,yo;
- for (y=ymin; y<min(ycenter,ymax); y++){
+ for (y=ymin; y<__min(ycenter,ymax); y++){
for (long x=xmin; x<xmax; x++){
yo = (long)(ycenter - yradius * sqrt(1-pow((float)(x - xcenter)/(float)xradius,2)));
if (yo<y) pSelection[x + y * head.biWidth] = level;
RECT r2;
if (current->x < next->x) {r2.left=current->x; r2.right=next->x; } else {r2.left=next->x ; r2.right=current->x; }
if (current->y < next->y) {r2.bottom=current->y; r2.top=next->y; } else {r2.bottom=next->y ; r2.top=current->y; }
- if (localbox.top < r2.top) localbox.top = max(0L,min(head.biHeight-1,r2.top+1));
- if (localbox.left > r2.left) localbox.left = max(0L,min(head.biWidth-1,r2.left-1));
- if (localbox.right < r2.right) localbox.right = max(0L,min(head.biWidth-1,r2.right+1));
- if (localbox.bottom > r2.bottom) localbox.bottom = max(0L,min(head.biHeight-1,r2.bottom-1));
+ if (localbox.top < r2.top) localbox.top = __max(0L,__min(head.biHeight-1,r2.top+1));
+ if (localbox.left > r2.left) localbox.left = __max(0L,__min(head.biWidth-1,r2.left-1));
+ if (localbox.right < r2.right) localbox.right = __max(0L,__min(head.biWidth-1,r2.right+1));
+ if (localbox.bottom > r2.bottom) localbox.bottom = __max(0L,__min(head.biHeight-1,r2.bottom-1));
i++;
}
for (x=localbox.left; x<=localbox.right; x++)
if (plocal[x + yoffset]!=1) pSelection[x + yoffset]=level;
}
- if (info.rSelectionBox.top <= localbox.top) info.rSelectionBox.top = min(head.biHeight,localbox.top + 1);
- if (info.rSelectionBox.left > localbox.left) info.rSelectionBox.left = min(head.biWidth,localbox.left);
- if (info.rSelectionBox.right <= localbox.right) info.rSelectionBox.right = min(head.biWidth,localbox.right + 1);
- if (info.rSelectionBox.bottom > localbox.bottom) info.rSelectionBox.bottom = min(head.biHeight,localbox.bottom);
+ if (info.rSelectionBox.top <= localbox.top) info.rSelectionBox.top = __min(head.biHeight,localbox.top + 1);
+ if (info.rSelectionBox.left > localbox.left) info.rSelectionBox.left = __min(head.biWidth,localbox.left);
+ if (info.rSelectionBox.right <= localbox.right) info.rSelectionBox.right = __min(head.biWidth,localbox.right + 1);
+ if (info.rSelectionBox.bottom > localbox.bottom) info.rSelectionBox.bottom = __min(head.biHeight,localbox.bottom);
free(plocal);
free(pix);
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);
}//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); //<Anatoly Ivasyuk>
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
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
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); //<Anatoly Ivasyuk>
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);
}//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); //<Anatoly Ivasyuk>
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
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
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;
}//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
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<newx; x++){
fX = x * xScale;
ifX = (int)fX;
- ifX1 = min(xmax, ifX+1);
+ ifX1 = __min(xmax, ifX+1);
dx = fX - ifX;
// Interpolate using the four nearest pixels in the source
if (head.biClrUsed){
eb=(long)c.rgbBlue - (long)ce.rgbBlue;
c = GetPixelColor(x+1,y);
- c.rgbRed = (BYTE)min(255L,max(0L,(long)c.rgbRed + ((er*7)/16)));
- c.rgbGreen = (BYTE)min(255L,max(0L,(long)c.rgbGreen + ((eg*7)/16)));
- c.rgbBlue = (BYTE)min(255L,max(0L,(long)c.rgbBlue + ((eb*7)/16)));
+ c.rgbRed = (BYTE)__min(255L,__max(0L,(long)c.rgbRed + ((er*7)/16)));
+ c.rgbGreen = (BYTE)__min(255L,__max(0L,(long)c.rgbGreen + ((eg*7)/16)));
+ c.rgbBlue = (BYTE)__min(255L,__max(0L,(long)c.rgbBlue + ((eb*7)/16)));
SetPixelColor(x+1,y,c);
int coeff=1;
for(int i=-1; i<2; i++){
coeff=1; break;
}
c = GetPixelColor(x+i,y+1);
- c.rgbRed = (BYTE)min(255L,max(0L,(long)c.rgbRed + ((er * coeff)/16)));
- c.rgbGreen = (BYTE)min(255L,max(0L,(long)c.rgbGreen + ((eg * coeff)/16)));
- c.rgbBlue = (BYTE)min(255L,max(0L,(long)c.rgbBlue + ((eb * coeff)/16)));
+ c.rgbRed = (BYTE)__min(255L,__max(0L,(long)c.rgbRed + ((er * coeff)/16)));
+ c.rgbGreen = (BYTE)__min(255L,__max(0L,(long)c.rgbGreen + ((eg * coeff)/16)));
+ c.rgbBlue = (BYTE)__min(255L,__max(0L,(long)c.rgbBlue + ((eb * coeff)/16)));
SetPixelColor(x+i,y+1,c);
}
}
}
nlevel = GetPixelIndex(x + 1, y) + (error * 8) / TotalCoeffSum;
- level = (BYTE)min(255, max(0, (int)nlevel));
+ level = (BYTE)__min(255, __max(0, (int)nlevel));
SetPixelIndex(x + 1, y, level);
nlevel = GetPixelIndex(x + 2, y) + (error * 4) / TotalCoeffSum;
- level = (BYTE)min(255, max(0, (int)nlevel));
+ level = (BYTE)__min(255, __max(0, (int)nlevel));
SetPixelIndex(x + 2, y, level);
int i;
for (i = -2; i < 3; i++) {
break;
}
nlevel = GetPixelIndex(x + i, y + 1) + (error * coeff) / TotalCoeffSum;
- level = (BYTE)min(255, max(0, (int)nlevel));
+ level = (BYTE)__min(255, __max(0, (int)nlevel));
SetPixelIndex(x + i, y + 1, level);
}
}
}
nlevel = GetPixelIndex(x + 1, y) + (error * 8) / TotalCoeffSum;
- level = (BYTE)min(255, max(0, (int)nlevel));
+ level = (BYTE)__min(255, __max(0, (int)nlevel));
SetPixelIndex(x + 1, y, level);
nlevel = GetPixelIndex(x + 2, y) + (error * 4) / TotalCoeffSum;
- level = (BYTE)min(255, max(0, (int)nlevel));
+ level = (BYTE)__min(255, __max(0, (int)nlevel));
SetPixelIndex(x + 2, y, level);
int i;
for (i = -2; i < 3; i++) {
break;
}
nlevel = GetPixelIndex(x + i, y + 1) + (error * coeff) / TotalCoeffSum;
- level = (BYTE)min(255, max(0, (int)nlevel));
+ level = (BYTE)__min(255, __max(0, (int)nlevel));
SetPixelIndex(x + i, y + 1, level);
}
for (i = -2; i < 3; i++) {
break;
}
nlevel = GetPixelIndex(x + i, y + 2) + (error * coeff) / TotalCoeffSum;
- level = (BYTE)min(255, max(0, (int)nlevel));
+ level = (BYTE)__min(255, __max(0, (int)nlevel));
SetPixelIndex(x + i, y + 2, level);
}
}
}
nlevel = GetPixelIndex(x + 1, y) + (error * 7) / TotalCoeffSum;
- level = (BYTE)min(255, max(0, (int)nlevel));
+ level = (BYTE)__min(255, __max(0, (int)nlevel));
SetPixelIndex(x + 1, y, level);
nlevel = GetPixelIndex(x + 2, y) + (error * 5) / TotalCoeffSum;
- level = (BYTE)min(255, max(0, (int)nlevel));
+ level = (BYTE)__min(255, __max(0, (int)nlevel));
SetPixelIndex(x + 2, y, level);
int i;
for (i = -2; i < 3; i++) {
break;
}
nlevel = GetPixelIndex(x + i, y + 1) + (error * coeff) / TotalCoeffSum;
- level = (BYTE)min(255, max(0, (int)nlevel));
+ level = (BYTE)__min(255, __max(0, (int)nlevel));
SetPixelIndex(x + i, y + 1, level);
}
for (i = -2; i < 3; i++) {
break;
}
nlevel = GetPixelIndex(x + i, y + 2) + (error * coeff) / TotalCoeffSum;
- level = (BYTE)min(255, max(0, (int)nlevel));
+ level = (BYTE)__min(255, __max(0, (int)nlevel));
SetPixelIndex(x + i, y + 2, level);
}
}
}
nlevel = GetPixelIndex(x + 1, y) + (error * 5) / TotalCoeffSum;
- level = (BYTE)min(255, max(0, (int)nlevel));
+ level = (BYTE)__min(255, __max(0, (int)nlevel));
SetPixelIndex(x + 1, y, level);
nlevel = GetPixelIndex(x + 2, y) + (error * 3) / TotalCoeffSum;
- level = (BYTE)min(255, max(0, (int)nlevel));
+ level = (BYTE)__min(255, __max(0, (int)nlevel));
SetPixelIndex(x + 2, y, level);
int i;
for (i = -2; i < 3; i++) {
break;
}
nlevel = GetPixelIndex(x + i, y + 1) + (error * coeff) / TotalCoeffSum;
- level = (BYTE)min(255, max(0, (int)nlevel));
+ level = (BYTE)__min(255, __max(0, (int)nlevel));
SetPixelIndex(x + i, y + 1, level);
}
for (i = -1; i < 2; i++) {
break;
}
nlevel = GetPixelIndex(x + i, y + 2) + (error * coeff) / TotalCoeffSum;
- level = (BYTE)min(255, max(0, (int)nlevel));
+ level = (BYTE)__min(255, __max(0, (int)nlevel));
SetPixelIndex(x + i, y + 2, level);
}
}
int tmp_index_y = y;
int tmp_coeff = 32;
nlevel = GetPixelIndex(tmp_index_x, tmp_index_y) + (error * tmp_coeff) / TotalCoeffSum;
- level = (BYTE)min(255, max(0, (int)nlevel));
+ level = (BYTE)__min(255, __max(0, (int)nlevel));
SetPixelIndex(tmp_index_x, tmp_index_y, level);
tmp_index_x = x - 3;
tmp_index_y = y + 1;
tmp_coeff = 12;
nlevel = GetPixelIndex(tmp_index_x, tmp_index_y) + (error * tmp_coeff) / TotalCoeffSum;
- level = (BYTE)min(255, max(0, (int)nlevel));
+ level = (BYTE)__min(255, __max(0, (int)nlevel));
SetPixelIndex(tmp_index_x, tmp_index_y, level);
tmp_index_x = x - 1;
tmp_coeff = 26;
nlevel = GetPixelIndex(tmp_index_x, tmp_index_y) + (error * tmp_coeff) / TotalCoeffSum;
- level = (BYTE)min(255, max(0, (int)nlevel));
+ level = (BYTE)__min(255, __max(0, (int)nlevel));
SetPixelIndex(tmp_index_x, tmp_index_y, level);
tmp_index_x = x + 1;
tmp_coeff = 30;
nlevel = GetPixelIndex(tmp_index_x, tmp_index_y) + (error * tmp_coeff) / TotalCoeffSum;
- level = (BYTE)min(255, max(0, (int)nlevel));
+ level = (BYTE)__min(255, __max(0, (int)nlevel));
SetPixelIndex(tmp_index_x, tmp_index_y, level);
tmp_index_x = x + 3;
tmp_coeff = 16;
nlevel = GetPixelIndex(tmp_index_x, tmp_index_y) + (error * tmp_coeff) / TotalCoeffSum;
- level = (BYTE)min(255, max(0, (int)nlevel));
+ level = (BYTE)__min(255, __max(0, (int)nlevel));
SetPixelIndex(tmp_index_x, tmp_index_y, level);
tmp_index_x = x - 2;
tmp_index_y = y + 2;
tmp_coeff = 12;
nlevel = GetPixelIndex(tmp_index_x, tmp_index_y) + (error * tmp_coeff) / TotalCoeffSum;
- level = (BYTE)min(255, max(0, (int)nlevel));
+ level = (BYTE)__min(255, __max(0, (int)nlevel));
SetPixelIndex(tmp_index_x, tmp_index_y, level);
tmp_index_x = x;
tmp_coeff = 26;
nlevel = GetPixelIndex(tmp_index_x, tmp_index_y) + (error * tmp_coeff) / TotalCoeffSum;
- level = (BYTE)min(255, max(0, (int)nlevel));
+ level = (BYTE)__min(255, __max(0, (int)nlevel));
SetPixelIndex(tmp_index_x, tmp_index_y, level);
tmp_index_x = x + 2;
tmp_coeff = 12;
nlevel = GetPixelIndex(tmp_index_x, tmp_index_y) + (error * tmp_coeff) / TotalCoeffSum;
- level = (BYTE)min(255, max(0, (int)nlevel));
+ level = (BYTE)__min(255, __max(0, (int)nlevel));
SetPixelIndex(tmp_index_x, tmp_index_y, level);
tmp_index_x = x - 3;
tmp_index_y = y + 3;
tmp_coeff = 5;
nlevel = GetPixelIndex(tmp_index_x, tmp_index_y) + (error * tmp_coeff) / TotalCoeffSum;
- level = (BYTE)min(255, max(0, (int)nlevel));
+ level = (BYTE)__min(255, __max(0, (int)nlevel));
SetPixelIndex(tmp_index_x, tmp_index_y, level);
tmp_index_x = x - 1;
tmp_coeff = 12;
nlevel = GetPixelIndex(tmp_index_x, tmp_index_y) + (error * tmp_coeff) / TotalCoeffSum;
- level = (BYTE)min(255, max(0, (int)nlevel));
+ level = (BYTE)__min(255, __max(0, (int)nlevel));
SetPixelIndex(tmp_index_x, tmp_index_y, level);
tmp_index_x = x + 1;
tmp_coeff = 12;
nlevel = GetPixelIndex(tmp_index_x, tmp_index_y) + (error * tmp_coeff) / TotalCoeffSum;
- level = (BYTE)min(255, max(0, (int)nlevel));
+ level = (BYTE)__min(255, __max(0, (int)nlevel));
SetPixelIndex(tmp_index_x, tmp_index_y, level);
tmp_index_x = x + 3;
tmp_coeff = 5;
nlevel = GetPixelIndex(tmp_index_x, tmp_index_y) + (error * tmp_coeff) / TotalCoeffSum;
- level = (BYTE)min(255, max(0, (int)nlevel));
+ level = (BYTE)__min(255, __max(0, (int)nlevel));
SetPixelIndex(tmp_index_x, tmp_index_y, level);
}
}
Bmatrix[i] = (BYTE)(dither);
}
- int scale = max(0,(8-2*order));
+ int scale = __max(0,(8-2*order));
int level;
for (long y=0;y<head.biHeight;y++){
info.nProgress = (long)(100*y/head.biHeight);
}
nlevel = GetPixelIndex(x+1,y) + (error * 7)/16;
- level = (BYTE)min(255,max(0,(int)nlevel));
+ level = (BYTE)__min(255,__max(0,(int)nlevel));
SetPixelIndex(x+1,y,level);
for(int i=-1; i<2; i++){
switch(i){
coeff=1; break;
}
nlevel = GetPixelIndex(x+i,y+1) + (error * coeff)/16;
- level = (BYTE)min(255,max(0,(int)nlevel));
+ level = (BYTE)__min(255,__max(0,(int)nlevel));
SetPixelIndex(x+i,y+1,level);
}
}
if ( fabs(angle)<0.0002 )
return Crop( topx, topy, topx+width, topy+height, iDst);
- startx = min(topx, topx - (long)(sin_angle*(double)height));
+ startx = __min(topx, topx - (long)(sin_angle*(double)height));
endx = topx + (long)(cos_angle*(double)width);
endy = topy + (long)(cos_angle*(double)height + sin_angle*(double)width);
// check: corners of the rectangle must be inside
{
if (!pDib) return false;
- long startx = max(0L,min(left,head.biWidth));
- long endx = max(0L,min(right,head.biWidth));
- long starty = head.biHeight - max(0L,min(top,head.biHeight));
- long endy = head.biHeight - max(0L,min(bottom,head.biHeight));
+ long startx = __max(0L,__min(left,head.biWidth));
+ long endx = __max(0L,__min(right,head.biWidth));
+ long starty = head.biHeight - __max(0L,__min(top,head.biHeight));
+ long endy = head.biHeight - __max(0L,__min(bottom,head.biHeight));
if (startx==endx || starty==endy) return false;