Cleanup: Renamed compositor executePixel functions and their 'read' wrappers in SocketReader.
Distinguish the 3 different methods for acquiring pixel color values (executePixel, executePixelSampled, executePixelFiltered). This makes it easier to keep track of the different sampling methods (and works nicer with IDEs that do code parsing). Differential Revision: http://developer.blender.org/D7
This commit is contained in:
@@ -63,7 +63,7 @@ protected:
|
|||||||
* @param y the y-coordinate of the pixel to calculate in image space
|
* @param y the y-coordinate of the pixel to calculate in image space
|
||||||
* @param inputBuffers chunks that can be read by their ReadBufferOperation.
|
* @param inputBuffers chunks that can be read by their ReadBufferOperation.
|
||||||
*/
|
*/
|
||||||
virtual void executePixel(float output[4], float x, float y, PixelSampler sampler) {}
|
virtual void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief calculate a single pixel
|
* @brief calculate a single pixel
|
||||||
@@ -75,7 +75,7 @@ protected:
|
|||||||
* @param chunkData chunk specific data a during execution time.
|
* @param chunkData chunk specific data a during execution time.
|
||||||
*/
|
*/
|
||||||
virtual void executePixel(float output[4], int x, int y, void *chunkData) {
|
virtual void executePixel(float output[4], int x, int y, void *chunkData) {
|
||||||
executePixel(output, x, y, COM_PS_NEAREST);
|
executePixelSampled(output, x, y, COM_PS_NEAREST);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -88,17 +88,17 @@ protected:
|
|||||||
* @param dy
|
* @param dy
|
||||||
* @param inputBuffers chunks that can be read by their ReadBufferOperation.
|
* @param inputBuffers chunks that can be read by their ReadBufferOperation.
|
||||||
*/
|
*/
|
||||||
virtual void executePixel(float output[4], float x, float y, float dx, float dy, PixelSampler sampler) {}
|
virtual void executePixelFiltered(float output[4], float x, float y, float dx, float dy, PixelSampler sampler) {}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
inline void read(float result[4], float x, float y, PixelSampler sampler) {
|
inline void readSampled(float result[4], float x, float y, PixelSampler sampler) {
|
||||||
executePixel(result, x, y, sampler);
|
executePixelSampled(result, x, y, sampler);
|
||||||
}
|
}
|
||||||
inline void read(float result[4], int x, int y, void *chunkData) {
|
inline void read(float result[4], int x, int y, void *chunkData) {
|
||||||
executePixel(result, x, y, chunkData);
|
executePixel(result, x, y, chunkData);
|
||||||
}
|
}
|
||||||
inline void read(float result[4], float x, float y, float dx, float dy, PixelSampler sampler) {
|
inline void readFiltered(float result[4], float x, float y, float dx, float dy, PixelSampler sampler) {
|
||||||
executePixel(result, x, y, dx, dy, sampler);
|
executePixelFiltered(result, x, y, dx, dy, sampler);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void *initializeTileData(rcti *rect) { return 0; }
|
virtual void *initializeTileData(rcti *rect) { return 0; }
|
||||||
|
|||||||
@@ -27,15 +27,15 @@ AlphaOverKeyOperation::AlphaOverKeyOperation() : MixBaseOperation()
|
|||||||
/* pass */
|
/* pass */
|
||||||
}
|
}
|
||||||
|
|
||||||
void AlphaOverKeyOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void AlphaOverKeyOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor1[4];
|
float inputColor1[4];
|
||||||
float inputOverColor[4];
|
float inputOverColor[4];
|
||||||
float value[4];
|
float value[4];
|
||||||
|
|
||||||
this->m_inputValueOperation->read(value, x, y, sampler);
|
this->m_inputValueOperation->readSampled(value, x, y, sampler);
|
||||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
|
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
|
||||||
this->m_inputColor2Operation->read(inputOverColor, x, y, sampler);
|
this->m_inputColor2Operation->readSampled(inputOverColor, x, y, sampler);
|
||||||
|
|
||||||
if (inputOverColor[3] <= 0.0f) {
|
if (inputOverColor[3] <= 0.0f) {
|
||||||
copy_v4_v4(output, inputColor1);
|
copy_v4_v4(output, inputColor1);
|
||||||
|
|||||||
@@ -39,6 +39,6 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -27,15 +27,15 @@ AlphaOverMixedOperation::AlphaOverMixedOperation() : MixBaseOperation()
|
|||||||
this->m_x = 0.0f;
|
this->m_x = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AlphaOverMixedOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void AlphaOverMixedOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor1[4];
|
float inputColor1[4];
|
||||||
float inputOverColor[4];
|
float inputOverColor[4];
|
||||||
float value[4];
|
float value[4];
|
||||||
|
|
||||||
this->m_inputValueOperation->read(value, x, y, sampler);
|
this->m_inputValueOperation->readSampled(value, x, y, sampler);
|
||||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
|
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
|
||||||
this->m_inputColor2Operation->read(inputOverColor, x, y, sampler);
|
this->m_inputColor2Operation->readSampled(inputOverColor, x, y, sampler);
|
||||||
|
|
||||||
if (inputOverColor[3] <= 0.0f) {
|
if (inputOverColor[3] <= 0.0f) {
|
||||||
copy_v4_v4(output, inputColor1);
|
copy_v4_v4(output, inputColor1);
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
void setX(float x) { this->m_x = x; }
|
void setX(float x) { this->m_x = x; }
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -27,15 +27,15 @@ AlphaOverPremultiplyOperation::AlphaOverPremultiplyOperation() : MixBaseOperatio
|
|||||||
/* pass */
|
/* pass */
|
||||||
}
|
}
|
||||||
|
|
||||||
void AlphaOverPremultiplyOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void AlphaOverPremultiplyOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor1[4];
|
float inputColor1[4];
|
||||||
float inputOverColor[4];
|
float inputOverColor[4];
|
||||||
float value[4];
|
float value[4];
|
||||||
|
|
||||||
this->m_inputValueOperation->read(value, x, y, sampler);
|
this->m_inputValueOperation->readSampled(value, x, y, sampler);
|
||||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
|
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
|
||||||
this->m_inputColor2Operation->read(inputOverColor, x, y, sampler);
|
this->m_inputColor2Operation->readSampled(inputOverColor, x, y, sampler);
|
||||||
|
|
||||||
/* Zero alpha values should still permit an add of RGB data */
|
/* Zero alpha values should still permit an add of RGB data */
|
||||||
if (inputOverColor[3] < 0.0f) {
|
if (inputOverColor[3] < 0.0f) {
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ void BlurBaseOperation::updateSize()
|
|||||||
{
|
{
|
||||||
if (!this->m_sizeavailable) {
|
if (!this->m_sizeavailable) {
|
||||||
float result[4];
|
float result[4];
|
||||||
this->getInputSocketReader(1)->read(result, 0, 0, COM_PS_NEAREST);
|
this->getInputSocketReader(1)->readSampled(result, 0, 0, COM_PS_NEAREST);
|
||||||
this->m_size = result[0];
|
this->m_size = result[0];
|
||||||
this->m_sizeavailable = true;
|
this->m_sizeavailable = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ void BokehBlurOperation::executePixel(float output[4], int x, int y, void *data)
|
|||||||
float tempBoundingBox[4];
|
float tempBoundingBox[4];
|
||||||
float bokeh[4];
|
float bokeh[4];
|
||||||
|
|
||||||
this->m_inputBoundingBoxReader->read(tempBoundingBox, x, y, COM_PS_NEAREST);
|
this->m_inputBoundingBoxReader->readSampled(tempBoundingBox, x, y, COM_PS_NEAREST);
|
||||||
if (tempBoundingBox[0] > 0.0f) {
|
if (tempBoundingBox[0] > 0.0f) {
|
||||||
float multiplier_accum[4] = {0.0f, 0.0f, 0.0f, 0.0f};
|
float multiplier_accum[4] = {0.0f, 0.0f, 0.0f, 0.0f};
|
||||||
MemoryBuffer *inputBuffer = (MemoryBuffer *)data;
|
MemoryBuffer *inputBuffer = (MemoryBuffer *)data;
|
||||||
@@ -93,7 +93,7 @@ void BokehBlurOperation::executePixel(float output[4], int x, int y, void *data)
|
|||||||
zero_v4(color_accum);
|
zero_v4(color_accum);
|
||||||
|
|
||||||
if (pixelSize < 2) {
|
if (pixelSize < 2) {
|
||||||
this->m_inputProgram->read(color_accum, x, y, COM_PS_NEAREST);
|
this->m_inputProgram->readSampled(color_accum, x, y, COM_PS_NEAREST);
|
||||||
multiplier_accum[0] = 1.0f;
|
multiplier_accum[0] = 1.0f;
|
||||||
multiplier_accum[1] = 1.0f;
|
multiplier_accum[1] = 1.0f;
|
||||||
multiplier_accum[2] = 1.0f;
|
multiplier_accum[2] = 1.0f;
|
||||||
@@ -118,7 +118,7 @@ void BokehBlurOperation::executePixel(float output[4], int x, int y, void *data)
|
|||||||
for (int nx = minx; nx < maxx; nx += step) {
|
for (int nx = minx; nx < maxx; nx += step) {
|
||||||
float u = this->m_bokehMidX - (nx - x) * m;
|
float u = this->m_bokehMidX - (nx - x) * m;
|
||||||
float v = this->m_bokehMidY - (ny - y) * m;
|
float v = this->m_bokehMidY - (ny - y) * m;
|
||||||
this->m_inputBokehProgram->read(bokeh, u, v, COM_PS_NEAREST);
|
this->m_inputBokehProgram->readSampled(bokeh, u, v, COM_PS_NEAREST);
|
||||||
madd_v4_v4v4(color_accum, bokeh, &buffer[bufferindex]);
|
madd_v4_v4v4(color_accum, bokeh, &buffer[bufferindex]);
|
||||||
add_v4_v4(multiplier_accum, bokeh);
|
add_v4_v4(multiplier_accum, bokeh);
|
||||||
bufferindex += offsetadd;
|
bufferindex += offsetadd;
|
||||||
@@ -130,7 +130,7 @@ void BokehBlurOperation::executePixel(float output[4], int x, int y, void *data)
|
|||||||
output[3] = color_accum[3] * (1.0f / multiplier_accum[3]);
|
output[3] = color_accum[3] * (1.0f / multiplier_accum[3]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this->m_inputProgram->read(output, x, y, COM_PS_NEAREST);
|
this->m_inputProgram->readSampled(output, x, y, COM_PS_NEAREST);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,7 +220,7 @@ void BokehBlurOperation::updateSize()
|
|||||||
{
|
{
|
||||||
if (!this->m_sizeavailable) {
|
if (!this->m_sizeavailable) {
|
||||||
float result[4];
|
float result[4];
|
||||||
this->getInputSocketReader(3)->read(result, 0, 0, COM_PS_NEAREST);
|
this->getInputSocketReader(3)->readSampled(result, 0, 0, COM_PS_NEAREST);
|
||||||
this->m_size = result[0];
|
this->m_size = result[0];
|
||||||
CLAMP(this->m_size, 0.0f, 10.0f);
|
CLAMP(this->m_size, 0.0f, 10.0f);
|
||||||
this->m_sizeavailable = true;
|
this->m_sizeavailable = true;
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ float BokehImageOperation::isInsideBokeh(float distance, float x, float y)
|
|||||||
}
|
}
|
||||||
return insideBokeh;
|
return insideBokeh;
|
||||||
}
|
}
|
||||||
void BokehImageOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void BokehImageOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float shift = this->m_data->lensshift;
|
float shift = this->m_data->lensshift;
|
||||||
float shift2 = shift / 2.0f;
|
float shift2 = shift / 2.0f;
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief the inner loop of this program
|
* @brief the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initialize the execution
|
* @brief Initialize the execution
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ void BoxMaskOperation::initExecution()
|
|||||||
this->m_aspectRatio = ((float)this->getWidth()) / this->getHeight();
|
this->m_aspectRatio = ((float)this->getWidth()) / this->getHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BoxMaskOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void BoxMaskOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputMask[4];
|
float inputMask[4];
|
||||||
float inputValue[4];
|
float inputValue[4];
|
||||||
@@ -57,8 +57,8 @@ void BoxMaskOperation::executePixel(float output[4], float x, float y, PixelSamp
|
|||||||
rx = this->m_data->x + (this->m_cosine * dx + this->m_sine * dy);
|
rx = this->m_data->x + (this->m_cosine * dx + this->m_sine * dy);
|
||||||
ry = this->m_data->y + (-this->m_sine * dx + this->m_cosine * dy);
|
ry = this->m_data->y + (-this->m_sine * dx + this->m_cosine * dy);
|
||||||
|
|
||||||
this->m_inputMask->read(inputMask, x, y, sampler);
|
this->m_inputMask->readSampled(inputMask, x, y, sampler);
|
||||||
this->m_inputValue->read(inputValue, x, y, sampler);
|
this->m_inputValue->readSampled(inputValue, x, y, sampler);
|
||||||
|
|
||||||
float halfHeight = this->m_data->height / 2.0f;
|
float halfHeight = this->m_data->height / 2.0f;
|
||||||
float halfWidth = this->m_data->width / 2.0f;
|
float halfWidth = this->m_data->width / 2.0f;
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the execution
|
* Initialize the execution
|
||||||
|
|||||||
@@ -37,15 +37,15 @@ void BrightnessOperation::initExecution()
|
|||||||
this->m_inputContrastProgram = this->getInputSocketReader(2);
|
this->m_inputContrastProgram = this->getInputSocketReader(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrightnessOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void BrightnessOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputValue[4];
|
float inputValue[4];
|
||||||
float a, b;
|
float a, b;
|
||||||
float inputBrightness[4];
|
float inputBrightness[4];
|
||||||
float inputContrast[4];
|
float inputContrast[4];
|
||||||
this->m_inputProgram->read(inputValue, x, y, sampler);
|
this->m_inputProgram->readSampled(inputValue, x, y, sampler);
|
||||||
this->m_inputBrightnessProgram->read(inputBrightness, x, y, sampler);
|
this->m_inputBrightnessProgram->readSampled(inputBrightness, x, y, sampler);
|
||||||
this->m_inputContrastProgram->read(inputContrast, x, y, sampler);
|
this->m_inputContrastProgram->readSampled(inputContrast, x, y, sampler);
|
||||||
float brightness = inputBrightness[0];
|
float brightness = inputBrightness[0];
|
||||||
float contrast = inputContrast[0];
|
float contrast = inputContrast[0];
|
||||||
brightness /= 100.0f;
|
brightness /= 100.0f;
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the execution
|
* Initialize the execution
|
||||||
|
|||||||
@@ -39,11 +39,11 @@ void ChangeHSVOperation::deinitExecution()
|
|||||||
this->m_inputOperation = NULL;
|
this->m_inputOperation = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChangeHSVOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void ChangeHSVOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor1[4];
|
float inputColor1[4];
|
||||||
|
|
||||||
this->m_inputOperation->read(inputColor1, x, y, sampler);
|
this->m_inputOperation->readSampled(inputColor1, x, y, sampler);
|
||||||
|
|
||||||
output[0] = inputColor1[0] + (this->m_hue - 0.5f);
|
output[0] = inputColor1[0] + (this->m_hue - 0.5f);
|
||||||
if (output[0] > 1.0f) output[0] -= 1.0f;
|
if (output[0] > 1.0f) output[0] -= 1.0f;
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
void setHue(float hue) { this->m_hue = hue; }
|
void setHue(float hue) { this->m_hue = hue; }
|
||||||
void setSaturation(float saturation) { this->m_saturation = saturation; }
|
void setSaturation(float saturation) { this->m_saturation = saturation; }
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ void ChannelMatteOperation::deinitExecution()
|
|||||||
this->m_inputImageProgram = NULL;
|
this->m_inputImageProgram = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChannelMatteOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void ChannelMatteOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inColor[4];
|
float inColor[4];
|
||||||
float alpha;
|
float alpha;
|
||||||
@@ -97,7 +97,7 @@ void ChannelMatteOperation::executePixel(float output[4], float x, float y, Pixe
|
|||||||
const float limit_min = this->m_limit_min;
|
const float limit_min = this->m_limit_min;
|
||||||
const float limit_range = this->m_limit_range;
|
const float limit_range = this->m_limit_range;
|
||||||
|
|
||||||
this->m_inputImageProgram->read(inColor, x, y, sampler);
|
this->m_inputImageProgram->readSampled(inColor, x, y, sampler);
|
||||||
|
|
||||||
/* matte operation */
|
/* matte operation */
|
||||||
alpha = inColor[this->m_ids[0]] - max(inColor[this->m_ids[1]], inColor[this->m_ids[2]]);
|
alpha = inColor[this->m_ids[0]] - max(inColor[this->m_ids[1]], inColor[this->m_ids[2]]);
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
void initExecution();
|
void initExecution();
|
||||||
void deinitExecution();
|
void deinitExecution();
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ void ChromaMatteOperation::deinitExecution()
|
|||||||
this->m_inputKeyProgram = NULL;
|
this->m_inputKeyProgram = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChromaMatteOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void ChromaMatteOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inKey[4];
|
float inKey[4];
|
||||||
float inImage[4];
|
float inImage[4];
|
||||||
@@ -57,8 +57,8 @@ void ChromaMatteOperation::executePixel(float output[4], float x, float y, Pixel
|
|||||||
float theta, beta;
|
float theta, beta;
|
||||||
float kfg;
|
float kfg;
|
||||||
|
|
||||||
this->m_inputKeyProgram->read(inKey, x, y, sampler);
|
this->m_inputKeyProgram->readSampled(inKey, x, y, sampler);
|
||||||
this->m_inputImageProgram->read(inImage, x, y, sampler);
|
this->m_inputImageProgram->readSampled(inImage, x, y, sampler);
|
||||||
|
|
||||||
/* store matte(alpha) value in [0] to go with
|
/* store matte(alpha) value in [0] to go with
|
||||||
* COM_SetAlphaOperation and the Value output
|
* COM_SetAlphaOperation and the Value output
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
void initExecution();
|
void initExecution();
|
||||||
void deinitExecution();
|
void deinitExecution();
|
||||||
|
|||||||
@@ -49,13 +49,13 @@ void ColorBalanceASCCDLOperation::initExecution()
|
|||||||
this->m_inputColorOperation = this->getInputSocketReader(1);
|
this->m_inputColorOperation = this->getInputSocketReader(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColorBalanceASCCDLOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void ColorBalanceASCCDLOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor[4];
|
float inputColor[4];
|
||||||
float value[4];
|
float value[4];
|
||||||
|
|
||||||
this->m_inputValueOperation->read(value, x, y, sampler);
|
this->m_inputValueOperation->readSampled(value, x, y, sampler);
|
||||||
this->m_inputColorOperation->read(inputColor, x, y, sampler);
|
this->m_inputColorOperation->readSampled(inputColor, x, y, sampler);
|
||||||
|
|
||||||
float fac = value[0];
|
float fac = value[0];
|
||||||
fac = min(1.0f, fac);
|
fac = min(1.0f, fac);
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the execution
|
* Initialize the execution
|
||||||
|
|||||||
@@ -54,13 +54,13 @@ void ColorBalanceLGGOperation::initExecution()
|
|||||||
this->m_inputColorOperation = this->getInputSocketReader(1);
|
this->m_inputColorOperation = this->getInputSocketReader(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColorBalanceLGGOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void ColorBalanceLGGOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor[4];
|
float inputColor[4];
|
||||||
float value[4];
|
float value[4];
|
||||||
|
|
||||||
this->m_inputValueOperation->read(value, x, y, sampler);
|
this->m_inputValueOperation->readSampled(value, x, y, sampler);
|
||||||
this->m_inputColorOperation->read(inputColor, x, y, sampler);
|
this->m_inputColorOperation->readSampled(inputColor, x, y, sampler);
|
||||||
|
|
||||||
float fac = value[0];
|
float fac = value[0];
|
||||||
fac = min(1.0f, fac);
|
fac = min(1.0f, fac);
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the execution
|
* Initialize the execution
|
||||||
|
|||||||
@@ -40,12 +40,12 @@ void ColorCorrectionOperation::initExecution()
|
|||||||
this->m_inputMask = this->getInputSocketReader(1);
|
this->m_inputMask = this->getInputSocketReader(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColorCorrectionOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void ColorCorrectionOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputImageColor[4];
|
float inputImageColor[4];
|
||||||
float inputMask[4];
|
float inputMask[4];
|
||||||
this->m_inputImage->read(inputImageColor, x, y, sampler);
|
this->m_inputImage->readSampled(inputImageColor, x, y, sampler);
|
||||||
this->m_inputMask->read(inputMask, x, y, sampler);
|
this->m_inputMask->readSampled(inputMask, x, y, sampler);
|
||||||
|
|
||||||
float level = (inputImageColor[0] + inputImageColor[1] + inputImageColor[2]) / 3.0f;
|
float level = (inputImageColor[0] + inputImageColor[1] + inputImageColor[2]) / 3.0f;
|
||||||
float contrast = this->m_data->master.contrast;
|
float contrast = this->m_data->master.contrast;
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the execution
|
* Initialize the execution
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ void ColorCurveOperation::initExecution()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColorCurveOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void ColorCurveOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
CurveMapping *cumap = this->m_curveMapping;
|
CurveMapping *cumap = this->m_curveMapping;
|
||||||
|
|
||||||
@@ -70,15 +70,15 @@ void ColorCurveOperation::executePixel(float output[4], float x, float y, PixelS
|
|||||||
float white[4];
|
float white[4];
|
||||||
float bwmul[3];
|
float bwmul[3];
|
||||||
|
|
||||||
this->m_inputBlackProgram->read(black, x, y, sampler);
|
this->m_inputBlackProgram->readSampled(black, x, y, sampler);
|
||||||
this->m_inputWhiteProgram->read(white, x, y, sampler);
|
this->m_inputWhiteProgram->readSampled(white, x, y, sampler);
|
||||||
|
|
||||||
/* get our own local bwmul value,
|
/* get our own local bwmul value,
|
||||||
* since we can't be threadsafe and use cumap->bwmul & friends */
|
* since we can't be threadsafe and use cumap->bwmul & friends */
|
||||||
curvemapping_set_black_white_ex(black, white, bwmul);
|
curvemapping_set_black_white_ex(black, white, bwmul);
|
||||||
|
|
||||||
this->m_inputFacProgram->read(fac, x, y, sampler);
|
this->m_inputFacProgram->readSampled(fac, x, y, sampler);
|
||||||
this->m_inputImageProgram->read(image, x, y, sampler);
|
this->m_inputImageProgram->readSampled(image, x, y, sampler);
|
||||||
|
|
||||||
if (*fac >= 1.0f) {
|
if (*fac >= 1.0f) {
|
||||||
curvemapping_evaluate_premulRGBF_ex(cumap, output, image,
|
curvemapping_evaluate_premulRGBF_ex(cumap, output, image,
|
||||||
@@ -130,13 +130,13 @@ void ConstantLevelColorCurveOperation::initExecution()
|
|||||||
curvemapping_set_black_white(this->m_curveMapping, this->m_black, this->m_white);
|
curvemapping_set_black_white(this->m_curveMapping, this->m_black, this->m_white);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConstantLevelColorCurveOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void ConstantLevelColorCurveOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float fac[4];
|
float fac[4];
|
||||||
float image[4];
|
float image[4];
|
||||||
|
|
||||||
this->m_inputFacProgram->read(fac, x, y, sampler);
|
this->m_inputFacProgram->readSampled(fac, x, y, sampler);
|
||||||
this->m_inputImageProgram->read(image, x, y, sampler);
|
this->m_inputImageProgram->readSampled(image, x, y, sampler);
|
||||||
|
|
||||||
if (*fac >= 1.0f) {
|
if (*fac >= 1.0f) {
|
||||||
curvemapping_evaluate_premulRGBF(this->m_curveMapping, output, image);
|
curvemapping_evaluate_premulRGBF(this->m_curveMapping, output, image);
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the execution
|
* Initialize the execution
|
||||||
@@ -70,7 +70,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the execution
|
* Initialize the execution
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ void ColorMatteOperation::deinitExecution()
|
|||||||
this->m_inputKeyProgram = NULL;
|
this->m_inputKeyProgram = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColorMatteOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void ColorMatteOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inColor[4];
|
float inColor[4];
|
||||||
float inKey[4];
|
float inKey[4];
|
||||||
@@ -55,8 +55,8 @@ void ColorMatteOperation::executePixel(float output[4], float x, float y, PixelS
|
|||||||
|
|
||||||
float h_wrap;
|
float h_wrap;
|
||||||
|
|
||||||
this->m_inputImageProgram->read(inColor, x, y, sampler);
|
this->m_inputImageProgram->readSampled(inColor, x, y, sampler);
|
||||||
this->m_inputKeyProgram->read(inKey, x, y, sampler);
|
this->m_inputKeyProgram->readSampled(inKey, x, y, sampler);
|
||||||
|
|
||||||
|
|
||||||
/* store matte(alpha) value in [0] to go with
|
/* store matte(alpha) value in [0] to go with
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
void initExecution();
|
void initExecution();
|
||||||
void deinitExecution();
|
void deinitExecution();
|
||||||
|
|||||||
@@ -43,11 +43,11 @@ void ColorRampOperation::initExecution()
|
|||||||
this->m_inputProgram = this->getInputSocketReader(0);
|
this->m_inputProgram = this->getInputSocketReader(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColorRampOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void ColorRampOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float values[4];
|
float values[4];
|
||||||
|
|
||||||
this->m_inputProgram->read(values, x, y, sampler);
|
this->m_inputProgram->readSampled(values, x, y, sampler);
|
||||||
do_colorband(this->m_colorBand, values[0], output);
|
do_colorband(this->m_colorBand, values[0], output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the execution
|
* Initialize the execution
|
||||||
|
|||||||
@@ -84,12 +84,12 @@ void ColorSpillOperation::deinitExecution()
|
|||||||
this->m_inputFacReader = NULL;
|
this->m_inputFacReader = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColorSpillOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void ColorSpillOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float fac[4];
|
float fac[4];
|
||||||
float input[4];
|
float input[4];
|
||||||
this->m_inputFacReader->read(fac, x, y, sampler);
|
this->m_inputFacReader->readSampled(fac, x, y, sampler);
|
||||||
this->m_inputImageReader->read(input, x, y, sampler);
|
this->m_inputImageReader->readSampled(input, x, y, sampler);
|
||||||
float rfac = min(1.0f, fac[0]);
|
float rfac = min(1.0f, fac[0]);
|
||||||
float map = calculateMapValue(rfac, input);
|
float map = calculateMapValue(rfac, input);
|
||||||
if (map > 0.0f) {
|
if (map > 0.0f) {
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
void initExecution();
|
void initExecution();
|
||||||
void deinitExecution();
|
void deinitExecution();
|
||||||
|
|||||||
@@ -188,20 +188,20 @@ void CompositorOperation::executeRegion(rcti *rect, unsigned int tileNumber)
|
|||||||
for (x = x1; x < x2 && (!breaked); x++) {
|
for (x = x1; x < x2 && (!breaked); x++) {
|
||||||
int input_x = x + dx, input_y = y + dy;
|
int input_x = x + dx, input_y = y + dy;
|
||||||
|
|
||||||
this->m_imageInput->read(color, input_x, input_y, COM_PS_NEAREST);
|
this->m_imageInput->readSampled(color, input_x, input_y, COM_PS_NEAREST);
|
||||||
if (this->m_ignoreAlpha) {
|
if (this->m_ignoreAlpha) {
|
||||||
color[3] = 1.0f;
|
color[3] = 1.0f;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (this->m_alphaInput != NULL) {
|
if (this->m_alphaInput != NULL) {
|
||||||
this->m_alphaInput->read(&(color[3]), input_x, input_y, COM_PS_NEAREST);
|
this->m_alphaInput->readSampled(&(color[3]), input_x, input_y, COM_PS_NEAREST);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
copy_v4_v4(buffer + offset4, color);
|
copy_v4_v4(buffer + offset4, color);
|
||||||
|
|
||||||
if (this->m_depthInput != NULL) {
|
if (this->m_depthInput != NULL) {
|
||||||
this->m_depthInput->read(color, input_x, input_y, COM_PS_NEAREST);
|
this->m_depthInput->readSampled(color, input_x, input_y, COM_PS_NEAREST);
|
||||||
zbuffer[offset] = color[0];
|
zbuffer[offset] = color[0];
|
||||||
}
|
}
|
||||||
offset4 += COM_NUMBER_OF_CHANNELS;
|
offset4 += COM_NUMBER_OF_CHANNELS;
|
||||||
|
|||||||
@@ -38,10 +38,10 @@ void ConvertColorProfileOperation::initExecution()
|
|||||||
this->m_inputOperation = this->getInputSocketReader(0);
|
this->m_inputOperation = this->getInputSocketReader(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConvertColorProfileOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void ConvertColorProfileOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float color[4];
|
float color[4];
|
||||||
this->m_inputOperation->read(color, x, y, sampler);
|
this->m_inputOperation->readSampled(color, x, y, sampler);
|
||||||
IMB_buffer_float_from_float(output, color, 4, this->m_toProfile, this->m_fromProfile, this->m_predivided, 1, 1, 0, 0);
|
IMB_buffer_float_from_float(output, color, 4, this->m_toProfile, this->m_fromProfile, this->m_predivided, 1, 1, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the execution
|
* Initialize the execution
|
||||||
|
|||||||
@@ -72,12 +72,12 @@ void ConvertDepthToRadiusOperation::initExecution()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConvertDepthToRadiusOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void ConvertDepthToRadiusOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputValue[4];
|
float inputValue[4];
|
||||||
float z;
|
float z;
|
||||||
float radius;
|
float radius;
|
||||||
this->m_inputOperation->read(inputValue, x, y, sampler);
|
this->m_inputOperation->readSampled(inputValue, x, y, sampler);
|
||||||
z = inputValue[0];
|
z = inputValue[0];
|
||||||
if (z != 0.f) {
|
if (z != 0.f) {
|
||||||
float iZ = (1.f / z);
|
float iZ = (1.f / z);
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the execution
|
* Initialize the execution
|
||||||
|
|||||||
@@ -47,10 +47,10 @@ ConvertValueToColorOperation::ConvertValueToColorOperation() : ConvertBaseOperat
|
|||||||
this->addOutputSocket(COM_DT_COLOR);
|
this->addOutputSocket(COM_DT_COLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConvertValueToColorOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void ConvertValueToColorOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputValue[4];
|
float inputValue[4];
|
||||||
this->m_inputOperation->read(inputValue, x, y, sampler);
|
this->m_inputOperation->readSampled(inputValue, x, y, sampler);
|
||||||
output[0] = output[1] = output[2] = inputValue[0];
|
output[0] = output[1] = output[2] = inputValue[0];
|
||||||
output[3] = 1.0f;
|
output[3] = 1.0f;
|
||||||
}
|
}
|
||||||
@@ -64,10 +64,10 @@ ConvertColorToValueOperation::ConvertColorToValueOperation() : ConvertBaseOperat
|
|||||||
this->addOutputSocket(COM_DT_VALUE);
|
this->addOutputSocket(COM_DT_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConvertColorToValueOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void ConvertColorToValueOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor[4];
|
float inputColor[4];
|
||||||
this->m_inputOperation->read(inputColor, x, y, sampler);
|
this->m_inputOperation->readSampled(inputColor, x, y, sampler);
|
||||||
output[0] = (inputColor[0] + inputColor[1] + inputColor[2]) / 3.0f;
|
output[0] = (inputColor[0] + inputColor[1] + inputColor[2]) / 3.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,10 +80,10 @@ ConvertColorToBWOperation::ConvertColorToBWOperation() : ConvertBaseOperation()
|
|||||||
this->addOutputSocket(COM_DT_VALUE);
|
this->addOutputSocket(COM_DT_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConvertColorToBWOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void ConvertColorToBWOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor[4];
|
float inputColor[4];
|
||||||
this->m_inputOperation->read(inputColor, x, y, sampler);
|
this->m_inputOperation->readSampled(inputColor, x, y, sampler);
|
||||||
output[0] = rgb_to_bw(inputColor);
|
output[0] = rgb_to_bw(inputColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,9 +96,9 @@ ConvertColorToVectorOperation::ConvertColorToVectorOperation() : ConvertBaseOper
|
|||||||
this->addOutputSocket(COM_DT_VECTOR);
|
this->addOutputSocket(COM_DT_VECTOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConvertColorToVectorOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void ConvertColorToVectorOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
this->m_inputOperation->read(output, x, y, sampler);
|
this->m_inputOperation->readSampled(output, x, y, sampler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -110,10 +110,10 @@ ConvertValueToVectorOperation::ConvertValueToVectorOperation() : ConvertBaseOper
|
|||||||
this->addOutputSocket(COM_DT_VECTOR);
|
this->addOutputSocket(COM_DT_VECTOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConvertValueToVectorOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void ConvertValueToVectorOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float input[4];
|
float input[4];
|
||||||
this->m_inputOperation->read(input, x, y, sampler);
|
this->m_inputOperation->readSampled(input, x, y, sampler);
|
||||||
output[0] = input[0];
|
output[0] = input[0];
|
||||||
output[1] = input[0];
|
output[1] = input[0];
|
||||||
output[2] = input[0];
|
output[2] = input[0];
|
||||||
@@ -129,9 +129,9 @@ ConvertVectorToColorOperation::ConvertVectorToColorOperation() : ConvertBaseOper
|
|||||||
this->addOutputSocket(COM_DT_COLOR);
|
this->addOutputSocket(COM_DT_COLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConvertVectorToColorOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void ConvertVectorToColorOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
this->m_inputOperation->read(output, x, y, sampler);
|
this->m_inputOperation->readSampled(output, x, y, sampler);
|
||||||
output[3] = 1.0f;
|
output[3] = 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,10 +144,10 @@ ConvertVectorToValueOperation::ConvertVectorToValueOperation() : ConvertBaseOper
|
|||||||
this->addOutputSocket(COM_DT_VALUE);
|
this->addOutputSocket(COM_DT_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConvertVectorToValueOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void ConvertVectorToValueOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float input[4];
|
float input[4];
|
||||||
this->m_inputOperation->read(input, x, y, sampler);
|
this->m_inputOperation->readSampled(input, x, y, sampler);
|
||||||
output[0] = (input[0] + input[1] + input[2]) / 3.0f;
|
output[0] = (input[0] + input[1] + input[2]) / 3.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,12 +176,12 @@ void ConvertRGBToYCCOperation::setMode(int mode)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConvertRGBToYCCOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void ConvertRGBToYCCOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor[4];
|
float inputColor[4];
|
||||||
float color[3];
|
float color[3];
|
||||||
|
|
||||||
this->m_inputOperation->read(inputColor, x, y, sampler);
|
this->m_inputOperation->readSampled(inputColor, x, y, sampler);
|
||||||
rgb_to_ycc(inputColor[0], inputColor[1], inputColor[2], &color[0], &color[1], &color[2], this->m_mode);
|
rgb_to_ycc(inputColor[0], inputColor[1], inputColor[2], &color[0], &color[1], &color[2], this->m_mode);
|
||||||
|
|
||||||
/* divided by 255 to normalize for viewing in */
|
/* divided by 255 to normalize for viewing in */
|
||||||
@@ -214,10 +214,10 @@ void ConvertYCCToRGBOperation::setMode(int mode)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConvertYCCToRGBOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void ConvertYCCToRGBOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor[4];
|
float inputColor[4];
|
||||||
this->m_inputOperation->read(inputColor, x, y, sampler);
|
this->m_inputOperation->readSampled(inputColor, x, y, sampler);
|
||||||
|
|
||||||
/* need to un-normalize the data */
|
/* need to un-normalize the data */
|
||||||
/* R,G,B --> Y,Cb,Cr */
|
/* R,G,B --> Y,Cb,Cr */
|
||||||
@@ -236,10 +236,10 @@ ConvertRGBToYUVOperation::ConvertRGBToYUVOperation() : ConvertBaseOperation()
|
|||||||
this->addOutputSocket(COM_DT_COLOR);
|
this->addOutputSocket(COM_DT_COLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConvertRGBToYUVOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void ConvertRGBToYUVOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor[4];
|
float inputColor[4];
|
||||||
this->m_inputOperation->read(inputColor, x, y, sampler);
|
this->m_inputOperation->readSampled(inputColor, x, y, sampler);
|
||||||
rgb_to_yuv(inputColor[0], inputColor[1], inputColor[2], &output[0], &output[1], &output[2]);
|
rgb_to_yuv(inputColor[0], inputColor[1], inputColor[2], &output[0], &output[1], &output[2]);
|
||||||
output[3] = inputColor[3];
|
output[3] = inputColor[3];
|
||||||
}
|
}
|
||||||
@@ -253,10 +253,10 @@ ConvertYUVToRGBOperation::ConvertYUVToRGBOperation() : ConvertBaseOperation()
|
|||||||
this->addOutputSocket(COM_DT_COLOR);
|
this->addOutputSocket(COM_DT_COLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConvertYUVToRGBOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void ConvertYUVToRGBOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor[4];
|
float inputColor[4];
|
||||||
this->m_inputOperation->read(inputColor, x, y, sampler);
|
this->m_inputOperation->readSampled(inputColor, x, y, sampler);
|
||||||
yuv_to_rgb(inputColor[0], inputColor[1], inputColor[2], &output[0], &output[1], &output[2]);
|
yuv_to_rgb(inputColor[0], inputColor[1], inputColor[2], &output[0], &output[1], &output[2]);
|
||||||
output[3] = inputColor[3];
|
output[3] = inputColor[3];
|
||||||
}
|
}
|
||||||
@@ -270,10 +270,10 @@ ConvertRGBToHSVOperation::ConvertRGBToHSVOperation() : ConvertBaseOperation()
|
|||||||
this->addOutputSocket(COM_DT_COLOR);
|
this->addOutputSocket(COM_DT_COLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConvertRGBToHSVOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void ConvertRGBToHSVOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor[4];
|
float inputColor[4];
|
||||||
this->m_inputOperation->read(inputColor, x, y, sampler);
|
this->m_inputOperation->readSampled(inputColor, x, y, sampler);
|
||||||
rgb_to_hsv_v(inputColor, output);
|
rgb_to_hsv_v(inputColor, output);
|
||||||
output[3] = inputColor[3];
|
output[3] = inputColor[3];
|
||||||
}
|
}
|
||||||
@@ -287,10 +287,10 @@ ConvertHSVToRGBOperation::ConvertHSVToRGBOperation() : ConvertBaseOperation()
|
|||||||
this->addOutputSocket(COM_DT_COLOR);
|
this->addOutputSocket(COM_DT_COLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConvertHSVToRGBOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void ConvertHSVToRGBOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor[4];
|
float inputColor[4];
|
||||||
this->m_inputOperation->read(inputColor, x, y, sampler);
|
this->m_inputOperation->readSampled(inputColor, x, y, sampler);
|
||||||
hsv_to_rgb_v(inputColor, output);
|
hsv_to_rgb_v(inputColor, output);
|
||||||
output[3] = inputColor[3];
|
output[3] = inputColor[3];
|
||||||
}
|
}
|
||||||
@@ -304,12 +304,12 @@ ConvertPremulToStraightOperation::ConvertPremulToStraightOperation() : ConvertBa
|
|||||||
this->addOutputSocket(COM_DT_COLOR);
|
this->addOutputSocket(COM_DT_COLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConvertPremulToStraightOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void ConvertPremulToStraightOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputValue[4];
|
float inputValue[4];
|
||||||
float alpha;
|
float alpha;
|
||||||
|
|
||||||
this->m_inputOperation->read(inputValue, x, y, sampler);
|
this->m_inputOperation->readSampled(inputValue, x, y, sampler);
|
||||||
alpha = inputValue[3];
|
alpha = inputValue[3];
|
||||||
|
|
||||||
if (fabsf(alpha) < 1e-5f) {
|
if (fabsf(alpha) < 1e-5f) {
|
||||||
@@ -332,12 +332,12 @@ ConvertStraightToPremulOperation::ConvertStraightToPremulOperation() : ConvertBa
|
|||||||
this->addOutputSocket(COM_DT_COLOR);
|
this->addOutputSocket(COM_DT_COLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConvertStraightToPremulOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void ConvertStraightToPremulOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputValue[4];
|
float inputValue[4];
|
||||||
float alpha;
|
float alpha;
|
||||||
|
|
||||||
this->m_inputOperation->read(inputValue, x, y, sampler);
|
this->m_inputOperation->readSampled(inputValue, x, y, sampler);
|
||||||
alpha = inputValue[3];
|
alpha = inputValue[3];
|
||||||
|
|
||||||
mul_v3_v3fl(output, inputValue, alpha);
|
mul_v3_v3fl(output, inputValue, alpha);
|
||||||
@@ -366,10 +366,10 @@ void SeparateChannelOperation::deinitExecution()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SeparateChannelOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void SeparateChannelOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float input[4];
|
float input[4];
|
||||||
this->m_inputOperation->read(input, x, y, sampler);
|
this->m_inputOperation->readSampled(input, x, y, sampler);
|
||||||
output[0] = input[this->m_channel];
|
output[0] = input[this->m_channel];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -407,23 +407,23 @@ void CombineChannelsOperation::deinitExecution()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CombineChannelsOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void CombineChannelsOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float input[4];
|
float input[4];
|
||||||
if (this->m_inputChannel1Operation) {
|
if (this->m_inputChannel1Operation) {
|
||||||
this->m_inputChannel1Operation->read(input, x, y, sampler);
|
this->m_inputChannel1Operation->readSampled(input, x, y, sampler);
|
||||||
output[0] = input[0];
|
output[0] = input[0];
|
||||||
}
|
}
|
||||||
if (this->m_inputChannel2Operation) {
|
if (this->m_inputChannel2Operation) {
|
||||||
this->m_inputChannel2Operation->read(input, x, y, sampler);
|
this->m_inputChannel2Operation->readSampled(input, x, y, sampler);
|
||||||
output[1] = input[0];
|
output[1] = input[0];
|
||||||
}
|
}
|
||||||
if (this->m_inputChannel3Operation) {
|
if (this->m_inputChannel3Operation) {
|
||||||
this->m_inputChannel3Operation->read(input, x, y, sampler);
|
this->m_inputChannel3Operation->readSampled(input, x, y, sampler);
|
||||||
output[2] = input[0];
|
output[2] = input[0];
|
||||||
}
|
}
|
||||||
if (this->m_inputChannel4Operation) {
|
if (this->m_inputChannel4Operation) {
|
||||||
this->m_inputChannel4Operation->read(input, x, y, sampler);
|
this->m_inputChannel4Operation->readSampled(input, x, y, sampler);
|
||||||
output[3] = input[0];
|
output[3] = input[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class ConvertValueToColorOperation : public ConvertBaseOperation {
|
|||||||
public:
|
public:
|
||||||
ConvertValueToColorOperation();
|
ConvertValueToColorOperation();
|
||||||
|
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ class ConvertColorToValueOperation : public ConvertBaseOperation {
|
|||||||
public:
|
public:
|
||||||
ConvertColorToValueOperation();
|
ConvertColorToValueOperation();
|
||||||
|
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ class ConvertColorToBWOperation : public ConvertBaseOperation {
|
|||||||
public:
|
public:
|
||||||
ConvertColorToBWOperation();
|
ConvertColorToBWOperation();
|
||||||
|
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ class ConvertColorToVectorOperation : public ConvertBaseOperation {
|
|||||||
public:
|
public:
|
||||||
ConvertColorToVectorOperation();
|
ConvertColorToVectorOperation();
|
||||||
|
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ class ConvertValueToVectorOperation : public ConvertBaseOperation {
|
|||||||
public:
|
public:
|
||||||
ConvertValueToVectorOperation();
|
ConvertValueToVectorOperation();
|
||||||
|
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ class ConvertVectorToColorOperation : public ConvertBaseOperation {
|
|||||||
public:
|
public:
|
||||||
ConvertVectorToColorOperation();
|
ConvertVectorToColorOperation();
|
||||||
|
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ class ConvertVectorToValueOperation : public ConvertBaseOperation {
|
|||||||
public:
|
public:
|
||||||
ConvertVectorToValueOperation();
|
ConvertVectorToValueOperation();
|
||||||
|
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ private:
|
|||||||
public:
|
public:
|
||||||
ConvertRGBToYCCOperation();
|
ConvertRGBToYCCOperation();
|
||||||
|
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
/** Set the YCC mode */
|
/** Set the YCC mode */
|
||||||
void setMode(int mode);
|
void setMode(int mode);
|
||||||
@@ -115,7 +115,7 @@ private:
|
|||||||
public:
|
public:
|
||||||
ConvertYCCToRGBOperation();
|
ConvertYCCToRGBOperation();
|
||||||
|
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
/** Set the YCC mode */
|
/** Set the YCC mode */
|
||||||
void setMode(int mode);
|
void setMode(int mode);
|
||||||
@@ -126,7 +126,7 @@ class ConvertRGBToYUVOperation : public ConvertBaseOperation {
|
|||||||
public:
|
public:
|
||||||
ConvertRGBToYUVOperation();
|
ConvertRGBToYUVOperation();
|
||||||
|
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@ class ConvertYUVToRGBOperation : public ConvertBaseOperation {
|
|||||||
public:
|
public:
|
||||||
ConvertYUVToRGBOperation();
|
ConvertYUVToRGBOperation();
|
||||||
|
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -142,7 +142,7 @@ class ConvertRGBToHSVOperation : public ConvertBaseOperation {
|
|||||||
public:
|
public:
|
||||||
ConvertRGBToHSVOperation();
|
ConvertRGBToHSVOperation();
|
||||||
|
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -150,7 +150,7 @@ class ConvertHSVToRGBOperation : public ConvertBaseOperation {
|
|||||||
public:
|
public:
|
||||||
ConvertHSVToRGBOperation();
|
ConvertHSVToRGBOperation();
|
||||||
|
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -158,7 +158,7 @@ class ConvertPremulToStraightOperation : public ConvertBaseOperation {
|
|||||||
public:
|
public:
|
||||||
ConvertPremulToStraightOperation();
|
ConvertPremulToStraightOperation();
|
||||||
|
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -166,7 +166,7 @@ class ConvertStraightToPremulOperation : public ConvertBaseOperation {
|
|||||||
public:
|
public:
|
||||||
ConvertStraightToPremulOperation();
|
ConvertStraightToPremulOperation();
|
||||||
|
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -176,7 +176,7 @@ private:
|
|||||||
int m_channel;
|
int m_channel;
|
||||||
public:
|
public:
|
||||||
SeparateChannelOperation();
|
SeparateChannelOperation();
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
void initExecution();
|
void initExecution();
|
||||||
void deinitExecution();
|
void deinitExecution();
|
||||||
@@ -193,7 +193,7 @@ private:
|
|||||||
SocketReader *m_inputChannel4Operation;
|
SocketReader *m_inputChannel4Operation;
|
||||||
public:
|
public:
|
||||||
CombineChannelsOperation();
|
CombineChannelsOperation();
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
void initExecution();
|
void initExecution();
|
||||||
void deinitExecution();
|
void deinitExecution();
|
||||||
|
|||||||
@@ -82,10 +82,10 @@ CropOperation::CropOperation() : CropBaseOperation()
|
|||||||
/* pass */
|
/* pass */
|
||||||
}
|
}
|
||||||
|
|
||||||
void CropOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void CropOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
if ((x < this->m_xmax && x >= this->m_xmin) && (y < this->m_ymax && y >= this->m_ymin)) {
|
if ((x < this->m_xmax && x >= this->m_xmin) && (y < this->m_ymax && y >= this->m_ymin)) {
|
||||||
this->m_inputOperation->read(output, x, y, sampler);
|
this->m_inputOperation->readSampled(output, x, y, sampler);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
zero_v4(output);
|
zero_v4(output);
|
||||||
@@ -117,10 +117,10 @@ void CropImageOperation::determineResolution(unsigned int resolution[2], unsigne
|
|||||||
resolution[1] = this->m_ymax - this->m_ymin;
|
resolution[1] = this->m_ymax - this->m_ymin;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CropImageOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void CropImageOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
if (x >= 0 && x < getWidth() && y >= 0 && y < getHeight()) {
|
if (x >= 0 && x < getWidth() && y >= 0 && y < getHeight()) {
|
||||||
this->m_inputOperation->read(output, (x + this->m_xmin), (y + this->m_ymin), sampler);
|
this->m_inputOperation->readSampled(output, (x + this->m_xmin), (y + this->m_ymin), sampler);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
zero_v4(output);
|
zero_v4(output);
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class CropOperation : public CropBaseOperation {
|
|||||||
private:
|
private:
|
||||||
public:
|
public:
|
||||||
CropOperation();
|
CropOperation();
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
class CropImageOperation : public CropBaseOperation {
|
class CropImageOperation : public CropBaseOperation {
|
||||||
@@ -57,7 +57,7 @@ public:
|
|||||||
CropImageOperation();
|
CropImageOperation();
|
||||||
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
|
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
|
||||||
void determineResolution(unsigned int resolution[2], unsigned int preferedResolution[2]);
|
void determineResolution(unsigned int resolution[2], unsigned int preferedResolution[2]);
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ void DifferenceMatteOperation::deinitExecution()
|
|||||||
this->m_inputImage2Program = NULL;
|
this->m_inputImage2Program = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DifferenceMatteOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void DifferenceMatteOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inColor1[4];
|
float inColor1[4];
|
||||||
float inColor2[4];
|
float inColor2[4];
|
||||||
@@ -54,8 +54,8 @@ void DifferenceMatteOperation::executePixel(float output[4], float x, float y, P
|
|||||||
float difference;
|
float difference;
|
||||||
float alpha;
|
float alpha;
|
||||||
|
|
||||||
this->m_inputImage1Program->read(inColor1, x, y, sampler);
|
this->m_inputImage1Program->readSampled(inColor1, x, y, sampler);
|
||||||
this->m_inputImage2Program->read(inColor2, x, y, sampler);
|
this->m_inputImage2Program->readSampled(inColor2, x, y, sampler);
|
||||||
|
|
||||||
difference = (fabsf(inColor2[0] - inColor1[0]) +
|
difference = (fabsf(inColor2[0] - inColor1[0]) +
|
||||||
fabsf(inColor2[1] - inColor1[1]) +
|
fabsf(inColor2[1] - inColor1[1]) +
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
void initExecution();
|
void initExecution();
|
||||||
void deinitExecution();
|
void deinitExecution();
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ void DirectionalBlurOperation::executePixel(float output[4], int x, int y, void
|
|||||||
const int iterations = pow(2.0f, this->m_data->iter);
|
const int iterations = pow(2.0f, this->m_data->iter);
|
||||||
float col[4] = {0, 0, 0, 0};
|
float col[4] = {0, 0, 0, 0};
|
||||||
float col2[4] = {0, 0, 0, 0};
|
float col2[4] = {0, 0, 0, 0};
|
||||||
this->m_inputProgram->read(col2, x, y, COM_PS_NEAREST);
|
this->m_inputProgram->readSampled(col2, x, y, COM_PS_NEAREST);
|
||||||
float ltx = this->m_tx;
|
float ltx = this->m_tx;
|
||||||
float lty = this->m_ty;
|
float lty = this->m_ty;
|
||||||
float lsc = this->m_sc;
|
float lsc = this->m_sc;
|
||||||
@@ -84,7 +84,7 @@ void DirectionalBlurOperation::executePixel(float output[4], int x, int y, void
|
|||||||
const float v = isc * (y - this->m_center_y_pix) + lty;
|
const float v = isc * (y - this->m_center_y_pix) + lty;
|
||||||
const float u = isc * (x - this->m_center_x_pix) + ltx;
|
const float u = isc * (x - this->m_center_x_pix) + ltx;
|
||||||
|
|
||||||
this->m_inputProgram->read(col,
|
this->m_inputProgram->readSampled(col,
|
||||||
cs * u + ss * v + this->m_center_x_pix,
|
cs * u + ss * v + this->m_center_x_pix,
|
||||||
cs * v - ss * u + this->m_center_y_pix,
|
cs * v - ss * u + this->m_center_y_pix,
|
||||||
COM_PS_NEAREST);
|
COM_PS_NEAREST);
|
||||||
|
|||||||
@@ -64,9 +64,9 @@ void DisplaceOperation::executePixel(float output[4], int x, int y, void *data)
|
|||||||
float dxt, dyt;
|
float dxt, dyt;
|
||||||
float u, v;
|
float u, v;
|
||||||
|
|
||||||
this->m_inputScaleXProgram->read(inScale, x, y, COM_PS_NEAREST);
|
this->m_inputScaleXProgram->readSampled(inScale, x, y, COM_PS_NEAREST);
|
||||||
float xs = inScale[0];
|
float xs = inScale[0];
|
||||||
this->m_inputScaleYProgram->read(inScale, x, y, COM_PS_NEAREST);
|
this->m_inputScaleYProgram->readSampled(inScale, x, y, COM_PS_NEAREST);
|
||||||
float ys = inScale[0];
|
float ys = inScale[0];
|
||||||
|
|
||||||
/* clamp x and y displacement to triple image resolution -
|
/* clamp x and y displacement to triple image resolution -
|
||||||
@@ -74,7 +74,7 @@ void DisplaceOperation::executePixel(float output[4], int x, int y, void *data)
|
|||||||
CLAMP(xs, -this->m_width_x4, this->m_width_x4);
|
CLAMP(xs, -this->m_width_x4, this->m_width_x4);
|
||||||
CLAMP(ys, -this->m_height_x4, this->m_height_x4);
|
CLAMP(ys, -this->m_height_x4, this->m_height_x4);
|
||||||
|
|
||||||
this->m_inputVectorProgram->read(inVector, x, y, COM_PS_NEAREST);
|
this->m_inputVectorProgram->readSampled(inVector, x, y, COM_PS_NEAREST);
|
||||||
p_dx = inVector[0] * xs;
|
p_dx = inVector[0] * xs;
|
||||||
p_dy = inVector[1] * ys;
|
p_dy = inVector[1] * ys;
|
||||||
|
|
||||||
@@ -83,9 +83,9 @@ void DisplaceOperation::executePixel(float output[4], int x, int y, void *data)
|
|||||||
v = y - p_dy + 0.5f;
|
v = y - p_dy + 0.5f;
|
||||||
|
|
||||||
/* calc derivatives */
|
/* calc derivatives */
|
||||||
this->m_inputVectorProgram->read(inVector, x + 1, y, COM_PS_NEAREST);
|
this->m_inputVectorProgram->readSampled(inVector, x + 1, y, COM_PS_NEAREST);
|
||||||
d_dx = inVector[0] * xs;
|
d_dx = inVector[0] * xs;
|
||||||
this->m_inputVectorProgram->read(inVector, x, y + 1, COM_PS_NEAREST);
|
this->m_inputVectorProgram->readSampled(inVector, x, y + 1, COM_PS_NEAREST);
|
||||||
d_dy = inVector[1] * ys;
|
d_dy = inVector[1] * ys;
|
||||||
|
|
||||||
/* clamp derivatives to minimum displacement distance in UV space */
|
/* clamp derivatives to minimum displacement distance in UV space */
|
||||||
@@ -96,7 +96,7 @@ void DisplaceOperation::executePixel(float output[4], int x, int y, void *data)
|
|||||||
dyt = signf(dyt) * max_ff(fabsf(dyt), DISPLACE_EPSILON) / this->getHeight();
|
dyt = signf(dyt) * max_ff(fabsf(dyt), DISPLACE_EPSILON) / this->getHeight();
|
||||||
|
|
||||||
/* EWA filtering (without nearest it gets blurry with NO distortion) */
|
/* EWA filtering (without nearest it gets blurry with NO distortion) */
|
||||||
this->m_inputColorProgram->read(output, u, v, dxt, dyt, COM_PS_NEAREST);
|
this->m_inputColorProgram->readFiltered(output, u, v, dxt, dyt, COM_PS_NEAREST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisplaceOperation::deinitExecution()
|
void DisplaceOperation::deinitExecution()
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ void DisplaceSimpleOperation::initExecution()
|
|||||||
* in order to take effect */
|
* in order to take effect */
|
||||||
// #define DISPLACE_EPSILON 0.01f
|
// #define DISPLACE_EPSILON 0.01f
|
||||||
|
|
||||||
void DisplaceSimpleOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void DisplaceSimpleOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inVector[4];
|
float inVector[4];
|
||||||
float inScale[4];
|
float inScale[4];
|
||||||
@@ -61,9 +61,9 @@ void DisplaceSimpleOperation::executePixel(float output[4], float x, float y, Pi
|
|||||||
float p_dx, p_dy; /* main displacement in pixel space */
|
float p_dx, p_dy; /* main displacement in pixel space */
|
||||||
float u, v;
|
float u, v;
|
||||||
|
|
||||||
this->m_inputScaleXProgram->read(inScale, x, y, sampler);
|
this->m_inputScaleXProgram->readSampled(inScale, x, y, sampler);
|
||||||
float xs = inScale[0];
|
float xs = inScale[0];
|
||||||
this->m_inputScaleYProgram->read(inScale, x, y, sampler);
|
this->m_inputScaleYProgram->readSampled(inScale, x, y, sampler);
|
||||||
float ys = inScale[0];
|
float ys = inScale[0];
|
||||||
|
|
||||||
/* clamp x and y displacement to triple image resolution -
|
/* clamp x and y displacement to triple image resolution -
|
||||||
@@ -71,7 +71,7 @@ void DisplaceSimpleOperation::executePixel(float output[4], float x, float y, Pi
|
|||||||
CLAMP(xs, -this->m_width_x4, this->m_width_x4);
|
CLAMP(xs, -this->m_width_x4, this->m_width_x4);
|
||||||
CLAMP(ys, -this->m_height_x4, this->m_height_x4);
|
CLAMP(ys, -this->m_height_x4, this->m_height_x4);
|
||||||
|
|
||||||
this->m_inputVectorProgram->read(inVector, x, y, sampler);
|
this->m_inputVectorProgram->readSampled(inVector, x, y, sampler);
|
||||||
p_dx = inVector[0] * xs;
|
p_dx = inVector[0] * xs;
|
||||||
p_dy = inVector[1] * ys;
|
p_dy = inVector[1] * ys;
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ void DisplaceSimpleOperation::executePixel(float output[4], float x, float y, Pi
|
|||||||
CLAMP(u, 0.f, this->getWidth() - 1.f);
|
CLAMP(u, 0.f, this->getWidth() - 1.f);
|
||||||
CLAMP(v, 0.f, this->getHeight() - 1.f);
|
CLAMP(v, 0.f, this->getHeight() - 1.f);
|
||||||
|
|
||||||
this->m_inputColorProgram->read(output, u, v, sampler);
|
this->m_inputColorProgram->readSampled(output, u, v, sampler);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisplaceSimpleOperation::deinitExecution()
|
void DisplaceSimpleOperation::deinitExecution()
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the execution
|
* Initialize the execution
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ float DistanceRGBMatteOperation::calculateDistance(float key[4], float image[4])
|
|||||||
return len_v3v3(key, image);
|
return len_v3v3(key, image);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DistanceRGBMatteOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void DistanceRGBMatteOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inKey[4];
|
float inKey[4];
|
||||||
float inImage[4];
|
float inImage[4];
|
||||||
@@ -60,8 +60,8 @@ void DistanceRGBMatteOperation::executePixel(float output[4], float x, float y,
|
|||||||
float distance;
|
float distance;
|
||||||
float alpha;
|
float alpha;
|
||||||
|
|
||||||
this->m_inputKeyProgram->read(inKey, x, y, sampler);
|
this->m_inputKeyProgram->readSampled(inKey, x, y, sampler);
|
||||||
this->m_inputImageProgram->read(inImage, x, y, sampler);
|
this->m_inputImageProgram->readSampled(inImage, x, y, sampler);
|
||||||
|
|
||||||
distance = this->calculateDistance(inKey, inImage);
|
distance = this->calculateDistance(inKey, inImage);
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
void initExecution();
|
void initExecution();
|
||||||
void deinitExecution();
|
void deinitExecution();
|
||||||
|
|||||||
@@ -45,11 +45,11 @@ void DotproductOperation::deinitExecution()
|
|||||||
|
|
||||||
/** @todo: current implementation is the inverse of a dotproduct. not 'logically' correct
|
/** @todo: current implementation is the inverse of a dotproduct. not 'logically' correct
|
||||||
*/
|
*/
|
||||||
void DotproductOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void DotproductOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float input1[4];
|
float input1[4];
|
||||||
float input2[4];
|
float input2[4];
|
||||||
this->m_input1Operation->read(input1, x, y, sampler);
|
this->m_input1Operation->readSampled(input1, x, y, sampler);
|
||||||
this->m_input2Operation->read(input2, x, y, sampler);
|
this->m_input2Operation->readSampled(input2, x, y, sampler);
|
||||||
output[0] = -(input1[0] * input2[0] + input1[1] * input2[1] + input1[2] * input2[2]);
|
output[0] = -(input1[0] * input2[0] + input1[1] * input2[1] + input1[2] * input2[2]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ private:
|
|||||||
SocketReader *m_input2Operation;
|
SocketReader *m_input2Operation;
|
||||||
public:
|
public:
|
||||||
DotproductOperation();
|
DotproductOperation();
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
void initExecution();
|
void initExecution();
|
||||||
void deinitExecution();
|
void deinitExecution();
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ void EllipseMaskOperation::initExecution()
|
|||||||
this->m_aspectRatio = ((float)this->getWidth()) / this->getHeight();
|
this->m_aspectRatio = ((float)this->getWidth()) / this->getHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EllipseMaskOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void EllipseMaskOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputMask[4];
|
float inputMask[4];
|
||||||
float inputValue[4];
|
float inputValue[4];
|
||||||
@@ -57,8 +57,8 @@ void EllipseMaskOperation::executePixel(float output[4], float x, float y, Pixel
|
|||||||
rx = this->m_data->x + (this->m_cosine * dx + this->m_sine * dy);
|
rx = this->m_data->x + (this->m_cosine * dx + this->m_sine * dy);
|
||||||
ry = this->m_data->y + (-this->m_sine * dx + this->m_cosine * dy);
|
ry = this->m_data->y + (-this->m_sine * dx + this->m_cosine * dy);
|
||||||
|
|
||||||
this->m_inputMask->read(inputMask, x, y, sampler);
|
this->m_inputMask->readSampled(inputMask, x, y, sampler);
|
||||||
this->m_inputValue->read(inputValue, x, y, sampler);
|
this->m_inputValue->readSampled(inputValue, x, y, sampler);
|
||||||
|
|
||||||
const float halfHeight = (this->m_data->height) / 2.0f;
|
const float halfHeight = (this->m_data->height) / 2.0f;
|
||||||
const float halfWidth = this->m_data->width / 2.0f;
|
const float halfWidth = this->m_data->width / 2.0f;
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the execution
|
* Initialize the execution
|
||||||
|
|||||||
@@ -42,12 +42,12 @@ void FlipOperation::deinitExecution()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void FlipOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void FlipOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float nx = this->m_flipX ? this->getWidth() - 1 - x : x;
|
float nx = this->m_flipX ? this->getWidth() - 1 - x : x;
|
||||||
float ny = this->m_flipY ? this->getHeight() - 1 - y : y;
|
float ny = this->m_flipY ? this->getHeight() - 1 - y : y;
|
||||||
|
|
||||||
this->m_inputOperation->read(output, nx, ny, sampler);
|
this->m_inputOperation->readSampled(output, nx, ny, sampler);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FlipOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
|
bool FlipOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ private:
|
|||||||
public:
|
public:
|
||||||
FlipOperation();
|
FlipOperation();
|
||||||
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
|
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
void initExecution();
|
void initExecution();
|
||||||
void deinitExecution();
|
void deinitExecution();
|
||||||
|
|||||||
@@ -34,10 +34,10 @@ void GammaCorrectOperation::initExecution()
|
|||||||
this->m_inputProgram = this->getInputSocketReader(0);
|
this->m_inputProgram = this->getInputSocketReader(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GammaCorrectOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void GammaCorrectOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor[4];
|
float inputColor[4];
|
||||||
this->m_inputProgram->read(inputColor, x, y, sampler);
|
this->m_inputProgram->readSampled(inputColor, x, y, sampler);
|
||||||
if (inputColor[3] > 0.0f) {
|
if (inputColor[3] > 0.0f) {
|
||||||
inputColor[0] /= inputColor[3];
|
inputColor[0] /= inputColor[3];
|
||||||
inputColor[1] /= inputColor[3];
|
inputColor[1] /= inputColor[3];
|
||||||
@@ -73,10 +73,10 @@ void GammaUncorrectOperation::initExecution()
|
|||||||
this->m_inputProgram = this->getInputSocketReader(0);
|
this->m_inputProgram = this->getInputSocketReader(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GammaUncorrectOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void GammaUncorrectOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor[4];
|
float inputColor[4];
|
||||||
this->m_inputProgram->read(inputColor, x, y, sampler);
|
this->m_inputProgram->readSampled(inputColor, x, y, sampler);
|
||||||
|
|
||||||
if (inputColor[3] > 0.0f) {
|
if (inputColor[3] > 0.0f) {
|
||||||
inputColor[0] /= inputColor[3];
|
inputColor[0] /= inputColor[3];
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the execution
|
* Initialize the execution
|
||||||
@@ -64,7 +64,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the execution
|
* Initialize the execution
|
||||||
|
|||||||
@@ -37,13 +37,13 @@ void GammaOperation::initExecution()
|
|||||||
this->m_inputGammaProgram = this->getInputSocketReader(1);
|
this->m_inputGammaProgram = this->getInputSocketReader(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GammaOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void GammaOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputValue[4];
|
float inputValue[4];
|
||||||
float inputGamma[4];
|
float inputGamma[4];
|
||||||
|
|
||||||
this->m_inputProgram->read(inputValue, x, y, sampler);
|
this->m_inputProgram->readSampled(inputValue, x, y, sampler);
|
||||||
this->m_inputGammaProgram->read(inputGamma, x, y, sampler);
|
this->m_inputGammaProgram->readSampled(inputGamma, x, y, sampler);
|
||||||
const float gamma = inputGamma[0];
|
const float gamma = inputGamma[0];
|
||||||
/* check for negative to avoid nan's */
|
/* check for negative to avoid nan's */
|
||||||
output[0] = inputValue[0] > 0.0f ? powf(inputValue[0], gamma) : inputValue[0];
|
output[0] = inputValue[0] > 0.0f ? powf(inputValue[0], gamma) : inputValue[0];
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the execution
|
* Initialize the execution
|
||||||
|
|||||||
@@ -42,11 +42,11 @@ void GlareThresholdOperation::initExecution()
|
|||||||
this->m_inputProgram = this->getInputSocketReader(0);
|
this->m_inputProgram = this->getInputSocketReader(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GlareThresholdOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void GlareThresholdOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
const float threshold = this->m_settings->threshold;
|
const float threshold = this->m_settings->threshold;
|
||||||
|
|
||||||
this->m_inputProgram->read(output, x, y, sampler);
|
this->m_inputProgram->readSampled(output, x, y, sampler);
|
||||||
if (rgb_to_luma_y(output) >= threshold) {
|
if (rgb_to_luma_y(output) >= threshold) {
|
||||||
output[0] -= threshold, output[1] -= threshold, output[2] -= threshold;
|
output[0] -= threshold, output[1] -= threshold, output[2] -= threshold;
|
||||||
output[0] = max(output[0], 0.0f);
|
output[0] = max(output[0], 0.0f);
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the execution
|
* Initialize the execution
|
||||||
|
|||||||
@@ -45,11 +45,11 @@ void HueSaturationValueCorrectOperation::initExecution()
|
|||||||
this->m_inputProgram = this->getInputSocketReader(0);
|
this->m_inputProgram = this->getInputSocketReader(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HueSaturationValueCorrectOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void HueSaturationValueCorrectOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float hsv[4], f;
|
float hsv[4], f;
|
||||||
|
|
||||||
this->m_inputProgram->read(hsv, x, y, sampler);
|
this->m_inputProgram->readSampled(hsv, x, y, sampler);
|
||||||
|
|
||||||
/* adjust hue, scaling returned default 0.5 up to 1 */
|
/* adjust hue, scaling returned default 0.5 up to 1 */
|
||||||
f = curvemapping_evaluateF(this->m_curveMapping, 0, hsv[0]);
|
f = curvemapping_evaluateF(this->m_curveMapping, 0, hsv[0]);
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the execution
|
* Initialize the execution
|
||||||
|
|||||||
@@ -33,11 +33,11 @@ void IDMaskOperation::initExecution()
|
|||||||
this->m_inputProgram = this->getInputSocketReader(0);
|
this->m_inputProgram = this->getInputSocketReader(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IDMaskOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void IDMaskOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputValue[4];
|
float inputValue[4];
|
||||||
|
|
||||||
this->m_inputProgram->read(inputValue, x, y, sampler);
|
this->m_inputProgram->readSampled(inputValue, x, y, sampler);
|
||||||
const float a = (inputValue[0] == this->m_objectIndex) ? 1.0f : 0.0f;
|
const float a = (inputValue[0] == this->m_objectIndex) ? 1.0f : 0.0f;
|
||||||
output[0] = a;
|
output[0] = a;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the execution
|
* Initialize the execution
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ static void sampleImageAtLocation(ImBuf *ibuf, float x, float y, PixelSampler sa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImageOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void ImageOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
if ((this->m_imageFloatBuffer == NULL && this->m_imageByteBuffer == NULL) || x < 0 || y < 0 || x >= this->getWidth() || y >= this->getHeight() ) {
|
if ((this->m_imageFloatBuffer == NULL && this->m_imageByteBuffer == NULL) || x < 0 || y < 0 || x >= this->getWidth() || y >= this->getHeight() ) {
|
||||||
zero_v4(output);
|
zero_v4(output);
|
||||||
@@ -156,7 +156,7 @@ void ImageOperation::executePixel(float output[4], float x, float y, PixelSample
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImageAlphaOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void ImageAlphaOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float tempcolor[4];
|
float tempcolor[4];
|
||||||
|
|
||||||
@@ -170,7 +170,7 @@ void ImageAlphaOperation::executePixel(float output[4], float x, float y, PixelS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImageDepthOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void ImageDepthOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
if (this->m_depthBuffer == NULL || x < 0 || y < 0 || x >= this->getWidth() || y >= this->getHeight() ) {
|
if (this->m_depthBuffer == NULL || x < 0 || y < 0 || x >= this->getWidth() || y >= this->getHeight() ) {
|
||||||
output[0] = 0.0f;
|
output[0] = 0.0f;
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public:
|
|||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
ImageOperation();
|
ImageOperation();
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
class ImageAlphaOperation : public BaseImageOperation {
|
class ImageAlphaOperation : public BaseImageOperation {
|
||||||
public:
|
public:
|
||||||
@@ -81,7 +81,7 @@ public:
|
|||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
ImageAlphaOperation();
|
ImageAlphaOperation();
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
class ImageDepthOperation : public BaseImageOperation {
|
class ImageDepthOperation : public BaseImageOperation {
|
||||||
public:
|
public:
|
||||||
@@ -89,6 +89,6 @@ public:
|
|||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
ImageDepthOperation();
|
ImageDepthOperation();
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -39,12 +39,12 @@ void InvertOperation::initExecution()
|
|||||||
this->m_inputColorProgram = this->getInputSocketReader(1);
|
this->m_inputColorProgram = this->getInputSocketReader(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InvertOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void InvertOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputValue[4];
|
float inputValue[4];
|
||||||
float inputColor[4];
|
float inputColor[4];
|
||||||
this->m_inputValueProgram->read(inputValue, x, y, sampler);
|
this->m_inputValueProgram->readSampled(inputValue, x, y, sampler);
|
||||||
this->m_inputColorProgram->read(inputColor, x, y, sampler);
|
this->m_inputColorProgram->readSampled(inputColor, x, y, sampler);
|
||||||
|
|
||||||
const float value = inputValue[0];
|
const float value = inputValue[0];
|
||||||
const float invertedValue = 1.0f - value;
|
const float invertedValue = 1.0f - value;
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the execution
|
* Initialize the execution
|
||||||
|
|||||||
@@ -53,13 +53,13 @@ void KeyingDespillOperation::deinitExecution()
|
|||||||
this->m_screenReader = NULL;
|
this->m_screenReader = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeyingDespillOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void KeyingDespillOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float pixelColor[4];
|
float pixelColor[4];
|
||||||
float screenColor[4];
|
float screenColor[4];
|
||||||
|
|
||||||
this->m_pixelReader->read(pixelColor, x, y, sampler);
|
this->m_pixelReader->readSampled(pixelColor, x, y, sampler);
|
||||||
this->m_screenReader->read(screenColor, x, y, sampler);
|
this->m_screenReader->readSampled(screenColor, x, y, sampler);
|
||||||
|
|
||||||
const int screen_primary_channel = max_axis_v3(screenColor);
|
const int screen_primary_channel = max_axis_v3(screenColor);
|
||||||
const int other_1 = (screen_primary_channel + 1) % 3;
|
const int other_1 = (screen_primary_channel + 1) % 3;
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public:
|
|||||||
void setDespillFactor(float value) {this->m_despillFactor = value;}
|
void setDespillFactor(float value) {this->m_despillFactor = value;}
|
||||||
void setColorBalance(float value) {this->m_colorBalance = value;}
|
void setColorBalance(float value) {this->m_colorBalance = value;}
|
||||||
|
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -65,13 +65,13 @@ void KeyingOperation::deinitExecution()
|
|||||||
this->m_screenReader = NULL;
|
this->m_screenReader = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeyingOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void KeyingOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float pixelColor[4];
|
float pixelColor[4];
|
||||||
float screenColor[4];
|
float screenColor[4];
|
||||||
|
|
||||||
this->m_pixelReader->read(pixelColor, x, y, sampler);
|
this->m_pixelReader->readSampled(pixelColor, x, y, sampler);
|
||||||
this->m_screenReader->read(screenColor, x, y, sampler);
|
this->m_screenReader->readSampled(screenColor, x, y, sampler);
|
||||||
|
|
||||||
const int primary_channel = max_axis_v3(screenColor);
|
const int primary_channel = max_axis_v3(screenColor);
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public:
|
|||||||
|
|
||||||
void setScreenBalance(float value) {this->m_screenBalance = value;}
|
void setScreenBalance(float value) {this->m_screenBalance = value;}
|
||||||
|
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ void LuminanceMatteOperation::deinitExecution()
|
|||||||
this->m_inputImageProgram = NULL;
|
this->m_inputImageProgram = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LuminanceMatteOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void LuminanceMatteOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inColor[4];
|
float inColor[4];
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ void LuminanceMatteOperation::executePixel(float output[4], float x, float y, Pi
|
|||||||
|
|
||||||
float alpha;
|
float alpha;
|
||||||
|
|
||||||
this->m_inputImageProgram->read(inColor, x, y, sampler);
|
this->m_inputImageProgram->readSampled(inColor, x, y, sampler);
|
||||||
|
|
||||||
/* one line thread-friend algorithm:
|
/* one line thread-friend algorithm:
|
||||||
* output[0] = max(inputValue[3], min(high, max(low, ((inColor[0]-low)/(high-low))))
|
* output[0] = max(inputValue[3], min(high, max(low, ((inColor[0]-low)/(high-low))))
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
void initExecution();
|
void initExecution();
|
||||||
void deinitExecution();
|
void deinitExecution();
|
||||||
|
|||||||
@@ -46,18 +46,18 @@ void MapRangeOperation::initExecution()
|
|||||||
/* The code below assumes all data is inside range +- this, and that input buffer is single channel */
|
/* The code below assumes all data is inside range +- this, and that input buffer is single channel */
|
||||||
#define BLENDER_ZMAX 10000.0f
|
#define BLENDER_ZMAX 10000.0f
|
||||||
|
|
||||||
void MapRangeOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MapRangeOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputs[8]; /* includes the 5 inputs + 3 pads */
|
float inputs[8]; /* includes the 5 inputs + 3 pads */
|
||||||
float value;
|
float value;
|
||||||
float source_min, source_max;
|
float source_min, source_max;
|
||||||
float dest_min, dest_max;
|
float dest_min, dest_max;
|
||||||
|
|
||||||
this->m_inputOperation->read(inputs, x, y, sampler);
|
this->m_inputOperation->readSampled(inputs, x, y, sampler);
|
||||||
this->m_sourceMinOperation->read(inputs + 1, x, y, sampler);
|
this->m_sourceMinOperation->readSampled(inputs + 1, x, y, sampler);
|
||||||
this->m_sourceMaxOperation->read(inputs + 2, x, y, sampler);
|
this->m_sourceMaxOperation->readSampled(inputs + 2, x, y, sampler);
|
||||||
this->m_destMinOperation->read(inputs + 3, x, y, sampler);
|
this->m_destMinOperation->readSampled(inputs + 3, x, y, sampler);
|
||||||
this->m_destMaxOperation->read(inputs + 4, x, y, sampler);
|
this->m_destMaxOperation->readSampled(inputs + 4, x, y, sampler);
|
||||||
|
|
||||||
value = inputs[0];
|
value = inputs[0];
|
||||||
source_min = inputs[1];
|
source_min = inputs[1];
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the execution
|
* Initialize the execution
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ void MapUVOperation::initExecution()
|
|||||||
this->m_inputUVProgram = this->getInputSocketReader(1);
|
this->m_inputUVProgram = this->getInputSocketReader(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapUVOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MapUVOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputUV[4];
|
float inputUV[4];
|
||||||
float uv_a[4], uv_b[4];
|
float uv_a[4], uv_b[4];
|
||||||
@@ -50,22 +50,22 @@ void MapUVOperation::executePixel(float output[4], float x, float y, PixelSample
|
|||||||
float uv_l, uv_r;
|
float uv_l, uv_r;
|
||||||
float uv_u, uv_d;
|
float uv_u, uv_d;
|
||||||
|
|
||||||
this->m_inputUVProgram->read(inputUV, x, y, sampler);
|
this->m_inputUVProgram->readSampled(inputUV, x, y, sampler);
|
||||||
if (inputUV[2] == 0.f) {
|
if (inputUV[2] == 0.f) {
|
||||||
zero_v4(output);
|
zero_v4(output);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* adaptive sampling, red (U) channel */
|
/* adaptive sampling, red (U) channel */
|
||||||
this->m_inputUVProgram->read(uv_a, x - 1, y, COM_PS_NEAREST);
|
this->m_inputUVProgram->readSampled(uv_a, x - 1, y, COM_PS_NEAREST);
|
||||||
this->m_inputUVProgram->read(uv_b, x + 1, y, COM_PS_NEAREST);
|
this->m_inputUVProgram->readSampled(uv_b, x + 1, y, COM_PS_NEAREST);
|
||||||
uv_l = uv_a[2] != 0.f ? fabsf(inputUV[0] - uv_a[0]) : 0.f;
|
uv_l = uv_a[2] != 0.f ? fabsf(inputUV[0] - uv_a[0]) : 0.f;
|
||||||
uv_r = uv_b[2] != 0.f ? fabsf(inputUV[0] - uv_b[0]) : 0.f;
|
uv_r = uv_b[2] != 0.f ? fabsf(inputUV[0] - uv_b[0]) : 0.f;
|
||||||
|
|
||||||
dx = 0.5f * (uv_l + uv_r);
|
dx = 0.5f * (uv_l + uv_r);
|
||||||
|
|
||||||
/* adaptive sampling, green (V) channel */
|
/* adaptive sampling, green (V) channel */
|
||||||
this->m_inputUVProgram->read(uv_a, x, y - 1, COM_PS_NEAREST);
|
this->m_inputUVProgram->readSampled(uv_a, x, y - 1, COM_PS_NEAREST);
|
||||||
this->m_inputUVProgram->read(uv_b, x, y + 1, COM_PS_NEAREST);
|
this->m_inputUVProgram->readSampled(uv_b, x, y + 1, COM_PS_NEAREST);
|
||||||
uv_u = uv_a[2] != 0.f ? fabsf(inputUV[1] - uv_a[1]) : 0.f;
|
uv_u = uv_a[2] != 0.f ? fabsf(inputUV[1] - uv_a[1]) : 0.f;
|
||||||
uv_d = uv_b[2] != 0.f ? fabsf(inputUV[1] - uv_b[1]) : 0.f;
|
uv_d = uv_b[2] != 0.f ? fabsf(inputUV[1] - uv_b[1]) : 0.f;
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@ void MapUVOperation::executePixel(float output[4], float x, float y, PixelSample
|
|||||||
u = inputUV[0] * this->m_inputColorProgram->getWidth();
|
u = inputUV[0] * this->m_inputColorProgram->getWidth();
|
||||||
v = inputUV[1] * this->m_inputColorProgram->getHeight();
|
v = inputUV[1] * this->m_inputColorProgram->getHeight();
|
||||||
|
|
||||||
this->m_inputColorProgram->read(output, u, v, dx, dy, COM_PS_NEAREST);
|
this->m_inputColorProgram->readFiltered(output, u, v, dx, dy, COM_PS_NEAREST);
|
||||||
|
|
||||||
/* "premul" */
|
/* "premul" */
|
||||||
if (alpha < 1.0f) {
|
if (alpha < 1.0f) {
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the execution
|
* Initialize the execution
|
||||||
|
|||||||
@@ -34,10 +34,10 @@ void MapValueOperation::initExecution()
|
|||||||
this->m_inputOperation = this->getInputSocketReader(0);
|
this->m_inputOperation = this->getInputSocketReader(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapValueOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MapValueOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float src[4];
|
float src[4];
|
||||||
this->m_inputOperation->read(src, x, y, sampler);
|
this->m_inputOperation->readSampled(src, x, y, sampler);
|
||||||
TexMapping *texmap = this->m_settings;
|
TexMapping *texmap = this->m_settings;
|
||||||
float value = (src[0] + texmap->loc[0]) * texmap->size[0];
|
float value = (src[0] + texmap->loc[0]) * texmap->size[0];
|
||||||
if (texmap->flag & TEXMAP_CLIP_MIN)
|
if (texmap->flag & TEXMAP_CLIP_MIN)
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the execution
|
* Initialize the execution
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ void MaskOperation::determineResolution(unsigned int resolution[2], unsigned int
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaskOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MaskOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
const float xy[2] = {x * this->m_maskWidthInv,
|
const float xy[2] = {x * this->m_maskWidthInv,
|
||||||
y * this->m_maskHeightInv};
|
y * this->m_maskHeightInv};
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ public:
|
|||||||
void setMotionBlurSamples(int samples) { this->m_rasterMaskHandleTot = min(max(1, samples), CMP_NODE_MASK_MBLUR_SAMPLES_MAX); }
|
void setMotionBlurSamples(int samples) { this->m_rasterMaskHandleTot = min(max(1, samples), CMP_NODE_MASK_MBLUR_SAMPLES_MAX); }
|
||||||
void setMotionBlurShutter(float shutter) { this->m_frame_shutter = shutter; }
|
void setMotionBlurShutter(float shutter) { this->m_frame_shutter = shutter; }
|
||||||
|
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -72,52 +72,52 @@ void MathBaseOperation::clampIfNeeded(float *color)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MathAddOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MathAddOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputValue1[4];
|
float inputValue1[4];
|
||||||
float inputValue2[4];
|
float inputValue2[4];
|
||||||
|
|
||||||
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
|
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
|
||||||
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
|
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
|
||||||
|
|
||||||
output[0] = inputValue1[0] + inputValue2[0];
|
output[0] = inputValue1[0] + inputValue2[0];
|
||||||
|
|
||||||
clampIfNeeded(output);
|
clampIfNeeded(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MathSubtractOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MathSubtractOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputValue1[4];
|
float inputValue1[4];
|
||||||
float inputValue2[4];
|
float inputValue2[4];
|
||||||
|
|
||||||
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
|
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
|
||||||
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
|
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
|
||||||
|
|
||||||
output[0] = inputValue1[0] - inputValue2[0];
|
output[0] = inputValue1[0] - inputValue2[0];
|
||||||
|
|
||||||
clampIfNeeded(output);
|
clampIfNeeded(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MathMultiplyOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MathMultiplyOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputValue1[4];
|
float inputValue1[4];
|
||||||
float inputValue2[4];
|
float inputValue2[4];
|
||||||
|
|
||||||
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
|
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
|
||||||
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
|
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
|
||||||
|
|
||||||
output[0] = inputValue1[0] * inputValue2[0];
|
output[0] = inputValue1[0] * inputValue2[0];
|
||||||
|
|
||||||
clampIfNeeded(output);
|
clampIfNeeded(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MathDivideOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MathDivideOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputValue1[4];
|
float inputValue1[4];
|
||||||
float inputValue2[4];
|
float inputValue2[4];
|
||||||
|
|
||||||
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
|
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
|
||||||
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
|
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
|
||||||
|
|
||||||
if (inputValue2[0] == 0) /* We don't want to divide by zero. */
|
if (inputValue2[0] == 0) /* We don't want to divide by zero. */
|
||||||
output[0] = 0.0;
|
output[0] = 0.0;
|
||||||
@@ -127,52 +127,52 @@ void MathDivideOperation::executePixel(float output[4], float x, float y, PixelS
|
|||||||
clampIfNeeded(output);
|
clampIfNeeded(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MathSineOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MathSineOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputValue1[4];
|
float inputValue1[4];
|
||||||
float inputValue2[4];
|
float inputValue2[4];
|
||||||
|
|
||||||
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
|
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
|
||||||
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
|
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
|
||||||
|
|
||||||
output[0] = sin(inputValue1[0]);
|
output[0] = sin(inputValue1[0]);
|
||||||
|
|
||||||
clampIfNeeded(output);
|
clampIfNeeded(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MathCosineOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MathCosineOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputValue1[4];
|
float inputValue1[4];
|
||||||
float inputValue2[4];
|
float inputValue2[4];
|
||||||
|
|
||||||
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
|
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
|
||||||
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
|
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
|
||||||
|
|
||||||
output[0] = cos(inputValue1[0]);
|
output[0] = cos(inputValue1[0]);
|
||||||
|
|
||||||
clampIfNeeded(output);
|
clampIfNeeded(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MathTangentOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MathTangentOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputValue1[4];
|
float inputValue1[4];
|
||||||
float inputValue2[4];
|
float inputValue2[4];
|
||||||
|
|
||||||
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
|
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
|
||||||
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
|
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
|
||||||
|
|
||||||
output[0] = tan(inputValue1[0]);
|
output[0] = tan(inputValue1[0]);
|
||||||
|
|
||||||
clampIfNeeded(output);
|
clampIfNeeded(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MathArcSineOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MathArcSineOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputValue1[4];
|
float inputValue1[4];
|
||||||
float inputValue2[4];
|
float inputValue2[4];
|
||||||
|
|
||||||
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
|
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
|
||||||
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
|
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
|
||||||
|
|
||||||
if (inputValue1[0] <= 1 && inputValue1[0] >= -1)
|
if (inputValue1[0] <= 1 && inputValue1[0] >= -1)
|
||||||
output[0] = asin(inputValue1[0]);
|
output[0] = asin(inputValue1[0]);
|
||||||
@@ -182,13 +182,13 @@ void MathArcSineOperation::executePixel(float output[4], float x, float y, Pixel
|
|||||||
clampIfNeeded(output);
|
clampIfNeeded(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MathArcCosineOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MathArcCosineOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputValue1[4];
|
float inputValue1[4];
|
||||||
float inputValue2[4];
|
float inputValue2[4];
|
||||||
|
|
||||||
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
|
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
|
||||||
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
|
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
|
||||||
|
|
||||||
if (inputValue1[0] <= 1 && inputValue1[0] >= -1)
|
if (inputValue1[0] <= 1 && inputValue1[0] >= -1)
|
||||||
output[0] = acos(inputValue1[0]);
|
output[0] = acos(inputValue1[0]);
|
||||||
@@ -198,26 +198,26 @@ void MathArcCosineOperation::executePixel(float output[4], float x, float y, Pix
|
|||||||
clampIfNeeded(output);
|
clampIfNeeded(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MathArcTangentOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MathArcTangentOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputValue1[4];
|
float inputValue1[4];
|
||||||
float inputValue2[4];
|
float inputValue2[4];
|
||||||
|
|
||||||
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
|
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
|
||||||
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
|
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
|
||||||
|
|
||||||
output[0] = atan(inputValue1[0]);
|
output[0] = atan(inputValue1[0]);
|
||||||
|
|
||||||
clampIfNeeded(output);
|
clampIfNeeded(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MathPowerOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MathPowerOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputValue1[4];
|
float inputValue1[4];
|
||||||
float inputValue2[4];
|
float inputValue2[4];
|
||||||
|
|
||||||
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
|
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
|
||||||
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
|
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
|
||||||
|
|
||||||
if (inputValue1[0] >= 0) {
|
if (inputValue1[0] >= 0) {
|
||||||
output[0] = pow(inputValue1[0], inputValue2[0]);
|
output[0] = pow(inputValue1[0], inputValue2[0]);
|
||||||
@@ -236,13 +236,13 @@ void MathPowerOperation::executePixel(float output[4], float x, float y, PixelSa
|
|||||||
clampIfNeeded(output);
|
clampIfNeeded(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MathLogarithmOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MathLogarithmOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputValue1[4];
|
float inputValue1[4];
|
||||||
float inputValue2[4];
|
float inputValue2[4];
|
||||||
|
|
||||||
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
|
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
|
||||||
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
|
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
|
||||||
|
|
||||||
if (inputValue1[0] > 0 && inputValue2[0] > 0)
|
if (inputValue1[0] > 0 && inputValue2[0] > 0)
|
||||||
output[0] = log(inputValue1[0]) / log(inputValue2[0]);
|
output[0] = log(inputValue1[0]) / log(inputValue2[0]);
|
||||||
@@ -252,78 +252,78 @@ void MathLogarithmOperation::executePixel(float output[4], float x, float y, Pix
|
|||||||
clampIfNeeded(output);
|
clampIfNeeded(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MathMinimumOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MathMinimumOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputValue1[4];
|
float inputValue1[4];
|
||||||
float inputValue2[4];
|
float inputValue2[4];
|
||||||
|
|
||||||
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
|
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
|
||||||
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
|
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
|
||||||
|
|
||||||
output[0] = min(inputValue1[0], inputValue2[0]);
|
output[0] = min(inputValue1[0], inputValue2[0]);
|
||||||
|
|
||||||
clampIfNeeded(output);
|
clampIfNeeded(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MathMaximumOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MathMaximumOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputValue1[4];
|
float inputValue1[4];
|
||||||
float inputValue2[4];
|
float inputValue2[4];
|
||||||
|
|
||||||
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
|
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
|
||||||
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
|
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
|
||||||
|
|
||||||
output[0] = max(inputValue1[0], inputValue2[0]);
|
output[0] = max(inputValue1[0], inputValue2[0]);
|
||||||
|
|
||||||
clampIfNeeded(output);
|
clampIfNeeded(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MathRoundOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MathRoundOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputValue1[4];
|
float inputValue1[4];
|
||||||
float inputValue2[4];
|
float inputValue2[4];
|
||||||
|
|
||||||
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
|
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
|
||||||
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
|
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
|
||||||
|
|
||||||
output[0] = round(inputValue1[0]);
|
output[0] = round(inputValue1[0]);
|
||||||
|
|
||||||
clampIfNeeded(output);
|
clampIfNeeded(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MathLessThanOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MathLessThanOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputValue1[4];
|
float inputValue1[4];
|
||||||
float inputValue2[4];
|
float inputValue2[4];
|
||||||
|
|
||||||
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
|
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
|
||||||
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
|
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
|
||||||
|
|
||||||
output[0] = inputValue1[0] < inputValue2[0] ? 1.0f : 0.0f;
|
output[0] = inputValue1[0] < inputValue2[0] ? 1.0f : 0.0f;
|
||||||
|
|
||||||
clampIfNeeded(output);
|
clampIfNeeded(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MathGreaterThanOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MathGreaterThanOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputValue1[4];
|
float inputValue1[4];
|
||||||
float inputValue2[4];
|
float inputValue2[4];
|
||||||
|
|
||||||
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
|
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
|
||||||
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
|
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
|
||||||
|
|
||||||
output[0] = inputValue1[0] > inputValue2[0] ? 1.0f : 0.0f;
|
output[0] = inputValue1[0] > inputValue2[0] ? 1.0f : 0.0f;
|
||||||
|
|
||||||
clampIfNeeded(output);
|
clampIfNeeded(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MathModuloOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MathModuloOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputValue1[4];
|
float inputValue1[4];
|
||||||
float inputValue2[4];
|
float inputValue2[4];
|
||||||
|
|
||||||
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
|
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
|
||||||
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
|
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
|
||||||
|
|
||||||
if (inputValue2[0] == 0)
|
if (inputValue2[0] == 0)
|
||||||
output[0] = 0.0;
|
output[0] = 0.0;
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler) = 0;
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the execution
|
* Initialize the execution
|
||||||
@@ -73,94 +73,94 @@ public:
|
|||||||
class MathAddOperation : public MathBaseOperation {
|
class MathAddOperation : public MathBaseOperation {
|
||||||
public:
|
public:
|
||||||
MathAddOperation() : MathBaseOperation() {}
|
MathAddOperation() : MathBaseOperation() {}
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
class MathSubtractOperation : public MathBaseOperation {
|
class MathSubtractOperation : public MathBaseOperation {
|
||||||
public:
|
public:
|
||||||
MathSubtractOperation() : MathBaseOperation() {}
|
MathSubtractOperation() : MathBaseOperation() {}
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
class MathMultiplyOperation : public MathBaseOperation {
|
class MathMultiplyOperation : public MathBaseOperation {
|
||||||
public:
|
public:
|
||||||
MathMultiplyOperation() : MathBaseOperation() {}
|
MathMultiplyOperation() : MathBaseOperation() {}
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
class MathDivideOperation : public MathBaseOperation {
|
class MathDivideOperation : public MathBaseOperation {
|
||||||
public:
|
public:
|
||||||
MathDivideOperation() : MathBaseOperation() {}
|
MathDivideOperation() : MathBaseOperation() {}
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
class MathSineOperation : public MathBaseOperation {
|
class MathSineOperation : public MathBaseOperation {
|
||||||
public:
|
public:
|
||||||
MathSineOperation() : MathBaseOperation() {}
|
MathSineOperation() : MathBaseOperation() {}
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
class MathCosineOperation : public MathBaseOperation {
|
class MathCosineOperation : public MathBaseOperation {
|
||||||
public:
|
public:
|
||||||
MathCosineOperation() : MathBaseOperation() {}
|
MathCosineOperation() : MathBaseOperation() {}
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
class MathTangentOperation : public MathBaseOperation {
|
class MathTangentOperation : public MathBaseOperation {
|
||||||
public:
|
public:
|
||||||
MathTangentOperation() : MathBaseOperation() {}
|
MathTangentOperation() : MathBaseOperation() {}
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
class MathArcSineOperation : public MathBaseOperation {
|
class MathArcSineOperation : public MathBaseOperation {
|
||||||
public:
|
public:
|
||||||
MathArcSineOperation() : MathBaseOperation() {}
|
MathArcSineOperation() : MathBaseOperation() {}
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
class MathArcCosineOperation : public MathBaseOperation {
|
class MathArcCosineOperation : public MathBaseOperation {
|
||||||
public:
|
public:
|
||||||
MathArcCosineOperation() : MathBaseOperation() {}
|
MathArcCosineOperation() : MathBaseOperation() {}
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
class MathArcTangentOperation : public MathBaseOperation {
|
class MathArcTangentOperation : public MathBaseOperation {
|
||||||
public:
|
public:
|
||||||
MathArcTangentOperation() : MathBaseOperation() {}
|
MathArcTangentOperation() : MathBaseOperation() {}
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
class MathPowerOperation : public MathBaseOperation {
|
class MathPowerOperation : public MathBaseOperation {
|
||||||
public:
|
public:
|
||||||
MathPowerOperation() : MathBaseOperation() {}
|
MathPowerOperation() : MathBaseOperation() {}
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
class MathLogarithmOperation : public MathBaseOperation {
|
class MathLogarithmOperation : public MathBaseOperation {
|
||||||
public:
|
public:
|
||||||
MathLogarithmOperation() : MathBaseOperation() {}
|
MathLogarithmOperation() : MathBaseOperation() {}
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
class MathMinimumOperation : public MathBaseOperation {
|
class MathMinimumOperation : public MathBaseOperation {
|
||||||
public:
|
public:
|
||||||
MathMinimumOperation() : MathBaseOperation() {}
|
MathMinimumOperation() : MathBaseOperation() {}
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
class MathMaximumOperation : public MathBaseOperation {
|
class MathMaximumOperation : public MathBaseOperation {
|
||||||
public:
|
public:
|
||||||
MathMaximumOperation() : MathBaseOperation() {}
|
MathMaximumOperation() : MathBaseOperation() {}
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
class MathRoundOperation : public MathBaseOperation {
|
class MathRoundOperation : public MathBaseOperation {
|
||||||
public:
|
public:
|
||||||
MathRoundOperation() : MathBaseOperation() {}
|
MathRoundOperation() : MathBaseOperation() {}
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
class MathLessThanOperation : public MathBaseOperation {
|
class MathLessThanOperation : public MathBaseOperation {
|
||||||
public:
|
public:
|
||||||
MathLessThanOperation() : MathBaseOperation() {}
|
MathLessThanOperation() : MathBaseOperation() {}
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
class MathGreaterThanOperation : public MathBaseOperation {
|
class MathGreaterThanOperation : public MathBaseOperation {
|
||||||
public:
|
public:
|
||||||
MathGreaterThanOperation() : MathBaseOperation() {}
|
MathGreaterThanOperation() : MathBaseOperation() {}
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
class MathModuloOperation : public MathBaseOperation {
|
class MathModuloOperation : public MathBaseOperation {
|
||||||
public:
|
public:
|
||||||
MathModuloOperation() : MathBaseOperation() {}
|
MathModuloOperation() : MathBaseOperation() {}
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -48,15 +48,15 @@ void MixBaseOperation::initExecution()
|
|||||||
this->m_inputColor2Operation = this->getInputSocketReader(2);
|
this->m_inputColor2Operation = this->getInputSocketReader(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MixBaseOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MixBaseOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor1[4];
|
float inputColor1[4];
|
||||||
float inputColor2[4];
|
float inputColor2[4];
|
||||||
float inputValue[4];
|
float inputValue[4];
|
||||||
|
|
||||||
this->m_inputValueOperation->read(inputValue, x, y, sampler);
|
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
|
||||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
|
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
|
||||||
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
|
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
|
||||||
|
|
||||||
float value = inputValue[0];
|
float value = inputValue[0];
|
||||||
if (this->useValueAlphaMultiply()) {
|
if (this->useValueAlphaMultiply()) {
|
||||||
@@ -107,15 +107,15 @@ MixAddOperation::MixAddOperation() : MixBaseOperation()
|
|||||||
/* pass */
|
/* pass */
|
||||||
}
|
}
|
||||||
|
|
||||||
void MixAddOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MixAddOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor1[4];
|
float inputColor1[4];
|
||||||
float inputColor2[4];
|
float inputColor2[4];
|
||||||
float inputValue[4];
|
float inputValue[4];
|
||||||
|
|
||||||
this->m_inputValueOperation->read(inputValue, x, y, sampler);
|
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
|
||||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
|
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
|
||||||
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
|
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
|
||||||
|
|
||||||
float value = inputValue[0];
|
float value = inputValue[0];
|
||||||
if (this->useValueAlphaMultiply()) {
|
if (this->useValueAlphaMultiply()) {
|
||||||
@@ -136,16 +136,16 @@ MixBlendOperation::MixBlendOperation() : MixBaseOperation()
|
|||||||
/* pass */
|
/* pass */
|
||||||
}
|
}
|
||||||
|
|
||||||
void MixBlendOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MixBlendOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor1[4];
|
float inputColor1[4];
|
||||||
float inputColor2[4];
|
float inputColor2[4];
|
||||||
float inputValue[4];
|
float inputValue[4];
|
||||||
float value;
|
float value;
|
||||||
|
|
||||||
this->m_inputValueOperation->read(inputValue, x, y, sampler);
|
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
|
||||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
|
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
|
||||||
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
|
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
|
||||||
value = inputValue[0];
|
value = inputValue[0];
|
||||||
|
|
||||||
if (this->useValueAlphaMultiply()) {
|
if (this->useValueAlphaMultiply()) {
|
||||||
@@ -167,16 +167,16 @@ MixBurnOperation::MixBurnOperation() : MixBaseOperation()
|
|||||||
/* pass */
|
/* pass */
|
||||||
}
|
}
|
||||||
|
|
||||||
void MixBurnOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MixBurnOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor1[4];
|
float inputColor1[4];
|
||||||
float inputColor2[4];
|
float inputColor2[4];
|
||||||
float inputValue[4];
|
float inputValue[4];
|
||||||
float tmp;
|
float tmp;
|
||||||
|
|
||||||
this->m_inputValueOperation->read(inputValue, x, y, sampler);
|
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
|
||||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
|
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
|
||||||
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
|
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
|
||||||
|
|
||||||
float value = inputValue[0];
|
float value = inputValue[0];
|
||||||
if (this->useValueAlphaMultiply()) {
|
if (this->useValueAlphaMultiply()) {
|
||||||
@@ -235,15 +235,15 @@ MixColorOperation::MixColorOperation() : MixBaseOperation()
|
|||||||
/* pass */
|
/* pass */
|
||||||
}
|
}
|
||||||
|
|
||||||
void MixColorOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MixColorOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor1[4];
|
float inputColor1[4];
|
||||||
float inputColor2[4];
|
float inputColor2[4];
|
||||||
float inputValue[4];
|
float inputValue[4];
|
||||||
|
|
||||||
this->m_inputValueOperation->read(inputValue, x, y, sampler);
|
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
|
||||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
|
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
|
||||||
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
|
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
|
||||||
|
|
||||||
float value = inputValue[0];
|
float value = inputValue[0];
|
||||||
if (this->useValueAlphaMultiply()) {
|
if (this->useValueAlphaMultiply()) {
|
||||||
@@ -277,15 +277,15 @@ MixDarkenOperation::MixDarkenOperation() : MixBaseOperation()
|
|||||||
/* pass */
|
/* pass */
|
||||||
}
|
}
|
||||||
|
|
||||||
void MixDarkenOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MixDarkenOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor1[4];
|
float inputColor1[4];
|
||||||
float inputColor2[4];
|
float inputColor2[4];
|
||||||
float inputValue[4];
|
float inputValue[4];
|
||||||
|
|
||||||
this->m_inputValueOperation->read(inputValue, x, y, sampler);
|
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
|
||||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
|
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
|
||||||
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
|
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
|
||||||
|
|
||||||
float value = inputValue[0];
|
float value = inputValue[0];
|
||||||
if (this->useValueAlphaMultiply()) {
|
if (this->useValueAlphaMultiply()) {
|
||||||
@@ -315,15 +315,15 @@ MixDifferenceOperation::MixDifferenceOperation() : MixBaseOperation()
|
|||||||
/* pass */
|
/* pass */
|
||||||
}
|
}
|
||||||
|
|
||||||
void MixDifferenceOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MixDifferenceOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor1[4];
|
float inputColor1[4];
|
||||||
float inputColor2[4];
|
float inputColor2[4];
|
||||||
float inputValue[4];
|
float inputValue[4];
|
||||||
|
|
||||||
this->m_inputValueOperation->read(inputValue, x, y, sampler);
|
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
|
||||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
|
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
|
||||||
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
|
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
|
||||||
|
|
||||||
float value = inputValue[0];
|
float value = inputValue[0];
|
||||||
if (this->useValueAlphaMultiply()) {
|
if (this->useValueAlphaMultiply()) {
|
||||||
@@ -345,15 +345,15 @@ MixDivideOperation::MixDivideOperation() : MixBaseOperation()
|
|||||||
/* pass */
|
/* pass */
|
||||||
}
|
}
|
||||||
|
|
||||||
void MixDivideOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MixDivideOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor1[4];
|
float inputColor1[4];
|
||||||
float inputColor2[4];
|
float inputColor2[4];
|
||||||
float inputValue[4];
|
float inputValue[4];
|
||||||
|
|
||||||
this->m_inputValueOperation->read(inputValue, x, y, sampler);
|
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
|
||||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
|
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
|
||||||
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
|
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
|
||||||
|
|
||||||
float value = inputValue[0];
|
float value = inputValue[0];
|
||||||
if (this->useValueAlphaMultiply()) {
|
if (this->useValueAlphaMultiply()) {
|
||||||
@@ -386,16 +386,16 @@ MixDodgeOperation::MixDodgeOperation() : MixBaseOperation()
|
|||||||
/* pass */
|
/* pass */
|
||||||
}
|
}
|
||||||
|
|
||||||
void MixDodgeOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MixDodgeOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor1[4];
|
float inputColor1[4];
|
||||||
float inputColor2[4];
|
float inputColor2[4];
|
||||||
float inputValue[4];
|
float inputValue[4];
|
||||||
float tmp;
|
float tmp;
|
||||||
|
|
||||||
this->m_inputValueOperation->read(inputValue, x, y, sampler);
|
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
|
||||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
|
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
|
||||||
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
|
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
|
||||||
|
|
||||||
float value = inputValue[0];
|
float value = inputValue[0];
|
||||||
if (this->useValueAlphaMultiply()) {
|
if (this->useValueAlphaMultiply()) {
|
||||||
@@ -459,16 +459,16 @@ MixGlareOperation::MixGlareOperation() : MixBaseOperation()
|
|||||||
/* pass */
|
/* pass */
|
||||||
}
|
}
|
||||||
|
|
||||||
void MixGlareOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MixGlareOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor1[4];
|
float inputColor1[4];
|
||||||
float inputColor2[4];
|
float inputColor2[4];
|
||||||
float inputValue[4];
|
float inputValue[4];
|
||||||
float value;
|
float value;
|
||||||
|
|
||||||
this->m_inputValueOperation->read(inputValue, x, y, sampler);
|
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
|
||||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
|
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
|
||||||
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
|
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
|
||||||
value = inputValue[0];
|
value = inputValue[0];
|
||||||
float mf = 2.f - 2.f * fabsf(value - 0.5f);
|
float mf = 2.f - 2.f * fabsf(value - 0.5f);
|
||||||
|
|
||||||
@@ -491,15 +491,15 @@ MixHueOperation::MixHueOperation() : MixBaseOperation()
|
|||||||
/* pass */
|
/* pass */
|
||||||
}
|
}
|
||||||
|
|
||||||
void MixHueOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MixHueOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor1[4];
|
float inputColor1[4];
|
||||||
float inputColor2[4];
|
float inputColor2[4];
|
||||||
float inputValue[4];
|
float inputValue[4];
|
||||||
|
|
||||||
this->m_inputValueOperation->read(inputValue, x, y, sampler);
|
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
|
||||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
|
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
|
||||||
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
|
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
|
||||||
|
|
||||||
float value = inputValue[0];
|
float value = inputValue[0];
|
||||||
if (this->useValueAlphaMultiply()) {
|
if (this->useValueAlphaMultiply()) {
|
||||||
@@ -533,15 +533,15 @@ MixLightenOperation::MixLightenOperation() : MixBaseOperation()
|
|||||||
/* pass */
|
/* pass */
|
||||||
}
|
}
|
||||||
|
|
||||||
void MixLightenOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MixLightenOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor1[4];
|
float inputColor1[4];
|
||||||
float inputColor2[4];
|
float inputColor2[4];
|
||||||
float inputValue[4];
|
float inputValue[4];
|
||||||
|
|
||||||
this->m_inputValueOperation->read(inputValue, x, y, sampler);
|
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
|
||||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
|
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
|
||||||
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
|
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
|
||||||
|
|
||||||
float value = inputValue[0];
|
float value = inputValue[0];
|
||||||
if (this->useValueAlphaMultiply()) {
|
if (this->useValueAlphaMultiply()) {
|
||||||
@@ -569,15 +569,15 @@ MixLinearLightOperation::MixLinearLightOperation() : MixBaseOperation()
|
|||||||
/* pass */
|
/* pass */
|
||||||
}
|
}
|
||||||
|
|
||||||
void MixLinearLightOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MixLinearLightOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor1[4];
|
float inputColor1[4];
|
||||||
float inputColor2[4];
|
float inputColor2[4];
|
||||||
float inputValue[4];
|
float inputValue[4];
|
||||||
|
|
||||||
this->m_inputValueOperation->read(inputValue, x, y, sampler);
|
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
|
||||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
|
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
|
||||||
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
|
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
|
||||||
|
|
||||||
float value = inputValue[0];
|
float value = inputValue[0];
|
||||||
if (this->useValueAlphaMultiply()) {
|
if (this->useValueAlphaMultiply()) {
|
||||||
@@ -608,15 +608,15 @@ MixMultiplyOperation::MixMultiplyOperation() : MixBaseOperation()
|
|||||||
/* pass */
|
/* pass */
|
||||||
}
|
}
|
||||||
|
|
||||||
void MixMultiplyOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MixMultiplyOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor1[4];
|
float inputColor1[4];
|
||||||
float inputColor2[4];
|
float inputColor2[4];
|
||||||
float inputValue[4];
|
float inputValue[4];
|
||||||
|
|
||||||
this->m_inputValueOperation->read(inputValue, x, y, sampler);
|
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
|
||||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
|
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
|
||||||
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
|
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
|
||||||
|
|
||||||
float value = inputValue[0];
|
float value = inputValue[0];
|
||||||
if (this->useValueAlphaMultiply()) {
|
if (this->useValueAlphaMultiply()) {
|
||||||
@@ -638,15 +638,15 @@ MixOverlayOperation::MixOverlayOperation() : MixBaseOperation()
|
|||||||
/* pass */
|
/* pass */
|
||||||
}
|
}
|
||||||
|
|
||||||
void MixOverlayOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MixOverlayOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor1[4];
|
float inputColor1[4];
|
||||||
float inputColor2[4];
|
float inputColor2[4];
|
||||||
float inputValue[4];
|
float inputValue[4];
|
||||||
|
|
||||||
this->m_inputValueOperation->read(inputValue, x, y, sampler);
|
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
|
||||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
|
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
|
||||||
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
|
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
|
||||||
|
|
||||||
float value = inputValue[0];
|
float value = inputValue[0];
|
||||||
if (this->useValueAlphaMultiply()) {
|
if (this->useValueAlphaMultiply()) {
|
||||||
@@ -685,15 +685,15 @@ MixSaturationOperation::MixSaturationOperation() : MixBaseOperation()
|
|||||||
/* pass */
|
/* pass */
|
||||||
}
|
}
|
||||||
|
|
||||||
void MixSaturationOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MixSaturationOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor1[4];
|
float inputColor1[4];
|
||||||
float inputColor2[4];
|
float inputColor2[4];
|
||||||
float inputValue[4];
|
float inputValue[4];
|
||||||
|
|
||||||
this->m_inputValueOperation->read(inputValue, x, y, sampler);
|
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
|
||||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
|
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
|
||||||
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
|
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
|
||||||
|
|
||||||
float value = inputValue[0];
|
float value = inputValue[0];
|
||||||
if (this->useValueAlphaMultiply()) {
|
if (this->useValueAlphaMultiply()) {
|
||||||
@@ -724,15 +724,15 @@ MixScreenOperation::MixScreenOperation() : MixBaseOperation()
|
|||||||
/* pass */
|
/* pass */
|
||||||
}
|
}
|
||||||
|
|
||||||
void MixScreenOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MixScreenOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor1[4];
|
float inputColor1[4];
|
||||||
float inputColor2[4];
|
float inputColor2[4];
|
||||||
float inputValue[4];
|
float inputValue[4];
|
||||||
|
|
||||||
this->m_inputValueOperation->read(inputValue, x, y, sampler);
|
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
|
||||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
|
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
|
||||||
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
|
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
|
||||||
|
|
||||||
float value = inputValue[0];
|
float value = inputValue[0];
|
||||||
if (this->useValueAlphaMultiply()) {
|
if (this->useValueAlphaMultiply()) {
|
||||||
@@ -755,15 +755,15 @@ MixSoftLightOperation::MixSoftLightOperation() : MixBaseOperation()
|
|||||||
/* pass */
|
/* pass */
|
||||||
}
|
}
|
||||||
|
|
||||||
void MixSoftLightOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) \
|
void MixSoftLightOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler) \
|
||||||
{
|
{
|
||||||
float inputColor1[4];
|
float inputColor1[4];
|
||||||
float inputColor2[4];
|
float inputColor2[4];
|
||||||
float inputValue[4];
|
float inputValue[4];
|
||||||
|
|
||||||
this->m_inputValueOperation->read(inputValue, x, y, sampler);
|
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
|
||||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
|
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
|
||||||
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
|
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
|
||||||
|
|
||||||
float value = inputValue[0];
|
float value = inputValue[0];
|
||||||
if (this->useValueAlphaMultiply()) {
|
if (this->useValueAlphaMultiply()) {
|
||||||
@@ -792,15 +792,15 @@ MixSubtractOperation::MixSubtractOperation() : MixBaseOperation()
|
|||||||
/* pass */
|
/* pass */
|
||||||
}
|
}
|
||||||
|
|
||||||
void MixSubtractOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MixSubtractOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor1[4];
|
float inputColor1[4];
|
||||||
float inputColor2[4];
|
float inputColor2[4];
|
||||||
float inputValue[4];
|
float inputValue[4];
|
||||||
|
|
||||||
this->m_inputValueOperation->read(inputValue, x, y, sampler);
|
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
|
||||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
|
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
|
||||||
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
|
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
|
||||||
|
|
||||||
float value = inputValue[0];
|
float value = inputValue[0];
|
||||||
if (this->useValueAlphaMultiply()) {
|
if (this->useValueAlphaMultiply()) {
|
||||||
@@ -821,15 +821,15 @@ MixValueOperation::MixValueOperation() : MixBaseOperation()
|
|||||||
/* pass */
|
/* pass */
|
||||||
}
|
}
|
||||||
|
|
||||||
void MixValueOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MixValueOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float inputColor1[4];
|
float inputColor1[4];
|
||||||
float inputColor2[4];
|
float inputColor2[4];
|
||||||
float inputValue[4];
|
float inputValue[4];
|
||||||
|
|
||||||
this->m_inputValueOperation->read(inputValue, x, y, sampler);
|
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
|
||||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
|
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
|
||||||
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
|
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
|
||||||
|
|
||||||
float value = inputValue[0];
|
float value = inputValue[0];
|
||||||
if (this->useValueAlphaMultiply()) {
|
if (this->useValueAlphaMultiply()) {
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the execution
|
* Initialize the execution
|
||||||
@@ -83,115 +83,115 @@ public:
|
|||||||
class MixAddOperation : public MixBaseOperation {
|
class MixAddOperation : public MixBaseOperation {
|
||||||
public:
|
public:
|
||||||
MixAddOperation();
|
MixAddOperation();
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
class MixBlendOperation : public MixBaseOperation {
|
class MixBlendOperation : public MixBaseOperation {
|
||||||
public:
|
public:
|
||||||
MixBlendOperation();
|
MixBlendOperation();
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
class MixBurnOperation : public MixBaseOperation {
|
class MixBurnOperation : public MixBaseOperation {
|
||||||
public:
|
public:
|
||||||
MixBurnOperation();
|
MixBurnOperation();
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
class MixColorOperation : public MixBaseOperation {
|
class MixColorOperation : public MixBaseOperation {
|
||||||
public:
|
public:
|
||||||
MixColorOperation();
|
MixColorOperation();
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
class MixDarkenOperation : public MixBaseOperation {
|
class MixDarkenOperation : public MixBaseOperation {
|
||||||
public:
|
public:
|
||||||
MixDarkenOperation();
|
MixDarkenOperation();
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
class MixDifferenceOperation : public MixBaseOperation {
|
class MixDifferenceOperation : public MixBaseOperation {
|
||||||
public:
|
public:
|
||||||
MixDifferenceOperation();
|
MixDifferenceOperation();
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
class MixDivideOperation : public MixBaseOperation {
|
class MixDivideOperation : public MixBaseOperation {
|
||||||
public:
|
public:
|
||||||
MixDivideOperation();
|
MixDivideOperation();
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
class MixDodgeOperation : public MixBaseOperation {
|
class MixDodgeOperation : public MixBaseOperation {
|
||||||
public:
|
public:
|
||||||
MixDodgeOperation();
|
MixDodgeOperation();
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
class MixGlareOperation : public MixBaseOperation {
|
class MixGlareOperation : public MixBaseOperation {
|
||||||
public:
|
public:
|
||||||
MixGlareOperation();
|
MixGlareOperation();
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
class MixHueOperation : public MixBaseOperation {
|
class MixHueOperation : public MixBaseOperation {
|
||||||
public:
|
public:
|
||||||
MixHueOperation();
|
MixHueOperation();
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
class MixLightenOperation : public MixBaseOperation {
|
class MixLightenOperation : public MixBaseOperation {
|
||||||
public:
|
public:
|
||||||
MixLightenOperation();
|
MixLightenOperation();
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
class MixLinearLightOperation : public MixBaseOperation {
|
class MixLinearLightOperation : public MixBaseOperation {
|
||||||
public:
|
public:
|
||||||
MixLinearLightOperation();
|
MixLinearLightOperation();
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
class MixMultiplyOperation : public MixBaseOperation {
|
class MixMultiplyOperation : public MixBaseOperation {
|
||||||
public:
|
public:
|
||||||
MixMultiplyOperation();
|
MixMultiplyOperation();
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
class MixOverlayOperation : public MixBaseOperation {
|
class MixOverlayOperation : public MixBaseOperation {
|
||||||
public:
|
public:
|
||||||
MixOverlayOperation();
|
MixOverlayOperation();
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
class MixSaturationOperation : public MixBaseOperation {
|
class MixSaturationOperation : public MixBaseOperation {
|
||||||
public:
|
public:
|
||||||
MixSaturationOperation();
|
MixSaturationOperation();
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
class MixScreenOperation : public MixBaseOperation {
|
class MixScreenOperation : public MixBaseOperation {
|
||||||
public:
|
public:
|
||||||
MixScreenOperation();
|
MixScreenOperation();
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
class MixSoftLightOperation : public MixBaseOperation {
|
class MixSoftLightOperation : public MixBaseOperation {
|
||||||
public:
|
public:
|
||||||
MixSoftLightOperation();
|
MixSoftLightOperation();
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
class MixSubtractOperation : public MixBaseOperation {
|
class MixSubtractOperation : public MixBaseOperation {
|
||||||
public:
|
public:
|
||||||
MixSubtractOperation();
|
MixSubtractOperation();
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
class MixValueOperation : public MixBaseOperation {
|
class MixValueOperation : public MixBaseOperation {
|
||||||
public:
|
public:
|
||||||
MixValueOperation();
|
MixValueOperation();
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ MovieClipAttributeOperation::MovieClipAttributeOperation() : NodeOperation()
|
|||||||
this->m_attribute = MCA_X;
|
this->m_attribute = MCA_X;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MovieClipAttributeOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MovieClipAttributeOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
if (!this->m_valueSet) {
|
if (!this->m_valueSet) {
|
||||||
float loc[2], scale, angle;
|
float loc[2], scale, angle;
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* the inner loop of this program
|
* the inner loop of this program
|
||||||
*/
|
*/
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
|
void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
|
||||||
|
|
||||||
void setMovieClip(MovieClip *clip) { this->m_clip = clip; }
|
void setMovieClip(MovieClip *clip) { this->m_clip = clip; }
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ void MovieClipBaseOperation::determineResolution(unsigned int resolution[2], uns
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MovieClipBaseOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MovieClipBaseOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
ImBuf *ibuf = this->m_movieClipBuffer;
|
ImBuf *ibuf = this->m_movieClipBuffer;
|
||||||
|
|
||||||
@@ -122,9 +122,9 @@ MovieClipAlphaOperation::MovieClipAlphaOperation() : MovieClipBaseOperation()
|
|||||||
this->addOutputSocket(COM_DT_VALUE);
|
this->addOutputSocket(COM_DT_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MovieClipAlphaOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MovieClipAlphaOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
MovieClipBaseOperation::executePixel(output, x, y, sampler);
|
MovieClipBaseOperation::executePixelSampled(output, x, y, sampler);
|
||||||
output[0] = output[3];
|
output[0] = output[3];
|
||||||
output[1] = 0.0f;
|
output[1] = 0.0f;
|
||||||
output[2] = 0.0f;
|
output[2] = 0.0f;
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ public:
|
|||||||
void setCacheFrame(bool value) { this->m_cacheFrame = value; }
|
void setCacheFrame(bool value) { this->m_cacheFrame = value; }
|
||||||
|
|
||||||
void setFramenumber(int framenumber) { this->m_framenumber = framenumber; }
|
void setFramenumber(int framenumber) { this->m_framenumber = framenumber; }
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
class MovieClipOperation : public MovieClipBaseOperation {
|
class MovieClipOperation : public MovieClipBaseOperation {
|
||||||
@@ -68,7 +68,7 @@ public:
|
|||||||
class MovieClipAlphaOperation : public MovieClipBaseOperation {
|
class MovieClipAlphaOperation : public MovieClipBaseOperation {
|
||||||
public:
|
public:
|
||||||
MovieClipAlphaOperation();
|
MovieClipAlphaOperation();
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -122,16 +122,16 @@ void MovieDistortionOperation::deinitExecution()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MovieDistortionOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MovieDistortionOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (this->m_cache != NULL) {
|
if (this->m_cache != NULL) {
|
||||||
float u, v;
|
float u, v;
|
||||||
this->m_cache->getUV(&this->m_movieClip->tracking, x, y, &u, &v);
|
this->m_cache->getUV(&this->m_movieClip->tracking, x, y, &u, &v);
|
||||||
this->m_inputOperation->read(output, u, v, COM_PS_BILINEAR);
|
this->m_inputOperation->readSampled(output, u, v, COM_PS_BILINEAR);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this->m_inputOperation->read(output, x, y, COM_PS_BILINEAR);
|
this->m_inputOperation->readSampled(output, x, y, COM_PS_BILINEAR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
MovieDistortionOperation(bool distortion);
|
MovieDistortionOperation(bool distortion);
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
|
|
||||||
void initExecution();
|
void initExecution();
|
||||||
void deinitExecution();
|
void deinitExecution();
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ ImBuf *MultilayerBaseOperation::getImBuf()
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MultilayerColorOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MultilayerColorOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
int yi = y;
|
int yi = y;
|
||||||
int xi = x;
|
int xi = x;
|
||||||
@@ -70,7 +70,7 @@ void MultilayerColorOperation::executePixel(float output[4], float x, float y, P
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MultilayerValueOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MultilayerValueOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
int yi = y;
|
int yi = y;
|
||||||
int xi = x;
|
int xi = x;
|
||||||
@@ -83,7 +83,7 @@ void MultilayerValueOperation::executePixel(float output[4], float x, float y, P
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MultilayerVectorOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void MultilayerVectorOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
int yi = y;
|
int yi = y;
|
||||||
int xi = x;
|
int xi = x;
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public:
|
|||||||
MultilayerColorOperation(int passindex) : MultilayerBaseOperation(passindex) {
|
MultilayerColorOperation(int passindex) : MultilayerBaseOperation(passindex) {
|
||||||
this->addOutputSocket(COM_DT_COLOR);
|
this->addOutputSocket(COM_DT_COLOR);
|
||||||
}
|
}
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
class MultilayerValueOperation : public MultilayerBaseOperation {
|
class MultilayerValueOperation : public MultilayerBaseOperation {
|
||||||
@@ -54,7 +54,7 @@ public:
|
|||||||
MultilayerValueOperation(int passindex) : MultilayerBaseOperation(passindex) {
|
MultilayerValueOperation(int passindex) : MultilayerBaseOperation(passindex) {
|
||||||
this->addOutputSocket(COM_DT_VALUE);
|
this->addOutputSocket(COM_DT_VALUE);
|
||||||
}
|
}
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
class MultilayerVectorOperation : public MultilayerBaseOperation {
|
class MultilayerVectorOperation : public MultilayerBaseOperation {
|
||||||
@@ -62,7 +62,7 @@ public:
|
|||||||
MultilayerVectorOperation(int passindex) : MultilayerBaseOperation(passindex) {
|
MultilayerVectorOperation(int passindex) : MultilayerBaseOperation(passindex) {
|
||||||
this->addOutputSocket(COM_DT_VECTOR);
|
this->addOutputSocket(COM_DT_VECTOR);
|
||||||
}
|
}
|
||||||
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ static void write_buffer_rect(rcti *rect, const bNodeTree *tree,
|
|||||||
|
|
||||||
for (y = y1; y < y2 && (!breaked); y++) {
|
for (y = y1; y < y2 && (!breaked); y++) {
|
||||||
for (x = x1; x < x2 && (!breaked); x++) {
|
for (x = x1; x < x2 && (!breaked); x++) {
|
||||||
reader->read(color, x, y, COM_PS_NEAREST);
|
reader->readSampled(color, x, y, COM_PS_NEAREST);
|
||||||
|
|
||||||
for (i = 0; i < size; ++i)
|
for (i = 0; i < size; ++i)
|
||||||
buffer[offset + i] = color[i];
|
buffer[offset + i] = color[i];
|
||||||
|
|||||||
@@ -40,10 +40,10 @@ void PixelateOperation::deinitExecution()
|
|||||||
this->m_inputOperation = NULL;
|
this->m_inputOperation = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PixelateOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void PixelateOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float nx = round(x);
|
float nx = round(x);
|
||||||
float ny = round(y);
|
float ny = round(y);
|
||||||
this->m_inputOperation->read(output, nx, ny, sampler);
|
this->m_inputOperation->readSampled(output, nx, ny, sampler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user