Cleanup: Use C style comments for descriptive text
This commit is contained in:
parent
29590eec6e
commit
d718d6b449
|
@ -176,9 +176,9 @@ class BKE_armature_find_selected_bones_test : public testing::Test {
|
|||
bone2.childbase = {nullptr, nullptr};
|
||||
bone3.childbase = {nullptr, nullptr};
|
||||
|
||||
BLI_addtail(&arm.bonebase, &bone1); // bone1 is root bone
|
||||
BLI_addtail(&arm.bonebase, &bone2); // bone2 is root bone
|
||||
BLI_addtail(&bone2.childbase, &bone3); // bone3 has bone2 as parent
|
||||
BLI_addtail(&arm.bonebase, &bone1); /* bone1 is root bone. */
|
||||
BLI_addtail(&arm.bonebase, &bone2); /* bone2 is root bone. */
|
||||
BLI_addtail(&bone2.childbase, &bone3); /* bone3 has bone2 as parent. */
|
||||
|
||||
/* Make sure the armature & its bones are visible, to make them selectable. */
|
||||
arm.layer = bone1.layer = bone2.layer = bone3.layer = 1;
|
||||
|
|
|
@ -3978,7 +3978,7 @@ static void dynamic_paint_paint_mesh_cell_point_cb_ex(
|
|||
total_sample = gaussianTotal;
|
||||
}
|
||||
|
||||
/* Supersampling */
|
||||
/* Super-sampling */
|
||||
for (ss = 0; ss < samples; ss++) {
|
||||
float ray_start[3], ray_dir[3];
|
||||
float sample_factor = 0.0f;
|
||||
|
@ -3999,7 +3999,7 @@ static void dynamic_paint_paint_mesh_cell_point_cb_ex(
|
|||
float hitCoord[3];
|
||||
int hitTri = -1;
|
||||
|
||||
/* Supersampling factor */
|
||||
/* Super-sampling factor. */
|
||||
if (samples > 1 && surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ) {
|
||||
sample_factor = gaussianFactors[ss];
|
||||
}
|
||||
|
@ -4240,25 +4240,25 @@ static void dynamic_paint_paint_mesh_cell_point_cb_ex(
|
|||
numOfHits++;
|
||||
}
|
||||
|
||||
/* apply sample strength */
|
||||
/* Apply sample strength. */
|
||||
brushStrength += sampleStrength;
|
||||
} // end supersampling
|
||||
} /* End super-sampling. */
|
||||
|
||||
/* if any sample was inside paint range */
|
||||
/* If any sample was inside paint range. */
|
||||
if (brushStrength > 0.0f || depth > 0.0f) {
|
||||
/* apply supersampling results */
|
||||
/* Apply super-sampling results. */
|
||||
if (samples > 1) {
|
||||
brushStrength /= total_sample;
|
||||
}
|
||||
CLAMP(brushStrength, 0.0f, 1.0f);
|
||||
|
||||
if (surface->type == MOD_DPAINT_SURFACE_T_PAINT) {
|
||||
/* Get final pixel color and alpha */
|
||||
/* Get final pixel color and alpha. */
|
||||
paintColor[0] /= numOfHits;
|
||||
paintColor[1] /= numOfHits;
|
||||
paintColor[2] /= numOfHits;
|
||||
}
|
||||
/* get final object space depth */
|
||||
/* Get final object space depth. */
|
||||
else if (ELEM(surface->type, MOD_DPAINT_SURFACE_T_DISPLACE, MOD_DPAINT_SURFACE_T_WAVE)) {
|
||||
depth /= bData->bNormal[index].normal_scale * total_sample;
|
||||
}
|
||||
|
|
|
@ -481,7 +481,9 @@ static void eff_tri_ray_hit(void *UNUSED(userData),
|
|||
hit->index = 1;
|
||||
}
|
||||
|
||||
// get visibility of a wind ray
|
||||
/**
|
||||
* Get visibility of a wind ray.
|
||||
*/
|
||||
static float eff_calc_visibility(ListBase *colliders,
|
||||
EffectorCache *eff,
|
||||
EffectorData *efd,
|
||||
|
|
|
@ -1580,7 +1580,7 @@ static void emit_from_particles(Object *flow_ob,
|
|||
|
||||
/* initialize particle cache */
|
||||
if (psys->part->type == PART_HAIR) {
|
||||
// TODO: PART_HAIR not supported whatsoever
|
||||
/* TODO: PART_HAIR not supported whatsoever. */
|
||||
totchild = 0;
|
||||
}
|
||||
else {
|
||||
|
@ -1674,9 +1674,9 @@ static void emit_from_particles(Object *flow_ob,
|
|||
if (ffs->flags & FLUID_FLOW_INITVELOCITY && (psys->part->phystype != PART_PHYS_NO)) {
|
||||
madd_v3_v3fl(&bb->velocity[index * 3], &particle_vel[p * 3], ffs->vel_multi);
|
||||
}
|
||||
} // particles loop
|
||||
} /* particles loop */
|
||||
}
|
||||
else if (valid_particles > 0) { // FLUID_FLOW_USE_PART_SIZE
|
||||
else if (valid_particles > 0) { /* #FLUID_FLOW_USE_PART_SIZE */
|
||||
int min[3], max[3], res[3];
|
||||
|
||||
/* setup loop bounds */
|
||||
|
@ -3171,7 +3171,7 @@ static void update_effectors_task_cb(void *__restrict userdata,
|
|||
if ((data->fuel && MAX2(data->density[index], data->fuel[index]) < FLT_EPSILON) ||
|
||||
(data->density && data->density[index] < FLT_EPSILON) ||
|
||||
(data->phi_obs_in && data->phi_obs_in[index] < 0.0f) ||
|
||||
data->flags[index] & 2) // mantaflow convention: 2 == FlagObstacle
|
||||
data->flags[index] & 2) /* Manta-flow convention: `2 == FlagObstacle`. */
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -4253,7 +4253,7 @@ static float calc_voxel_transp(
|
|||
{
|
||||
const size_t index = manta_get_index(pixel[0], res[0], pixel[1], res[1], pixel[2]);
|
||||
|
||||
// T_ray *= T_vox
|
||||
/* `T_ray *= T_vox`. */
|
||||
*t_ray *= expf(input[index] * correct);
|
||||
|
||||
if (result[index] < 0.0f) {
|
||||
|
|
|
@ -580,7 +580,7 @@ int BKE_fcm_envelope_find_index(FCM_EnvelopeData array[],
|
|||
if (loopbreaker == (maxloop - 1)) {
|
||||
CLOG_ERROR(&LOG, "binary search was taking too long");
|
||||
|
||||
// include debug info
|
||||
/* Include debug info. */
|
||||
CLOG_ERROR(&LOG,
|
||||
"\tround = %d: start = %d, end = %d, arraylen = %d",
|
||||
loopbreaker,
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#include "BKE_lib_id.h"
|
||||
#include "BKE_linestyle.h"
|
||||
|
||||
// function declarations
|
||||
/* Function declarations. */
|
||||
static FreestyleLineSet *alloc_lineset(void);
|
||||
static void copy_lineset(FreestyleLineSet *new_lineset, FreestyleLineSet *lineset, const int flag);
|
||||
static FreestyleModuleConfig *alloc_module(void);
|
||||
|
|
|
@ -914,7 +914,7 @@ static void long_edge_queue_edge_add_recursive(
|
|||
for (int i = 0; i < ARRAY_SIZE(l_adjacent); i++) {
|
||||
float len_sq_other = BM_edge_calc_length_squared(l_adjacent[i]->e);
|
||||
if (len_sq_other > max_ff(len_sq_cmp, limit_len_sq)) {
|
||||
// edge_queue_insert(eq_ctx, l_adjacent[i]->e, -len_sq_other);
|
||||
// edge_queue_insert(eq_ctx, l_adjacent[i]->e, -len_sq_other);
|
||||
long_edge_queue_edge_add_recursive(
|
||||
eq_ctx, l_adjacent[i]->radial_next, l_adjacent[i], len_sq_other, limit_len);
|
||||
}
|
||||
|
|
|
@ -342,9 +342,9 @@ int txt_extended_ascii_as_utf8(char **str)
|
|||
return added;
|
||||
}
|
||||
|
||||
// this function removes any control characters from
|
||||
// a textline and fixes invalid utf-8 sequences
|
||||
|
||||
/**
|
||||
* Removes any control characters from a text-line and fixes invalid UTF8 sequences.
|
||||
*/
|
||||
static void cleanup_textline(TextLine *tl)
|
||||
{
|
||||
int i;
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#ifdef WIN32
|
||||
|
||||
/* standalone for inclusion in binaries other than blender */
|
||||
/* Standalone for inclusion in binaries other than Blender. */
|
||||
# ifdef USE_STANDALONE
|
||||
# define MEM_mallocN(size, str) ((void)str, malloc(size))
|
||||
# define MEM_callocN(size, str) ((void)str, calloc(size, 1))
|
||||
|
@ -33,7 +33,7 @@
|
|||
# include "MEM_guardedalloc.h"
|
||||
# endif
|
||||
|
||||
# define WIN32_SKIP_HKEY_PROTECTION // need to use HKEY
|
||||
# define WIN32_SKIP_HKEY_PROTECTION /* Need to use `HKEY`. */
|
||||
# include "BLI_utildefines.h"
|
||||
# include "BLI_winstuff.h"
|
||||
# include "utfconv.h"
|
||||
|
|
|
@ -1842,7 +1842,7 @@ void text_test(
|
|||
std::copy(b_before_arcs_in.vert.begin(), b_before_arcs_in.vert.end(), b_vert.begin());
|
||||
std::copy(b_before_arcs_in.face.begin(), b_before_arcs_in.face.end(), b_face.begin());
|
||||
if (num_arc_points > 0) {
|
||||
b_face[0].pop_last(); // We'll add center point back between arcs for outer face.
|
||||
b_face[0].pop_last(); /* We'll add center point back between arcs for outer face. */
|
||||
for (int arc = 0; arc < narcs; ++arc) {
|
||||
int arc_origin_vert;
|
||||
int arc_terminal_vert;
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
|
||||
#include "readfile.h"
|
||||
|
||||
#include "BLI_sys_types.h" // needed for intptr_t
|
||||
#include "BLI_sys_types.h" /* Needed for `intptr_t`. */
|
||||
|
||||
#ifdef WIN32
|
||||
# include "BLI_winstuff.h"
|
||||
|
|
|
@ -95,11 +95,11 @@ constexpr DataType COM_num_channels_data_type(const int num_channels)
|
|||
}
|
||||
}
|
||||
|
||||
// configurable items
|
||||
|
||||
// chunk size determination
|
||||
|
||||
// chunk order
|
||||
/* Configurable items.
|
||||
*
|
||||
* Chunk size determination.
|
||||
*
|
||||
* Chunk order. */
|
||||
/**
|
||||
* \brief The order of chunks to be scheduled
|
||||
* \ingroup Execution
|
||||
|
|
|
@ -446,7 +446,7 @@ void ExecutionGroup::finalizeChunkExecution(int chunkNumber, MemoryBuffer **memo
|
|||
MEM_freeN(memoryBuffers);
|
||||
}
|
||||
if (this->m_bTree) {
|
||||
// status report is only performed for top level Execution Groups.
|
||||
/* Status report is only performed for top level Execution Groups. */
|
||||
float progress = this->m_chunks_finished;
|
||||
progress /= this->m_chunks_len;
|
||||
this->m_bTree->progress(this->m_bTree->prh, progress);
|
||||
|
@ -494,7 +494,7 @@ void ExecutionGroup::determineChunkRect(rcti *r_rect, const unsigned int chunkNu
|
|||
|
||||
MemoryBuffer *ExecutionGroup::allocateOutputBuffer(rcti &rect)
|
||||
{
|
||||
// we assume that this method is only called from complex execution groups.
|
||||
/* We assume that this method is only called from complex execution groups. */
|
||||
NodeOperation *operation = this->getOutputOperation();
|
||||
if (operation->get_flags().is_write_buffer_operation) {
|
||||
WriteBufferOperation *writeOperation = (WriteBufferOperation *)operation;
|
||||
|
@ -510,8 +510,9 @@ bool ExecutionGroup::scheduleAreaWhenPossible(ExecutionSystem *graph, rcti *area
|
|||
if (this->m_flags.single_threaded) {
|
||||
return scheduleChunkWhenPossible(graph, 0, 0);
|
||||
}
|
||||
// find all chunks inside the rect
|
||||
// determine minxchunk, minychunk, maxxchunk, maxychunk where x and y are chunknumbers
|
||||
/* Find all chunks inside the rect
|
||||
* determine `minxchunk`, `minychunk`, `maxxchunk`, `maxychunk`
|
||||
* where x and y are chunk-numbers. */
|
||||
|
||||
int indexx, indexy;
|
||||
int minx = max_ii(area->xmin - m_viewerBorder.xmin, 0);
|
||||
|
|
|
@ -46,13 +46,13 @@ void GlareNode::convertToOperations(NodeConverter &converter,
|
|||
case 3:
|
||||
glareoperation = new GlareGhostOperation();
|
||||
break;
|
||||
case 2: // streaks
|
||||
case 2: /* Streaks. */
|
||||
glareoperation = new GlareStreaksOperation();
|
||||
break;
|
||||
case 1: // fog glow
|
||||
case 1: /* Fog glow. */
|
||||
glareoperation = new GlareFogGlowOperation();
|
||||
break;
|
||||
case 0: // simple star
|
||||
case 0: /* Simple star. */
|
||||
glareoperation = new GlareSimpleStarOperation();
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ void KeyingScreenNode::convertToOperations(NodeConverter &converter,
|
|||
|
||||
NodeOutput *outputScreen = this->getOutputSocket(0);
|
||||
|
||||
// always connect the output image
|
||||
/* Always connect the output image. */
|
||||
KeyingScreenOperation *operation = new KeyingScreenOperation();
|
||||
operation->setMovieClip(clip);
|
||||
operation->setTrackingObject(keyingscreen_data->tracking_object);
|
||||
|
|
|
@ -34,7 +34,7 @@ void ViewLevelsNode::convertToOperations(NodeConverter &converter,
|
|||
{
|
||||
NodeInput *input = this->getInputSocket(0);
|
||||
if (input->isLinked()) {
|
||||
// add preview to inputSocket;
|
||||
/* Add preview to input-socket. */
|
||||
|
||||
/* calculate mean operation */
|
||||
{
|
||||
|
|
|
@ -58,8 +58,9 @@ void ZCombineNode::convertToOperations(NodeConverter &converter,
|
|||
}
|
||||
else {
|
||||
/* XXX custom1 is "use_alpha", what on earth is this supposed to do here?!? */
|
||||
// not full anti alias, use masking for Z combine. be aware it uses anti aliasing.
|
||||
// step 1 create mask
|
||||
/* not full anti alias, use masking for Z combine. be aware it uses anti aliasing. */
|
||||
|
||||
/* Step 1 create mask. */
|
||||
NodeOperation *maskoperation;
|
||||
if (this->getbNode()->custom1) {
|
||||
maskoperation = new MathGreaterThanOperation();
|
||||
|
@ -76,13 +77,13 @@ void ZCombineNode::convertToOperations(NodeConverter &converter,
|
|||
converter.mapInputSocket(getInputSocket(3), maskoperation->getInputSocket(1));
|
||||
}
|
||||
|
||||
// step 2 anti alias mask bit of an expensive operation, but does the trick
|
||||
/* Step 2 anti alias mask bit of an expensive operation, but does the trick. */
|
||||
AntiAliasOperation *antialiasoperation = new AntiAliasOperation();
|
||||
converter.addOperation(antialiasoperation);
|
||||
|
||||
converter.addLink(maskoperation->getOutputSocket(), antialiasoperation->getInputSocket(0));
|
||||
|
||||
// use mask to blend between the input colors.
|
||||
/* use mask to blend between the input colors. */
|
||||
ZCombineMaskOperation *zcombineoperation = this->getbNode()->custom1 ?
|
||||
new ZCombineMaskAlphaOperation() :
|
||||
new ZCombineMaskOperation();
|
||||
|
|
|
@ -43,8 +43,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];
|
||||
|
@ -67,14 +67,14 @@ void BilateralBlurOperation::executePixel(float output[4], int x, int y, void *d
|
|||
*/
|
||||
for (int yi = miny; yi < maxy; yi += QualityStepHelper::getStep()) {
|
||||
for (int xi = minx; xi < maxx; xi += QualityStepHelper::getStep()) {
|
||||
// read determinator
|
||||
/* Read determinator. */
|
||||
this->m_inputDeterminatorProgram->read(determinator, xi, yi, data);
|
||||
deltaColor = (fabsf(determinatorReferenceColor[0] - determinator[0]) +
|
||||
fabsf(determinatorReferenceColor[1] - determinator[1]) +
|
||||
fabsf(determinatorReferenceColor[2] -
|
||||
determinator[2])); // do not take the alpha channel into account
|
||||
/* Do not take the alpha channel into account. */
|
||||
fabsf(determinatorReferenceColor[2] - determinator[2]));
|
||||
if (deltaColor < sigmacolor) {
|
||||
// add this to the blur
|
||||
/* Add this to the blur. */
|
||||
this->m_inputColorProgram->read(tempColor, xi, yi, data);
|
||||
add_v4_v4(blurColor, tempColor);
|
||||
blurDivider += 1.0f;
|
||||
|
|
|
@ -132,7 +132,7 @@ void ColorCorrectionOperation::executePixelSampled(float output[4],
|
|||
g = color_correct_powf_safe(g * gain + lift, invgamma, g);
|
||||
b = color_correct_powf_safe(b * gain + lift, invgamma, b);
|
||||
|
||||
// mix with mask
|
||||
/* Mix with mask. */
|
||||
r = mvalue * inputImageColor[0] + value * r;
|
||||
g = mvalue * inputImageColor[1] + value * g;
|
||||
b = mvalue * inputImageColor[2] + value * b;
|
||||
|
|
|
@ -58,7 +58,7 @@ void ConvertDepthToRadiusOperation::initExecution()
|
|||
this->m_inputOperation = this->getInputSocketReader(0);
|
||||
float focalDistance = determineFocalDistance();
|
||||
if (focalDistance == 0.0f) {
|
||||
focalDistance = 1e10f; /* if the dof is 0.0 then set it to be far away */
|
||||
focalDistance = 1e10f; /* If the DOF is 0.0 then set it to be far away. */
|
||||
}
|
||||
this->m_inverseFocalDistance = 1.0f / focalDistance;
|
||||
this->m_aspect = (this->getWidth() > this->getHeight()) ?
|
||||
|
@ -66,9 +66,9 @@ void ConvertDepthToRadiusOperation::initExecution()
|
|||
(this->getWidth() / (float)this->getHeight());
|
||||
this->m_aperture = 0.5f * (this->m_cam_lens / (this->m_aspect * cam_sensor)) / this->m_fStop;
|
||||
const float minsz = MIN2(getWidth(), getHeight());
|
||||
this->m_dof_sp = minsz /
|
||||
((cam_sensor / 2.0f) /
|
||||
this->m_cam_lens); // <- == aspect * MIN2(img->x, img->y) / tan(0.5f * fov);
|
||||
this->m_dof_sp =
|
||||
minsz / ((cam_sensor / 2.0f) /
|
||||
this->m_cam_lens); /* <- == `aspect * MIN2(img->x, img->y) / tan(0.5f * fov)` */
|
||||
|
||||
if (this->m_blurPostOperation) {
|
||||
m_blurPostOperation->setSigma(MIN2(m_aperture * 128.0f, this->m_maxRadius));
|
||||
|
@ -91,7 +91,7 @@ void ConvertDepthToRadiusOperation::executePixelSampled(float output[4],
|
|||
/* bug T6656 part 2b, do not re-scale. */
|
||||
#if 0
|
||||
bcrad = 0.5f * fabs(aperture * (dof_sp * (cam_invfdist - iZ) - 1.0f));
|
||||
// scale crad back to original maximum and blend
|
||||
/* Scale crad back to original maximum and blend. */
|
||||
crad->rect[px] = bcrad + wts->rect[px] * (scf * crad->rect[px] - bcrad);
|
||||
#endif
|
||||
radius = 0.5f * fabsf(this->m_aperture *
|
||||
|
|
|
@ -47,15 +47,15 @@ void GlareStreaksOperation::generateGlare(float *data,
|
|||
const float p4 = pow(4.0, (double)n);
|
||||
const float vxp = vx * p4, vyp = vy * p4;
|
||||
const float wt = pow((double)settings->fade, (double)p4);
|
||||
const float cmo = 1.0f -
|
||||
(float)pow((double)settings->colmod,
|
||||
(double)n +
|
||||
1); // colormodulation amount relative to current pass
|
||||
|
||||
/* Color-modulation amount relative to current pass. */
|
||||
const float cmo = 1.0f - (float)pow((double)settings->colmod, (double)n + 1);
|
||||
|
||||
float *tdstcol = tdst.getBuffer();
|
||||
for (y = 0; y < tsrc.getHeight() && (!breaked); y++) {
|
||||
for (x = 0; x < tsrc.getWidth(); x++, tdstcol += 4) {
|
||||
// first pass no offset, always same for every pass, exact copy,
|
||||
// otherwise results in uneven brightness, only need once
|
||||
/* First pass no offset, always same for every pass, exact copy,
|
||||
* otherwise results in uneven brightness, only need once. */
|
||||
if (n == 0) {
|
||||
tsrc.read(c1, x, y);
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ void GlareStreaksOperation::generateGlare(float *data,
|
|||
tsrc.readBilinear(c2, x + vxp, y + vyp);
|
||||
tsrc.readBilinear(c3, x + vxp * 2.0f, y + vyp * 2.0f);
|
||||
tsrc.readBilinear(c4, x + vxp * 3.0f, y + vyp * 3.0f);
|
||||
// modulate color to look vaguely similar to a color spectrum
|
||||
/* Modulate color to look vaguely similar to a color spectrum. */
|
||||
c2[1] *= cmo;
|
||||
c2[2] *= cmo;
|
||||
|
||||
|
|
|
@ -213,12 +213,12 @@ void ScaleAbsoluteOperation::executePixelSampled(float output[4],
|
|||
this->m_inputXOperation->readSampled(scaleX, x, y, effective_sampler);
|
||||
this->m_inputYOperation->readSampled(scaleY, x, y, effective_sampler);
|
||||
|
||||
const float scx = scaleX[0]; // target absolute scale
|
||||
const float scy = scaleY[0]; // target absolute scale
|
||||
const float scx = scaleX[0]; /* Target absolute scale. */
|
||||
const float scy = scaleY[0]; /* Target absolute scale. */
|
||||
|
||||
const float width = this->getWidth();
|
||||
const float height = this->getHeight();
|
||||
// div
|
||||
/* Divide. */
|
||||
float relativeXScale = scx / width;
|
||||
float relativeYScale = scy / height;
|
||||
|
||||
|
@ -244,7 +244,7 @@ bool ScaleAbsoluteOperation::determineDependingAreaOfInterest(rcti *input,
|
|||
const float scy = scaleY[0];
|
||||
const float width = this->getWidth();
|
||||
const float height = this->getHeight();
|
||||
// div
|
||||
/* Divide. */
|
||||
float relateveXScale = scx / width;
|
||||
float relateveYScale = scy / height;
|
||||
|
||||
|
|
|
@ -369,7 +369,7 @@ bool ScreenLensDistortionOperation::determineDependingAreaOfInterest(
|
|||
void ScreenLensDistortionOperation::updateVariables(float distortion, float dispersion)
|
||||
{
|
||||
m_k[1] = max_ff(min_ff(distortion, 1.0f), -0.999f);
|
||||
// smaller dispersion range for somewhat more control
|
||||
/* Smaller dispersion range for somewhat more control. */
|
||||
float d = 0.25f * max_ff(min_ff(dispersion, 1.0f), 0.0f);
|
||||
m_k[0] = max_ff(min_ff((m_k[1] + d), 1.0f), -0.999f);
|
||||
m_k[2] = max_ff(min_ff((m_k[1] - d), 1.0f), -0.999f);
|
||||
|
|
|
@ -28,11 +28,11 @@ namespace blender::compositor {
|
|||
VariableSizeBokehBlurOperation::VariableSizeBokehBlurOperation()
|
||||
{
|
||||
this->addInputSocket(DataType::Color);
|
||||
this->addInputSocket(DataType::Color, ResizeMode::None); // do not resize the bokeh image.
|
||||
this->addInputSocket(DataType::Value); // radius
|
||||
this->addInputSocket(DataType::Color, ResizeMode::None); /* Do not resize the bokeh image. */
|
||||
this->addInputSocket(DataType::Value); /* Radius. */
|
||||
#ifdef COM_DEFOCUS_SEARCH
|
||||
this->addInputSocket(DataType::Color,
|
||||
ResizeMode::None); // inverse search radius optimization structure.
|
||||
/* Inverse search radius optimization structure. */
|
||||
this->addInputSocket(DataType::Color, ResizeMode::None);
|
||||
#endif
|
||||
this->addOutputSocket(DataType::Color);
|
||||
flags.complex = true;
|
||||
|
@ -438,10 +438,10 @@ void VariableSizeBokehBlurOperation::update_memory_buffer_partial(MemoryBuffer *
|
|||
}
|
||||
|
||||
#ifdef COM_DEFOCUS_SEARCH
|
||||
// InverseSearchRadiusOperation
|
||||
/* #InverseSearchRadiusOperation. */
|
||||
InverseSearchRadiusOperation::InverseSearchRadiusOperation()
|
||||
{
|
||||
this->addInputSocket(DataType::Value, ResizeMode::None); // radius
|
||||
this->addInputSocket(DataType::Value, ResizeMode::None); /* Radius. */
|
||||
this->addOutputSocket(DataType::Color);
|
||||
this->flags.complex = true;
|
||||
this->m_inputRadius = nullptr;
|
||||
|
@ -472,37 +472,39 @@ void *InverseSearchRadiusOperation::initializeTileData(rcti *rect)
|
|||
offset += 4;
|
||||
}
|
||||
}
|
||||
// for (x = rect->xmin; x < rect->xmax ; x++) {
|
||||
// for (y = rect->ymin; y < rect->ymax ; y++) {
|
||||
// int rx = x * DIVIDER;
|
||||
// int ry = y * DIVIDER;
|
||||
// float radius = 0.0f;
|
||||
// float maxx = x;
|
||||
// float maxy = y;
|
||||
# if 0
|
||||
for (x = rect->xmin; x < rect->xmax; x++) {
|
||||
for (y = rect->ymin; y < rect->ymax; y++) {
|
||||
int rx = x * DIVIDER;
|
||||
int ry = y * DIVIDER;
|
||||
float radius = 0.0f;
|
||||
float maxx = x;
|
||||
float maxy = y;
|
||||
|
||||
// for (int x2 = 0 ; x2 < DIVIDER ; x2 ++) {
|
||||
// for (int y2 = 0 ; y2 < DIVIDER ; y2 ++) {
|
||||
// this->m_inputRadius->read(temp, rx+x2, ry+y2, PixelSampler::Nearest);
|
||||
// if (radius < temp[0]) {
|
||||
// radius = temp[0];
|
||||
// maxx = x2;
|
||||
// maxy = y2;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// int impactRadius = ceil(radius / DIVIDER);
|
||||
// for (int x2 = x - impactRadius ; x2 < x + impactRadius ; x2 ++) {
|
||||
// for (int y2 = y - impactRadius ; y2 < y + impactRadius ; y2 ++) {
|
||||
// data->read(temp, x2, y2);
|
||||
// temp[0] = MIN2(temp[0], maxx);
|
||||
// temp[1] = MIN2(temp[1], maxy);
|
||||
// temp[2] = MAX2(temp[2], maxx);
|
||||
// temp[3] = MAX2(temp[3], maxy);
|
||||
// data->writePixel(x2, y2, temp);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
for (int x2 = 0; x2 < DIVIDER; x2++) {
|
||||
for (int y2 = 0; y2 < DIVIDER; y2++) {
|
||||
this->m_inputRadius->read(temp, rx + x2, ry + y2, PixelSampler::Nearest);
|
||||
if (radius < temp[0]) {
|
||||
radius = temp[0];
|
||||
maxx = x2;
|
||||
maxy = y2;
|
||||
}
|
||||
}
|
||||
}
|
||||
int impactRadius = ceil(radius / DIVIDER);
|
||||
for (int x2 = x - impactRadius; x2 < x + impactRadius; x2++) {
|
||||
for (int y2 = y - impactRadius; y2 < y + impactRadius; y2++) {
|
||||
data->read(temp, x2, y2);
|
||||
temp[0] = MIN2(temp[0], maxx);
|
||||
temp[1] = MIN2(temp[1], maxy);
|
||||
temp[2] = MAX2(temp[2], maxx);
|
||||
temp[3] = MAX2(temp[3], maxy);
|
||||
data->writePixel(x2, y2, temp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
# endif
|
||||
return data;
|
||||
}
|
||||
|
||||
|
|
|
@ -264,7 +264,7 @@ void compute_node_loc(const int column, float *r_locx, float *r_locy, NodePlacem
|
|||
r_ctx->column_offsets[column] += r_ctx->vertical_step + 10.0f;
|
||||
}
|
||||
|
||||
} // End anonymous namespace.
|
||||
} // namespace
|
||||
|
||||
USDMaterialReader::USDMaterialReader(const USDImportParams ¶ms, Main *bmain)
|
||||
: params_(params), bmain_(bmain)
|
||||
|
|
|
@ -170,10 +170,10 @@ static void deformVerts(ModifierData *md,
|
|||
mul_m4_v3(ob->obmat, collmd->x[i].co);
|
||||
}
|
||||
|
||||
collmd->xnew = MEM_dupallocN(collmd->x); // frame end position
|
||||
collmd->current_x = MEM_dupallocN(collmd->x); // inter-frame
|
||||
collmd->current_xnew = MEM_dupallocN(collmd->x); // inter-frame
|
||||
collmd->current_v = MEM_dupallocN(collmd->x); // inter-frame
|
||||
collmd->xnew = MEM_dupallocN(collmd->x); /* Frame end position. */
|
||||
collmd->current_x = MEM_dupallocN(collmd->x); /* Inter-frame. */
|
||||
collmd->current_xnew = MEM_dupallocN(collmd->x); /* Inter-frame. */
|
||||
collmd->current_v = MEM_dupallocN(collmd->x); /* Inter-frame. */
|
||||
|
||||
collmd->mvert_num = mvert_num;
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ static bNodeSocketTemplate cmp_node_doubleedgemask_out[] = {
|
|||
|
||||
void register_node_type_cmp_doubleedgemask(void)
|
||||
{
|
||||
static bNodeType ntype; // allocate a node type data structure
|
||||
static bNodeType ntype; /* Allocate a node type data structure. */
|
||||
|
||||
cmp_node_type_base(&ntype, CMP_NODE_DOUBLEEDGEMASK, "Double Edge Mask", NODE_CLASS_MATTE, 0);
|
||||
node_type_socket_templates(&ntype, cmp_node_doubleedgemask_in, cmp_node_doubleedgemask_out);
|
||||
|
|
|
@ -978,7 +978,7 @@ static void apply_tangmat_callback(DerivedMesh *lores_dm,
|
|||
#if 0
|
||||
/* **************** Ambient Occlusion Baker **************** */
|
||||
|
||||
// must be a power of two
|
||||
/* Must be a power of two. */
|
||||
# define MAX_NUMBER_OF_AO_RAYS 1024
|
||||
|
||||
static unsigned short ao_random_table_1[MAX_NUMBER_OF_AO_RAYS];
|
||||
|
|
Loading…
Reference in New Issue