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.3 src/filter.cpp
reflexion-0.2.1 src/filter.cpp
reflexion-0.2 src/filter.cpp
reflexion-0.1.57 src/filter.cpp
reflexion-0.1.56 src/filter.cpp
reflexion-0.1.55 src/filter.cpp
reflexion-0.1.54 src/filter.cpp
reflexion-0.1.53 src/filter.cpp
reflexion-0.1.52 src/filter.cpp
reflexion-0.1.51 src/filter.cpp
reflexion-0.1.50 src/filter.cpp
reflexion-0.1.49 src/filter.cpp
reflexion-0.1.48 src/filter.cpp
reflexion-0.1.47 src/filter.cpp
reflexion-0.1.46 src/filter.cpp
reflexion-0.1.45 src/filter.cpp
reflexion-0.1.44 src/filter.cpp
reflexion-0.1.43 src/filter.cpp
reflexion-0.1.42 src/filter.cpp
reflexion-0.1.41 src/filter.cpp