if (g_adjustInf.passAdvance != 0) { if (job_info.m_nPass != 0) { signed long long step1, step2; if (printedBands % job_info.m_nPass == 0) { g_adjustInf.PassStarY = data_header.Inf.band_inf.band_Y; } step1 = (signed long long)((INT32S)data_header.Inf.band_inf.band_Y - g_adjustInf.PassStarY) * g_adjustInf.passStepValue / g_adjustInf.passAdvance + data_header.Inf.band_inf.shiftY; step2 = (signed long long)((INT32S)data_header.Inf.band_inf.nextBandY - g_adjustInf.PassStarY) * g_adjustInf.passStepValue / g_adjustInf.passAdvance + data_header.Inf.band_inf.shiftY; step_value = step2 - step1; } else { step_value = (signed long long)(data_header.Inf.band_inf.nextBandY - data_header.Inf.band_inf.band_Y) * g_adjustInf.passStepValue / g_adjustInf.passAdvance + data_header.Inf.band_inf.shiftY; } } else step_value = data_header.Inf.band_inf.step_distance;
时间: 2024-04-19 11:27:06 浏览: 120
Seas0nPass
这段代码是一个条件语句,根据条件的不同分支执行不同的操作。首先判断`g_adjustInf.passAdvance`是否为0,如果不为0,则进入第一个分支。在第一个分支中,又判断`job_info.m_nPass`是否为0,如果不为0,则进入第二个分支。
在第二个分支中,定义了两个`signed long long`类型的变量`step1`和`step2`。如果`printedBands`除以`job_info.m_nPass`的余数为0,则将`data_header.Inf.band_inf.band_Y`赋值给`g_adjustInf.PassStarY`。然后计算`step1`和`step2`的值,具体计算方法是将`(INT32S)data_header.Inf.band_inf.band_Y - g_adjustInf.PassStarY`乘以`g_adjustInf.passStepValue / g_adjustInf.passAdvance`,再加上`data_header.Inf.band_inf.shiftY`。最后,将`step2 - step1`的差值赋值给`step_value`。
在第一个分支的另一个分支中,直接计算了`step_value`的值。计算方法是将`(data_header.Inf.band_inf.nextBandY - data_header.Inf.band_inf.band_Y)`乘以`g_adjustInf.passStepValue / g_adjustInf.passAdvance`,再加上`data_header.Inf.band_inf.shiftY`。
在整个条件语句的最后一个分支中,直接将`data_header.Inf.band_inf.step_distance`赋值给`step_value`。
这段代码的逻辑比较复杂,根据不同的条件执行不同的计算,最终得到`step_value`的值。
阅读全文