libansilove

Library for converting ANSI, ASCII, and other formats to PNG
Log | Files | Refs | README | LICENSE

commit 7567ce0e84da0af07abae00a1f94e00bec04381e
parent 970aa041a81a30c0c91d842ae06f7385e4b8d813
Author: Frederic Cambus <fred@statdns.com>
Date:   Mon,  9 Apr 2018 22:36:40 +0200

Formatting fixes

Diffstat:
Msrc/drawchar.c | 6+++---
Msrc/drawchar.h | 4++--
Msrc/loaders/artworx.c | 4++--
Msrc/loaders/binary.c | 8++++----
Msrc/loaders/icedraw.c | 4++--
Msrc/loaders/pcboard.c | 10+++++-----
Msrc/loaders/tundra.c | 32++++++++++++++++----------------
Msrc/loaders/xbin.c | 8++++----
Msrc/output.c | 6+++---
9 files changed, 41 insertions(+), 41 deletions(-)

diff --git a/src/drawchar.c b/src/drawchar.c @@ -13,13 +13,13 @@ // shared method for drawing characters void drawchar(gdImagePtr im, const unsigned char *font_data, int32_t bits, - int32_t height, int32_t column, int32_t row, - int32_t background, int32_t foreground, unsigned char character) + int32_t height, int32_t column, int32_t row, + int32_t background, int32_t foreground, unsigned char character) { int32_t x, y; gdImageFilledRectangle(im, column * bits, row*height, column * bits + - bits - 1, row * height + height - 1, background); + bits - 1, row * height + height - 1, background); for (y = 0; y < height; y++) { for (x = 0; x < bits; x++) { diff --git a/src/drawchar.h b/src/drawchar.h @@ -19,7 +19,7 @@ // prototypes void drawchar(gdImagePtr im, const unsigned char *font_data, int32_t bits, - int32_t height, int32_t column, int32_t row, - int32_t background, int32_t foreground, unsigned char character); + int32_t height, int32_t column, int32_t row, + int32_t background, int32_t foreground, unsigned char character); #endif diff --git a/src/loaders/artworx.c b/src/loaders/artworx.c @@ -49,8 +49,8 @@ void artworx(struct input *inputFile, struct output *outputFile) { index = (adf_colors[loop] * 3) + 1; gdImageColorAllocate(canvas, (inputFile->data[index] << 2 | inputFile->data[index] >> 4), - (inputFile->data[index + 1] << 2 | inputFile->data[index + 1] >> 4), - (inputFile->data[index + 2] << 2 | inputFile->data[index + 2] >> 4)); + (inputFile->data[index + 1] << 2 | inputFile->data[index + 1] >> 4), + (inputFile->data[index + 2] << 2 | inputFile->data[index + 2] >> 4)); } gdImageColorAllocate(canvas, 0, 0, 0); diff --git a/src/loaders/binary.c b/src/loaders/binary.c @@ -30,7 +30,7 @@ void binary(struct input *inputFile, struct output *outputFile) // allocate buffer image memory canvas = gdImageCreate(inputFile->columns * outputFile->bits, - ((inputFile->size / 2) / inputFile->columns * fontData.height)); + ((inputFile->size / 2) / inputFile->columns * fontData.height)); if (!canvas) { perror("Error, can't allocate buffer image memory"); @@ -45,8 +45,8 @@ void binary(struct input *inputFile, struct output *outputFile) for (int i = 0; i < 16; i++) { colors[i] = gdImageColorAllocate(canvas, binary_palette[i*3], - binary_palette[i*3+1], - binary_palette[i*3+2]); + binary_palette[i*3+1], + binary_palette[i*3+2]); } // process binary @@ -73,7 +73,7 @@ void binary(struct input *inputFile, struct output *outputFile) } drawchar(canvas, fontData.font_data, outputFile->bits, fontData.height, - column, row, colors[background], colors[foreground], character); + column, row, colors[background], colors[foreground], character); column++; loop += 2; diff --git a/src/loaders/icedraw.c b/src/loaders/icedraw.c @@ -108,8 +108,8 @@ void icedraw(struct input *inputFile, struct output *outputFile) { index = (loop * 3) + inputFile->size - 48; colors[loop] = gdImageColorAllocate(canvas, (inputFile->data[index] << 2 | inputFile->data[index] >> 4), - (inputFile->data[index + 1] << 2 | inputFile->data[index + 1] >> 4), - (inputFile->data[index + 2] << 2 | inputFile->data[index + 2] >> 4)); + (inputFile->data[index + 1] << 2 | inputFile->data[index + 1] >> 4), + (inputFile->data[index + 2] << 2 | inputFile->data[index + 2] >> 4)); } // render IDF diff --git a/src/loaders/pcboard.c b/src/loaders/pcboard.c @@ -93,7 +93,7 @@ void pcboard(struct input *inputFile, struct output *outputFile) loop += 3; } else if (current_character == 64 && next_character == 67 && - inputFile->data[loop+2] == 'L' && inputFile->data[loop+3] == 'S') + inputFile->data[loop+2] == 'L' && inputFile->data[loop+3] == 'S') { // erase display column = 0; @@ -105,7 +105,7 @@ void pcboard(struct input *inputFile, struct output *outputFile) loop += 4; } else if (current_character == 64 && next_character == 80 && inputFile->data[loop+2] == 'O' - && inputFile->data[loop+3] == 'S' && inputFile->data[loop+4] == ':') + && inputFile->data[loop+3] == 'S' && inputFile->data[loop+4] == ':') { // cursor position if (inputFile->data[loop+6] == '@') @@ -163,8 +163,8 @@ void pcboard(struct input *inputFile, struct output *outputFile) for (int i = 0; i < 16; i++) { colors[i] = gdImageColorAllocate(canvas, ansi_palette[i*3], - ansi_palette[i*3+1], - ansi_palette[i*3+2]); + ansi_palette[i*3+1], + ansi_palette[i*3+2]); } // the last value of loop tells us how many items are stored in there @@ -181,7 +181,7 @@ void pcboard(struct input *inputFile, struct output *outputFile) character = pcboard_buffer[loop].current_character; drawchar(canvas, fontData.font_data, outputFile->bits, fontData.height, - column, row, colors[background], colors[foreground], character); + column, row, colors[background], colors[foreground], character); } // create output image diff --git a/src/loaders/tundra.c b/src/loaders/tundra.c @@ -51,12 +51,12 @@ void tundra(struct input *inputFile, struct output *outputFile) if (character == 1) { row = - (inputFile->data[loop + 1] << 24) + (inputFile->data[loop + 2] << 16) + - (inputFile->data[loop + 3] << 8) + inputFile->data[loop+4]; + (inputFile->data[loop + 1] << 24) + (inputFile->data[loop + 2] << 16) + + (inputFile->data[loop + 3] << 8) + inputFile->data[loop+4]; column = - (inputFile->data[loop + 5] << 24) + (inputFile->data[loop + 6] << 16) + - (inputFile->data[loop + 7] << 8) + inputFile->data[loop+8]; + (inputFile->data[loop + 5] << 24) + (inputFile->data[loop + 6] << 16) + + (inputFile->data[loop + 7] << 8) + inputFile->data[loop+8]; loop += 8; } @@ -117,12 +117,12 @@ void tundra(struct input *inputFile, struct output *outputFile) if (character == 1) { row = - (inputFile->data[loop + 1] << 24) + (inputFile->data[loop + 2] << 16) + - (inputFile->data[loop + 3] << 8) + inputFile->data[loop + 4]; + (inputFile->data[loop + 1] << 24) + (inputFile->data[loop + 2] << 16) + + (inputFile->data[loop + 3] << 8) + inputFile->data[loop + 4]; column = - (inputFile->data[loop + 5] << 24) + (inputFile->data[loop + 6] << 16) + - (inputFile->data[loop + 7] << 8) + inputFile->data[loop + 8]; + (inputFile->data[loop + 5] << 24) + (inputFile->data[loop + 6] << 16) + + (inputFile->data[loop + 7] << 8) + inputFile->data[loop + 8]; loop += 8; } @@ -130,8 +130,8 @@ void tundra(struct input *inputFile, struct output *outputFile) if (character == 2) { foreground = - (inputFile->data[loop + 3] << 16) + (inputFile->data[loop + 4] << 8) + - inputFile->data[loop + 5]; + (inputFile->data[loop + 3] << 16) + (inputFile->data[loop + 4] << 8) + + inputFile->data[loop + 5]; character = inputFile->data[loop+1]; @@ -141,7 +141,7 @@ void tundra(struct input *inputFile, struct output *outputFile) if (character == 4) { background = (inputFile->data[loop + 3] << 16) + (inputFile->data[loop + 4] << 8) + - inputFile->data[loop+5]; + inputFile->data[loop+5]; character = inputFile->data[loop+1]; @@ -151,12 +151,12 @@ void tundra(struct input *inputFile, struct output *outputFile) if (character == 6) { foreground = - (inputFile->data[loop + 3] << 16) + (inputFile->data[loop + 4] << 8) + - inputFile->data[loop+5]; + (inputFile->data[loop + 3] << 16) + (inputFile->data[loop + 4] << 8) + + inputFile->data[loop+5]; background = - (inputFile->data[loop + 7] << 16) + (inputFile->data[loop + 8] << 8) + - inputFile->data[loop+9]; + (inputFile->data[loop + 7] << 16) + (inputFile->data[loop + 8] << 8) + + inputFile->data[loop+9]; character = inputFile->data[loop+1]; @@ -166,7 +166,7 @@ void tundra(struct input *inputFile, struct output *outputFile) if (character != 1 && character != 2 && character != 4 && character != 6) { drawchar(canvas, fontData.font_data, outputFile->bits, fontData.height, - column, row, background, foreground, character); + column, row, background, foreground, character); column++; } diff --git a/src/loaders/xbin.c b/src/loaders/xbin.c @@ -50,8 +50,8 @@ void xbin(struct input *inputFile, struct output *outputFile) index = (loop * 3) + offset; colors[loop] = gdImageColorAllocate(canvas, (inputFile->data[index] << 2 | inputFile->data[index] >> 4), - (inputFile->data[index + 1] << 2 | inputFile->data[index + 1] >> 4), - (inputFile->data[index + 2] << 2 | inputFile->data[index + 2] >> 4)); + (inputFile->data[index + 1] << 2 | inputFile->data[index + 1] >> 4), + (inputFile->data[index + 2] << 2 | inputFile->data[index + 2] >> 4)); } offset += 48; @@ -59,8 +59,8 @@ void xbin(struct input *inputFile, struct output *outputFile) else { for (int i = 0; i < 16; i++) { colors[i] = gdImageColorAllocate(canvas, binary_palette[i*3], - binary_palette[i*3+1], - binary_palette[i*3+2]); + binary_palette[i*3+1], + binary_palette[i*3+2]); } } diff --git a/src/output.c b/src/output.c @@ -28,11 +28,11 @@ void output(gdImagePtr im_Source, char *output, char *retinaout, int retinaScale // make the Retina image retinaScaleFactor as large as im_Source im_Retina = gdImageCreate(im_Source->sx * retinaScaleFactor, - im_Source->sy * retinaScaleFactor); + im_Source->sy * retinaScaleFactor); gdImageCopyResized(im_Retina, im_Source, 0, 0, 0, 0, - im_Retina->sx, im_Retina->sy, - im_Source->sx, im_Source->sy); + im_Retina->sx, im_Retina->sy, + im_Source->sx, im_Source->sy); // create retina output image FILE *file_RetinaOut = fopen(retinaout, "wb");