Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/graphics/PixelFormat#constants) \| [Fields](https://developer.android.com/reference/android/graphics/PixelFormat#lfields) \| [Ctors](https://developer.android.com/reference/android/graphics/PixelFormat#pubctors) \| [Methods](https://developer.android.com/reference/android/graphics/PixelFormat#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/graphics/PixelFormat#inhmethods)

# PixelFormat

*** ** * ** ***

` public class PixelFormat `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.graphics.PixelFormat |

<br />

*** ** * ** ***

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/graphics/PixelFormat#A_8` <br /> |
| `int` | `https://developer.android.com/reference/android/graphics/PixelFormat#JPEG` *This constant was deprecated in API level 15. use `https://developer.android.com/reference/android/graphics/ImageFormat#JPEG` instead.* |
| `int` | `https://developer.android.com/reference/android/graphics/PixelFormat#LA_88` <br /> |
| `int` | `https://developer.android.com/reference/android/graphics/PixelFormat#L_8` <br /> |
| `int` | `https://developer.android.com/reference/android/graphics/PixelFormat#OPAQUE` System chooses an opaque format (no alpha bits required) |
| `int` | `https://developer.android.com/reference/android/graphics/PixelFormat#RGBA_1010102` <br /> |
| `int` | `https://developer.android.com/reference/android/graphics/PixelFormat#RGBA_4444` <br /> |
| `int` | `https://developer.android.com/reference/android/graphics/PixelFormat#RGBA_5551` <br /> |
| `int` | `https://developer.android.com/reference/android/graphics/PixelFormat#RGBA_8888` <br /> |
| `int` | `https://developer.android.com/reference/android/graphics/PixelFormat#RGBA_F16` <br /> |
| `int` | `https://developer.android.com/reference/android/graphics/PixelFormat#RGBX_8888` <br /> |
| `int` | `https://developer.android.com/reference/android/graphics/PixelFormat#RGB_332` <br /> |
| `int` | `https://developer.android.com/reference/android/graphics/PixelFormat#RGB_565` <br /> |
| `int` | `https://developer.android.com/reference/android/graphics/PixelFormat#RGB_888` <br /> |
| `int` | `https://developer.android.com/reference/android/graphics/PixelFormat#TRANSLUCENT` System chooses a format that supports translucency (many alpha bits) |
| `int` | `https://developer.android.com/reference/android/graphics/PixelFormat#TRANSPARENT` System chooses a format that supports transparency (at least 1 alpha bit) |
| `int` | `https://developer.android.com/reference/android/graphics/PixelFormat#UNKNOWN` <br /> |
| `int` | `https://developer.android.com/reference/android/graphics/PixelFormat#YCbCr_420_SP` *This constant was deprecated in API level 15. use `https://developer.android.com/reference/android/graphics/ImageFormat#NV21` instead.* |
| `int` | `https://developer.android.com/reference/android/graphics/PixelFormat#YCbCr_422_I` *This constant was deprecated in API level 15. use `https://developer.android.com/reference/android/graphics/ImageFormat#YUY2` instead.* |
| `int` | `https://developer.android.com/reference/android/graphics/PixelFormat#YCbCr_422_SP` *This constant was deprecated in API level 15. use `https://developer.android.com/reference/android/graphics/ImageFormat#NV16` instead.* |

| ### Fields ||
|---|---|
| ` public int` | `https://developer.android.com/reference/android/graphics/PixelFormat#bitsPerPixel` <br /> |
| ` public int` | `https://developer.android.com/reference/android/graphics/PixelFormat#bytesPerPixel` <br /> |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/graphics/PixelFormat#PixelFormat()() ` |

| ### Public methods ||
|---|---|
| ` static boolean` | ` https://developer.android.com/reference/android/graphics/PixelFormat#formatHasAlpha(int)(int format) ` |
| ` static void` | ` https://developer.android.com/reference/android/graphics/PixelFormat#getPixelFormatInfo(int,%20android.graphics.PixelFormat)(int format, https://developer.android.com/reference/android/graphics/PixelFormat info) ` |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Constants

### A_8

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int A_8
```

<br />

<br />

Constant Value: 8 (0x00000008)

### JPEG

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int JPEG
```

<br />

**This constant was deprecated in API level 15.**   

use `https://developer.android.com/reference/android/graphics/ImageFormat#JPEG` instead.

<br />

<br />

Constant Value: 256 (0x00000100)

