Add gdispImageIsOpen() function.
This commit is contained in:
parent
d45bba45e1
commit
dd43a37b9b
2 changed files with 22 additions and 1 deletions
|
@ -185,7 +185,7 @@ extern "C" {
|
||||||
gdispImageError gdispImageOpen(gdispImage *img);
|
gdispImageError gdispImageOpen(gdispImage *img);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Close an image and release any dynamicly allocated working storage.
|
* @brief Close an image and release any dynamically allocated working storage.
|
||||||
*
|
*
|
||||||
* @param[in] img The image structure
|
* @param[in] img The image structure
|
||||||
*
|
*
|
||||||
|
@ -195,6 +195,19 @@ extern "C" {
|
||||||
*/
|
*/
|
||||||
void gdispImageClose(gdispImage *img);
|
void gdispImageClose(gdispImage *img);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Is an image open.
|
||||||
|
* @return TRUE if the image is currently open.
|
||||||
|
*
|
||||||
|
* @param[in] img The image structure
|
||||||
|
*
|
||||||
|
* @note Be careful with calling this on an uninitialized image structure as the image
|
||||||
|
* will contain random data which may be interpreted as meaning the image
|
||||||
|
* is open. Clearing the Image structure to 0's will guarantee the image
|
||||||
|
* is seen as being closed.
|
||||||
|
*/
|
||||||
|
bool_t gdispImageIsOpen(gdispImage *img);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set the background color of the image.
|
* @brief Set the background color of the image.
|
||||||
*
|
*
|
||||||
|
|
|
@ -184,6 +184,14 @@ void gdispImageClose(gdispImage *img) {
|
||||||
img->fns->close(img);
|
img->fns->close(img);
|
||||||
else
|
else
|
||||||
img->io.fns->close(&img->io);
|
img->io.fns->close(&img->io);
|
||||||
|
img->type = GDISP_IMAGE_TYPE_UNKNOWN;
|
||||||
|
img->flags = 0;
|
||||||
|
img->fns = 0;
|
||||||
|
img->priv = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool_t gdispImageIsOpen(gdispImage *img) {
|
||||||
|
return img->type != GDISP_IMAGE_TYPE_UNKNOWN && img->fns != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void gdispImageSetBgColor(gdispImage *img, color_t bgcolor) {
|
void gdispImageSetBgColor(gdispImage *img, color_t bgcolor) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue