6#include "./framebuffer.h"
10FrameBufferBase::FrameBufferBase(
Color3i* array,
int n_pixels)
11 : color_array_(array), n_color_array_(n_pixels) {}
13FrameBufferBase::~FrameBufferBase() {}
15void FrameBufferBase::Set(
int i,
const Color3i& c) {
18void FrameBufferBase::Set(
int i,
int length,
const Color3i& color) {
19 for (
int j = 0; j < length; ++j) {
23void FrameBufferBase::FillColor(
const Color3i& color) {
24 for (
int i = 0; i < n_color_array_; ++i) {
25 color_array_[i] = color;
28void FrameBufferBase::ApplyBlendSubtract(
const Color3i& color) {
29 for (
int i = 0; i < n_color_array_; ++i) {
30 color_array_[i].Sub(color);
33void FrameBufferBase::ApplyBlendAdd(
const Color3i& color) {
34 for (
int i = 0; i < n_color_array_; ++i) {
35 color_array_[i].Add(color);
38void FrameBufferBase::ApplyBlendMultiply(
const Color3i& color) {
39 for (
int i = 0; i < n_color_array_; ++i) {
40 color_array_[i].Mul(color);
43Color3i* FrameBufferBase::GetIterator(
int i) {
44 return color_array_ + i;
47int FrameBufferBase::length()
const {
return n_color_array_; }
49FrameBuffer::FrameBuffer(
int n_pixels)
54FrameBuffer::~FrameBuffer() {