摘要: 测试目标点是否在多边形内int pnpoly(int nvert, float *vertx, float *verty, float testx, float testy){ int i, j, c = 0; for (i = 0, j = nvert-1; i testy) != (verty[j]>testy)) && (testx < (vertx[j]-vertx[i]) * (testy-verty[i]) / (verty[j]-verty[i]) + vertx[i]) ) c = !c; } return c;}ArgumentMeaningnve 阅读全文
posted @ 2014-03-05 11:58 superping 阅读(766) 评论(0) 推荐(0) 编辑
摘要: final double x_pi = 3.14159265358979324 * 3000.0 / 180.0; public GeoPoint bd_encrypt(GeoPoint point){ double x = point.getLongitudeE6()/1E6; double y = point.getLatitudeE6()/1E6; double z = Math.sqrt(x*x+y*y)+0.00002*Math.sin(y*x_pi); double theta = Math.at... 阅读全文
posted @ 2013-11-05 12:17 superping 阅读(730) 评论(0) 推荐(0) 编辑
摘要: What happened when I long press power button ?What is shutdown sequence ?How is it different from desktop linux shutdown sequence?How to change shutdown menu ?Many questions pop-up in mind when we think about Android shutdown sequence. Before you read about shutdown sequence I suggest you to read ab 阅读全文
posted @ 2013-10-25 10:54 superping 阅读(512) 评论(0) 推荐(0) 编辑
摘要: In Depth : Android Boot Sequence / ProcessWhat happened when I press power on button in my Android device ?What is Android boot sequence ?What is linux kernel ?What is different between desktop linux kernel and Android linux kernel ?What is bootloader ?What is Zygote ?What is x86 and ARM linux ?What 阅读全文
posted @ 2013-10-25 10:46 superping 阅读(686) 评论(0) 推荐(0) 编辑
摘要: 1.uniform变量uniform变量是外部application程序传递给(vertex和fragment)shader的变量。因此它是application通过函数glUniform**()函数赋值的。在(vertex和fragment)shader程序内部,uniform变量就像是C语言里面的常量(const ),它不能被shader程序修改。(shader只能用,不能改)如果uniform变量在vertex和fragment两者之间声明方式完全一样,则它可以在vertex和fragment共享使用。(相当于一个被vertex和fragment shader共享的全局变量)unifor 阅读全文
posted @ 2013-10-24 09:36 superping 阅读(450) 评论(0) 推荐(0) 编辑
摘要: 需要流畅显示YUV图像需要使用Opengl库调用GPU资源,网上在这部分的资料很少。实际上Android已经为我们提供了相关的Opengl方法主体过程如下:1、建立GLSurfaceView2、建立Render4、设置GLSurfaceView的Render为你创建的Render,并设置RenderMode为RENDERMODE_WHEN_DIRTY3、把数据推入Render而在Render中需要实现3个方法1、voidonSurfaceCreated(GL10 gl, EGLConfig config)2、void onDrawFrame(GL10 gl)3、void onSurfaceCh 阅读全文
posted @ 2013-10-24 09:34 superping 阅读(7243) 评论(0) 推荐(0) 编辑
摘要: 全屏显示getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);或者 隐藏任务栏 getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION); 阅读全文
posted @ 2013-10-24 09:00 superping 阅读(243) 评论(0) 推荐(0) 编辑
摘要: ByteArrayOutputStream out = new ByteArrayOutputStream(); String path = "res/drawable/sample.yuv"; byte buffer[]; buffer = new byte[1024*1024]; InputStream is = getClassLoader().getResourceAsStream(path); try{ ... 阅读全文
posted @ 2013-10-16 16:34 superping 阅读(1166) 评论(0) 推荐(0) 编辑
摘要: 按照API Guides和搜索到的各种方法,都没办法把Nexus 7上面的USB 设备列举出来。使用市场上的软件依然不行。在找demo的时候找到一位大神chainfire,他似乎有所解释看来得换一种方法 阅读全文
posted @ 2013-10-10 21:17 superping 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 昨晚探索了一下Android系统内的目录,意外发现系统锁屏的数据库使用adb shell进入系统根目录adb shellsuadb shellsu sqlite3 data/system/locksettings.dbselect * from locksettings;update locksettings set value=1 where name='lockscreen.disable';.quit机器重启后直接进入系统默认App,电源键关屏幕后也不需要划屏开机 阅读全文
posted @ 2013-10-09 09:50 superping 阅读(1975) 评论(0) 推荐(1) 编辑