MPLABĀ® Harmony Graphics Suite  GFX v3.13.0
Legato API Documentation
legato_palette.h
Go to the documentation of this file.
1 /*******************************************************************************
2 * Copyright (C) 2020 Microchip Technology Inc. and its subsidiaries.
3 *
4 * Subject to your compliance with these terms, you may use Microchip software
5 * and any derivatives exclusively with Microchip products. It is your
6 * responsibility to comply with third party license terms applicable to your
7 * use of third party software (including open source software) that may
8 * accompany Microchip software.
9 *
10 * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
11 * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
12 * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
13 * PARTICULAR PURPOSE.
14 *
15 * IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
16 * INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
17 * WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
18 * BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
19 * FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
20 * ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
21 * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
22 *******************************************************************************/
23 
24 /*******************************************************************************
25  Module for Microchip Graphics Library - Legato User Interface Library
26 
27  Company:
28  Microchip Technology Inc.
29 
30  File Name:
31  legato_palette.h
32 
33  Summary:
34  Defines palette assets
35 
36  Description:
37  Get palette color
38 *******************************************************************************/
39 
46 #ifndef LE_PALETTE_H
47 #define LE_PALETTE_H
48 
51 
52 // *****************************************************************************
53 /* Structure:
54  lePalette
55 
56  Summary:
57  Describes a palette asset. A palette is a lookup table for unique colors.
58  Given in an index, a color can be retrieved.
59 
60  header - standard asset header
61  colorCount - the number of colors contained in the palette
62  colorMode - the color mode of the image
63 */
69 typedef struct lePalette
70 {
72  uint32_t colorCount;
74 } lePalette;
75 
76 // *****************************************************************************
77 /* Function:
78  leResult lePaletteGetColor(void);
79 
80  Summary:
81  Gets a color from a palette asset given an index value.
82 
83  Parameters:
84  lePalette* pal - pointer to the palette to read
85 
86  uint32_t idx - the index of the color to look up
87 
88  Returns:
89  leColor - the color that was retrieved
90 */
104 leColor lePalette_GetColor(lePalette* pal, uint32_t idx);
105 
106 
107 #endif /* LE_PALETTE_H */
struct lePalette lePalette
This struct represents a palette asset.
Color definitions and functions.
leColor lePalette_GetColor(lePalette *pal, uint32_t idx)
Get color from a palette.
Definition: legato_palette.c:30
This struct represents a palette asset.
Definition: legato_palette.h:69
This struct represents a stream descriptor.
Definition: legato_stream.h:60
leStreamDescriptor header
Definition: legato_palette.h:71
leColorMode
This enum represents the supported RGB color formats.
Definition: legato_color.h:148
uint32_t colorCount
Definition: legato_palette.h:72
leColorMode colorMode
Definition: legato_palette.h:73
Defines a common header for all stream operations.