![]() |
MPLABĀ® Harmony Graphics Suite
GFX v3.13.0
Legato API Documentation
|
An array implementation for storing rectangles for the Legato user interface library. More...
#include "gfx/legato/common/legato_common.h"

Go to the source code of this file.
Data Structures | |
| struct | leRectArray |
| This struct represents a rectange array. More... | |
Typedefs | |
| typedef struct leRectArray | leRectArray |
| This struct represents a rectange array. | |
Functions | |
| leResult | leRectArray_Create (leRectArray *arr) |
| Creates a new rectangle. More... | |
| leResult | leRectArray_Resize (leRectArray *arr, uint32_t sz) |
| Resizes the capacity of the array. More... | |
| leResult | leRectArray_PushFront (leRectArray *arr, const leRect *rect) |
| Pushes a new rectangle onto the front of the array. More... | |
| leResult | leRectArray_PopFront (leRectArray *arr) |
| Removes the first value from the array. More... | |
| leResult | leRectArray_PushBack (leRectArray *arr, const leRect *rect) |
| Push value on back. More... | |
| leResult | leRectArray_PopBack (leRectArray *arr) |
| Removes the last rectangle from the array. More... | |
| leResult | leRectArray_InsertAt (leRectArray *arr, uint32_t idx, const leRect *rect) |
| Inserts a rectangle into an array at a given index. More... | |
| leResult | leRectArray_RemoveAt (leRectArray *arr, uint32_t idx) |
| Removes a rectangle from the array at an index. More... | |
| leResult | leRectArray_Copy (leRectArray *src, leRectArray *dest) |
| Copy array. More... | |
| leResult | leRectArray_Clear (leRectArray *arr) |
| Removes all values from a given array. More... | |
| leResult | leRectArray_Destroy (leRectArray *arr) |
| Destroy array. More... | |
| leResult | leRectArray_RemoveDuplicates (leRectArray *arr) |
| Removes any duplicate rectangles from an array. More... | |
| leResult | leRectArray_SortBySize (leRectArray *arr) |
| Sorts a given array. More... | |
| leResult | leRectArray_SortByX (leRectArray *arr) |
| Sort array by X coordinate. More... | |
| leResult | leRectArray_SortByY (leRectArray *arr) |
| Sort array by Y coordinate. More... | |
| leResult | leRectArray_MergeSimilar (leRectArray *arr) |
| Merge rectangles. More... | |
| leResult | leRectArray_RemoveOverlapping (leRectArray *arr) |
| Remove overlappping rectangles. More... | |
| leResult | leRectArray_CropToArea (leRectArray *arr, uint32_t width, uint32_t height) |
| Crops rectange by width and height. More... | |
| leResult | leRectArray_CropToSizeY (leRectArray *arr, uint32_t size) |
| Slices an array of rectangles to a given pixel count. More... | |
| leResult | leRectArray_CropToSizeX (leRectArray *arr, uint32_t size) |
| Slices an array of rectangles to a given pixel count. More... | |
An array implementation for storing rectangles for the Legato user interface library.
This is an array implementation that is used internally by the Legato user interface library.
| leResult leRectArray_Clear | ( | leRectArray * | arr | ) |
Removes all values from a given array.
Removes all values from arr. Array capacity remains the same.
| arr | is the array to modify. |
| leResult leRectArray_Copy | ( | leRectArray * | src, |
| leRectArray * | dest | ||
| ) |
Copy array.
Copys the contents of src to the array pointed to by dest.
| src | is the source array. |
| dest | is the destination array. |
| leResult leRectArray_Create | ( | leRectArray * | arr | ) |
Creates a new rectangle.
Creates a new rectangle arr.
| arr | is array to initialize. |
| leResult leRectArray_CropToArea | ( | leRectArray * | arr, |
| uint32_t | width, | ||
| uint32_t | height | ||
| ) |
Crops rectange by width and height.
Crops arr to given width and height. Any remainder will be moved into a new rectangle and will be cropped again if needed.
| arr | the array to modify. |
| width | the crop width. |
| height | arr the crop height. |

