Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/image.h')
-rw-r--r--src/render/image.h38
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();