From a59b1d81fd5fcb0efb02b9c50b24e88b43cac915 Mon Sep 17 00:00:00 2001 From: Pavel Charvat Date: Wed, 7 Nov 2007 16:12:22 +0100 Subject: [PATCH] images: Fixed trailing spaces and invalid indentation. --- images/color.c | 4 ++-- images/dup-init.c | 2 +- images/image-dup-test.c | 6 +++--- images/image-sim-test.c | 10 +++++----- images/images.h | 12 ++++++------ images/io-libpng.c | 4 ++-- images/io-libungif.c | 4 ++-- images/io-main.c | 2 +- images/object.c | 2 +- images/sig-cmp-gen.h | 2 +- images/sig-init.c | 2 +- images/sig-seg.c | 4 ++-- images/sig-txt.c | 8 ++++---- 13 files changed, 31 insertions(+), 31 deletions(-) diff --git a/images/color.c b/images/color.c index e0b079c2..041f90b3 100644 --- a/images/color.c +++ b/images/color.c @@ -154,7 +154,7 @@ color_put(struct image_context *ctx, struct color *color, byte *dest, uns dest_s struct image_conv_options image_conv_defaults = { .flags = IMAGE_CONV_COPY_ALPHA | IMAGE_CONV_FILL_ALPHA | IMAGE_CONV_APPLY_ALPHA, .background = { .color_space = COLOR_SPACE_GRAYSCALE } }; - + /* Grayscale <-> RGB */ #define IMAGE_WALK_PREFIX(x) walk_##x @@ -348,7 +348,7 @@ image_conv_color_space(struct image_context *ctx UNUSED, struct image *dest, str case COLOR_SPACE_CMYK: switch (src->flags & IMAGE_CHANNELS_FORMAT) { - case COLOR_SPACE_RGB: + case COLOR_SPACE_RGB: if (dest->pixel_size == 4) { image_conv_rgb_n_to_cmyk_4(dest, src); diff --git a/images/dup-init.c b/images/dup-init.c index eb650e82..0fddc40c 100644 --- a/images/dup-init.c +++ b/images/dup-init.c @@ -92,7 +92,7 @@ image_dup_init(struct image_context *ctx, struct image_dup *dup, struct image *i { for (uns x = 0; x < (uns)(1 << i); x++) { - pixels_average(d, s, s + line_size); + pixels_average(d, s, s + line_size); d += 3; s += 3; } diff --git a/images/image-dup-test.c b/images/image-dup-test.c index 2695cd78..ef1e044d 100644 --- a/images/image-dup-test.c +++ b/images/image-dup-test.c @@ -106,7 +106,7 @@ main(int argc, char **argv) usage(); file_name_1 = argv[optind++]; file_name_2 = argv[optind]; - + #define TRY(x) do{ if (!(x)) exit(1); }while(0) MSG("Initializing image library"); struct image_context ctx; @@ -129,7 +129,7 @@ main(int argc, char **argv) bclose(io.fastbuf); img1 = io.image; MSG("Image size=%ux%u", img1->cols, img1->rows); - + image_io_reset(&io); MSG("Reading %s", file_name_2); io.fastbuf = bopen(file_name_2, O_RDONLY, 1 << 18); @@ -155,7 +155,7 @@ main(int argc, char **argv) MSG("Similarity bitmap %02x", image_dup_compare(&dup1, &dup2, transformations | IMAGE_DUP_SCALE | IMAGE_DUP_WANT_ALL)); mp_delete(pool); - + image_destroy(img1); image_destroy(img2); image_context_cleanup(&ctx); diff --git a/images/image-sim-test.c b/images/image-sim-test.c index d4875887..52309bdb 100644 --- a/images/image-sim-test.c +++ b/images/image-sim-test.c @@ -112,7 +112,7 @@ static void write_segmentation(struct image_sig_data *data, byte *fn) { MSG("Writing segmentation to %s", fn); - + struct fastbuf *fb = bopen(fn, O_WRONLY | O_CREAT | O_TRUNC, 4096); struct image *img; TRY(img = image_new(&ctx, data->image->cols, data->image->rows, COLOR_SPACE_RGB, NULL)); @@ -127,9 +127,9 @@ write_segmentation(struct image_sig_data *data, byte *fn) luv[2] = ((int)data->regions[i].a[2] - 128) * (4 / 2.55); luv_to_xyz_exact(xyz, luv); xyz_to_srgb_exact(srgb, xyz); - c[0] = CLAMP(srgb[0] * 255, 0, 255); - c[1] = CLAMP(srgb[1] * 255, 0, 255); - c[2] = CLAMP(srgb[2] * 255, 0, 255); + c[0] = CLAMP(srgb[0] * 255, 0, 255); + c[1] = CLAMP(srgb[1] * 255, 0, 255); + c[2] = CLAMP(srgb[2] * 255, 0, 255); for (struct image_sig_block *block = data->regions[i].blocks; block; block = block->next) { uns x1 = block->x * 4; @@ -152,7 +152,7 @@ write_segmentation(struct image_sig_data *data, byte *fn) io.fastbuf = fb; io.image = img; - io.format = image_file_name_to_format(fn); + io.format = image_file_name_to_format(fn); TRY(image_io_write(&io)); image_io_reset(&io); diff --git a/images/images.h b/images/images.h index 5449519c..34ba1ad9 100644 --- a/images/images.h +++ b/images/images.h @@ -119,15 +119,15 @@ enum image_format { }; struct image_io { - /* R - read_header input */ - /* H - read_header output */ - /* I - read_data input */ - /* O - read_data output */ - /* W - write input */ + /* R - read_header input */ + /* H - read_header output */ + /* I - read_data input */ + /* O - read_data output */ + /* W - write input */ struct image *image; /* [ OW] - image data */ enum image_format format; /* [R W] - file format (IMAGE_FORMAT_x) */ - struct fastbuf *fastbuf; /* [R W] - source/destination stream */ + struct fastbuf *fastbuf; /* [R W] - source/destination stream */ struct mempool *pool; /* [ I ] - parameter to image_new */ uns cols; /* [ HI ] - number of columns, parameter to image_new */ uns rows; /* [ HI ] - number of rows, parameter to image_new */ diff --git a/images/io-libpng.c b/images/io-libpng.c index 2095065f..afec24a0 100644 --- a/images/io-libpng.c +++ b/images/io-libpng.c @@ -201,7 +201,7 @@ libpng_read_data(struct image_io *io) } uns read_flags = io->flags; - + /* Apply transformations */ if (rd->bit_depth == 16) png_set_strip_16(rd->png_ptr); @@ -254,7 +254,7 @@ libpng_read_data(struct image_io *io) read_flags = (read_flags & IMAGE_CHANNELS_FORMAT) | IMAGE_ALPHA; else png_set_strip_alpha(rd->png_ptr); - } + } break; case PNG_COLOR_TYPE_RGB: if ((read_flags & IMAGE_COLOR_SPACE) == COLOR_SPACE_GRAYSCALE) diff --git a/images/io-libungif.c b/images/io-libungif.c index b3e8960a..c20c9f58 100644 --- a/images/io-libungif.c +++ b/images/io-libungif.c @@ -190,8 +190,8 @@ libungif_read_data(struct image_io *io) return 0; } # define DO_ROW_END do{ \ - walk_row_start += dein_step; \ - while (walk_row_start >= img_end) \ + walk_row_start += dein_step; \ + while (walk_row_start >= img_end) \ { uns n = dein_next >> 1; walk_row_start = rdi.image->pixels + n, dein_step = dein_next; dein_next = n; } \ }while(0) # define IMAGE_WALK_PREFIX(x) walk_##x diff --git a/images/io-main.c b/images/io-main.c index 3d02a9e5..f69b8b6c 100644 --- a/images/io-main.c +++ b/images/io-main.c @@ -52,7 +52,7 @@ libungif_failed: #endif #ifdef CONFIG_IMAGES_LIBPNG libpng_cleanup(io); -libpng_failed: +libpng_failed: #endif #ifdef CONFIG_IMAGES_LIBJPEG libjpeg_cleanup(io); diff --git a/images/object.c b/images/object.c index 4552077a..7138aa95 100644 --- a/images/object.c +++ b/images/object.c @@ -85,7 +85,7 @@ read_image_obj_thumb(struct image_obj_info *ioi, struct fastbuf *fb, struct imag return img; error: DBG("Failed to decompress thumbnail: %s", io->thread->err_msg); - return NULL; + return NULL; } void diff --git a/images/sig-cmp-gen.h b/images/sig-cmp-gen.h index 5a391db0..0c88768e 100644 --- a/images/sig-cmp-gen.h +++ b/images/sig-cmp-gen.h @@ -351,7 +351,7 @@ image_signatures_dist_average_explain(struct image_signature *sig1, struct image uns dist = 0; for (uns i = 0; i < IMAGE_VEC_F; i++) { - uns d = image_sig_cmp_features_weights[0] * isqr((int)sig1->vec.f[i] - (int)sig2->vec.f[i]); + uns d = image_sig_cmp_features_weights[0] * isqr((int)sig1->vec.f[i] - (int)sig2->vec.f[i]); MSGL("feature %u: d=%u (%u %u)", i, d, sig1->vec.f[i], sig2->vec.f[i]); dist += d; } diff --git a/images/sig-init.c b/images/sig-init.c index 3cb8cab0..60b53350 100644 --- a/images/sig-init.c +++ b/images/sig-init.c @@ -188,7 +188,7 @@ image_sig_finish(struct image_sig_data *data, struct image_signature *sig) sig->flags = data->flags; if (!sig->len) return; - + /* For each region */ u64 w_total = 0; uns w_border = MIN(data->cols, data->rows) * image_sig_border_size; diff --git a/images/sig-seg.c b/images/sig-seg.c index 74798f47..8deeca91 100644 --- a/images/sig-seg.c +++ b/images/sig-seg.c @@ -176,7 +176,7 @@ prequant(struct image_sig_block *blocks, uns blocks_count, struct image_sig_regi cval++; } } - + /* Select split value - to minimize error */ uns b1 = val[0] * cnt[0]; uns c1 = isqr(val[0]) * cnt[0]; @@ -195,7 +195,7 @@ prequant(struct image_sig_block *blocks, uns blocks_count, struct image_sig_regi c2 -= c0; i += cnt[k]; j -= cnt[k]; - u64 err = (u64)c1 - (u64)b1 * b1 / i + (u64)c2 - (u64)b2 * b2 / j; + u64 err = (u64)c1 - (u64)b1 * b1 / i + (u64)c2 - (u64)b2 * b2 / j; if (err < best_err) { best_err = err; diff --git a/images/sig-txt.c b/images/sig-txt.c index 5b0a7e6d..1e2a9cd3 100644 --- a/images/sig-txt.c +++ b/images/sig-txt.c @@ -27,7 +27,7 @@ image_sig_detect_textured(struct image_sig_data *data) DBG("Zero textured threshold."); return; } - + uns cols = data->cols; uns rows = data->rows; uns cell_cols = MIN((cols + 1) / 2, MAX_CELLS_COLS); @@ -44,7 +44,7 @@ image_sig_detect_textured(struct image_sig_data *data) } DBG("Detecting textured image... cols=%u rows=%u cell_cols=%u cell_rows=%u", cols, rows, cell_cols, cell_rows); - + /* Compute cells boundaries */ for (i = 1, j = 0; i < cell_cols; i++) cell_x[i] = fast_div_u32_u8(j += cols, cell_cols); @@ -59,7 +59,7 @@ image_sig_detect_textured(struct image_sig_data *data) for (uns i = 0; i < data->regions_count; i++) for (struct image_sig_block *block = data->regions[i].blocks; block; block = block->next) block->region = i; - + /* Process cells */ double e = 0; for (uns j = 0; j < cell_rows; j++) @@ -79,7 +79,7 @@ image_sig_detect_textured(struct image_sig_data *data) } for (uns k = 0; k < data->regions_count; k++) { - int a = data->blocks_count * cnt[k] - cell_area * data->regions[k].count; + int a = data->blocks_count * cnt[k] - cell_area * data->regions[k].count; e += (double)a * a / ((double)isqr(data->regions[k].count) * cell_area); } } -- 2.39.5