# Transform

- enum FadasTransformPipeline\_e

    - Transform algorithm pipeline specifying what algorithm pipeline is run by subsequent calls to [FadasTransform\_RunMT()](https://docs.qualcomm.com/doc/80-63309-1/topic/transform.html#group__transform_1gabc1656b0f8c19ebfb1d9b627ebfabd33).

- Param FADAS\_TRANSFORM\_PIPELINE\_AffineClippedu8:

    - Affine transform clipped with input/output data type as uint8\_t.

*Values:*

- enumerator FADAS\_TRANSFORM\_PIPELINE\_AffineClippedu8

    - Affine clipped uint8\_t.

- enumerator FADAS\_TRANSFORM\_PIPELINE\_MAX

    - Do not use. Must be last.

- [FadasError\_e](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#_CPPv412FadasError_e) FadasTransform\_Init(const char \*licenseKey)

    - Initialize FastADAS transform feature. **WARNING:** Must be called once before other FastADAS functions except [FadasVersion()](https://docs.qualcomm.com/doc/80-63309-1/topic/misc.html#group__misc_1ga55cbdff48d751f2a0227ae4ac106d746).

- Parameters:

    - **licenseKey** – Pointer to the license key string.

- Returns:

    - [FADAS\_ERROR\_NONE](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#fadas_8h_1a280abf443019bfc722ac1158e5fe1013aea09a4171f0866f38326d7e5323f2d12) — Success.

- [FadasError\_e](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#_CPPv412FadasError_e) FadasTransform\_DeInit(void)

    - Deinitialize FastADAS transform feature. **WARNING:** Must be called once after all other FastADAS functions.

- Returns:

    - [FADAS\_ERROR\_NONE](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#fadas_8h_1a280abf443019bfc722ac1158e5fe1013aea09a4171f0866f38326d7e5323f2d12) — Success.

- [FadasError\_e](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#_CPPv412FadasError_e) FadasTransform\_AffineClippedu8(const [FadasImage\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/struct_fadas_image__t.html#_CPPv412FadasImage_t) \*srcImg, const [FadasMatrix\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/struct_fadas_matrix__t.html#_CPPv413FadasMatrix_t) \*transformMat, [FadasImage\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/struct_fadas_image__t.html#_CPPv412FadasImage_t) \*dstImg, uint32\_t \*\_\_restrict dstBorder, uint32\_t borderStride, [FadasInterpolationType\_e](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a6776fc51b79aacf23898536f1a752d0e.html#_CPPv424FadasInterpolationType_e) interpolation, [FadasBorderType\_e](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a305617b24360b847c507ebb8370a0fc4.html#_CPPv417FadasBorderType_e) borderType = [FADAS\_BORDER\_UNDEFINED](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a305617b24360b847c507ebb8370a0fc4.html#_CPPv4N17FadasBorderType_e22FADAS_BORDER_UNDEFINEDE), uint8\_t borderValue = 0)

    - Applies an affine transformation on a gray scale image using 2x3 matrix.

- Parameters:

    - - **srcImg** – Pointer to the input image object of type [FadasImage\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/struct_fadas_image__t.html#struct_fadas_image__t).
- **transformMat** – Pointer to the input matrix object of type [FadasMatrix\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/struct_fadas_matrix__t.html#struct_fadas_matrix__t). Transform matrix is a 2x3 perspective transformation matrix. The matrix stored in transformMat-&gt;ptr is using row major ordering: a11, a12, a13, a21, a22, a23 where the matrix is: | a11, a12, a13 | | a21, a22, a23 | Stride is 6 for affine transform.
- **dstImg** – Pointer to the output image object of type [FadasImage\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/struct_fadas_image__t.html#struct_fadas_image__t).
- **dstBorder** – Pointer to the output borders.
- **borderStride** – Input buffer stride for dstBorder. **WARNING:** Stride must be a multiple of 128.
- **interpolation** – Specifies the interpolation method to use for sampling. Might hold values [FADAS\_INTERPOLATION\_TYPE\_NEAREST\_NEIGHBOR](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a6776fc51b79aacf23898536f1a752d0e.html#fadas_8h_1a6776fc51b79aacf23898536f1a752d0eabe7c41fda1d62c6c7015bdd372728a9d) or [FADAS\_INTERPOLATION\_TYPE\_BILINEAR](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a6776fc51b79aacf23898536f1a752d0e.html#fadas_8h_1a6776fc51b79aacf23898536f1a752d0ea4f01e44273fde09dddefc95fc9f78285) or [FADAS\_INTERPOLATION\_TYPE\_AREA](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a6776fc51b79aacf23898536f1a752d0e.html#fadas_8h_1a6776fc51b79aacf23898536f1a752d0eae3030e9d41f14e8a5dddf784f74c5d5c)
- **borderType** – Specifies the border type of output image. Might hold values [FADAS\_BORDER\_UNDEFINED](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a305617b24360b847c507ebb8370a0fc4.html#fadas_8h_1a305617b24360b847c507ebb8370a0fc4a4a6518ac45ef101f2d9ad128ce92bb70) or [FADAS\_BORDER\_CONSTANT](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a305617b24360b847c507ebb8370a0fc4.html#fadas_8h_1a305617b24360b847c507ebb8370a0fc4a568962aa5e1fd25256274b3944a470f0)
- **borderValue** – Border pixel value.

- Returns:

    - [FADAS\_ERROR\_NONE](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#fadas_8h_1a280abf443019bfc722ac1158e5fe1013aea09a4171f0866f38326d7e5323f2d12) — Success.

- void \*FadasTransform\_CreateWorkers(uint32\_t nThreads, int32\_t pThreadsAffinity[], [FadasTransformPipeline\_e](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_group__transform_1gabb6e84ee14bcdb7e7a998c3bfb70987a.html#_CPPv424FadasTransformPipeline_e) ePipeline)

    - Creates a multithreaded worker pool specifically for the transform affine feature.

- Parameters:

    - - **nThreads** – Requested number of threads, can be limited to the maximum number of threads if requesting more than that limit. The maximum is the maximum number of physical or logical cores. If requesting 0 threads, use the maximum number.
- **pThreadsAffinity** – Array to set threads affinity
- **ePipeline** – Execution pipeline to use with this worker pool.

- Returns:

    - Worker pool pointer.

- [FadasError\_e](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#_CPPv412FadasError_e) FadasTransform\_DestroyWorkers(void \*wrkrs)

    - Destroys a transform affine worker pool.

- Parameters:

    - **wrkrs** – Pointer to the worker pool created by [FadasTransform\_CreateWorkers()](https://docs.qualcomm.com/doc/80-63309-1/topic/transform.html#group__transform_1ga2e7052727fe5f80e320e430e03793ab0).

- Returns:

    - [FADAS\_ERROR\_NONE](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#fadas_8h_1a280abf443019bfc722ac1158e5fe1013aea09a4171f0866f38326d7e5323f2d12) — Success.

- [FadasError\_e](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#_CPPv412FadasError_e) FadasTransform\_RunMT(void \*wrkrs, const [FadasImage\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/struct_fadas_image__t.html#_CPPv412FadasImage_t) \*srcImg, const [FadasMatrix\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/struct_fadas_matrix__t.html#_CPPv413FadasMatrix_t) \*transformMat, [FadasImage\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/struct_fadas_image__t.html#_CPPv412FadasImage_t) \*dstImg, uint32\_t \*\_\_restrict dstBorder, uint32\_t borderStride, [FadasInterpolationType\_e](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a6776fc51b79aacf23898536f1a752d0e.html#_CPPv424FadasInterpolationType_e) interpolation, [FadasBorderType\_e](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a305617b24360b847c507ebb8370a0fc4.html#_CPPv417FadasBorderType_e) borderType = [FADAS\_BORDER\_UNDEFINED](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a305617b24360b847c507ebb8370a0fc4.html#_CPPv4N17FadasBorderType_e22FADAS_BORDER_UNDEFINEDE), uint8\_t borderValue = 0)

    - Runs a multithreaded pipeline for this transform module. Applies an affine transformation on a grayscale image using 2x3 matrix.

Runs a multithreaded pipeline using a worker pool created by [FadasTransform\_CreateWorkers()](https://docs.qualcomm.com/doc/80-63309-1/topic/transform.html#group__transform_1ga2e7052727fe5f80e320e430e03793ab0). At worker pool creation, the pipeline of one or more chained algorithms is defined.

- Parameters:

    - - **wrkrs** – Worker pool created by [FadasTransform\_CreateWorkers()](https://docs.qualcomm.com/doc/80-63309-1/topic/transform.html#group__transform_1ga2e7052727fe5f80e320e430e03793ab0).
- **srcImg** – Pointer to the input image object of type [FadasImage\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/struct_fadas_image__t.html#struct_fadas_image__t).
- **transformMat** – Pointer to the input matrix object of type [FadasMatrix\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/struct_fadas_matrix__t.html#struct_fadas_matrix__t). Transform matrix is a 2x3 perspective transformation matrix. The matrix stored in transformMat-&gt;ptr is using row major ordering: a11, a12, a13, a21, a22, a23 where the matrix is: | a11, a12, a13 | | a21, a22, a23 | Stride is 6 for affine transform.
- **dstImg** – Pointer to the output image object of type [FadasImage\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/struct_fadas_image__t.html#struct_fadas_image__t).
- **dstBorder** – Pointer to the output borders.
- **borderStride** – Input buffer stride for dstBorder. **WARNING:** Stride must be a multiple of 128.
- **interpolation** – Specifies the interpolation method to use for sampling. Might hold values [FADAS\_INTERPOLATION\_TYPE\_NEAREST\_NEIGHBOR](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a6776fc51b79aacf23898536f1a752d0e.html#fadas_8h_1a6776fc51b79aacf23898536f1a752d0eabe7c41fda1d62c6c7015bdd372728a9d) or [FADAS\_INTERPOLATION\_TYPE\_BILINEAR](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a6776fc51b79aacf23898536f1a752d0e.html#fadas_8h_1a6776fc51b79aacf23898536f1a752d0ea4f01e44273fde09dddefc95fc9f78285) or [FADAS\_INTERPOLATION\_TYPE\_AREA](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a6776fc51b79aacf23898536f1a752d0e.html#fadas_8h_1a6776fc51b79aacf23898536f1a752d0eae3030e9d41f14e8a5dddf784f74c5d5c)
- **borderType** – Specifies the border type of output image. Might hold values [FADAS\_BORDER\_UNDEFINED](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a305617b24360b847c507ebb8370a0fc4.html#fadas_8h_1a305617b24360b847c507ebb8370a0fc4a4a6518ac45ef101f2d9ad128ce92bb70) or [FADAS\_BORDER\_CONSTANT](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a305617b24360b847c507ebb8370a0fc4.html#fadas_8h_1a305617b24360b847c507ebb8370a0fc4a568962aa5e1fd25256274b3944a470f0)
- **borderValue** – Border pixel value.

- Returns:

    - [FADAS\_ERROR\_NONE](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#fadas_8h_1a280abf443019bfc722ac1158e5fe1013aea09a4171f0866f38326d7e5323f2d12) — Success.

Last Published: Sep 30, 2024

[Previous Topic
Tensor](https://docs.qualcomm.com/bundle/publicresource/80-63309-1/topics/tensor.md) [Next Topic
Vector](https://docs.qualcomm.com/bundle/publicresource/80-63309-1/topics/vector.md)