]> mj.ucw.cz Git - libucw.git/commitdiff
images: Fixed trailing spaces and invalid indentation.
authorPavel Charvat <pavel.charvat@netcentrum.cz>
Wed, 7 Nov 2007 15:12:22 +0000 (16:12 +0100)
committerPavel Charvat <pavel.charvat@netcentrum.cz>
Wed, 7 Nov 2007 15:12:22 +0000 (16:12 +0100)
13 files changed:
images/color.c
images/dup-init.c
images/image-dup-test.c
images/image-sim-test.c
images/images.h
images/io-libpng.c
images/io-libungif.c
images/io-main.c
images/object.c
images/sig-cmp-gen.h
images/sig-init.c
images/sig-seg.c
images/sig-txt.c

index e0b079c21b8df7a61d91b7eb9e2e64f3edff062c..041f90b36c4670a43e3cd1b63fff2828b395d349 100644 (file)
@@ -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);
index eb650e82a4cf659f044642b5e4440d0d0473fb4b..0fddc40c8302ca868d9430e2811b18fcd74fccbc 100644 (file)
@@ -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;
                }
index 2695cd788f3e2401c31da067b431582307edfb4e..ef1e044d2427c368d5e0a05f28d87d3dd07bad4d 100644 (file)
@@ -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);
index d48758873816f3445303e2ba7fc6cd32f193a1ad..52309bdb82a317c4fb7034d341ad921b29220806 100644 (file)
@@ -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);
 
index 5449519c172b5abc4dd9816a5c55c7f708ca1ec4..34ba1ad961823b1534f2fbb459e9ff1bbee18a1e 100644 (file)
@@ -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 */
index 2095065f189a9c4a198697b3c90081d230a627b2..afec24a0141c2c36570f16c11fd8c7ee3e08d88f 100644 (file)
@@ -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)
index b3e8960a39fc6b1d3adff9c3df675425df65774d..c20c9f58d0fe65627607f3feae112a5e3c610d1b 100644 (file)
@@ -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
index 3d02a9e5e8aecee0f0f27616f794666216f6ef24..f69b8b6c4a4bf926706f365c36cbbd5f2d6f3dc1 100644 (file)
@@ -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);
index 4552077ada71f7369dcf1f64e0a9df143825c50e..7138aa954f703d7a1ee0d73b34660ff54c489db2 100644 (file)
@@ -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
index 5a391db068322b1289bd039189d7fdc1dd614c42..0c88768eeb2dbaca4d0b9d5c4a0ce26c4016dcbf 100644 (file)
@@ -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;
     }
index 3cb8cab008cb319f3b900036261baab42e90bda7..60b53350548ee642554565df51f3521d475d33fa 100644 (file)
@@ -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;
index 74798f47fe178f8eae98802cf032ddc98ea43b66..8deeca91677d98ebec30b70ce48183885ba285e6 100644 (file)
@@ -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;
index 5b0a7e6d3d9aad5331119260c4fd20dffb71246f..1e2a9cd31e41c326e3c1afa901b3ea005d2c3b35 100644 (file)
@@ -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);
          }
       }