openscenegraph
ColorMatrix
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
12*/
13
14#ifndef OSG_COLORMATRIX
15#define OSG_COLORMATRIX 1
16
17#include <osg/Matrix>
18#include <osg/StateAttribute>
19
20namespace osg {
21
24{
25 public :
26
28
30 ColorMatrix(const ColorMatrix& cm,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
31 StateAttribute(cm,copyop),
32 _matrix(cm._matrix) {}
33
35
37 virtual int compare(const StateAttribute& sa) const
38 {
39 // Check for equal types, then create the rhs variable
40 // used by the COMPARE_StateAttribute_Parameter macros below.
42
43 // Compare each parameter in turn against the rhs.
45
46 return 0; // Passed all the above comparison macros, so must be equal.
47 }
48
50 inline void setMatrix(const Matrix& matrix) { _matrix = matrix; }
51
53 inline Matrix& getMatrix() { return _matrix; }
54
56 inline const Matrix& getMatrix() const { return _matrix; }
57
59 virtual void apply(State& state) const;
60
61 protected:
62
63 virtual ~ColorMatrix( void );
64
66
67};
68
69}
70
71
72#endif
#define COMPARE_StateAttribute_Parameter(parameter)
Definition StateAttribute:69
#define COMPARE_StateAttribute_Types(TYPE, rhs_attribute)
Definition StateAttribute:57
Definition ColorMatrix:24
virtual int compare(const StateAttribute &sa) const
Definition ColorMatrix:37
Matrix _matrix
Definition ColorMatrix:65
ColorMatrix(const ColorMatrix &cm, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
Definition ColorMatrix:30
virtual ~ColorMatrix(void)
void setMatrix(const Matrix &matrix)
Definition ColorMatrix:50
Matrix & getMatrix()
Definition ColorMatrix:53
const Matrix & getMatrix() const
Definition ColorMatrix:56
META_StateAttribute(osg, ColorMatrix, COLORMATRIX)
virtual void apply(State &state) const
Definition CopyOp:41
Definition Matrixd:27
Definition StateAttribute:77
Definition State:80
author: Julien Valentin 2017 (mp3butcher@hotmail.com)
Definition AlphaFunc:19
#define OSG_EXPORT
Definition osg/Export:39