# Class VisionImage

java.lang.Object
com.codename1.ai.vision.VisionImage

public final class VisionImage extends Object
Immutable vision input. Camera-frame factories copy the callback-owned bytes so asynchronous analyzers never retain recycled camera buffers.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static VisionImage`
  `encoded(byte[] bytes)`
  `static VisionImage`
  `fromCameraFrame(CameraFrame frame)`
  `byte[]`
  `getEncodedBytes()`
  `FrameFormat`
  `getFormat()`
  `int`
  `getHeight()`
  `byte[]`
  `getPixels()`
  `int`
  `getRotationDegrees()`
  `long`
  `getTimestampNanos()`
  `int`
  `getWidth()`
  `static VisionImage`
  `pixels(byte[] bytes, int width, int height, FrameFormat format, int rotationDegrees)`

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### encoded

    public static VisionImage encoded(byte[] bytes)

  - ### pixels

    public static VisionImage pixels(byte[] bytes, int width, int height, FrameFormat format, int rotationDegrees)

  - ### fromCameraFrame

    public static VisionImage fromCameraFrame(CameraFrame frame)

  - ### getEncodedBytes

    public byte[] getEncodedBytes()

  - ### getPixels

    public byte[] getPixels()

  - ### getWidth

    public int getWidth()

  - ### getHeight

    public int getHeight()

  - ### getRotationDegrees

    public int getRotationDegrees()

  - ### getTimestampNanos

    public long getTimestampNanos()

  - ### getFormat

    public FrameFormat getFormat()