diff options
author | Stijn Buys <ingar@osirion.org> | 2009-08-18 09:24:15 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2009-08-18 09:24:15 +0000 |
commit | f030154fe727e25a2afe1f78b3998c2d2dba95e4 (patch) | |
tree | cd92baf9e4fa8a136523b9eb570e9811846c9250 /src/render/image.h | |
parent | 5636fad174f0bcff857c357c394c4cc8d424b302 (diff) |
astyle cleanup, corrects not loading of material textures
Diffstat (limited to 'src/render/image.h')
-rw-r--r-- | src/render/image.h | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/src/render/image.h b/src/render/image.h index c7add6f..244948e 100644 --- a/src/render/image.h +++ b/src/render/image.h @@ -1,7 +1,7 @@ /* render/image.h - This file is part of the Osirion project and is distributed under - the terms of the GNU General Public License version 2 + This file is part of the Osirion project and is distributed under + the terms of the GNU General Public License version 2 */ #ifndef __INCLUDED_RENDER_IMAGE_H__ @@ -9,34 +9,50 @@ #include <string> -namespace render { +namespace render +{ /// RGB (24bpp) or RGBA (32bpp) image data -class Image { +class Image +{ public: Image(unsigned int width, unsigned int height, unsigned int channels); ~Image(); /// pointer to the raw image data - inline unsigned char *data() { return image_data; } + inline unsigned char *data() { + return image_data; + } /// index into the raw image data - inline unsigned char *operator[](size_t index) { return &image_data[index]; } + inline unsigned char *operator[](size_t index) { + return &image_data[index]; + } /// width of the image in pixels - inline unsigned int width() const { return image_width; } + inline unsigned int width() const { + return image_width; + } /// height of the image in pixels - inline unsigned int height() const { return image_height; } + inline unsigned int height() const { + return image_height; + } /// size of the image data in bytes - inline size_t size() const { return ((size_t) image_width * (size_t) image_height * (size_t) image_channels); } + inline size_t size() const { + return ((size_t) image_width *(size_t) image_height *(size_t) image_channels); + } /// number of channels 3 (RGB) or 4 (RGBA) - inline unsigned int channels() const { return image_channels; } + inline unsigned int channels() const { + return image_channels; + } /// bits per pixel - inline unsigned int bpp() const { return (image_channels * 8); } + inline unsigned int bpp() const { + return (image_channels * 8); + } /// set image data to zero void clear(); |