-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ConstantColor class.
- Loading branch information
Showing
3 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright (C) Kevin Suffern 2000-2007. | ||
// This C++ code is for non-commercial purposes only. | ||
// This C++ code is licensed under the GNU General Public License Version 2. | ||
// See the file COPYING.txt for the full license. | ||
|
||
// Copyright notice for changes since the originally published version: | ||
// Copyright (C) Eduárd Mándy 2019-2021 | ||
// Though this C++ code was change in a large measure it still has the original copyright notice. | ||
// This C++ code is for non-commercial purposes only. | ||
// This C++ code is licensed under the GNU General Public License Version 2. | ||
// See the file COPYING.txt for the full license. | ||
|
||
#include "ConstantColor.h" | ||
|
||
RGBColor ConstantColor::get_color(const ShadeRec& sr) const { | ||
return color; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright (C) Kevin Suffern 2000-2007. | ||
// This C++ code is for non-commercial purposes only. | ||
// This C++ code is licensed under the GNU General Public License Version 2. | ||
// See the file COPYING.txt for the full license. | ||
|
||
// Copyright notice for changes since the originally published version: | ||
// Copyright (C) Eduárd Mándy 2019-2021 | ||
// Though this C++ code was change in a large measure it still has the original copyright notice. | ||
// This C++ code is for non-commercial purposes only. | ||
// This C++ code is licensed under the GNU General Public License Version 2. | ||
// See the file COPYING.txt for the full license. | ||
|
||
#ifndef __CONSTANTCOLOR__ | ||
#define __CONSTANTCOLOR__ | ||
|
||
#include "Texture.h" | ||
#include "../Utilities/RGBColor.h" | ||
|
||
class ConstantColor : public Texture { | ||
public: | ||
|
||
void set_color(const RGBColor& c); | ||
|
||
RGBColor get_color(const ShadeRec& sr) const override; | ||
|
||
private: | ||
|
||
RGBColor color = RGBColor::white; | ||
}; | ||
|
||
inline void ConstantColor::set_color(const RGBColor &c) { color = c; } | ||
|
||
#endif |