i_contrast(im, 0.8);
i_hardinvert(im);
+ i_hardinvertall(im);
i_unsharp_mask(im, 2.0, 1.0);
- // and more
+ ... and more
=head1 DESCRIPTION
}
-/*
-=item i_hardinvert(im)
-
-Inverts the pixel values of the input image.
-
- im - image object
-
-=cut
-*/
-
-void
-i_hardinvert(i_img *im) {
+static int
+s_hardinvert_low(i_img *im, int all) {
int x, y;
int ch;
- int color_channels = i_img_color_channels(im);
+ int invert_channels = all ? im->channels : i_img_color_channels(im);
mm_log((1,"i_hardinvert(im %p)\n", im));
IM_GLIN(im, 0, im->xsize, y, row);
entry = row;
for(x = 0; x < im->xsize; x++) {
- for(ch = 0; ch < color_channels; ch++) {
+ for(ch = 0; ch < invert_channels; ch++) {
entry->channel[ch] = IM_SAMPLE_MAX - entry->channel[ch];
}
++entry;
}
myfree(row);
#/code
+
+ return 1;
}
+/*
+=item i_hardinvert(im)
+
+Inverts the color channels of the input image.
+ im - image object
+
+=cut
+*/
+
+void
+i_hardinvert(i_img *im) {
+ s_hardinvert_low(im, 0);
+}
+
+/*
+=item i_hardinvertall(im)
+
+Inverts all channels of the input image.
+
+ im - image object
+
+=cut
+*/
+
+void
+i_hardinvertall(i_img *im) {
+ s_hardinvert_low(im, 1);
+}
/*
=item i_noise(im, amount, type)
} i_fill_fountain_t;
static void
-fill_fountf(i_fill_t *fill, int x, int y, int width, int channels,
+fill_fountf(i_fill_t *fill, i_img_dim x, i_img_dim y, i_img_dim width, int channels,
i_fcolor *data);
static void
fount_fill_destroy(i_fill_t *fill);
+static i_fill_fountain_t
+fount_fill_proto =
+ {
+ {
+ NULL,
+ fill_fountf,
+ fount_fill_destroy
+ }
+ };
+
+
/*
-=item i_new_fill_fount(xa, ya, xb, yb, type, repeat, combine, super_sample, ssample_param, count, segs)
+=item i_new_fill_fount(C<xa>, C<ya>, C<xb>, C<yb>, C<type>, C<repeat>, C<combine>, C<super_sample>, C<ssample_param>, C<count>, C<segs>)
=category Fills
=synopsis fill = i_new_fill_fount(0, 0, 100, 100, i_ft_linear, i_ft_linear,
int count, i_fountain_seg *segs) {
i_fill_fountain_t *fill = mymalloc(sizeof(i_fill_fountain_t));
- fill->base.fill_with_color = NULL;
- fill->base.fill_with_fcolor = fill_fountf;
- fill->base.destroy = fount_fill_destroy;
+ *fill = fount_fill_proto;
if (combine)
i_get_combine(combine, &fill->base.combine, &fill->base.combinef);
else {
=cut
*/
static void
-fill_fountf(i_fill_t *fill, int x, int y, int width, int channels,
- i_fcolor *data) {
+fill_fountf(i_fill_t *fill, i_img_dim x, i_img_dim y, i_img_dim width,
+ int channels, i_fcolor *data) {
i_fill_fountain_t *f = (i_fill_fountain_t *)fill;
while (width--) {