aboutsummaryrefslogtreecommitdiffstats
path: root/src/gdisp/gdisp_image.h
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@embedded.pro>2016-11-11 19:09:34 +0100
committerJoel Bodenmann <joel@embedded.pro>2016-11-11 19:09:34 +0100
commitb60383c03e8ddd0fb2f24f597fd15c787653d652 (patch)
tree194d64c2386f29f6b6faea429ac13c2f2bd35f92 /src/gdisp/gdisp_image.h
parentc91f42ec85a2c2f127663c0b0a9f11f11a6660b8 (diff)
parent477aa8e87872ae79e568e1a1d5468c614fc1c457 (diff)
downloaduGFX-b60383c03e8ddd0fb2f24f597fd15c787653d652.tar.gz
uGFX-b60383c03e8ddd0fb2f24f597fd15c787653d652.tar.bz2
uGFX-b60383c03e8ddd0fb2f24f597fd15c787653d652.zip
Merge branch 'image_palette'
Diffstat (limited to 'src/gdisp/gdisp_image.h')
-rw-r--r--src/gdisp/gdisp_image.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/gdisp/gdisp_image.h b/src/gdisp/gdisp_image.h
index 2b6fdf19..76773887 100644
--- a/src/gdisp/gdisp_image.h
+++ b/src/gdisp/gdisp_image.h
@@ -247,6 +247,42 @@ extern "C" {
* frame/page.
*/
delaytime_t gdispImageNext(gdispImage *img);
+
+ /**
+ * @brief Get the number of entries in the color palette.
+ * @return The number of entries in the color palette or 0 if the image doesn't use a color palette.
+ *
+ * @param[in] img The image structure
+ *
+ * @pre gdispImageOpen() must have returned successfully.
+ */
+ uint16_t gdispImageGetPaletteSize(gdispImage *img);
+
+ /**
+ * @brief Get an entry in the color palette.
+ * @return The color value at a given position in the color palette.
+ *
+ * @param[in] img The image structure
+ * @param[in] index The index of the color palette entry
+ *
+ * @pre gdispImageOpen() must have returned successfully.
+ *
+ * @note This function will return 0 if the index is out of bounds or if the image doesn't use a color palette.
+ */
+ color_t gdispImageGetPalette(gdispImage *img, uint16_t index);
+
+ /**
+ * @brief Modify an entry in the color palette.
+ * @return @p TRUE on success, @p FALSE otherwise.
+ *
+ * @param[in] img The image structure
+ * @param[in] index The index of the color palette entry
+ * @param[in] newColor The new color value of the specified entry
+ *
+ * @pre gdispImageOpen() must have returned successfully.
+ * @note This function will return @p FALSE if the index is out of bounds or if the image doesn't use a color palette.
+ */
+ bool_t gdispImageAdjustPalette(gdispImage *img, uint16_t index, color_t newColor);
#ifdef __cplusplus
}