Revision: 56624
http://sourceforge.net/p/brlcad/code/56624
Author: mohitdaga
Date: 2013-08-06 15:07:16 +0000 (Tue, 06 Aug 2013)
Log Message:
-----------
Cleaning Stylistic WhiteSpaces
Modified Paths:
--------------
brlcad/trunk/src/libicv/bw.c
brlcad/trunk/src/libicv/decimate.c
brlcad/trunk/src/libicv/encoding.c
brlcad/trunk/src/libicv/filter.c
brlcad/trunk/src/libicv/operations.c
brlcad/trunk/src/libicv/pix.c
brlcad/trunk/src/libicv/stat.c
Modified: brlcad/trunk/src/libicv/bw.c
===================================================================
--- brlcad/trunk/src/libicv/bw.c 2013-08-06 14:50:48 UTC (rev 56623)
+++ brlcad/trunk/src/libicv/bw.c 2013-08-06 15:07:16 UTC (rev 56624)
@@ -35,7 +35,7 @@
#include "bn.h"
#include "icv.h"
- /* defined in encoding.c */
+/* defined in encoding.c */
extern HIDDEN double *uchar2double(unsigned char *data, long int size);
extern HIDDEN unsigned char *data2uchar(const icv_image_t *bif);
@@ -50,25 +50,25 @@
size_t ret, size;
if (bif->color_space == ICV_COLOR_SPACE_RGB) {
- icv_rgb2gray(bif, 0, 0, 0, 0, 0);
+ icv_rgb2gray(bif, 0, 0, 0, 0, 0);
} else if (bif->color_space != ICV_COLOR_SPACE_GRAY) {
- bu_log("bw_save : Color Space conflict");
- return -1;
+ bu_log("bw_save : Color Space conflict");
+ return -1;
}
data = data2uchar(bif);
size = (size_t) bif->height*bif->width;
fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, WRMODE);
if (fd < 0) {
- bu_log("Unable to open the file\n");
- return -1;
+ bu_log("Unable to open the file\n");
+ return -1;
}
ret = write(fd, data, size);
close(fd);
bu_free(data, "bw_save : Unsigned Char data");
if (ret != size) {
- bu_log("bw_save : Short Write\n");
- return -1;
+ bu_log("bw_save : Short Write\n");
+ return -1;
}
return 0;
@@ -84,21 +84,21 @@
size_t size;
if (width == 0 || height == 0) {
- height = 512;
- width = 512;
+ height = 512;
+ width = 512;
}
size = (size_t) height*width;
if ((fd = open(filename, O_RDONLY, WRMODE))<0) {
- bu_log("bw_load: Cannot open file for reading\n");
- return NULL;
+ bu_log("bw_load: Cannot open file for reading\n");
+ return NULL;
}
data = (unsigned char *)bu_malloc(size, "bw_load : unsigned char data");
if (read(fd, data, size) !=0) {
- bu_log("bw_load: Error Occurred while Reading\n");
- bu_free(data, "icv_image data");
- return NULL;
+ bu_log("bw_load: Error Occurred while Reading\n");
+ bu_free(data, "icv_image data");
+ return NULL;
}
BU_ALLOC(bif, struct icv_image);
ICV_IMAGE_INIT(bif);
Modified: brlcad/trunk/src/libicv/decimate.c
===================================================================
--- brlcad/trunk/src/libicv/decimate.c 2013-08-06 14:50:48 UTC (rev 56623)
+++ brlcad/trunk/src/libicv/decimate.c 2013-08-06 15:07:16 UTC (rev 56624)
@@ -42,9 +42,9 @@
for (y=0; y<bif->height; y+=factor)
for (x=0; x<bif->width; x+=factor) {
- for (c=0; c<bif->channels; c++) {
- p[c]= 0;
- }
+ for (c=0; c<bif->channels; c++) {
+ p[c]= 0;
+ }
for (py = 0; py < factor; py++) {
data_p = bif->data + (y+py)*widthstep;
@@ -73,7 +73,6 @@
int x, y, widthstep;
widthstep = bif->width*bif->channels;
-
res_p = data_p = bif->data;
for (y=0; y<bif->height; y+=factor) {
@@ -106,7 +105,6 @@
for (j=0; j<out_height; j++) {
y = (int) (j*ystep);
-
in_r = bif->data + y*widthstep;
for (i = 0; i < out_width; i++) {
@@ -160,7 +158,7 @@
upp_c = upp_r + (int)x*bif->channels;
low_c = low_r + (int)x*bif->channels;
- for(c=0; c<bif->channels; c++) {
+ for (c=0; c<bif->channels; c++) {
mid1 = low_c[0] + dx * ((double) low_c[bif->channels] -
(double) low_c[0] );
mid2 = upp_c[0] + dx * ((double) upp_c[bif->channels] -
(double) upp_c[0] );
*out_p = mid1 + dy * (mid2 - mid1);
Modified: brlcad/trunk/src/libicv/encoding.c
===================================================================
--- brlcad/trunk/src/libicv/encoding.c 2013-08-06 14:50:48 UTC (rev 56623)
+++ brlcad/trunk/src/libicv/encoding.c 2013-08-06 15:07:16 UTC (rev 56624)
@@ -52,9 +52,9 @@
char_p = data;
double_p = double_data = (double *) bu_malloc(size*sizeof(double),
"uchar2data : double data");
for (i=0; i<size; i++) {
- *double_p = ICV_CONV_8BIT(*char_p);
- double_p++;
- char_p++;
+ *double_p = ICV_CONV_8BIT(*char_p);
+ double_p++;
+ char_p++;
}
return double_data;
@@ -84,22 +84,22 @@
double_p = bif->data;
if (ZERO(bif->gamma_corr)) {
- for (i=0; i<size; i++) {
- *char_p = (unsigned char)((*double_p)*255.0 +0.5) ;
- char_p++;
- double_p++;
- }
+ for (i=0; i<size; i++) {
+ *char_p = (unsigned char)((*double_p)*255.0 +0.5) ;
+ char_p++;
+ double_p++;
+ }
} else {
- float *rand_p;
- double ex = 1.0/bif->gamma_corr;
- bn_rand_init(rand_p, 0);
+ float *rand_p;
+ double ex = 1.0/bif->gamma_corr;
+ bn_rand_init(rand_p, 0);
- for (i=0; i<size; i++) {
- *char_p = floor(pow(*double_p, ex)*255.0 + (double)
bn_rand0to1(rand_p) + 0.5);
- char_p++;
- double_p++;
- }
+ for (i=0; i<size; i++) {
+ *char_p = floor(pow(*double_p, ex)*255.0 + (double)
bn_rand0to1(rand_p) + 0.5);
+ char_p++;
+ double_p++;
+ }
}
return uchar_data;
Modified: brlcad/trunk/src/libicv/filter.c
===================================================================
--- brlcad/trunk/src/libicv/filter.c 2013-08-06 14:50:48 UTC (rev 56623)
+++ brlcad/trunk/src/libicv/filter.c 2013-08-06 15:07:16 UTC (rev 56624)
@@ -300,7 +300,7 @@
for (;size>0; size--) {
*data = *data*fraction;
- if(*data > 1)
+ if (*data > 1)
*data= 1.0;
data++;
}
Modified: brlcad/trunk/src/libicv/operations.c
===================================================================
--- brlcad/trunk/src/libicv/operations.c 2013-08-06 14:50:48 UTC (rev
56623)
+++ brlcad/trunk/src/libicv/operations.c 2013-08-06 15:07:16 UTC (rev
56624)
@@ -38,7 +38,7 @@
size_t size;
data= img->data;
for (size = img->width*img->height*img->channels; size>0; size--) {
- if(*data>1.0)
+ if (*data>1.0)
*data = 1.0;
else if (*data<0)
*data = 0;
@@ -59,7 +59,7 @@
data++;
}
- if(img->flags & ICV_OPERATIONS_MODE)
+ if (img->flags & ICV_OPERATIONS_MODE)
img->flags&=(!ICV_SANITIZED);
else
icv_sanitize(img);
@@ -76,7 +76,7 @@
*data *= val;
data++;
}
- if((img->flags & ICV_OPERATIONS_MODE))
+ if ((img->flags & ICV_OPERATIONS_MODE))
img->flags&=(!ICV_SANITIZED);
else
icv_sanitize(img);
@@ -96,7 +96,7 @@
data++;
}
- if((img->flags & ICV_OPERATIONS_MODE))
+ if ((img->flags & ICV_OPERATIONS_MODE))
img->flags&=(!ICV_SANITIZED);
else
icv_sanitize(img);
@@ -114,7 +114,7 @@
data++;
}
- if((img->flags & ICV_OPERATIONS_MODE))
+ if ((img->flags & ICV_OPERATIONS_MODE))
img->flags&=(!ICV_SANITIZED);
else
icv_sanitize(img);
@@ -248,7 +248,7 @@
rwgt = 0.31*(1.0-sat);
gwgt = 0.61*(1.0-sat);
bwgt = 0.08*(1.0-sat);
- while(size-- > 0) {
+ while (size-- > 0) {
rt = *data;
gt = *(data+1);
bt = *(data+2);
Modified: brlcad/trunk/src/libicv/pix.c
===================================================================
--- brlcad/trunk/src/libicv/pix.c 2013-08-06 14:50:48 UTC (rev 56623)
+++ brlcad/trunk/src/libicv/pix.c 2013-08-06 15:07:16 UTC (rev 56624)
@@ -49,10 +49,10 @@
size_t ret, size;
if (bif->color_space == ICV_COLOR_SPACE_GRAY) {
- icv_gray2rgb(bif);
+ icv_gray2rgb(bif);
} else if (bif->color_space != ICV_COLOR_SPACE_RGB) {
- bu_log("pix_save : Color Space conflict");
- return -1;
+ bu_log("pix_save : Color Space conflict");
+ return -1;
}
data = data2uchar(bif);
size = (size_t) bif->width*bif->height*3;
@@ -60,8 +60,8 @@
ret = write(fd, data, size);
close(fd);
if (ret != size) {
- bu_log("pix_save : Short Write");
- return -1;
+ bu_log("pix_save : Short Write");
+ return -1;
}
return 0;
}
@@ -77,21 +77,21 @@
size_t size;
if (width == 0 || height == 0) {
- height = 512;
- width = 512;
+ height = 512;
+ width = 512;
}
size = (size_t) height*width*3;
if ((fd = open(filename, O_RDONLY, WRMODE))<0) {
- bu_log("pix_load: Cannot open file for reading\n");
- return NULL;
+ bu_log("pix_load: Cannot open file for reading\n");
+ return NULL;
}
data = (unsigned char *)bu_malloc(size, "pix_load : unsigned char data");
if (read(fd, data, size) !=0) {
- bu_log("pix_load: Error Occurred while Reading\n");
- bu_free(data, "icv_image data");
- return NULL;
+ bu_log("pix_load: Error Occurred while Reading\n");
+ bu_free(data, "icv_image data");
+ return NULL;
}
BU_ALLOC(bif, struct icv_image);
ICV_IMAGE_INIT(bif);
Modified: brlcad/trunk/src/libicv/stat.c
===================================================================
--- brlcad/trunk/src/libicv/stat.c 2013-08-06 14:50:48 UTC (rev 56623)
+++ brlcad/trunk/src/libicv/stat.c 2013-08-06 15:07:16 UTC (rev 56624)
@@ -35,7 +35,7 @@
bins = (size_t**) bu_malloc(sizeof(size_t*)*img->channels, "icv_init_bins
: Histogram Bins");
for (c = 0; c <= img->channels; c++) {
bins[c] = (size_t*) bu_malloc(sizeof(size_t)*n_bins, "icv_init_bins :
Histogram Array for Channels");
- for(i=0; i<n_bins; i++) {
+ for (i=0; i<n_bins; i++) {
bins[c][i] = 0;
}
}
@@ -56,8 +56,8 @@
bins = icv_init_bins(img, n_bins);
- for(i=0; i<=size; i++) {
- for(j=0; j < img->channels; j++) {
+ for (i=0; i<=size; i++) {
+ for (j=0; j < img->channels; j++) {
temp = (*data++)*n_bins;
bins[j][temp]++;
}
@@ -74,7 +74,7 @@
max = bu_malloc(sizeof(double)*img->channels, "max values");
- for(i=0; i<img->channels; i++)
+ for (i=0; i<img->channels; i++)
max[i] = 0.0;
data = img->data;
@@ -96,7 +96,7 @@
size_t size,j;
sum = bu_malloc(sizeof(double)*img->channels, "sum values");
- for(i=0; i<img->channels; i++)
+ for (i=0; i<img->channels; i++)
sum[i] = 0.0;
data = img->data;
@@ -118,7 +118,7 @@
mean = icv_sum(img); /**< receives sum from icv_image_sum*/
size = (size_t)img->width*img->height;
- for(i=0; i<img->channels; i++)
+ for (i=0; i<img->channels; i++)
mean[i]/=size;
return mean;
@@ -133,7 +133,7 @@
min = bu_malloc(sizeof(double)*img->channels, "min values");
- for(i=0; i<img->channels; i++)
+ for (i=0; i<img->channels; i++)
min[i] = 1.0;
data = img->data;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits