summaryrefslogtreecommitdiff
path: root/src/types.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-02-02 22:33:27 +0000
committerCarl Hetherington <cth@carlh.net>2015-02-02 22:33:27 +0000
commit989f182558193a51e0a26603fb2ca59f827216a0 (patch)
tree7d2b2511967e5417838a4343341e5aa9d26cf2b8 /src/types.h
parent0d7fe66361a40702cb97357955cf35256f1d2c26 (diff)
Remove Image and ARGBImage and just dump RGB data into
uint8_t* buffers. This is hopefully simpler than trying to come up with some Image hierarchy that suits everything.
Diffstat (limited to 'src/types.h')
-rw-r--r--src/types.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/types.h b/src/types.h
index 594bd7b7..4c303e0d 100644
--- a/src/types.h
+++ b/src/types.h
@@ -35,6 +35,29 @@ namespace parse {
class AssetMap;
}
+/** @struct Size
+ * @brief The integer, two-dimensional size of something.
+ */
+struct Size
+{
+ Size ()
+ : width (0)
+ , height (0)
+ {}
+
+ Size (int w, int h)
+ : width (w)
+ , height (h)
+ {}
+
+ float ratio () const {
+ return float (width) / height;
+ }
+
+ int width;
+ int height;
+};
+
/** Identifier for a sound channel */
enum Channel {
LEFT = 0, ///< left