GY is set on the line that has "GY =" but not used on the right-hand
side of the equation anywhere after that. There is no code that says,
for example, "B = GY + Y".



Yusuf Saib
Android
·T· · ·Mobile· stick together
The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.



On Sep 15, 1:24 am, eldo <[email protected]> wrote:
> Hi all ,
>    could someone help me with the below given code snippet.awarning
> persists in my application saying that vriable GY is never read . This
> warning results in an incorrect output . Could someone help me know if
> there is a change in the calculations to be done .
>
> int RY, GY, BY, RYY, GYY, BYY, R, G, B, Y;
>         double angle = (3.14159d * (double)deg) / 180.0d;
>         int S = (int)(256.0d * Math.sin(angle));
>         int C = (int)(256.0d * Math.cos(angle));
>
>         for (int y = 0; y < pich; y++)
>         for (int x = 0; x < picw; x++)
>             {
>             int index = y * picw + x;
>             int r = (pix[index] >> 16) & 0xff;
>             int g = (pix[index] >> 8) & 0xff;
>             int b = pix[index] & 0xff;
>             RY = (70 * r - 59 * g - 11 * b) / 100;
>             GY = (-30 * r + 41 * g - 11 * b) / 100;
>             BY = (-30 * r - 59 * g + 89 * b) / 100;
>             Y = (30 * r + 59 * g + 11 * b) / 100;
>             RYY = (S * BY + C * RY) / 256;
>             BYY = (C * BY - S * RY ) / 256;
>             GYY = (-51 * RYY - 19 * BYY) / 100;
>             R = Y + RYY;
>             R = (R < 0) ? 0 : ((R > 255) ? 255 : R);
>             G = Y + GYY;
>             G = (G < 0) ? 0 : ((G > 255) ? 255 : G);
>             B = Y + BYY;
>             B = (B < 0) ? 0 : ((B > 255) ? 255 : B);
>             pix[index] = 0xff000000 | (R << 16) | (G << 8) | B;
>             }
>
> how can i get rid of the warning GY unread variable
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to