Sha256: f439c5d45c9aa81ce9a42b416efdbacb352aa4dc60f05564a7b39fa0631beabb

Contents?: true

Size: 1.1 KB

Versions: 39

Compression:

Stored size: 1.1 KB

Contents

// -*- c++ -*-
#pragma once
#ifndef __RAYS_BITMAP_H__
#define __RAYS_BITMAP_H__


#include <xot/pimpl.h>
#include <rays/defs.h>
#include <rays/color_space.h>
#include <rays/font.h>


namespace Rays
{


	class Bitmap
	{

		typedef Bitmap This;

		public:

			Bitmap ();

			Bitmap (
				int width, int height, const ColorSpace& cs = RGBA,
				const void* pixels = NULL);

			~Bitmap ();

			Bitmap dup () const;

			int width () const;

			int height () const;

			const ColorSpace& color_space () const;

			int pitch () const;

			size_t size () const;

			      void* pixels ();

			const void* pixels () const;

			template <typename T>       T* at (int x, int y);

			template <typename T> const T* at (int x, int y) const;

			operator bool () const;

			bool operator ! () const;

			struct Data;

			Xot::PSharedImpl<Data> self;

	};// Bitmap


	template <typename T> T*
	Bitmap::at (int x, int y)
	{
		return (T*) (((char*) pixels()) + pitch() * y + x * color_space().Bpp());
	}

	template <typename T> const T*
	Bitmap::at (int x, int y) const
	{
		return const_cast<This*>(this)->at<T>(x, y);
	}


}// Rays


#endif//EOH

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
rays-0.1.31 include/rays/bitmap.h
rays-0.1.30 include/rays/bitmap.h
rays-0.1.29 include/rays/bitmap.h
rays-0.1.28 include/rays/bitmap.h
rays-0.1.27 include/rays/bitmap.h
rays-0.1.26 include/rays/bitmap.h
rays-0.1.25 include/rays/bitmap.h
rays-0.1.24 include/rays/bitmap.h
rays-0.1.23 include/rays/bitmap.h
rays-0.1.22 include/rays/bitmap.h
rays-0.1.21 include/rays/bitmap.h
rays-0.1.20 include/rays/bitmap.h
rays-0.1.19 include/rays/bitmap.h
rays-0.1.18 include/rays/bitmap.h
rays-0.1.17 include/rays/bitmap.h
rays-0.1.16 include/rays/bitmap.h
rays-0.1.15 include/rays/bitmap.h
rays-0.1.14 include/rays/bitmap.h
rays-0.1.13 include/rays/bitmap.h