aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2019-05-03 11:55:12 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2019-05-03 11:55:12 +0200
commit099c4db0a3a8e77deb7af7436faec802fe9401de (patch)
tree80611d2f441e1c1652e37421c835140dc783a85e
parentbdcbb4816251b726f37c995880d1517196fb822b (diff)
downloadAsciiMap-099c4db0a3a8e77deb7af7436faec802fe9401de.tar.gz
Fixing whitespace errors
-rw-r--r--m.c12
-rw-r--r--main.c14
2 files changed, 14 insertions, 12 deletions
diff --git a/m.c b/m.c
index c8d3a23..b1401f1 100644
--- a/m.c
+++ b/m.c
@@ -2,15 +2,15 @@
uint8_t avg(int argc, uint8_t *argv)
{
- uint8_t ret = 0;
- uint64_t sum = 0;
+ uint8_t ret = 0;
+ uint64_t sum = 0;
- for(int i = 0; i < argc; i++)
- sum += (uint64_t)argv[i];
+ for(int i = 0; i < argc; i++)
+ sum += (uint64_t)argv[i];
- ret = (char)(sum / argc);
+ ret = (char)(sum / argc);
- return ret;
+ return ret;
}//avg
diff --git a/main.c b/main.c
index 4488562..b8bf074 100644
--- a/main.c
+++ b/main.c
@@ -27,7 +27,7 @@ struct prog_param
uint8_t color;
};
-struct prog_param parse_args(int argc, char *argv[]);
+struct prog_param parse_args(int argc, char *argv[]);
void print_help( void );
@@ -35,7 +35,9 @@ int main(int argc, char *argv[])
{
struct prog_param args = parse_args(argc, argv);
+ //Stores a luminance array
uint8_t **ascii_buff;
+ //Stores a color array
char* **col_buff;
uint8_t b_max = 0x00;
@@ -50,9 +52,9 @@ int main(int argc, char *argv[])
return 1;
}
- //Calculate Averages of CHAR_SIZE x CHAR_SIZE blocks
+ //x and y size of ASCII-image
unsigned int size_x,size_y;
- size_x = bitmap.x / args.charsize_x;
+ size_x = bitmap.x / args.charsize_x;
size_y = bitmap.y / args.charsize_y;
DEBUG_PRINTF("Output size: %u x %u\n", size_x, size_y);
@@ -72,11 +74,11 @@ int main(int argc, char *argv[])
//Nest thine Lööps
//Very not optimal Variable names!!!!!!!!!!!!!
//
- //For every Pixel-char: calculate average values of pixel blocks
+ //For every size_x * size_y block: calculate average values of pixel blocks
for(unsigned int x = 0; x < size_x; x++) {
for(unsigned int y = 0; y < size_y; y++) {
- uint8_t brightness [ args.charsize_x ][ args.charsize_y ]; //Average brightness of every pixels
- uint8_t cc[ 3 ][ args.charsize_x * args.charsize_y ]; //RGB Values of block
+ uint8_t brightness [ args.charsize_x ][ args.charsize_y ]; //Average brightness of every pixel
+ uint8_t cc[ 3 ][ args.charsize_x * args.charsize_y ]; //RGB Values of Pixels
unsigned int cc_counter = 0;
//Iterate through Pixel block