### LA_88

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int LA_88
```

<br />

<br />

Constant Value: 10 (0x0000000a)

### L_8

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int L_8
```

<br />

<br />

Constant Value: 9 (0x00000009)

### OPAQUE

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int OPAQUE
```

System chooses an opaque format (no alpha bits required)

<br />

Constant Value: -1 (0xffffffff)

### RGBA_1010102

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int RGBA_1010102
```

<br />

<br />

Constant Value: 43 (0x0000002b)

### RGBA_4444

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int RGBA_4444
```

<br />

<br />

Constant Value: 7 (0x00000007)

### RGBA_5551

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int RGBA_5551
```

<br />

<br />

Constant Value: 6 (0x00000006)

### RGBA_8888

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int RGBA_8888
```

<br />

<br />

Constant Value: 1 (0x00000001)

### RGBA_F16

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int RGBA_F16
```

<br />

<br />

Constant Value: 22 (0x00000016)

### RGBX_8888

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int RGBX_8888
```

<br />

<br />

Constant Value: 2 (0x00000002)

### RGB_332

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int RGB_332
```

<br />

<br />

Constant Value: 11 (0x0000000b)

### RGB_565

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int RGB_565
```

<br />

<br />

Constant Value: 4 (0x00000004)

### RGB_888

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int RGB_888
```

<br />

<br />

Constant Value: 3 (0x00000003)

### TRANSLUCENT

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TRANSLUCENT
```

System chooses a format that supports translucency (many alpha bits)

<br />

Constant Value: -3 (0xfffffffd)

### TRANSPARENT

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TRANSPARENT
```

System chooses a format that supports transparency (at least 1 alpha bit)

<br />

Constant Value: -2 (0xfffffffe)

### UNKNOWN

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int UNKNOWN
```

<br />

<br />

Constant Value: 0 (0x00000000)

### YCbCr_420_SP

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int YCbCr_420_SP
```

<br />

**This constant was deprecated in API level 15.**   

use `https://developer.android.com/reference/android/graphics/ImageFormat#NV21` instead.

<br />

<br />

Constant Value: 17 (0x00000011)

### YCbCr_422_I

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int YCbCr_422_I
```

<br />

**This constant was deprecated in API level 15.**   

use `https://developer.android.com/reference/android/graphics/ImageFormat#YUY2` instead.

<br />

<br />

Constant Value: 20 (0x00000014)

### YCbCr_422_SP

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int YCbCr_422_SP
```

<br />

**This constant was deprecated in API level 15.**   

use `https://developer.android.com/reference/android/graphics/ImageFormat#NV16` instead.

<br />

<br />

Constant Value: 16 (0x00000010)

## Fields

### bitsPerPixel

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int bitsPerPixel
```

<br />

<br />

### bytesPerPixel

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int bytesPerPixel
```

<br />

<br />

## Public constructors

### PixelFormat

```
public PixelFormat ()
```

<br />

<br />

## Public methods

### formatHasAlpha

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static boolean formatHasAlpha (int format)
```

<br />

<br />

| Parameters ||
|---|---|
| `format` | `int`: Value is one of the following: - `https://developer.android.com/reference/android/graphics/PixelFormat#RGBA_8888` - `https://developer.android.com/reference/android/graphics/PixelFormat#RGBX_8888` - `https://developer.android.com/reference/android/graphics/PixelFormat#RGBA_F16` - `https://developer.android.com/reference/android/graphics/PixelFormat#RGBA_1010102` - `https://developer.android.com/reference/android/graphics/PixelFormat#RGB_888` - `https://developer.android.com/reference/android/graphics/PixelFormat#RGB_565` |

| Returns ||
|---|---|
| `boolean` | <br /> |

### getPixelFormatInfo

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void getPixelFormatInfo (int format, 
                PixelFormat info)
```

<br />

<br />

| Parameters ||
|---|---|
| `format` | `int`: Value is one of the following: - `https://developer.android.com/reference/android/graphics/PixelFormat#RGBA_8888` - `https://developer.android.com/reference/android/graphics/PixelFormat#RGBX_8888` - `https://developer.android.com/reference/android/graphics/PixelFormat#RGBA_F16` - `https://developer.android.com/reference/android/graphics/PixelFormat#RGBA_1010102` - `https://developer.android.com/reference/android/graphics/PixelFormat#RGB_888` - `https://developer.android.com/reference/android/graphics/PixelFormat#RGB_565` |
| `info` | `PixelFormat` <br /> |