Fixed stupid typo: dispill vs. despill

This commit is contained in:
2012-05-29 14:55:01 +00:00
parent b63a2be5c1
commit ec4f675055
9 changed files with 38 additions and 38 deletions

View File

@@ -340,8 +340,8 @@ set(SRC
operations/COM_KeyingOperation.h
operations/COM_KeyingScreenOperation.cpp
operations/COM_KeyingScreenOperation.h
operations/COM_KeyingDispillOperation.cpp
operations/COM_KeyingDispillOperation.h
operations/COM_KeyingDespillOperation.cpp
operations/COM_KeyingDespillOperation.h
operations/COM_ColorSpillOperation.cpp
operations/COM_ColorSpillOperation.h

View File

@@ -26,7 +26,7 @@
#include "COM_ExecutionSystem.h"
#include "COM_KeyingOperation.h"
#include "COM_KeyingDispillOperation.h"
#include "COM_KeyingDespillOperation.h"
#include "COM_SeparateChannelOperation.h"
#include "COM_CombineChannelsOperation.h"
@@ -135,18 +135,18 @@ OutputSocket *KeyingNode::setupDilateErode(ExecutionSystem *graph, OutputSocket
return dilateErodeOperation->getOutputSocket(0);
}
OutputSocket *KeyingNode::setupDispill(ExecutionSystem *graph, OutputSocket *dispillInput, InputSocket *inputScreen, float factor)
OutputSocket *KeyingNode::setupDespill(ExecutionSystem *graph, OutputSocket *despillInput, InputSocket *inputScreen, float factor)
{
KeyingDispillOperation *dispillOperation = new KeyingDispillOperation();
KeyingDespillOperation *despillOperation = new KeyingDespillOperation();
dispillOperation->setDispillFactor(factor);
despillOperation->setDespillFactor(factor);
addLink(graph, dispillInput, dispillOperation->getInputSocket(0));
inputScreen->relinkConnections(dispillOperation->getInputSocket(1), 1, graph);
addLink(graph, despillInput, despillOperation->getInputSocket(0));
inputScreen->relinkConnections(despillOperation->getInputSocket(1), 1, graph);
graph->addOperation(dispillOperation);
graph->addOperation(despillOperation);
return dispillOperation->getOutputSocket(0);
return despillOperation->getOutputSocket(0);
}
void KeyingNode::convertToOperations(ExecutionSystem *graph, CompositorContext *context)
@@ -198,9 +198,9 @@ void KeyingNode::convertToOperations(ExecutionSystem *graph, CompositorContext *
postprocessedImage = alphaOperation->getOutputSocket();
/* dispill output image */
if (keying_data->dispill_factor > 0.0f) {
postprocessedImage = setupDispill(graph, postprocessedImage, inputScreen, keying_data->dispill_factor);
/* despill output image */
if (keying_data->despill_factor > 0.0f) {
postprocessedImage = setupDespill(graph, postprocessedImage, inputScreen, keying_data->despill_factor);
}
/* connect result to output sockets */

View File

@@ -36,7 +36,7 @@ protected:
OutputSocket *setupPreBlur(ExecutionSystem *graph, InputSocket *inputImage, int size, OutputSocket **originalImage);
OutputSocket *setupPostBlur(ExecutionSystem *graph, OutputSocket *postBLurInput, int size);
OutputSocket *setupDilateErode(ExecutionSystem *graph, OutputSocket *dilateErodeInput, int distance);
OutputSocket *setupDispill(ExecutionSystem *graph, OutputSocket *dispillInput, InputSocket *inputSrceen, float factor);
OutputSocket *setupDespill(ExecutionSystem *graph, OutputSocket *despillInput, InputSocket *inputSrceen, float factor);
public:
KeyingNode(bNode *editorNode);
void convertToOperations(ExecutionSystem *graph, CompositorContext *context);

View File

@@ -21,7 +21,7 @@
* Sergey Sharybin
*/
#include "COM_KeyingDispillOperation.h"
#include "COM_KeyingDespillOperation.h"
#include "MEM_guardedalloc.h"
@@ -40,31 +40,31 @@ static int get_pixel_primary_channel(float *pixel)
return 2;
}
KeyingDispillOperation::KeyingDispillOperation(): NodeOperation()
KeyingDespillOperation::KeyingDespillOperation(): NodeOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->dispillFactor = 0.5f;
this->despillFactor = 0.5f;
this->pixelReader = NULL;
this->screenReader = NULL;
}
void KeyingDispillOperation::initExecution()
void KeyingDespillOperation::initExecution()
{
this->pixelReader = this->getInputSocketReader(0);
this->screenReader = this->getInputSocketReader(1);
}
void KeyingDispillOperation::deinitExecution()
void KeyingDespillOperation::deinitExecution()
{
this->pixelReader = NULL;
this->screenReader = NULL;
}
void KeyingDispillOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
void KeyingDespillOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
{
float pixelColor[4];
float screenColor[4];
@@ -83,7 +83,7 @@ void KeyingDispillOperation::executePixel(float *color, float x, float y, PixelS
color[2] = pixelColor[2];
color[3] = pixelColor[3];
if (this->dispillFactor * amount > 0) {
color[screen_primary_channel] = pixelColor[screen_primary_channel] - this->dispillFactor * amount;
if (this->despillFactor * amount > 0) {
color[screen_primary_channel] = pixelColor[screen_primary_channel] - this->despillFactor * amount;
}
}

View File

@@ -21,27 +21,27 @@
* Sergey Sharybin
*/
#ifndef _COM_KeyingDispillOperation_h
#define _COM_KeyingDispillOperation_h
#ifndef _COM_KeyingDespillOperation_h
#define _COM_KeyingDespillOperation_h
#include "COM_NodeOperation.h"
/**
* Class with implementation of keying dispill node
* Class with implementation of keying despill node
*/
class KeyingDispillOperation : public NodeOperation {
class KeyingDespillOperation : public NodeOperation {
protected:
SocketReader *pixelReader;
SocketReader *screenReader;
float dispillFactor;
float despillFactor;
public:
KeyingDispillOperation();
KeyingDespillOperation();
void initExecution();
void deinitExecution();
void setDispillFactor(float value) {this->dispillFactor = value;}
void setDespillFactor(float value) {this->despillFactor = value;}
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]);
};

View File

@@ -2417,7 +2417,7 @@ static void node_composit_buts_keying(uiLayout *layout, bContext *UNUSED(C), Poi
bNode *node= ptr->data;
uiItemR(layout, ptr, "blur_pre", 0, NULL, ICON_NONE);
uiItemR(layout, ptr, "dispill_factor", 0, NULL, ICON_NONE);
uiItemR(layout, ptr, "despill_factor", 0, NULL, ICON_NONE);
uiItemR(layout, ptr, "clip_black", 0, NULL, ICON_NONE);
uiItemR(layout, ptr, "clip_white", 0, NULL, ICON_NONE);
uiItemR(layout, ptr, "dilate_distance", 0, NULL, ICON_NONE);

View File

@@ -622,7 +622,7 @@ typedef struct NodeKeyingScreenData {
} NodeKeyingScreenData;
typedef struct NodeKeyingData {
float dispill_factor;
float despill_factor;
float clip_black, clip_white;
int dilate_distance;
int blur_pre, blur_post;

View File

@@ -3073,10 +3073,10 @@ static void def_cmp_keying(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "NodeKeyingData", "storage");
prop = RNA_def_property(srna, "dispill_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dispill_factor");
prop = RNA_def_property(srna, "despill_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "despill_factor");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Dispill", "");
RNA_def_property_ui_text(prop, "Despill", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
prop = RNA_def_property(srna, "clip_black", PROP_FLOAT, PROP_FACTOR);

View File

@@ -97,7 +97,7 @@ static void do_key(bNode *node, float *out, float *pixel, float *screen)
NodeKeyingData *data = node->storage;
float screen_balance = 0.5f;
float dispill_factor = data->dispill_factor;
float despill_factor = data->despill_factor;
float clip_black = data->clip_black;
float clip_white = data->clip_white;
@@ -109,7 +109,7 @@ static void do_key(bNode *node, float *out, float *pixel, float *screen)
if (primary_channel != screen_primary_channel) {
/* different main channel means pixel is on foreground,
* but screen color still need to be despilled from it */
despil_pixel(out, pixel, screen, dispill_factor);
despil_pixel(out, pixel, screen, despill_factor);
out[3] = 1.0f;
}
else if (saturation >= screen_saturation) {
@@ -122,7 +122,7 @@ static void do_key(bNode *node, float *out, float *pixel, float *screen)
else {
float distance;
despil_pixel(out, pixel, screen, dispill_factor);
despil_pixel(out, pixel, screen, despill_factor);
distance = 1.0f - saturation / screen_saturation;
@@ -196,7 +196,7 @@ static void node_composit_init_keying(bNodeTree *UNUSED(ntree), bNode* node, bNo
data = MEM_callocN(sizeof(NodeKeyingData), "node keying data");
data->dispill_factor = 1.0f;
data->despill_factor = 1.0f;
data->clip_black = 0.0f;
data->clip_white = 1.0f;