# Image Pyramid

- enum FadasPyramidPipeline\_e

    - Algorithm pipeline.

- Param FADAS\_PYRAMID\_PIPELINE\_DownscaleUYVYAndRGB888:

    - Scale UYUV image down by 1x to 8x in each dimension, the ratios in height and width need not be the same, and convert to RGB888.

- Param FADAS\_PYRAMID\_PIPELINE\_DownscaleUYVYBy2AndRGB888:

    - Scale UYUV image down by two in each dimension, the ratios in height and width need not be the same, and convert to RGB888.

- Param FADAS\_PYRAMID\_PIPELINE\_DownscaleYUV888AndRGB888:

    - Scale YUV888 image down by 1x to 8x in each dimension, the ratios in height and width need not be the same, and convert to RGB888.

- Param FADAS\_PYRAMID\_PIPELINE\_DownscaleYUV888By2AndRGB888:

    - Scale YUV888 image down by two in each dimension, the ratios in height and width need not be the same, and convert to RGB888.

- Param FADAS\_PYRAMID\_PIPELINE\_DownscaleY8UV8By2:

    - Scale Y8UV8 image down by 2 in each dimension and the ratios in height and width need not be the same and convert to RGB888.

- Param FADAS\_PYRAMID\_PIPELINE\_DownscaleY10UV10By2:

    - Scale Y10UV10 image down by 2 in each dimension and the ratios in height and width need not be the same and convert to RGB888.

*Values:*

- enumerator FADAS\_PYRAMID\_PIPELINE\_DownscaleBy2

    - Single planar luma image (Y) with 8 bit data in 8 bit carriers.

- enumerator FADAS\_PYRAMID\_PIPELINE\_DownscaleRGB888By2

    - Single planar image (RGB) with 8 bit data in 8 bit carriers.

- enumerator FADAS\_PYRAMID\_PIPELINE\_DownscaleY8UV8By2

    - Multiplanar image (Y,UV) with 8 bit data in 8 bit carriers.

- enumerator FADAS\_PYRAMID\_PIPELINE\_DownscaleY10UV10By2

    - Multiplanar image (Y,UV) with 10 bit data in 16 bit carriers.

- enumerator FADAS\_PYRAMID\_PIPELINE\_DownscaleY10UV8By2

    - Multiplanar image (Y,UV) with 10 bit(Y) data in 16 bit carriers.

- enumerator FADAS\_PYRAMID\_PIPELINE\_DownscaleY12UV8By2

    - Multiplanar image (Y,UV) with 10 bit(Y) data in 16 bit carriers.

- enumerator FADAS\_PYRAMID\_PIPELINE\_MAX

    - Do not use.

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

    - Initialize the pyramid 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** – 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) FadasPyramid\_DeInit(void)

    - Deinitialize the FastADAS pyramid 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) FadasPyramid\_Allocate([FadasImgProps\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/struct_fadas_img_props__t.html#_CPPv415FadasImgProps_t) srcProps, [FadasPyramid\_Level\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/struct_fadas_pyramid___level__t.html#_CPPv420FadasPyramid_Level_t) \*pyramid, uint32\_t numLevels, bool externalLevel0 = false)

    - Allocates memory for a pyramid.

- Parameters:

    - - **srcProps** – Image properties of the source image. **WARNING:** Image sizes must be appropriate for the specified numLevels so that the dimensions are properly divisible by 2 for each next level of the pyramid.
- **pyramid** – Pointer to pyramid.
- **numLevels** – Number of levels to the pyramid. **WARNING:** Must not exceed [FADAS\_MAX\_PYRAMID\_LEVELS](https://docs.qualcomm.com/doc/80-63309-1/topic/define_fadas_pyramid_8h_1aa692e771e73fd1c3e837a0480d3085b3.html#fadas_pyramid_8h_1aa692e771e73fd1c3e837a0480d3085b3).
- **externalLevel0** – If true, memory is only allocated for levels 1 through (numLevels-1) so that level 0 can point to externally allocated memory.

- 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) FadasPyramid\_Free([FadasPyramid\_Level\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/struct_fadas_pyramid___level__t.html#_CPPv420FadasPyramid_Level_t) \*pyramid, uint32\_t numLevels)

    - Frees memory for a pyramid.

- Parameters:

    - - **pyramid** – Pointer to pyramid.
- **numLevels** – Number of levels to the pyramid.

- 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) FadasPyramid\_Run([FadasImage\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/struct_fadas_image__t.html#_CPPv412FadasImage_t) \*src, [FadasPyramid\_Level\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/struct_fadas_pyramid___level__t.html#_CPPv420FadasPyramid_Level_t) \*dst, uint32\_t numLevels)

    - Runs the pyramid creation feature to populate the different levels of a previously allocated pyramid.

- Parameters:

    - - **src** – Pointer to the source image to build the pyramid. **WARNING:** Image sizes must be appropriate for the given numLevels so that the dimensions are properly divisible by 2 for each next level of the pyramid.
- **dst** – Pointer to a previously allocated pyramid.
- **numLevels** – Number of levels to the pyramid.

- Returns:

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

- void \*FadasPyramid\_CreateWorkers(uint32\_t nThreads, int32\_t pThreadsAffinity[], [FadasPyramidPipeline\_e](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_group__pyramid_1ga2bf258abebc78373735b18777150976e.html#_CPPv422FadasPyramidPipeline_e) ePipeline)

    - Creates a multithreaded worker pool for the pyramidal down scalar feature.

- Parameters:

    - - **nThreads** – Requested number of threads, can limit 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 for setting threads affinity
- **ePipeline** – Descriptor of execution pipeline to use.

- Returns:

    - Worker pool pointer.

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

    - Destroys a pyramidal down-scalar worker pool.

- Parameters:

    - **wrkrs** – Pointer to the worker pool created by FadasCvtYUV\_CreateWorkers.

- 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) FadasPyramid\_RunMT(void \*wrkrs, [FadasImage\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/struct_fadas_image__t.html#_CPPv412FadasImage_t) \*src, [FadasPyramid\_Level\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/struct_fadas_pyramid___level__t.html#_CPPv420FadasPyramid_Level_t) \*dst, uint32\_t numLevels)

    - Runs a multithreaded pipeline for this pyramid module.

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

- Parameters:

    - - **wrkrs** – Pointer to the worker pool created by FadasPyramid\_CreateWorkers.
- **src** – Pointer to the source image to build the pyramid.
- **dst** – Pointer to pyramid.
- **numLevels** – Number of levels to the pyramid.

- Returns:

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

- struct FadasPyramid\_Level\_t

    - Pyramid image structure.

- Param data:

    - Image data of this image level.

- Param bAllocated:

    - Status of the memory allocation by pyramid.

Public Members

- [FadasImage\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/struct_fadas_image__t.html#_CPPv412FadasImage_t) data

    - 

- bool bAllocated

    -

## Related examples

- [one/one.cpp](https://docs.qualcomm.com/doc/80-63309-1/topic/one.html)

Last Published: Sep 30, 2024

[Previous Topic
Object Detection](https://docs.qualcomm.com/bundle/publicresource/80-63309-1/topics/object-detection.md) [Next Topic
Remap](https://docs.qualcomm.com/bundle/publicresource/80-63309-1/topics/remap.md)