diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-05-01 03:50:02 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-05-01 03:51:13 +0300 |
commit | c7041403d0e52a1ddffefb1db5713dbb8e6908c7 (patch) | |
tree | 3eccb37efa2c624af31b5f067e3d3b5242fc0eb4 /source/blender/compositor/operations | |
parent | 63f0e150edaeea26fbcc48f62597f4f5c71cc64a (diff) |
Cleanup: comments (long lines) in compositor
Diffstat (limited to 'source/blender/compositor/operations')
19 files changed, 67 insertions, 49 deletions
diff --git a/source/blender/compositor/operations/COM_BilateralBlurOperation.cpp b/source/blender/compositor/operations/COM_BilateralBlurOperation.cpp index 5628c575b70..44cb4056c99 100644 --- a/source/blender/compositor/operations/COM_BilateralBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_BilateralBlurOperation.cpp @@ -44,7 +44,8 @@ void BilateralBlurOperation::initExecution() void BilateralBlurOperation::executePixel(float output[4], int x, int y, void *data) { - // read the determinator color at x, y, this will be used as the reference color for the determinator + // read the determinator color at x, y, this will be used as the reference color for the + // determinator float determinatorReferenceColor[4]; float determinator[4]; float tempColor[4]; diff --git a/source/blender/compositor/operations/COM_BokehImageOperation.h b/source/blender/compositor/operations/COM_BokehImageOperation.h index 58a1e2f85d8..2bb3e5bc1ab 100644 --- a/source/blender/compositor/operations/COM_BokehImageOperation.h +++ b/source/blender/compositor/operations/COM_BokehImageOperation.h @@ -21,8 +21,8 @@ #include "COM_NodeOperation.h" /** - * \brief The BokehImageOperation class is an operation that creates an image useful to mimic the internals - *of a camera. + * \brief The BokehImageOperation class is an operation that creates an image useful to mimic the + *internals of a camera. * * features: * - number of flaps @@ -31,20 +31,21 @@ * - simulate catadioptric * - simulate lensshift * - * Per pixel the algorithm determines the edge of the bokeh on the same line as the center of the image and the pixel - * is evaluating. + * Per pixel the algorithm determines the edge of the bokeh on the same line as the center of the + *image and the pixel is evaluating. * - * The edge is detected by finding the closest point on the direct line between the two nearest flap-corners. - * this edge is interpolated with a full circle. - * Result of this edge detection is stored as the distance between the center of the image and the edge. + * The edge is detected by finding the closest point on the direct line between the two nearest + *flap-corners. this edge is interpolated with a full circle. Result of this edge detection is + *stored as the distance between the center of the image and the edge. * - * catadioptric lenses are simulated to interpolate between the center of the image and the distance of the edge. - * We now have three distances: + * catadioptric lenses are simulated to interpolate between the center of the image and the + *distance of the edge. We now have three distances: * - distance between the center of the image and the pixel to be evaluated * - distance between the center of the image and the outer-edge * - distance between the center of the image and the inner-edge * - * With a simple compare it can be detected if the evaluated pixel is between the outer and inner edge. + * With a simple compare it can be detected if the evaluated pixel is between the outer and inner + *edge. */ class BokehImageOperation : public NodeOperation { private: @@ -95,7 +96,8 @@ class BokehImageOperation : public NodeOperation { /** * \brief Determine if a coordinate is inside the bokeh image * - * \param distance: the distance that will be used. This parameter is modified a bit to mimic lens shifts + * \param distance: the distance that will be used. + * This parameter is modified a bit to mimic lens shifts. * \param x: the x coordinate of the pixel to evaluate * \param y: the y coordinate of the pixel to evaluate * \return float range 0..1 0 is completely outside @@ -121,9 +123,8 @@ class BokehImageOperation : public NodeOperation { void deinitExecution(); /** - * \brief determine the resolution of this operation. currently fixed at [COM_BLUR_BOKEH_PIXELS, COM_BLUR_BOKEH_PIXELS] - * \param resolution: - * \param preferredResolution: + * \brief determine the resolution of this operation. currently fixed at [COM_BLUR_BOKEH_PIXELS, + * COM_BLUR_BOKEH_PIXELS] \param resolution: \param preferredResolution: */ void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); diff --git a/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.h b/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.h index 3f5c0896221..7fb9d839d2d 100644 --- a/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.h +++ b/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.h @@ -22,7 +22,8 @@ #include "DNA_node_types.h" #include "COM_CalculateMeanOperation.h" /** - * \brief base class of CalculateStandardDeviation, implementing the simple CalculateStandardDeviation + * \brief base class of CalculateStandardDeviation, + * implementing the simple CalculateStandardDeviation. * \ingroup operation */ class CalculateStandardDeviationOperation : public CalculateMeanOperation { diff --git a/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.cpp b/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.cpp index c48c39f7726..68b5af3089a 100644 --- a/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.cpp +++ b/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.cpp @@ -24,7 +24,8 @@ inline float colorbalance_lgg(float in, float lift_lgg, float gamma_inv, float g /* 1:1 match with the sequencer with linear/srgb conversions, the conversion isnt pretty * but best keep it this way, sice testing for durian shows a similar calculation * without lin/srgb conversions gives bad results (over-saturated shadows) with colors - * slightly below 1.0. some correction can be done but it ends up looking bad for shadows or lighter tones - campbell */ + * slightly below 1.0. some correction can be done but it ends up looking bad for shadows or + * lighter tones - campbell */ float x = (((linearrgb_to_srgb(in) - 1.0f) * lift_lgg) + 1.0f) * gain; /* prevent NaN */ diff --git a/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.cpp b/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.cpp index c47e4d560a5..704f7cfad39 100644 --- a/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.cpp +++ b/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.cpp @@ -95,7 +95,8 @@ void ConvertDepthToRadiusOperation::executePixelSampled(float output[4], #endif radius = 0.5f * fabsf(this->m_aperture * (this->m_dof_sp * (this->m_inverseFocalDistance - iZ) - 1.0f)); - // 'bug' #6615, limit minimum radius to 1 pixel, not really a solution, but somewhat mitigates the problem + // 'bug' #6615, limit minimum radius to 1 pixel, not really a solution, but somewhat mitigates + // the problem if (radius < 0.0f) { radius = 0.0f; } diff --git a/source/blender/compositor/operations/COM_DespeckleOperation.cpp b/source/blender/compositor/operations/COM_DespeckleOperation.cpp index 807450040de..9b8d72da26d 100644 --- a/source/blender/compositor/operations/COM_DespeckleOperation.cpp +++ b/source/blender/compositor/operations/COM_DespeckleOperation.cpp @@ -70,7 +70,7 @@ void DespeckleOperation::executePixel(float output[4], int x, int y, void * /*da CLAMP(y3, 0, getHeight() - 1); float value[4]; this->m_inputValueOperation->read(value, x2, y2, NULL); - //const float mval = 1.0f - value[0]; + // const float mval = 1.0f - value[0]; this->m_inputOperation->read(color_org, x2, y2, NULL); @@ -115,7 +115,7 @@ void DespeckleOperation::executePixel(float output[4], int x, int y, void * /*da COLOR_ADD(TOT_DIV_CNR) mul_v4_fl(color_mid, 1.0f / (4.0f + (4.0f * (float)M_SQRT1_2))); - //mul_v4_fl(color_mid, 1.0f / w); + // mul_v4_fl(color_mid, 1.0f / w); if ((w != 0.0f) && ((w / WTOT) > (this->m_threshold_neighbor)) && color_diff(color_mid, color_org, this->m_threshold)) { diff --git a/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp b/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp index cd1dae2c9b5..f872388e3c7 100644 --- a/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp +++ b/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp @@ -950,12 +950,16 @@ static void do_createEdgeLocationBuffer(unsigned int t, unsigned int rsl; // long used for finding fast 1.0/sqrt unsigned int gradientFillOffset; - unsigned int innerAccum = - 0; // for looping inner edge pixel indexes, represents current position from offset - unsigned int outerAccum = - 0; // for looping outer edge pixel indexes, represents current position from offset - unsigned int gradientAccum = - 0; // for looping gradient pixel indexes, represents current position from offset + + /* For looping inner edge pixel indexes, represents current position from offset. */ + unsigned int innerAccum = 0; + /* For looping outer edge pixel indexes, represents current position from offset. */ + unsigned int outerAccum = 0; + /* For looping gradient pixel indexes, represents current position from offset. */ + unsigned int gradientAccum = 0; + + /* */ + /* clang-format off */ /* * Here we compute the size of buffer needed to hold (row,col) coordinates * for each pixel previously determined to be either gradient, inner edge, @@ -1017,6 +1021,7 @@ static void do_createEdgeLocationBuffer(unsigned int t, * each iteration of the final gradient calculation than it is to deconstruct * a memory location into x,y pairs each round. */ + /* clang-format on */ gradientFillOffset = 0; // since there are likely "more" of these, put it first. :) *innerEdgeOffset = gradientFillOffset + gsz; // set start of inner edge indexes @@ -1025,7 +1030,7 @@ static void do_createEdgeLocationBuffer(unsigned int t, gradientAccum = gradientFillOffset; // each accumulator variable starts at its respective innerAccum = *innerEdgeOffset; // section's offset so when we start filling, each outerAccum = *outerEdgeOffset; // section fills up it's allocated space in gbuf - //uses dmin=row, rsl=col + // uses dmin=row, rsl=col for (x = 0, dmin = 0; x < t; x += rw, dmin++) { for (rsl = 0; rsl < rw; rsl++) { a = x + rsl; @@ -1187,7 +1192,7 @@ static void do_fillGradientBuffer(unsigned int rw, * Pixel Index = Pixel Column + ( Pixel Row * Row Width ) */ res[gbuf[gradientFillOffset + 1] + (gbuf[gradientFillOffset] * rw)] = - (idist / (idist + odist)); //set intensity + (idist / (idist + odist)); // set intensity } } diff --git a/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp b/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp index 8d11328b63b..2c12091c458 100644 --- a/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp @@ -147,7 +147,8 @@ void FastGaussianBlurOperation::IIR_gauss(MemoryBuffer *src, } // see "Recursive Gabor Filtering" by Young/VanVliet - // all factors here in double.prec. Required, because for single.prec it seems to blow up if sigma > ~200 + // all factors here in double.prec. + // Required, because for single.prec it seems to blow up if sigma > ~200 if (sigma >= 3.556f) { q = 0.9804f * (sigma - 3.556f) + 2.5091f; } diff --git a/source/blender/compositor/operations/COM_GlareFogGlowOperation.cpp b/source/blender/compositor/operations/COM_GlareFogGlowOperation.cpp index ff75fb7090f..1f5749d782c 100644 --- a/source/blender/compositor/operations/COM_GlareFogGlowOperation.cpp +++ b/source/blender/compositor/operations/COM_GlareFogGlowOperation.cpp @@ -83,7 +83,7 @@ static void FHT(fREAL *data, unsigned int M, unsigned int inverse) n2 = n >> 1; if (n > 2) { fc = dc = cos(a); - fs = ds = sqrt(1.0 - fc * fc); //sin(a); + fs = ds = sqrt(1.0 - fc * fc); // sin(a); bd = n - 2; for (bl = 1; bl < n2; bl++) { fREAL *data_nbd = &data_n[bd]; @@ -431,7 +431,7 @@ void GlareFogGlowOperation::generateGlare(float *data, fcol[1] = expf(d * cs_g); fcol[2] = expf(d * cs_b); // linear window good enough here, visual result counts, not scientific analysis - //w = (1.0f-fabs(u))*(1.0f-fabs(v)); + // w = (1.0f-fabs(u))*(1.0f-fabs(v)); // actually, Hanning window is ok, cos^2 for some reason is slower w = (0.5f + 0.5f * cosf(u * (float)M_PI)) * (0.5f + 0.5f * cosf(v * (float)M_PI)); mul_v3_fl(fcol, w); diff --git a/source/blender/compositor/operations/COM_MapRangeOperation.cpp b/source/blender/compositor/operations/COM_MapRangeOperation.cpp index 46bd015163b..ff5804a63a4 100644 --- a/source/blender/compositor/operations/COM_MapRangeOperation.cpp +++ b/source/blender/compositor/operations/COM_MapRangeOperation.cpp @@ -39,7 +39,8 @@ void MapRangeOperation::initExecution() this->m_destMaxOperation = this->getInputSocketReader(4); } -/* 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 void MapRangeOperation::executePixelSampled(float output[4], diff --git a/source/blender/compositor/operations/COM_NormalizeOperation.cpp b/source/blender/compositor/operations/COM_NormalizeOperation.cpp index da594be2268..f7e689fa008 100644 --- a/source/blender/compositor/operations/COM_NormalizeOperation.cpp +++ b/source/blender/compositor/operations/COM_NormalizeOperation.cpp @@ -80,7 +80,8 @@ bool NormalizeOperation::determineDependingAreaOfInterest(rcti * /*input*/, return false; } -/* 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 void *NormalizeOperation::initializeTileData(rcti *rect) diff --git a/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp b/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp index f6cbb8f69c1..9d1be09de0e 100644 --- a/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp +++ b/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp @@ -39,7 +39,7 @@ extern "C" { #include "IMB_imbuf_types.h" } -/************************************ OpenEXR Singlelayer Multiview *****************************************/ +/************************************ OpenEXR Singlelayer Multiview ******************************/ OutputOpenExrSingleLayerMultiViewOperation::OutputOpenExrSingleLayerMultiViewOperation( const RenderData *rd, @@ -142,7 +142,7 @@ void OutputOpenExrSingleLayerMultiViewOperation::deinitExecution() } } -/************************************ OpenEXR Multilayer Multiview *****************************************/ +/************************************ OpenEXR Multilayer Multiview *******************************/ OutputOpenExrMultiLayerMultiViewOperation::OutputOpenExrMultiLayerMultiViewOperation( const RenderData *rd, diff --git a/source/blender/compositor/operations/COM_PlaneCornerPinOperation.cpp b/source/blender/compositor/operations/COM_PlaneCornerPinOperation.cpp index 90bc859a1bb..313be2f5ecf 100644 --- a/source/blender/compositor/operations/COM_PlaneCornerPinOperation.cpp +++ b/source/blender/compositor/operations/COM_PlaneCornerPinOperation.cpp @@ -223,5 +223,8 @@ bool PlaneCornerPinWarpImageOperation::determineDependingAreaOfInterest( output->xmax = getInputOperation(0)->getWidth(); output->ymax = getInputOperation(0)->getHeight(); return true; - // return PlaneDistortWarpImageOperation::determineDependingAreaOfInterest(input, readOperation, output); +#if 0 + return PlaneDistortWarpImageOperation::determineDependingAreaOfInterest( + input, readOperation, output); +#endif } diff --git a/source/blender/compositor/operations/COM_ScaleOperation.cpp b/source/blender/compositor/operations/COM_ScaleOperation.cpp index 3663d56dc87..1c5b2a71859 100644 --- a/source/blender/compositor/operations/COM_ScaleOperation.cpp +++ b/source/blender/compositor/operations/COM_ScaleOperation.cpp @@ -155,7 +155,7 @@ void ScaleAbsoluteOperation::executePixelSampled(float output[4], const float width = this->getWidth(); const float height = this->getHeight(); - //div + // div float relativeXScale = scx / width; float relativeYScale = scy / height; @@ -181,7 +181,7 @@ bool ScaleAbsoluteOperation::determineDependingAreaOfInterest(rcti *input, const float scy = scaleY[0]; const float width = this->getWidth(); const float height = this->getHeight(); - //div + // div float relateveXScale = scx / width; float relateveYScale = scy / height; diff --git a/source/blender/compositor/operations/COM_SunBeamsOperation.cpp b/source/blender/compositor/operations/COM_SunBeamsOperation.cpp index 80b1c1f798a..6f47e0e190b 100644 --- a/source/blender/compositor/operations/COM_SunBeamsOperation.cpp +++ b/source/blender/compositor/operations/COM_SunBeamsOperation.cpp @@ -146,8 +146,8 @@ template<int fxu, int fxv, int fyu, int fyv> struct BufferLineAccumulator { * Perform the actual accumulation along a ray segment from source to pt. * Only pixels within dist_min..dist_max contribute. * - * The loop runs backwards(!) over the primary sector space axis u, i.e. increasing distance to pt. - * After each step it decrements v by dv < 1, adding a buffer shift when necessary. + * The loop runs backwards(!) over the primary sector space axis u, i.e. increasing distance to + * pt. After each step it decrements v by dv < 1, adding a buffer shift when necessary. */ static void eval(MemoryBuffer *input, float output[4], @@ -229,11 +229,12 @@ template<int fxu, int fxv, int fyu, int fyv> struct BufferLineAccumulator { }; /** - * Dispatch function which selects an appropriate accumulator based on the sector of the target point, - * relative to the source. + * Dispatch function which selects an appropriate accumulator based on the sector of the target + * point, relative to the source. * * The BufferLineAccumulator defines the actual loop over the buffer, with an efficient inner loop - * due to using compile time constants instead of a local matrix variable defining the sector space. + * due to using compile time constants instead of a local matrix variable defining the sector + * space. */ static void accumulate_line(MemoryBuffer *input, float output[4], diff --git a/source/blender/compositor/operations/COM_TextureOperation.cpp b/source/blender/compositor/operations/COM_TextureOperation.cpp index 4cc9d7a748c..f2d78845b6c 100644 --- a/source/blender/compositor/operations/COM_TextureOperation.cpp +++ b/source/blender/compositor/operations/COM_TextureOperation.cpp @@ -29,8 +29,8 @@ extern "C" { TextureBaseOperation::TextureBaseOperation() : NodeOperation() { - this->addInputSocket(COM_DT_VECTOR); //offset - this->addInputSocket(COM_DT_VECTOR); //size + this->addInputSocket(COM_DT_VECTOR); // offset + this->addInputSocket(COM_DT_VECTOR); // size this->m_texture = NULL; this->m_inputSize = NULL; this->m_inputOffset = NULL; diff --git a/source/blender/compositor/operations/COM_VectorBlurOperation.cpp b/source/blender/compositor/operations/COM_VectorBlurOperation.cpp index fb86b04cff7..8e67b8ac786 100644 --- a/source/blender/compositor/operations/COM_VectorBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_VectorBlurOperation.cpp @@ -46,7 +46,7 @@ VectorBlurOperation::VectorBlurOperation() : NodeOperation() { this->addInputSocket(COM_DT_COLOR); this->addInputSocket(COM_DT_VALUE); // ZBUF - this->addInputSocket(COM_DT_COLOR); //SPEED + this->addInputSocket(COM_DT_COLOR); // SPEED this->addOutputSocket(COM_DT_COLOR); this->m_settings = NULL; this->m_cachedInstance = NULL; @@ -409,7 +409,8 @@ static void zbuf_fill_in_rgba( } /* char value==255 is filled in, rest should be zero */ -/* returns alpha values, but sets alpha to 1 for zero alpha pixels that have an alpha value as neighbor */ +/* returns alpha values, + * but sets alpha to 1 for zero alpha pixels that have an alpha value as neighbor. */ void antialias_tagbuf(int xsize, int ysize, char *rectmove) { char *row1, *row2, *row3; diff --git a/source/blender/compositor/operations/COM_WrapOperation.cpp b/source/blender/compositor/operations/COM_WrapOperation.cpp index cb119fb4f1d..c25e8ba897c 100644 --- a/source/blender/compositor/operations/COM_WrapOperation.cpp +++ b/source/blender/compositor/operations/COM_WrapOperation.cpp @@ -53,7 +53,7 @@ void WrapOperation::executePixelSampled(float output[4], float x, float y, Pixel MemoryBufferExtend extend_x = COM_MB_CLIP, extend_y = COM_MB_CLIP; switch (m_wrappingType) { case CMP_NODE_WRAP_NONE: - //Intentionally empty, originalXPos and originalYPos have been set before + // Intentionally empty, originalXPos and originalYPos have been set before break; case CMP_NODE_WRAP_X: // wrap only on the x-axis diff --git a/source/blender/compositor/operations/COM_ZCombineOperation.cpp b/source/blender/compositor/operations/COM_ZCombineOperation.cpp index 222f42e8241..767280e2cd2 100644 --- a/source/blender/compositor/operations/COM_ZCombineOperation.cpp +++ b/source/blender/compositor/operations/COM_ZCombineOperation.cpp @@ -97,7 +97,7 @@ void ZCombineOperation::deinitExecution() // MASK combine ZCombineMaskOperation::ZCombineMaskOperation() : NodeOperation() { - this->addInputSocket(COM_DT_VALUE); //mask + this->addInputSocket(COM_DT_VALUE); // mask this->addInputSocket(COM_DT_COLOR); this->addInputSocket(COM_DT_COLOR); this->addOutputSocket(COM_DT_COLOR); |