diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2017-03-12 11:19:09 -0500 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2017-03-22 12:07:26 +0100 |
commit | cfb66cd25bbf31857b471735e5ff0f7c2aea4d3c (patch) | |
tree | 8d8d06c9e2c880611a3c8cc025d8c35fe38d59ba /source/fitz/output-tga.c | |
parent | 3832d0c7ab87aa1f2b3a3dbebe43a37e4055d121 (diff) | |
download | mupdf-cfb66cd25bbf31857b471735e5ff0f7c2aea4d3c.tar.xz |
Rename fz_putc/puts/printf to fz_write_*.
Rename fz_write to fz_write_data.
Rename fz_write_buffer_* and fz_buffer_printf to fz_append_*.
Be consistent in naming:
fz_write_* calls write to fz_output.
fz_append_* calls append to fz_buffer.
Update documentation.
Diffstat (limited to 'source/fitz/output-tga.c')
-rw-r--r-- | source/fitz/output-tga.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/source/fitz/output-tga.c b/source/fitz/output-tga.c index 0e3cf3c5..e6e9a4a5 100644 --- a/source/fitz/output-tga.c +++ b/source/fitz/output-tga.c @@ -15,35 +15,35 @@ static inline void tga_put_pixel(fz_context *ctx, fz_output *out, const unsigned { case 4: /* RGBA or BGRA */ if (!is_bgr) { - fz_putc(ctx, out, data[2]); - fz_putc(ctx, out, data[1]); - fz_putc(ctx, out, data[0]); + fz_write_byte(ctx, out, data[2]); + fz_write_byte(ctx, out, data[1]); + fz_write_byte(ctx, out, data[0]); } else { - fz_putc(ctx, out, data[0]); - fz_putc(ctx, out, data[1]); - fz_putc(ctx, out, data[2]); + fz_write_byte(ctx, out, data[0]); + fz_write_byte(ctx, out, data[1]); + fz_write_byte(ctx, out, data[2]); } - fz_putc(ctx, out, data[3]); + fz_write_byte(ctx, out, data[3]); break; case 3: /* RGB or BGR */ if (!is_bgr) { - fz_putc(ctx, out, data[2]); - fz_putc(ctx, out, data[1]); - fz_putc(ctx, out, data[0]); + fz_write_byte(ctx, out, data[2]); + fz_write_byte(ctx, out, data[1]); + fz_write_byte(ctx, out, data[0]); } else { - fz_putc(ctx, out, data[0]); - fz_putc(ctx, out, data[1]); - fz_putc(ctx, out, data[2]); + fz_write_byte(ctx, out, data[0]); + fz_write_byte(ctx, out, data[1]); + fz_write_byte(ctx, out, data[2]); } break; case 2: /* GA */ - fz_putc(ctx, out, data[0]); - fz_putc(ctx, out, data[0]); - fz_putc(ctx, out, data[0]); - fz_putc(ctx, out, data[1]); + fz_write_byte(ctx, out, data[0]); + fz_write_byte(ctx, out, data[0]); + fz_write_byte(ctx, out, data[0]); + fz_write_byte(ctx, out, data[1]); break; case 1: /* G */ - fz_putc(ctx, out, data[0]); + fz_write_byte(ctx, out, data[0]); break; } } @@ -97,7 +97,7 @@ tga_write_header(fz_context *ctx, fz_band_writer *writer_) head[16] = d * 8; /* BPP */ head[17] = alpha && n > 1 ? 8 : 0; /* Alpha bpp */ - fz_write(ctx, out, head, sizeof(head)); + fz_write_data(ctx, out, head, sizeof(head)); } static void @@ -121,7 +121,7 @@ tga_write_band(fz_context *ctx, fz_band_writer *writer_, int stride, int band_st for (; i + j < w && j < 128 && !memcmp(line + i * n, line + (i + j) * n, d); j++); if (j > 1) { - fz_putc(ctx, out, j - 1 + 128); + fz_write_byte(ctx, out, j - 1 + 128); tga_put_pixel(ctx, out, line + i * n, n, is_bgr); } else @@ -129,7 +129,7 @@ tga_write_band(fz_context *ctx, fz_band_writer *writer_, int stride, int band_st for (; i + j < w && j <= 128 && memcmp(line + (i + j - 1) * n, line + (i + j) * n, d) != 0; j++); if (i + j < w || j > 128) j--; - fz_putc(ctx, out, j - 1); + fz_write_byte(ctx, out, j - 1); for (; j > 0; j--, i++) tga_put_pixel(ctx, out, line + i * n, n, is_bgr); } @@ -142,7 +142,7 @@ tga_write_trailer(fz_context *ctx, fz_band_writer *writer) { fz_output *out = writer->out; - fz_write(ctx, out, "\0\0\0\0\0\0\0\0TRUEVISION-XFILE.\0", 26); + fz_write_data(ctx, out, "\0\0\0\0\0\0\0\0TRUEVISION-XFILE.\0", 26); } fz_band_writer *fz_new_tga_band_writer(fz_context *ctx, fz_output *out, int is_bgr) |