Sha256: 9988b43574f3f6f3893abc12a54f64a50fcb930134ad233a1411d34d4380c5fa

Contents?: true

Size: 905 Bytes

Versions: 47

Compression:

Stored size: 905 Bytes

Contents

#include "reflex/filter.h"


#include "reflex/exception.h"
#include "reflex/debug.h"


namespace Reflex
{


	struct Filter::Data
	{

		Shader shader;

	};// Filter::Data


	Filter::Filter ()
	{
	}

	Filter::Filter (const Shader& shader)
	{
		self->shader = shader;
	}

	Filter::~Filter ()
	{
	}

	void
	Filter::apply (Painter* painter, const Image& image) const
	{
		if (!self->shader)
			return;

		if (!painter || !image)
			argument_error(__FILE__, __LINE__);

		painter->set_shader(self->shader);
		painter->image(image);
	}

	void
	Filter::set_shader (const Shader& shader)
	{
		self->shader = shader;
	}

	Shader&
	Filter::shader ()
	{
		return self->shader;
	}

	const Shader&
	Filter::shader () const
	{
		return const_cast<Filter*>(this)->shader();
	}

	Filter::operator bool () const
	{
		return self->shader;
	}

	bool
	Filter::operator ! () const
	{
		return !operator bool();
	}


}// Reflex

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
reflexion-0.1.20 src/filter.cpp
reflexion-0.1.19 src/filter.cpp
reflexion-0.1.17 src/filter.cpp
reflexion-0.1.16 src/filter.cpp
reflexion-0.1.15 src/filter.cpp
reflexion-0.1.14 src/filter.cpp
reflexion-0.1.13 src/filter.cpp