The last good commit wasf57e4c5b98. After this one more fix was committed, this one is preserved as well:67bd678887.
49 lines
1.0 KiB
C++
49 lines
1.0 KiB
C++
/* SPDX-FileCopyrightText: 2011 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
#pragma once
|
|
|
|
#include "COM_MultiThreadedOperation.h"
|
|
|
|
namespace blender::compositor {
|
|
|
|
class BoxMaskOperation : public MultiThreadedOperation {
|
|
private:
|
|
using MaskFunc = std::function<float(bool is_inside, const float *mask, const float *value)>;
|
|
|
|
float sine_;
|
|
float cosine_;
|
|
float aspect_ratio_;
|
|
int mask_type_;
|
|
|
|
const NodeBoxMask *data_;
|
|
|
|
public:
|
|
BoxMaskOperation();
|
|
|
|
void init_execution() override;
|
|
|
|
void set_data(const NodeBoxMask *data)
|
|
{
|
|
data_ = data;
|
|
}
|
|
|
|
void set_mask_type(int mask_type)
|
|
{
|
|
mask_type_ = mask_type;
|
|
}
|
|
|
|
void update_memory_buffer_partial(MemoryBuffer *output,
|
|
const rcti &area,
|
|
Span<MemoryBuffer *> inputs) override;
|
|
|
|
private:
|
|
void apply_mask(MemoryBuffer *output,
|
|
const rcti &area,
|
|
Span<MemoryBuffer *> inputs,
|
|
MaskFunc mask_func);
|
|
};
|
|
|
|
} // namespace blender::compositor
|