Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2010-12-06 21:33:34 +0000
committerStijn Buys <ingar@osirion.org>2010-12-06 21:33:34 +0000
commitc50095cab023e91ba2a4fec8dcb290e6d817124b (patch)
treee9511df876d45faffb428ee7ae342a8aabab4194 /src/render/image.h
parent8c7fa7dd3258e8d3e112fb9780249dd0d0ef008a (diff)
Re-enabled environment mapping with the skybox as cubemap.
Diffstat (limited to 'src/render/image.h')
-rw-r--r--src/render/image.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/render/image.h b/src/render/image.h
index 244948e..3182fc8 100644
--- a/src/render/image.h
+++ b/src/render/image.h
@@ -20,7 +20,7 @@ public:
~Image();
/// pointer to the raw image data
- inline unsigned char *data() {
+ inline unsigned char *ptr() {
return image_data;
}
@@ -28,6 +28,10 @@ public:
inline unsigned char *operator[](size_t index) {
return &image_data[index];
}
+
+ inline unsigned char *pixel(size_t x, size_t y) {
+ return &image_data[(y * image_width + x) * image_channels];
+ }
/// width of the image in pixels
inline unsigned int width() const {
@@ -61,10 +65,16 @@ public:
void swap_channels();
/// flip upside-down
- void flip();
+ void flip_vertical();
+
+ /// flip left-right
+ void flip_horizontal();
/// pad width and height up to 8 bytes
void pad();
+
+ /// load an image
+ static Image *load(const std::string & name);
private:
unsigned char *image_data;