android.renderscript.Element.RGBA_8888()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(261)

本文整理了Java中android.renderscript.Element.RGBA_8888()方法的一些代码示例,展示了Element.RGBA_8888()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.RGBA_8888()方法的具体详情如下:
包路径:android.renderscript.Element
类名称:Element
方法名:RGBA_8888

Element.RGBA_8888介绍

暂无

代码示例

代码示例来源:origin: gearvrf/GearVRf-Demos

  1. yuvTypeBuilder.setYuvFormat(ImageFormat.YUV_420_888);
  2. Type.Builder rgbTypeBuilder = new Type.Builder(rs, Element.RGBA_8888(rs));
  3. rgbTypeBuilder.setX(width);
  4. rgbTypeBuilder.setY(height);

代码示例来源:origin: googlesamples/android-HdrViewfinder

  1. public ViewfinderProcessor(RenderScript rs, Size dimensions) {
  2. Type.Builder yuvTypeBuilder = new Type.Builder(rs, Element.YUV(rs));
  3. yuvTypeBuilder.setX(dimensions.getWidth());
  4. yuvTypeBuilder.setY(dimensions.getHeight());
  5. yuvTypeBuilder.setYuvFormat(ImageFormat.YUV_420_888);
  6. mInputHdrAllocation = Allocation.createTyped(rs, yuvTypeBuilder.create(),
  7. Allocation.USAGE_IO_INPUT | Allocation.USAGE_SCRIPT);
  8. mInputNormalAllocation = Allocation.createTyped(rs, yuvTypeBuilder.create(),
  9. Allocation.USAGE_IO_INPUT | Allocation.USAGE_SCRIPT);
  10. Type.Builder rgbTypeBuilder = new Type.Builder(rs, Element.RGBA_8888(rs));
  11. rgbTypeBuilder.setX(dimensions.getWidth());
  12. rgbTypeBuilder.setY(dimensions.getHeight());
  13. mPrevAllocation = Allocation.createTyped(rs, rgbTypeBuilder.create(),
  14. Allocation.USAGE_SCRIPT);
  15. mOutputAllocation = Allocation.createTyped(rs, rgbTypeBuilder.create(),
  16. Allocation.USAGE_IO_OUTPUT | Allocation.USAGE_SCRIPT);
  17. HandlerThread processingThread = new HandlerThread("ViewfinderProcessor");
  18. processingThread.start();
  19. mProcessingHandler = new Handler(processingThread.getLooper());
  20. mHdrMergeScript = new ScriptC_hdr_merge(rs);
  21. mHdrMergeScript.set_gPrevFrame(mPrevAllocation);
  22. mHdrTask = new ProcessingTask(mInputHdrAllocation, dimensions.getWidth()/2, true);
  23. mNormalTask = new ProcessingTask(mInputNormalAllocation, 0, false);
  24. setRenderMode(MODE_NORMAL);
  25. }

相关文章