flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
macgub 12 Feb 2025, 14:46
Perhaps something like:
gray = A_r, A_g, A_b rgb = B_r, B_g, B_b result = (A_r*B_r) shr 8, (A_g*B_g) shr 8, (A_b*B_b) shr 8 |
|||
![]() |
|
Roman 12 Feb 2025, 15:12
Thanks.
|
|||
![]() |
|
revolution 12 Feb 2025, 16:27
Using "shr 8" gives inaccurate results.
Use "/ 255" instead to retain the full resolution. Compare: Code: (255 * 255) shr 8 == 254 <--- off-by-one (255 * 255) / 255 == 255 <--- correct value |
|||
![]() |
|
macgub 13 Feb 2025, 11:42
Thanks for correction.
It can be importand, but for me kind of nuance. For me shr is more convenient to use. But all depends upon concrete implementation. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.