2023-08-16 00:20:26 +10:00
|
|
|
/* SPDX-FileCopyrightText: 2011 Blender Authors
|
2023-05-31 16:19:06 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2012-10-24 08:36:10 +00:00
|
|
|
|
|
|
|
|
#include "COM_PixelateNode.h"
|
|
|
|
|
|
2020-03-19 09:33:03 +01:00
|
|
|
#include "COM_PixelateOperation.h"
|
2012-10-24 08:36:10 +00:00
|
|
|
|
2021-03-23 17:12:27 +01:00
|
|
|
namespace blender::compositor {
|
|
|
|
|
|
2021-10-13 23:01:15 +02:00
|
|
|
PixelateNode::PixelateNode(bNode *editor_node) : Node(editor_node)
|
2012-10-24 08:36:10 +00:00
|
|
|
{
|
2012-10-24 09:07:54 +00:00
|
|
|
/* pass */
|
2012-10-24 08:36:10 +00:00
|
|
|
}
|
|
|
|
|
|
2021-10-13 23:01:15 +02:00
|
|
|
void PixelateNode::convert_to_operations(NodeConverter &converter,
|
|
|
|
|
const CompositorContext & /*context*/) const
|
2012-10-24 08:36:10 +00:00
|
|
|
{
|
2024-01-18 11:30:55 +01:00
|
|
|
const bNode *editor_node = this->get_bnode();
|
|
|
|
|
|
2021-10-13 23:01:15 +02:00
|
|
|
NodeInput *input_socket = this->get_input_socket(0);
|
|
|
|
|
NodeOutput *output_socket = this->get_output_socket(0);
|
2012-10-24 09:07:54 +00:00
|
|
|
|
2024-01-18 11:30:55 +01:00
|
|
|
PixelateOperation *operation = new PixelateOperation();
|
2021-10-13 23:01:15 +02:00
|
|
|
converter.add_operation(operation);
|
2018-06-17 17:05:29 +02:00
|
|
|
|
2024-01-18 11:30:55 +01:00
|
|
|
operation->set_pixel_size(editor_node->custom1);
|
|
|
|
|
|
2021-10-13 23:01:15 +02:00
|
|
|
converter.map_input_socket(input_socket, operation->get_input_socket(0));
|
|
|
|
|
converter.map_output_socket(output_socket, operation->get_output_socket(0));
|
2012-10-24 08:36:10 +00:00
|
|
|
}
|
2021-03-23 17:12:27 +01:00
|
|
|
|
|
|
|
|
} // namespace blender::compositor
|