01-28-2024, 07:16 AM
A better way may be to just get values directly.
$Checking:off
Alpha = _MEMGET(m, o +3, _unsigned _byte)
Red = _MEMGET(m, o + 2, unsigned byte)
Green... o + 1
Blue ... o
$Checking:on
No shifting, no calculations. Just a direct value read.
(When then goes to the speed question: is it faster to just read 4 values directly, or to only read one and then math it?)
I'd *think* a simple direct read would be faster, but with cacheing and all nowadays... I'd swear to nothing!
$Checking:off
Alpha = _MEMGET(m, o +3, _unsigned _byte)
Red = _MEMGET(m, o + 2, unsigned byte)
Green... o + 1
Blue ... o
$Checking:on
No shifting, no calculations. Just a direct value read.
(When then goes to the speed question: is it faster to just read 4 values directly, or to only read one and then math it?)
I'd *think* a simple direct read would be faster, but with cacheing and all nowadays... I'd swear to nothing!