YUV2RGB
来源:互联网 发布:uwp截图软件 编辑:程序博客网 时间:2024/05/16 08:55
效率不是很够,数据量不大可以使用
public Bitmap convertYUV420_NV21toRGB8888_RenderScript(byte[] data, int W, int H) { RenderScript rs; ScriptIntrinsicYuvToRGB yuvToRgbIntrinsic; rs = RenderScript.create(MyApplication.getAppContext()); yuvToRgbIntrinsic = ScriptIntrinsicYuvToRGB.create(rs, Element.U8_4(rs)); //Create an intrinsic for converting YUV to RGB. Type.Builder yuvType = new Type.Builder(rs, Element.U8(rs)).setX(data.length); Allocation in = Allocation.createTyped(rs, yuvType.create(), Allocation.USAGE_SCRIPT); //an Allocation will be populated with empty data when it is first created Type.Builder rgbaType = new Type.Builder(rs, Element.RGBA_8888(rs)).setX(W).setY(H); Allocation out = Allocation.createTyped(rs, rgbaType.create(), Allocation.USAGE_SCRIPT); //an Allocation will be populated with empty data when it is first created in.copyFrom(data);//Populate Allocations with data. yuvToRgbIntrinsic.setInput(in); //Set the input yuv allocation, must be U8(RenderScript). yuvToRgbIntrinsic.forEach(out); //Launch the appropriate kernels,Convert the image to RGB. Bitmap bmpout = Bitmap.createBitmap(W, H, Bitmap.Config.ARGB_8888); out.copyTo(bmpout); //Copy data out of Allocation objects. return bmpout;}
0 0
- YUV2RGB
- yuv2rgb
- YUV2RGB
- YUV2RGB
- yuv2rgb
- yuv2rgb.c
- YUV2RGB总结
- yuv2rgb 优化
- 【数据压缩】yuv2rgb
- YUV2RGB Opencv
- RGB2YUV/YUV2RGB
- formula YUV2RGB RGB2YUV
- android yuv2rgb方案
- YUV2RGB实验报告
- 【数据压缩】RGB2YUV/YUV2RGB实验报告
- 关于YUV2RGB的2篇文章(ZZ)
- 实验一:彩色空间转换(YUV2RGB)
- 《数据压缩》实验报告一·YUV2RGB实验
- Ubuntu+python+opencv
- JENA操作本体
- linux下安装keepalived
- TCP协议中的三次握手和四次挥手(图解)
- Java zip/gzip文件压缩和解压缩
- YUV2RGB
- IntelliJ IDEA+jetty部署Eova
- 什么是堆栈--------------------yi
- 大奖赛,去掉最高分以及最低分
- 基于PHP的APP微信支付开发(二)
- UIWebview ScalesPageToFit 页面变小
- 用Powerdesigner设计数据库
- 欢迎使用CSDN-markdown编辑器
- Why and How to Enable rc.local Support with Systemd