!215 修复类型转换编译告警

Merge pull request !215 from suwenxiang/OpenHarmony-3.2-Beta3
This commit is contained in:
openharmony_ci
2022-09-28 14:05:47 +00:00
committed by Gitee
4 changed files with 13 additions and 11 deletions
@@ -58,7 +58,9 @@ public:
if (isGetRGBAIntegral) {
GetRGBAIntegralImage((uint8_t*)img.PixValuePtr(0, 0), width, height, stride);
}
#ifdef __ICCARM__
#pragma omp parallel for
#endif
for (int32_t y = 0; y < height; y++) {
int32_t y1 = MATH_MAX(y - radius, 0);
int32_t y2 = MATH_MIN(y + radius + 1, height);
@@ -65,8 +65,8 @@ public:
: interpolator_(&inter),
gradientFunction_(&GradientFunction),
colorFunction_(&ColorFunction),
distance1_(distance1 * GRADIENT_SUBPIXEL_SCALE),
distance2_(distance2 * GRADIENT_SUBPIXEL_SCALE) {}
distance1_(static_cast<int32_t>(distance1 * GRADIENT_SUBPIXEL_SCALE)),
distance2_(static_cast<int32_t>(distance2 * GRADIENT_SUBPIXEL_SCALE)) {}
void Prepare() {}
@@ -121,9 +121,9 @@ public:
* @param dy In the y-axis direction, the distance from the end circle center to the start circle center
*/
GradientRadialCalculate(float endRadius, float dx, float dy)
: endRadius_(endRadius * GRADIENT_SUBPIXEL_SCALE),
dx_(dx * GRADIENT_SUBPIXEL_SCALE),
dy_(dy * GRADIENT_SUBPIXEL_SCALE)
: endRadius_(static_cast<int32_t>(endRadius * GRADIENT_SUBPIXEL_SCALE)),
dx_(static_cast<int32_t>(dx * GRADIENT_SUBPIXEL_SCALE)),
dy_(static_cast<int32_t>(dy * GRADIENT_SUBPIXEL_SCALE))
{
UpdateValues();
}
@@ -149,9 +149,9 @@ public:
if (deltaRadius < 1) {
deltaRadius = 1;
}
int16_t index = (((dx * dx_ + dy * dy_ +
int16_t index = static_cast<int16_t>((((dx * dx_ + dy * dy_ +
Sqrt(fabs(radiusDistance)))
* mul_ - startRadius) * size) / deltaRadius;
* mul_ - startRadius) * size) / deltaRadius);
if (index < 0) {
index = 0;
}
@@ -81,7 +81,7 @@ public:
colorProfile_.ReSize(RemoveDuplicates(colorProfile_, OffsetEqual));
if (colorProfile_.Size() > 1) {
uint32_t index;
uint32_t start = colorProfile_[0].offset * colorLutSize_;
uint32_t start = static_cast<uint32_t>(colorProfile_[0].offset * colorLutSize_);
uint32_t end;
Rgba8T color = colorProfile_[0].color;
@@ -95,7 +95,7 @@ public:
* From 1 to colorprofile Interpolation color calculation between size ()
*/
for (index = 1; index < colorProfile_.Size(); index++) {
end = colorProfile_[index].offset * colorLutSize_;
end = static_cast<uint32_t>(colorProfile_[index].offset * colorLutSize_);
ColorInterpolator ci(colorProfile_[index - 1].color,
colorProfile_[index].color,
end - start + 1);
@@ -76,8 +76,8 @@ public:
void Generate(Rgba8T* span, int32_t x, int32_t y, uint32_t len)
{
y = y - patternStartY_;
x = x - patternStartX_;
y = static_cast<int32_t>(y - patternStartY_);
x = static_cast<int32_t>(x - patternStartX_);
for (; len; --len, span++, x++) {
if (patternRepeat_ == NO_REPEAT) {
if (x >= patternImagewidth_ ||