Changeset View
Changeset View
Standalone View
Standalone View
source/blender/compositor/operations/COM_SMAAOperation.cc
| Show All 15 Lines | |||||
| * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||||
| * | * | ||||
| * Contributor: IRIE Shinsuke | * Contributor: IRIE Shinsuke | ||||
| */ | */ | ||||
| #include "COM_SMAAOperation.h" | #include "COM_SMAAOperation.h" | ||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "COM_SMAAAreaTexture.h" | #include "COM_SMAAAreaTexture.h" | ||||
| #include "BKE_node.h" | |||||
| extern "C" { | extern "C" { | ||||
| #include "IMB_colormanagement.h" | #include "IMB_colormanagement.h" | ||||
| } | } | ||||
| namespace blender::compositor { | namespace blender::compositor { | ||||
| /* | /* | ||||
| ▲ Show 20 Lines • Show All 129 Lines • ▼ Show 20 Lines | |||||
| SMAAEdgeDetectionOperation::SMAAEdgeDetectionOperation() | SMAAEdgeDetectionOperation::SMAAEdgeDetectionOperation() | ||||
| { | { | ||||
| this->addInputSocket(DataType::Color); /* image */ | this->addInputSocket(DataType::Color); /* image */ | ||||
| this->addInputSocket(DataType::Value); /* depth, material ID, etc. */ | this->addInputSocket(DataType::Value); /* depth, material ID, etc. */ | ||||
| this->addOutputSocket(DataType::Color); | this->addOutputSocket(DataType::Color); | ||||
| this->flags.complex = true; | this->flags.complex = true; | ||||
| this->m_imageReader = nullptr; | this->m_imageReader = nullptr; | ||||
| this->m_valueReader = nullptr; | this->m_valueReader = nullptr; | ||||
| this->m_threshold = 0.1f; | this->setThreshold(CMP_DEFAULT_SMAA_THRESHOLD); | ||||
| this->m_contrast_limit = 2.0f; | this->setLocalContrastAdaptationFactor(CMP_DEFAULT_SMAA_CONTRAST_LIMIT); | ||||
| } | } | ||||
| void SMAAEdgeDetectionOperation::initExecution() | void SMAAEdgeDetectionOperation::initExecution() | ||||
| { | { | ||||
| this->m_imageReader = this->getInputSocketReader(0); | this->m_imageReader = this->getInputSocketReader(0); | ||||
| this->m_valueReader = this->getInputSocketReader(1); | this->m_valueReader = this->getInputSocketReader(1); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 113 Lines • ▼ Show 20 Lines | |||||
| /*-----------------------------------------------------------------------------*/ | /*-----------------------------------------------------------------------------*/ | ||||
| SMAABlendingWeightCalculationOperation::SMAABlendingWeightCalculationOperation() | SMAABlendingWeightCalculationOperation::SMAABlendingWeightCalculationOperation() | ||||
| { | { | ||||
| this->addInputSocket(DataType::Color); /* edges */ | this->addInputSocket(DataType::Color); /* edges */ | ||||
| this->addOutputSocket(DataType::Color); | this->addOutputSocket(DataType::Color); | ||||
| this->flags.complex = true; | this->flags.complex = true; | ||||
| this->m_imageReader = nullptr; | this->m_imageReader = nullptr; | ||||
| this->m_corner_rounding = 25; | this->setCornerRounding(CMP_DEFAULT_SMAA_CORNER_ROUNDING); | ||||
| } | } | ||||
| void *SMAABlendingWeightCalculationOperation::initializeTileData(rcti *rect) | void *SMAABlendingWeightCalculationOperation::initializeTileData(rcti *rect) | ||||
| { | { | ||||
| return getInputOperation(0)->initializeTileData(rect); | return getInputOperation(0)->initializeTileData(rect); | ||||
| } | } | ||||
| void SMAABlendingWeightCalculationOperation::initExecution() | void SMAABlendingWeightCalculationOperation::initExecution() | ||||
| ▲ Show 20 Lines • Show All 560 Lines • Show Last 20 Lines | |||||