Angus Leeming <[EMAIL PROTECTED]> writes:

| On Thursday 18 April 2002 2:13 pm, Herbert Voss wrote:
>> Angus Leeming wrote:
>> > On Thursday 18 April 2002 1:45 pm, Lars Gullik Bjønnes wrote:
>> >>Herbert Voss <[EMAIL PROTECTED]> writes:
>> >>| Angus Leeming wrote:
>> >>>> r = int(factor * double(r));
>> >>>> g = int(factor * double(g));
>> >>>> b = int(factor * double(b));
>> >>|
>> >>| never divide or multiply with powers of 2!
>> >>
>> >>Hmm why?
>> >
>> > You mean use left-shit and right-shift operators?
>> > No; I hate them. It's equivalent to pointer arithmetic and IMO is an
>> > optimisation that's justified only very rarely.
>>
>> I can't understand why you are using floats for
>> pure hexadecimal operations. You want nothing else
>> than only specific bytes. that's nothing else
>> than shift and logical oprators and it has
>> nothing to do with pointer aritjmetics. shift is
>> one cycle in assembler code ...
>>
>> Herbert
>
| Feel free to patch.

rrrr is a 2 byte integer  so just loose the less important ones >> 8
rrr  is a 1.5 byte integer  >> 4  (does this format even exist?)
r    is a 0.5 byte integer << 4 (does this format exist?)

with rr then just do nothing.

-- 
        Lgb

Reply via email to