change the angle of pixel

by eldo » Tue, 15 Sep 2009 16:25:29 GMT


Sponsored Links
 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
--~--~---------~--~----~------------~-------~--~----~



change the angle of pixel

by Yusuf Saib (T-Mobile USA) » Wed, 16 Sep 2009 01:14:04 GMT


 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.





--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


change the angle of pixel

by eldo jacob » Fri, 18 Sep 2009 13:53:51 GMT


 Thank You  , i got the point but i needed to know whether the formulas used
has some more code to be added , so that the each pixel is rotated
accordingly .

On Tue, Sep 15, 2009 at 10:43 PM, Yusuf Saib (T-Mobile USA) <





--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. [WTShare] GUI for Darktremor Apps2SD

Buat yg pake Darktremor Apps2SD (DTA2SD), ada yg bikin Graphical User
Interface (GUI) buat Darktremor nihh.. lumayan jd ga usah ngapalin command2
a2sd, wekekekk..
http://forum.xda-developers.com/showthread.php?t=991684

Buat yg ga tau DTA2SD itu apa, monggo dicari tahu dsini ->
http://forum.xda-developers.com/showthread.php?t=715940
AFAIK sih ini buat Nexus One.. gak tau bisa dipake di hh laen apa kaga.. :)

-- 
===============

2. Suppoting android 1.6. VerifyError.

I've got a method like this one. I want to autocomplite e-mail in
EditText. But application crashes

private void setAccount() {
        Account[] accounts = AccountManager.get(this).getAccounts();

        for (Account account : accounts) {
           if (emailIsOk(account.name)) {
                ((EditText)
findViewById(R.id.email_input)).setText(account.name);
                break;
            }
        }
    }

I've tried
if (Build.VERSION.SDK_INT > 4)

But It still crashes.

I want to support  android 1,6 and at the same time autocomplite e-
mail in other vesrions of SDK

This is my problem
Thant you

--
Kirill

-- 

3. Problem in accessing the phone

4. Anyone know the name of this menu?

5. Gingerbread now on the N1!

6. Time.setToNow and AM/PM

7. Multiple ListViews in One Screen. HoneyComb.