On Fri, May 22, 2009 at 1:09 PM, Gavin Aiken <[email protected]>wrote:

> Hey all,
>
> Before I submit this I just wanted to check it's not a java nuiance.
>
> The Color class can be used to extract rgb values from a pixel (32 bit
> int).
>
> I implemented a lookup table filter and used a byte to store each
> individual r g & b value to save a bit of space.
>
> Long story short;
>
>     public void testColor(){
>
>         int nr = (byte)0; // Simulation of lookup in array of byte values
> representing individual bands
>         int ng = (byte)0;
>         int nb = (byte)0;
>         int nc = Color.rgb(nr, ng, nb);
>
>         assertEquals(nr,Color.red(nc));
>         assertEquals(ng,Color.green(nc));
>         assertEquals(ng,Color.blue(nc));


Typo?

        nr = (byte)0;
>         ng = (byte)137;


A byte is a signed 8-bit number, and 137 won't fit in that, so you may not
get what you want.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to