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. conatct/calender/dialer does not launch

hello,

I have android 1.5 running on developer board which does not have
touhchscreen and all keboard keys are passed through UART. All
application works except contact, calender and dialer. When these
applciations are launched "android.process.acore has stopped
unexpectdegly" error comes wth force close.

Below is the log and It s not clear resourcetype get is failing and
ultimatly VM is shutting down.   Any idea?



# D/dalvikvm(  887): GC freed 315 objects / 14056 bytes in 113ms
^[[CW/KeyCharacterMap(  887): No keyboard for id 0
W/KeyCharacterMap(  887): Using default keymap: /system/usr/keychars/
qwerty.kcm.
bin
^[[A
: not found
# I/ActivityManager(  518): Starting activity: Intent
{ action=android.intent.ac
tion.MAIN categories={android.intent.category.LAUNCHER}
flags=0x10200000 comp={c
om.android.contacts/
com.android.contacts.DialtactsContactsEntryActivity} }
W/InputManagerService(  518): Starting input on non-focused client
com.android.i
nternal.view.iinputmethodclient$stub$pr...@4376d8c8 (uid=10004
pid=887)
W/ResourceType(  887): Failure getting entry for 0x7f030005 (t=2 e=5)
in package
 0: 0xffffffb5
D/AndroidRuntime(  887): Shutting down VM
W/dalvikvm(  887): threadid=3: thread exiting with uncaught exception
(group=0x4
000fe70)
E/AndroidRuntime(  887): Uncaught handler: thread main exiting due to
uncaught e
xception
E/AndroidRuntime(  887): java.lang.RuntimeException: Unable to start
activity Co
mponentInfo{com.android.contacts/
com.android.contacts.DialtactsActivity}: androi
d.content.res.Resources$NotFoundException: Resource ID #0x7f030005
E/AndroidRuntime(  887):        at
android.app.ActivityThread.performLaunchActiv
ity(ActivityThread.java:2268)
E/AndroidRuntime(  887):        at
android.app.ActivityThread.handleLaunchActivi
ty(ActivityThread.java:2284)
E/AndroidRuntime(  887):        at android.app.ActivityThread.access$1800
(Activi
tyThread.java:112)
E/AndroidRuntime(  887):        at android.app.ActivityThread$H.handleMessage
(Ac
tivityThread.java:1692)
E/AndroidRuntime(  887):        at android.os.Handler.dispatchMessage
(Handler.ja
va:99)
E/AndroidRuntime(  887):        at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(  887):        at android.app.ActivityThread.main
(ActivityThrea
d.java:3948)
E/AndroidRuntime(  887):        at java.lang.reflect.Method.invokeNative
(Native
Method)
E/AndroidRuntime(  887):        at java.lang.reflect.Method.invoke
(Method.java:5
21)
E/AndroidRuntime(  887):        at com.android.internal.os.ZygoteInit
$MethodAndA
rgsCaller.run(ZygoteInit.java:782)
E/AndroidRuntime(  887):        at com.android.internal.os.ZygoteInit.main
(Zygot
eInit.java:540)
E/AndroidRuntime(  887):        at dalvik.system.NativeStart.main(Native
Method)
E/AndroidRuntime(  887): Caused by: android.content.res.Resources
$NotFoundExcept
ion: Resource ID #0x7f030005
E/AndroidRuntime(  887):        at android.content.res.Resources.getValue
(Resour
ces.java:846)
E/AndroidRuntime(  887):        at
android.content.res.Resources.loadXmlResource
Parser(Resources.java:1796)
E/AndroidRuntime(  887):        at android.content.res.Resources.getLayout
(Resou
rces.java:685)
E/AndroidRuntime(  887):        at android.view.LayoutInflater.inflate
(LayoutInf
later.java:318)
E/AndroidRuntime(  887):        at android.view.LayoutInflater.inflate
(LayoutInf
later.java:276)
E/AndroidRuntime(  887):        at
com.android.internal.policy.impl.PhoneWindow.
setContentView(PhoneWindow.java:309)
E/AndroidRuntime(  887):        at android.app.Activity.setContentView
(Activity.
java:1626)
E/AndroidRuntime(  887):        at
com.android.contacts.DialtactsActivity.onCrea
te(DialtactsActivity.java:73)
E/AndroidRuntime(  887):        at
android.app.Instrumentation.callActivityOnCre
ate(Instrumentation.java:1123)
E/AndroidRuntime(  887):        at
android.app.ActivityThread.performLaunchActiv
ity(ActivityThread.java:2231)
E/AndroidRuntime(  887):        ... 11 more
I/Process (  518): Sending signal. PID: 887 SIG: 3
I/dalvikvm(  887): threadid=7: reacting to signal 3
I/dalvikvm(  887): Wrote stack trace to '/data/anr/traces.txt'
D/dalvikvm(  518): GC freed 9343 objects / 436720 bytes in 172ms
E/ActivityThread(  518): Failed to find provider info for
android.server.checkin
E/Checkin (  518): Error reporting crash:
java.lang.IllegalArgumentException: Un
known URL content://android.server.checkin/crashes
W/ActivityManager(  518): Launch timeout has expired, giving up wake
lock!
W/ActivityManager(  518): Activity idle timeout for HistoryRecord
{43767d18 {com.
android.contacts/com.android.contacts.DialtactsContactsEntryActivity}}


--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. how to create a custom listener for some objects..

Hi!

I try to implement a listener for a few objects and when object send a
message i want the others objects received it.(like in ListView when
selectect one new item : the selected item is deselected and the new item is
selected).i hope that is possible..

Can someone help me with an suggestion?



Thank you!

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

3. booting up the emulator with custom kernel build

4. cannot find htonl

5. Help with WiFinder

6. Is it possible to change text color of all child TextViews

7. Exclude directory with adb pull