# ImageProxyTransformFactory

Artifact: [androidx.camera:camera-view](https://developer.android.com/jetpack/androidx/releases/camera) [View Source](https://cs.android.com/search?q=file:androidx/camera/view/transform/ImageProxyTransformFactory.java+class:androidx.camera.view.transform.ImageProxyTransformFactory) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/camera#1.1.0)

*** ** * ** ***


```
class ImageProxyTransformFactory
```

<br />

*** ** * ** ***

Factory for extracting transform info from `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageProxy`.

This class is for extracting a `https://developer.android.com/reference/kotlin/androidx/camera/view/transform/OutputTransform` from an `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageProxy` object. The `https://developer.android.com/reference/kotlin/androidx/camera/view/transform/OutputTransform` represents the transform being applied to the original camera buffer, which can be used by `https://developer.android.com/reference/kotlin/androidx/camera/view/transform/CoordinateTransform` to transform coordinates between `https://developer.android.com/reference/kotlin/androidx/camera/core/UseCase`s.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/view/transform/OutputTransform` |   |
| `https://developer.android.com/reference/kotlin/androidx/camera/view/transform/CoordinateTransform` |   |

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/view/transform/ImageProxyTransformFactory#ImageProxyTransformFactory()()` |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/view/transform/OutputTransform` | `https://developer.android.com/reference/kotlin/androidx/camera/view/transform/ImageProxyTransformFactory#getOutputTransform(androidx.camera.core.ImageProxy)(imageProxy: https://developer.android.com/reference/kotlin/androidx/camera/core/ImageProxy)` Extracts the transform from the given `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageProxy`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/view/transform/ImageProxyTransformFactory#isUsingCropRect()()` Whether the factory respects the value of `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageProxy#getCropRect()`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/view/transform/ImageProxyTransformFactory#isUsingRotationDegrees()()` Whether the factory respects the value of `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageInfo#getRotationDegrees()`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/view/transform/ImageProxyTransformFactory#setUsingCropRect(boolean)(usingCropRect: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Whether to use the crop rect of the `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageProxy`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/view/transform/ImageProxyTransformFactory#setUsingRotationDegrees(boolean)(usingRotationDegrees: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Whether to use the rotation degrees of the `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageProxy`. |

## Public constructors

### ImageProxyTransformFactory

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

```
ImageProxyTransformFactory()
```

## Public functions

### getOutputTransform

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

```
fun getOutputTransform(imageProxy: ImageProxy): OutputTransform
```

Extracts the transform from the given `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageProxy`.

This method returns a `https://developer.android.com/reference/kotlin/androidx/camera/view/transform/OutputTransform` that represents the transform applied to the buffer of a `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageProxy` based on factory settings. An `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageProxy` can be the output of `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageAnalysis` or in-memory `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture`.

### isUsingCropRect

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

```
fun isUsingCropRect(): Boolean
```

Whether the factory respects the value of `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageProxy#getCropRect()`.

By default, the value is false.

### isUsingRotationDegrees

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

```
fun isUsingRotationDegrees(): Boolean
```

Whether the factory respects the value of `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageInfo#getRotationDegrees()`.

By default, the value is false.

### setUsingCropRect

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

```
fun setUsingCropRect(usingCropRect: Boolean): Unit
```

Whether to use the crop rect of the `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageProxy`.

By default, the value is false and the factory uses the `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageProxy`'s entire buffer. Only set this value if the coordinates to be transformed respect the crop rect. For example, top-left corner of the crop rect is (0, 0).

### setUsingRotationDegrees

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

```
fun setUsingRotationDegrees(usingRotationDegrees: Boolean): Unit
```

Whether to use the rotation degrees of the `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageProxy`.

By default, the value is false and the factory uses a rotation degree of 0. Only set this value to true if the coordinates to be transformed is after the rotation degree is applied. For example, if the `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageInfo#getRotationDegrees()` is 90 degrees, (0, 0) in the original buffer should be mapped to (height, 0) in the rotated image. Set this value to true if the input coordinates are based on the original image, and false if the coordinates are based on the rotated image.