android.renderscript.Allocation.ioReceive()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(153)

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

Allocation.ioReceive介绍

暂无

代码示例

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

@Override
  public void run() {
    // Find out how many frames have arrived
    int pendingFrames;
    synchronized(this) {
      pendingFrames = mPendingFrames;
      mPendingFrames = 0;
      mProcessingHandler.removeCallbacks(this);
    }
    // Get to newest input
    for (int i = 0; i < pendingFrames; i++) {
      mInputAllocation.ioReceive();
    }
    if( mNeedYuvConversion )
    {
      mScriptIntrinsic.setInput(mInputAllocation);
      mScriptIntrinsic.forEach(mInterAllocation);
      mScript.forEach_root(mInterAllocation, mOutputAllocation);
    }
    else {
      mScript.forEach_root(mInputAllocation, mOutputAllocation);
    }
    mOutputAllocation.ioSend();
  }
}

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

@Override
  public void run() {
    // Find out how many frames have arrived
    int pendingFrames;
    synchronized(this) {
      pendingFrames = mPendingFrames;
      mPendingFrames = 0;
      // Discard extra messages in case processing is slower than frame rate
      mProcessingHandler.removeCallbacks(this);
    }
    // Get to newest input
    for (int i = 0; i < pendingFrames; i++) {
      mInputAllocation.ioReceive();
    }
    mHdrMergeScript.set_gFrameCounter(mFrameCounter++);
    mHdrMergeScript.set_gCurrentFrame(mInputAllocation);
    mHdrMergeScript.set_gCutPointX(mCutPointX);
    if (mCheckMerge && mMode == MODE_HDR) {
      mHdrMergeScript.set_gDoMerge(1);
    } else {
      mHdrMergeScript.set_gDoMerge(0);
    }
    // Run processing pass
    mHdrMergeScript.forEach_mergeHdrFrames(mPrevAllocation, mOutputAllocation);
    mOutputAllocation.ioSend();
  }
}

相关文章