The procedure scales a rectangle (.xSrc, .ySrc, .wSrc, .hSrc) from the image [.ImgSrc] to the size of destination rectangle (.xDst, .yDst, .wDst, .hDst) and draws the scaled rectangle over the image [.ImgDst].
.ImgSrc - the source image with format described below.
.xSrc. .ySrc - the upper left corner XY coordinates of the source rectangle.
.wSrc, .hSrc - the width and height of the source rectangle.
.ImgDst - destination image.
.xDst, .yDst - the upper left corner XY coordinates of the destination rectangle.
.wDst, .hDst - the width and height of the destination rectangle.
The image structure is simple:
.widthdd?; width in pixels.
.heightdd?; height in pixels.
.pPixelsdd?; pointer to the pixel memory buffer.
The pixel format is always dword ARGB, not pre multiplied alpha. The scan lines are aligned on dword.
The code must be OS independent. So, calling OS graphics functions is not allowed. 32bit code is needed. MMX is OK, but other extensions are questionable (at least I don't use them in the remaining part of the library).
I can provide some help on the integration in the library and testing, but not too time consuming.
Joined: 16 Jun 2003
codestar, I am not searching for reference sources or some help to implement the above task. I simply don't have time to deal with this procedure that is good to have, but not vital or even important.
So, if someone (you?) want to contribute the code for FreshLib - the interface is in my first post.
The implementation should follow, at least loosely, the coding style of FreshLib and to not use macros more than really needed. (And they must obey the assembly style: label: COP operand, operand, operand, ...)
m := resize.Resize(x, y, img, resize.NearestNeighbor) gives good enough result if you need to shrink image to something 6 times smaller, but you may need to try different algorithms if you have to shrink only a little, or to make new image larger.
I'm afraid I'm not going to recode it into assembler by hand, I'm not skilled in that at all.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum