# PictureFrame

Artifact: [androidx.media3:media3-extractor](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/extractor/metadata/flac/PictureFrame.java+class:androidx.media3.extractor.metadata.flac.PictureFrame)

*** ** * ** ***


```
@UnstableApi
public final class PictureFrame implements Metadata.Entry
```

<br />

*** ** * ** ***

A picture parsed from a Vorbis Comment or a FLAC picture block.

## Summary

| ### Public fields |
|---|---|
| `final int` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/flac/PictureFrame#colors()` For indexed-color pictures (e.g. GIF), the number of colors used. |
| `final int` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/flac/PictureFrame#depth()` The color depth of the picture in bits-per-pixel. |
| `final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/flac/PictureFrame#description()` A description of the picture. |
| `final int` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/flac/PictureFrame#height()` The height of the picture in pixels. |
| `final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/flac/PictureFrame#mimeType()` The MIME type of the picture. |
| `final byte[]` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/flac/PictureFrame#pictureData()` The encoded picture data. |
| `final int` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/flac/PictureFrame#pictureType()` The type of the picture. |
| `final int` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/flac/PictureFrame#width()` The width of the picture in pixels. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/extractor/metadata/flac/PictureFrame#PictureFrame(int,java.lang.String,java.lang.String,int,int,int,int,byte[])( int pictureType, https://developer.android.com/reference/java/lang/String.html mimeType, https://developer.android.com/reference/java/lang/String.html description, int width, int height, int depth, int colors, byte[] pictureData )` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/flac/PictureFrame#equals(java.lang.Object)(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Object.html obj)` |
| `static https://developer.android.com/reference/androidx/media3/extractor/metadata/flac/PictureFrame` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/flac/PictureFrame#fromPictureBlock(androidx.media3.common.util.ParsableByteArray)(https://developer.android.com/reference/androidx/media3/common/util/ParsableByteArray pictureBlock)` Parses a `METADATA_BLOCK_PICTURE` into a `PictureFrame` instance. |
| `int` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/flac/PictureFrame#hashCode()()` |
| `void` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/flac/PictureFrame#populateMediaMetadata(androidx.media3.common.MediaMetadata.Builder)(https://developer.android.com/reference/androidx/media3/common/MediaMetadata.Builder builder)` Updates the `https://developer.android.com/reference/androidx/media3/common/MediaMetadata.Builder` with the type-specific values stored in this ` Entry`. |
| `https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/flac/PictureFrame#toString()()` |

| ### Inherited methods |
|---|
| From [androidx.media3.common.Metadata.Entry](https://developer.android.com/reference/androidx/media3/common/Metadata.Entry) |---|---| | `@https://developer.android.com/reference/androidx/annotation/Nullable byte[]` | `https://developer.android.com/reference/androidx/media3/common/Metadata.Entry#getWrappedMetadataBytes()()` Returns the bytes of the wrapped metadata in this Entry, or null if it doesn't contain wrapped metadata. | | `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/common/Format` | `https://developer.android.com/reference/androidx/media3/common/Metadata.Entry#getWrappedMetadataFormat()()` Returns the `https://developer.android.com/reference/androidx/media3/common/Format` that can be used to decode the wrapped metadata in `https://developer.android.com/reference/androidx/media3/common/Metadata.Entry#getWrappedMetadataBytes()`, or null if this Entry doesn't contain wrapped metadata. | |

## Public fields

### colors

```
public final int colors
```

For indexed-color pictures (e.g. GIF), the number of colors used. 0 otherwise.

### depth

```
public final int depth
```

The color depth of the picture in bits-per-pixel.

### description

```
public final String description
```

A description of the picture.

### height

```
public final int height
```

The height of the picture in pixels.

### mimeType

```
public final String mimeType
```

The MIME type of the picture.

### pictureData

```
public final byte[] pictureData
```

The encoded picture data.

### pictureType

```
public final int pictureType
```

The type of the picture.

### width

```
public final int width
```

The width of the picture in pixels.

## Public constructors

### PictureFrame

```
public PictureFrame(
    int pictureType,
    String mimeType,
    String description,
    int width,
    int height,
    int depth,
    int colors,
    byte[] pictureData
)
```

## Public methods

### equals

```
public boolean equals(@Nullable Object obj)
```

### fromPictureBlock

```
public static PictureFrame fromPictureBlock(ParsableByteArray pictureBlock)
```

Parses a `METADATA_BLOCK_PICTURE` into a `PictureFrame` instance.

`pictureBlock` may be read directly from a [FLAC file](https://www.rfc-editor.org/rfc/rfc9639.html#name-picture), or decoded from the base64 content of a [Vorbis Comment](https://wiki.xiph.org/VorbisComment#METADATA_BLOCK_PICTURE).

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/util/ParsableByteArray pictureBlock` | The data of the `METADATA_BLOCK_PICTURE`, not including any headers. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/extractor/metadata/flac/PictureFrame` | A `PictureFrame` parsed from `pictureBlock`. |

### hashCode

```
public int hashCode()
```

### populateMediaMetadata

```
public void populateMediaMetadata(MediaMetadata.Builder builder)
```

Updates the `https://developer.android.com/reference/androidx/media3/common/MediaMetadata.Builder` with the type-specific values stored in this `
Entry`.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/MediaMetadata.Builder builder` | The builder to be updated. |

### toString

```
public String toString()
```