Open majidmetal opened 7 years ago
The reason for passing the blend % as an integer is that 64-bit calling convention becomes confusing and convoluted when trying to pass a float. It can certainly be done (most languages do it as a matter of course), but being the only float value, the blend factor will come into the function in XMM0. You can do it if you want to; the code in this article won’t. As a general rule, I’ve found that a lot of mistakes and debugging time are saved by utilizing XMM registers in some kind of sensible order where they’re not so easily lost track of. There are sixteen of the things and it’s quite easy to forget who’s doing what and why if you implement them at random. In the end, the entire issue is purely aesthetic, but I personally find it far preferable to doing things any other way: parameter 3, R8, holds the source bitmap blend percent times a hundred - allowing an integer value to be passed in a general purpose register.
For reasons discussed shortly, there is no danger of overflowing any 8-bit color channel anywhere in the blend process.
On entry to the function, immediately point RDI at the first bitmap’s data, and RSI at the second. The assembly STOSD instruction writes to the location where RDI is pointing, and bitmap one is where the blended output is written. So it may as well be set up as the first order of business.
جعبه ابزار جعبه ابزار پلاستیکی اتو لوله سبز دریل چکشی دریل شارژی کمپرسور باد فندکی تراز لیزری دریل چکشی رونیکس اره فارسی بر فارسی بر آاگ دریل چکشی رونیکس بتن کن ابزارهای دستی دریل شارژی رونیکس