aboutsummaryrefslogtreecommitdiff
path: root/src/image.h
diff options
context:
space:
mode:
authorJohn Ankarstr\xf6m <john@ankarstrom.se>2021-05-29 12:54:47 +0200
committerJohn Ankarstr\xf6m <john@ankarstrom.se>2021-05-29 13:18:40 +0200
commita041d9898e6d699bd8c0c25482ec574feb03c547 (patch)
tree7f094e33fb530152c3ab6238ce7300750b47addb /src/image.h
downloadjwm-a041d9898e6d699bd8c0c25482ec574feb03c547.tar.gz
First commit
This is the original state of the released tarball for JWM 1.8, which will serve as my starting point for further modifications.
Diffstat (limited to 'src/image.h')
-rw-r--r--src/image.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/image.h b/src/image.h
new file mode 100644
index 0000000..1291e1b
--- /dev/null
+++ b/src/image.h
@@ -0,0 +1,47 @@
+/**
+ * @file image.h
+ * @author Joe Wingbermuehle
+ * @date 2005-2006
+ *
+ * @brief Functions to load images.
+ *
+ */
+
+#ifndef IMAGE_H
+#define IMAGE_H
+
+/** Structure to represent an image. */
+typedef struct ImageNode {
+
+#ifdef USE_PNG
+ png_uint_32 width; /**< Width of the image. */
+ png_uint_32 height; /**< Height of the image. */
+#else
+ int width; /**< Width of the image. */
+ int height; /**< Height of the image. */
+#endif
+
+ unsigned long *data; /**< Image data. */
+
+} ImageNode;
+
+/** Load an image from a file.
+ * @param fileName The file containing the image.
+ * @return A new image node (NULL if the image could not be loaded).
+ */
+ImageNode *LoadImage(const char *fileName);
+
+/** Load an image from data.
+ * The data must be in the format from the EWMH spec.
+ * @param data The image data.
+ * @return A new image node (NULL if there were errors.
+ */
+ImageNode *LoadImageFromData(char **data);
+
+/** Destroy an image node.
+ * @param image The image to destroy.
+ */
+void DestroyImage(ImageNode *image);
+
+#endif
+