Tabnine Logo
Frame$Builder.setImageData
Code IndexAdd Tabnine to your IDE (free)

How to use
setImageData
method
in
com.google.android.gms.vision.Frame$Builder

Best Java code snippets using com.google.android.gms.vision.Frame$Builder.setImageData (Showing top 12 results out of 315)

origin: googlesamples/android-vision

/**
 * Creates a new frame based on the original frame, with additional width on the right to
 * increase the size to avoid the bug in the underlying face detector.
 */
private Frame padFrameRight(Frame originalFrame, int newWidth) {
  Frame.Metadata metadata = originalFrame.getMetadata();
  int width = metadata.getWidth();
  int height = metadata.getHeight();
  Log.i(TAG, "Padded image from: " + width + "x" + height + " to " + newWidth + "x" + height);
  ByteBuffer origBuffer = originalFrame.getGrayscaleImageData();
  int origOffset = origBuffer.arrayOffset();
  byte[] origBytes = origBuffer.array();
  // This can be changed to just .allocate in the future, when Frame supports non-direct
  // byte buffers.
  ByteBuffer paddedBuffer = ByteBuffer.allocateDirect(newWidth * height);
  int paddedOffset = paddedBuffer.arrayOffset();
  byte[] paddedBytes = paddedBuffer.array();
  Arrays.fill(paddedBytes, (byte) 0);
  for (int y = 0; y < height; ++y) {
    int origStride = origOffset + y * width;
    int paddedStride = paddedOffset + y * newWidth;
    System.arraycopy(origBytes, origStride, paddedBytes, paddedStride, width);
  }
  return new Frame.Builder()
      .setImageData(paddedBuffer, newWidth, height, ImageFormat.NV21)
      .setId(metadata.getId())
      .setRotation(metadata.getRotation())
      .setTimestampMillis(metadata.getTimestampMillis())
      .build();
}
origin: googlesamples/android-vision

.setImageData(paddedBuffer, width, newHeight, ImageFormat.NV21)
.setId(metadata.getId())
.setRotation(metadata.getRotation())
origin: googlesamples/android-vision

.setImageData(mPendingFrameData, mPreviewSize.getWidth(),
    mPreviewSize.getHeight(), ImageFormat.NV21)
.setId(mPendingFrameId)
origin: thegenuinegourav/Questor

.setImageData(mPendingFrameData, mPreviewSize.getWidth(),
    mPreviewSize.getHeight(), ImageFormat.NV21)
.setId(mPendingFrameId)
origin: peekler/GDG

.setImageData(mPendingFrameData, mPreviewSize.getWidth(),
    mPreviewSize.getHeight(), ImageFormat.NV21)
.setId(mPendingFrameId)
origin: adafruit/Bluefruit_LE_Connect_Android

.setImageData(mPendingFrameData, mPreviewSize.getWidth(),
    mPreviewSize.getHeight(), ImageFormat.NV21)
.setId(mPendingFrameId)
origin: TrustWallet/trust-wallet-android-source

.setImageData(mPendingFrameData, mPreviewSize.getWidth(),
    mPreviewSize.getHeight(), ImageFormat.NV21)
.setId(mPendingFrameId)
origin: EzequielAdrianM/Camera2Vision

.setImageData(ByteBuffer.wrap(quarterNV21(mPendingFrameData, mPreviewSize.getWidth(), mPreviewSize.getHeight())), mPreviewSize.getWidth()/4, mPreviewSize.getHeight()/4, ImageFormat.NV21)
.setId(mPendingFrameId)
.setTimestampMillis(mPendingTimeMillis)
origin: EzequielAdrianM/Camera2Vision

.setImageData(quarterNV21(mPendingFrameData, previewW, previewH), previewW/4, previewH/4, ImageFormat.NV21)
.setId(mPendingFrameId)
.setTimestampMillis(mPendingTimeMillis)
origin: EdwardvanRaak/MaterialBarcodeScanner

.setImageData(mPendingFrameData, mPreviewSize.getWidth(),
    mPreviewSize.getHeight(), ImageFormat.NV21)
.setId(mPendingFrameId)
origin: googlesamples/android-vision

.setImageData(mPendingFrameData, previewSize.getWidth(),
    previewSize.getHeight(), ImageFormat.NV21)
.setId(mPendingFrameId)
origin: googlesamples/android-vision

.setImageData(mPendingFrameData, mPreviewSize.getWidth(),
    mPreviewSize.getHeight(), ImageFormat.NV21)
.setId(mPendingFrameId)
com.google.android.gms.visionFrame$BuildersetImageData

Popular methods of Frame$Builder

  • <init>
  • build
  • setId
  • setRotation
  • setTimestampMillis
  • setBitmap

Popular in Java

  • Making http post requests using okhttp
  • setScale (BigDecimal)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • addToBackStack (FragmentTransaction)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now