| leResult leRectArray_CropToSizeX | ( | leRectArray * | arr, |
| uint32_t | size | ||
| ) |
Slices an array of rectangles to a given pixel count.
Crops arr to given width and size. This method attempts to keep the rectangle slices as tall as possible.
| arr | the array to modify. |
| size | the number of pixels to crop to. |
| leResult leRectArray_CropToSizeY | ( | leRectArray * | arr, |
| uint32_t | size | ||
| ) |
Slices an array of rectangles to a given pixel count.
Crops arr to given width and size. This method attempts to keep the rectangle slices as wide as possible.
| arr | the array to modify. |
| size | the number of pixels to crop to. |
| leResult leRectArray_Destroy | ( | leRectArray * | arr | ) |
Destroy array.
Removes all values from arr. Array capacity is set to 0. leRectArray* arr; leResult res = leRectArray_Destroy(arr)
| arr | the array to modify. |
| leResult leRectArray_InsertAt | ( | leRectArray * | arr, |
| uint32_t | idx, | ||
| const leRect * | rect | ||
| ) |
Inserts a rectangle into an array at a given index.
Inserts rect into the arr at the specified idx. All existing values from index are shifted right one place.
| arr | is the array to modify. |
| idx | is the location at which to insert value. |
| val | is value to insert. |
| leResult leRectArray_MergeSimilar | ( | leRectArray * | arr | ) |
Merge rectangles.
Merges similar rectangles in arr.
| arr | the array to modify. |

| leResult leRectArray_PopBack | ( | leRectArray * | arr | ) |
Removes the last rectangle from the array.
Removes the last value from the back of arr.
| arr | is the array to modify. |
| leResult leRectArray_PopFront | ( | leRectArray * | arr | ) |
Removes the first value from the array.
Removes the first value from the front of arr. This function shuffles all other values forward one index.
| arr | The pointer to the array to modify. |
| leResult leRectArray_PushBack | ( | leRectArray * | arr, |
| const leRect * | rect | ||
| ) |
Push value on back.
Pushes val onto the back of arr.
| arr | is the array to modify. |
| val | is the value to push. |

| leResult leRectArray_PushFront | ( | leRectArray * | arr, |
| const leRect * | rect | ||
| ) |
Pushes a new rectangle onto the front of the array.
Pushes val onto the front of arr. This function shuffles all other values backward one index.
| arr | is the array to modify. |
| val | is the value to push. |
| leResult leRectArray_RemoveAt | ( | leRectArray * | arr, |
| uint32_t | idx | ||
| ) |
Removes a rectangle from the array at an index.
Removes the rectangle at idx from arr.
| arr | is the array to modify. |
| idx | is the location at which to insert value. |

| leResult leRectArray_RemoveDuplicates | ( | leRectArray * | arr | ) |
Removes any duplicate rectangles from an array.
Removes all duplicates from arr.
| arr | the array to modify. |
| leResult leRectArray_RemoveOverlapping | ( | leRectArray * | arr | ) |
Remove overlappping rectangles.
Removes overlapping rectangles in arr. The function first sorts the array by size then removes any rectangles that are completely overlapped by another larger rectangle.
| arr | the array to modify. |

| leResult leRectArray_Resize | ( | leRectArray * | arr, |
| uint32_t | sz | ||
| ) |
Resizes the capacity of the array.
Expands (or shrinks) an array arr to the specified sz.
If the array shrinks, any nodes beyond the new capacity will be discarded.
| arr | The pointer to the array to resize. |
| sz | The desired capacity. |
| leResult leRectArray_SortBySize | ( | leRectArray * | arr | ) |
Sorts a given array.
Sorts values in arr from largest to smallest.
| arr | is the array to sort. |

| leResult leRectArray_SortByX | ( | leRectArray * | arr | ) |
Sort array by X coordinate.
Sorts the values in arr in order of the X coordinate.
| arr | the array to sort. |
| leResult leRectArray_SortByY | ( | leRectArray * | arr | ) |
Sort array by Y coordinate.
Sorts the values in arr in order of the Y coordinate.
| arr | the array to analyze. |