mirror of
https://github.com/vonhyou/ray-tracer-comp371.git
synced 2025-06-08 07:22:01 +00:00
make getters const
This commit is contained in:
parent
94f1898b51
commit
43a8204032
2 changed files with 7 additions and 7 deletions
|
@ -10,13 +10,13 @@ void Output::write() {
|
|||
for (unsigned int x = 0; x < width; ++x)
|
||||
fout << (char)(255.0f * red[y * width + x])
|
||||
<< (char)(255.0f * green[y * width + x])
|
||||
<< (char)(255.0f * blue[y * width + x]);
|
||||
<< (char)(255.0f * blue[y * height + x]);
|
||||
fout.close();
|
||||
}
|
||||
|
||||
float Output::r(int index) { return red.at(index); }
|
||||
float Output::g(int index) { return green.at(index); }
|
||||
float Output::b(int index) { return blue.at(index); }
|
||||
float Output::r(int index) const { return red.at(index); }
|
||||
float Output::g(int index) const { return green.at(index); }
|
||||
float Output::b(int index) const { return blue.at(index); }
|
||||
void Output::r(int index, float value) { red.at(index) = value; }
|
||||
void Output::g(int index, float value) { green.at(index) = value; }
|
||||
void Output::b(int index, float value) { blue.at(index) = value; }
|
||||
|
|
|
@ -27,11 +27,11 @@ private:
|
|||
|
||||
public:
|
||||
void r(int, float);
|
||||
float r(int);
|
||||
float r(int) const;
|
||||
void g(int, float);
|
||||
float g(int);
|
||||
float g(int) const;
|
||||
void b(int, float);
|
||||
float b(int);
|
||||
float b(int) const;
|
||||
};
|
||||
|
||||
#endif // !OUTPUT_H_
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue