# Feature

Artifact: [androidx.graphics:graphics-shapes](https://developer.android.com/jetpack/androidx/releases/graphics) [View Source](https://cs.android.com/search?q=file:androidx/graphics/shapes/Features.kt+class:androidx.graphics.shapes.Feature) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.1.0)

*** ** * ** ***


```
public abstract class Feature
```

<br />

*** ** * ** ***

While a polygon's shape can be drawn solely using a list of `https://developer.android.com/reference/androidx/graphics/shapes/Cubic` objects representing its raw curves and lines, features add an extra layer of context to groups of cubics. Features group cubics into (straight) edges, convex corners, or concave corners. For example, rounding a rectangle adds many cubics around its edges, but the rectangle's overall number of corners remains the same. `https://developer.android.com/reference/androidx/graphics/shapes/Morph` therefore uses this grouping for several reasons:

- Noise Reduction: Grouping cubics reduces the amount of noise introduced by individual cubics (as seen in the rounded rectangle example).

- Mapping Base: The grouping serves as the base set for `https://developer.android.com/reference/androidx/graphics/shapes/Morph`'s mapping process.

- Curve Type Mapping: `https://developer.android.com/reference/androidx/graphics/shapes/Morph` maps similar curve types (convex, concave) together. Note that edges or features created with `https://developer.android.com/reference/androidx/graphics/shapes/Feature.Factory#buildIgnorableFeature(kotlin.collections.List)` are ignored in the default mapping.

By using features, you can manipulate polygon shapes with more context and control.

## Summary

| ### Nested types |
|---|
| `public static class https://developer.android.com/reference/androidx/graphics/shapes/Feature.Factory` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/graphics/shapes/Feature#Feature(kotlin.collections.List)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/graphics/shapes/Cubic> cubics)` |

| ### Public methods |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/graphics/shapes/Cubic>` | `https://developer.android.com/reference/androidx/graphics/shapes/Feature#getCubics()()` |
| `abstract boolean` | `https://developer.android.com/reference/androidx/graphics/shapes/Feature#isConcaveCorner()()` Whether this Feature is a concave corner (inward indentation in a shape). |
| `abstract boolean` | `https://developer.android.com/reference/androidx/graphics/shapes/Feature#isConvexCorner()()` Whether this Feature is a convex corner (outward indentation in a shape). |
| `abstract boolean` | `https://developer.android.com/reference/androidx/graphics/shapes/Feature#isEdge()()` Whether this Feature is an Edge with no inward or outward indentation. |
| `abstract boolean` | `https://developer.android.com/reference/androidx/graphics/shapes/Feature#isIgnorableFeature()()` Whether this Feature gets ignored in the Morph mapping. |
| `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/graphics/shapes/Feature` | `https://developer.android.com/reference/androidx/graphics/shapes/Feature#reversed()()` Returns a new `https://developer.android.com/reference/androidx/graphics/shapes/Feature` with the points that define the shape of this `https://developer.android.com/reference/androidx/graphics/shapes/Feature` in reversed order. |
| `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/graphics/shapes/Feature` | `https://developer.android.com/reference/androidx/graphics/shapes/Feature#transformed(androidx.graphics.shapes.PointTransformer)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/graphics/shapes/PointTransformer f)` Transforms the points in this `https://developer.android.com/reference/androidx/graphics/shapes/Feature` with the given `https://developer.android.com/reference/androidx/graphics/shapes/PointTransformer` and returns a new `https://developer.android.com/reference/androidx/graphics/shapes/Feature` |

## Public constructors

### Feature

```
public Feature(@NonNull List<@NonNull Cubic> cubics)
```

## Public methods

### getCubics

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.1.0)

```
public final @NonNull List<@NonNull Cubic> getCubics()
```

### isConcaveCorner

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.1.0)

```
public abstract boolean isConcaveCorner()
```

Whether this Feature is a concave corner (inward indentation in a shape).

### isConvexCorner

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.1.0)

```
public abstract boolean isConvexCorner()
```

Whether this Feature is a convex corner (outward indentation in a shape).

### isEdge

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.1.0)

```
public abstract boolean isEdge()
```

Whether this Feature is an Edge with no inward or outward indentation.

### isIgnorableFeature

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.1.0)

```
public abstract boolean isIgnorableFeature()
```

Whether this Feature gets ignored in the Morph mapping. See `https://developer.android.com/reference/androidx/graphics/shapes/Feature.Factory#buildIgnorableFeature(kotlin.collections.List)` for more details.

### reversed

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.1.0)

```
public abstract @NonNull Feature reversed()
```

Returns a new `https://developer.android.com/reference/androidx/graphics/shapes/Feature` with the points that define the shape of this `https://developer.android.com/reference/androidx/graphics/shapes/Feature` in reversed order.

### transformed

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.1.0)

```
public abstract @NonNull Feature transformed(@NonNull PointTransformer f)
```

Transforms the points in this `https://developer.android.com/reference/androidx/graphics/shapes/Feature` with the given `https://developer.android.com/reference/androidx/graphics/shapes/PointTransformer` and returns a new `https://developer.android.com/reference/androidx/graphics/shapes/Feature`

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/graphics/shapes/PointTransformer f` | The `https://developer.android.com/reference/androidx/graphics/shapes/PointTransformer` used to transform this `https://developer.android.com/reference/androidx/graphics/shapes/Feature` |