Fixed aspect ratio scaler

svn-id: r9723
This commit is contained in:
Jochen Hoenicke 2003-08-16 11:00:13 +00:00
parent 8cd96c7926
commit c9ece33b81
2 changed files with 7 additions and 3 deletions

View File

@ -783,13 +783,17 @@ int stretch200To240(uint8 *buf, uint32 pitch, int width, int height, int srcX, i
memcpy(dstPtr, srcPtr, width * 2);
break;
case 1:
case 4:
interpolate5Line<1>((uint16 *)dstPtr, (const uint16 *)(srcPtr - pitch), (const uint16 *)srcPtr, width);
break;
case 2:
case 3:
interpolate5Line<2>((uint16 *)dstPtr, (const uint16 *)(srcPtr - pitch), (const uint16 *)srcPtr, width);
break;
case 3:
interpolate5Line<2>((uint16 *)dstPtr, (const uint16 *)srcPtr, (const uint16 *)(srcPtr - pitch), width);
break;
case 4:
interpolate5Line<1>((uint16 *)dstPtr, (const uint16 *)srcPtr, (const uint16 *)(srcPtr - pitch), width);
break;
}
#endif
dstPtr -= pitch;

View File

@ -46,7 +46,7 @@ FORCEINLINE int real2Aspect(int y) {
}
FORCEINLINE int aspect2Real(int y) {
return (y * 5 + 3) / 6;
return (y * 5 + 4) / 6;
}
extern void makeRectStretchable(int &x, int &y, int &w, int &h);