if ((k + i) >= w) continue;
all(+=, a, r, g, b, points[k + rad], in + k + i);
}
- // FIXME: use ARGB_JOIN
- *(out) =
- (wavg(a, weight) << 24) |
- (wavg(r, weight) << 16) |
- (wavg(g, weight) << 8) |
- (wavg(b, weight));
+ *(out) = ARGB_JOIN(wavg(a, weight),
+ wavg(r, weight),
+ wavg(g, weight),
+ wavg(b, weight));
out++;
}
return 0;
double weight;
int i, k;
double r, g, b, a;
-
+
/* Get twice the radius: even rows have 1 element */
points = gaussian_row_getd(rad * 2, &npoints, &weight);
for (i = -rad; i < (w + rad); i++)
if ((k + i) >= w) continue;
all(+=, a, r, g, b, points[k + rad], in + k + i);
}
- // FIXME: use ARGB_JOIN
- *(out) =
- (wavgd(a, weight) << 24) |
- (wavgd(r, weight) << 16) |
- (wavgd(g, weight) << 8) |
- (wavgd(b, weight));
+ *(out) = ARGB_JOIN(wavgd(a, weight),
+ wavgd(r, weight),
+ wavgd(g, weight),
+ wavgd(b, weight));
out++;
}
return 0;
if ((k + i) >= w) continue;
all(+=, a, r, g, b, points[k + rad], in + k + i);
}
- // FIXME: use ARGB_JOIN
- *(out) =
- (wavg(a, weight) << 24) |
- (wavg(r, weight) << 16) |
- (wavg(g, weight) << 8) |
- (wavg(b, weight));
+ *(out) = ARGB_JOIN(wavg(a, weight),
+ wavg(r, weight),
+ wavg(g, weight),
+ wavg(b, weight));
out++;
}
return 0;
uint32_t weight;
int i, k;
uint32_t r, g, b, a;
-
+
/* Get twice the radius: even rows have 1 element */
points = gaussian_row_get(rad * 2, &npoints, &weight);
weight = 0;
for (i = 0; i < npoints; i++) weight += points[i];
-
+
for (i = -rad; i < (h + rad); i++)
{
r = g = b = a = 0;
if ((k + i) >= h) continue;
all(+=, a, r, g, b, points[k + rad], in + (skip * (k + i)));
}
- // FIXME: use ARGB_JOIN
- *(out) =
- (wavg(a, weight) << 24) |
- (wavg(r, weight) << 16) |
- (wavg(g, weight) << 8) |
- (wavg(b, weight));
+ *(out) = ARGB_JOIN(wavg(a, weight),
+ wavg(r, weight),
+ wavg(g, weight),
+ wavg(b, weight));
out += skip;
}
return 0;
uint64_t weight;
int i, k;
uint64_t r, g, b, a;
-
+
/* Get twice the radius: even rows have 1 element */
points = gaussian_row_get64(rad * 2, &npoints, &weight);
weight = 0;
for (i = 0; i < npoints; i++) weight += points[i];
-
+
for (i = -rad; i < (h + rad); i++)
{
r = g = b = a = 0;
if ((k + i) >= h) continue;
all(+=, a, r, g, b, points[k + rad], in + (skip * (k + i)));
}
- // FIXME: use ARGB_JOIN
- *(out) =
- (wavg(a, weight) << 24) |
- (wavg(r, weight) << 16) |
- (wavg(g, weight) << 8) |
- (wavg(b, weight));
+ *(out) = ARGB_JOIN(wavg(a, weight),
+ wavg(r, weight),
+ wavg(g, weight),
+ wavg(b, weight));
out += skip;
}
return 0;
double weight;
int i, k;
double r, g, b, a;
-
+
/* Get twice the radius: even rows have 1 element */
points = gaussian_row_getd(rad * 2, &npoints, &weight);
weight = 0;
for (i = 0 ; i < npoints ; i ++) weight += points[i];
-
+
for (i = -rad ; i < h + rad; i ++)
{
r = g = b = a = 0;
if ((k + i) >= h) continue;
all(+=, a, r, g, b, points[k + rad], in + (skip * (k + i)));
}
- // FIXME: use ARGB_JOIN
- *(out) =
- (wavgd(a, weight) << 24) |
- (wavgd(r, weight) << 16) |
- (wavgd(g, weight) << 8) |
- (wavgd(b, weight));
+ *(out) = ARGB_JOIN(wavgd(a, weight),
+ wavgd(r, weight),
+ wavgd(g, weight),
+ wavgd(b, weight));
out += skip;
}
return 0;
static int last = -1;
static uint32_t lastweight = -1;
int c, k;
-
+
if (row < 0) return NULL;
-
+
if (npoints) *npoints = row + 1;
-
+
if (last == row)
{
if (weight) *weight = lastweight;
return NULL;
}
last = row;
-
+
c = 1;
for (k = 0; k <= row; k++)
{
points[k] = c;
c = c * (row - k) / (k + 1);
}
-
+
for (k = 0, lastweight = 0; k <= row; k++) lastweight += points[k];
if (weight) *weight = lastweight;
return points;
static uint64_t lastweight = -1;
uint64_t c;
int k;
-
+
if (row < 0) return NULL;
-
+
if (npoints) *npoints = row + 1;
if (last == row)
{