From f030154fe727e25a2afe1f78b3998c2d2dba95e4 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 18 Aug 2009 09:24:15 +0000 Subject: astyle cleanup, corrects not loading of material textures --- src/render/image.h | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) (limited to 'src/render/image.h') 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 -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(); -- cgit v1.2.3