# Enum FrameFormat

java.lang.Object
java.lang.Enum<FrameFormat>
com.codename1.camera.FrameFormat

All Implemented Interfaces:
  `Comparable<FrameFormat>`

public enum FrameFormat extends Enum<FrameFormat>

Pixel format requested for `CameraFrame` data delivered to a `FrameListener`.

`JPEG` is the default and the right choice for feeding frames into the `com.codename1.ai.*` modules, all of which accept JPEG `byte[]` directly. Raw formats (`NV21`, `RGBA8888`) are useful when an application performs its own pixel processing and wants to avoid the JPEG encode/decode round-trip.

- ## Enum Constant Summary

  Enum Constants
  Enum Constant
  Description
  `JPEG`
  JPEG-encoded bytes available via `CameraFrame#getJpegBytes()`.
  `NV21`
  YUV 4:2:0 NV21 layout available via `CameraFrame#getRawBytes()`.
  `RGBA8888`
  32-bit RGBA available via `CameraFrame#getRawBytes()`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static FrameFormat`
  `valueOf(String name)`
  Returns the enum constant of this type with the specified name.
  `static FrameFormat[]`
  `values()`
  Returns an array containing the constants of this enum type, in the order they are declared.

  ### Methods inherited from class Enum

  `clone, compareTo, equals, getDeclaringClass, getEnumValues, hashCode, name, ordinal, setEnumValues, toString, valueOf`

  ### Methods inherited from class Object

  `getClass, notify, notifyAll, wait, wait, wait`

- ## Enum Constant Details

  - ### JPEG

    public static final FrameFormat JPEG
    JPEG-encoded bytes available via `CameraFrame#getJpegBytes()`. Always available regardless of the requested format; this is the universal format for AI/vision module integration.

  - ### NV21

    public static final FrameFormat NV21
    YUV 4:2:0 NV21 layout available via `CameraFrame#getRawBytes()`. Useful for low-level pixel work on Android-style pipelines.

  - ### RGBA8888

    public static final FrameFormat RGBA8888
    32-bit RGBA available via `CameraFrame#getRawBytes()`. Width * height * 4 bytes.

- ## Method Details

  - ### values

    public static FrameFormat[] values()
    Returns an array containing the constants of this enum type, in the order they are declared.
    Returns:
      an array containing the constants of this enum type, in the order they are declared

  - ### valueOf

    public static FrameFormat valueOf(String name)
    Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
    Parameters:
      `name` - the name of the enum constant to be returned.
    Returns:
      the enum constant with the specified name
    Throws:
      `IllegalArgumentException` - if this enum type has no constant with the specified name
      `NullPointerException` - if the argument is null