Files
test/source/blender/compositor/operations/COM_CurveBaseOperation.cc
Aras Pranckevicius fec8461365 Cleanup: move BKE_colorband.h and BKE_colorcools.h to .hh
Also remove includes of those where not needed

Pull Request: https://projects.blender.org/blender/blender/pulls/116416
2023-12-21 10:10:53 +01:00

47 lines
1004 B
C++

/* SPDX-FileCopyrightText: 2011 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "COM_CurveBaseOperation.h"
#include "BKE_colortools.hh"
namespace blender::compositor {
CurveBaseOperation::CurveBaseOperation()
{
curve_mapping_ = nullptr;
flags_.can_be_constant = true;
}
CurveBaseOperation::~CurveBaseOperation()
{
if (curve_mapping_) {
BKE_curvemapping_free(curve_mapping_);
curve_mapping_ = nullptr;
}
}
void CurveBaseOperation::init_execution()
{
BKE_curvemapping_init(curve_mapping_);
}
void CurveBaseOperation::deinit_execution()
{
if (curve_mapping_) {
BKE_curvemapping_free(curve_mapping_);
curve_mapping_ = nullptr;
}
}
void CurveBaseOperation::set_curve_mapping(const CurveMapping *mapping)
{
/* duplicate the curve to avoid glitches while drawing, see bug #32374. */
if (curve_mapping_) {
BKE_curvemapping_free(curve_mapping_);
}
curve_mapping_ = BKE_curvemapping_copy(mapping);
}
} // namespace blender::compositor