summaryrefslogtreecommitdiff
path: root/src/gd_tiff.c
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2013-04-30 09:14:20 +0200
committerOndřej Surý <ondrej@sury.org>2013-04-30 09:14:20 +0200
commite432fcabd05b667fcf21b4a377dce32f3b626672 (patch)
tree4e5502ff0aaace9397478890a13ee748d4dd22f5 /src/gd_tiff.c
parent9ca6456f419257526c696a4cc2a334741f9bba36 (diff)
downloadlibgd-e432fcabd05b667fcf21b4a377dce32f3b626672.tar.gz
WS & CS
Diffstat (limited to 'src/gd_tiff.c')
-rw-r--r--src/gd_tiff.c45
1 files changed, 22 insertions, 23 deletions
diff --git a/src/gd_tiff.c b/src/gd_tiff.c
index 2aebd8f..d289fe1 100644
--- a/src/gd_tiff.c
+++ b/src/gd_tiff.c
@@ -265,19 +265,19 @@ void tiffWriter(gdImagePtr image, gdIOCtx *out, int bitDepth)
* correct areas of file opened and modifieable by the gdIOCtx functions
*/
tiff = TIFFClientOpen("", "w", th, tiff_readproc,
- tiff_writeproc,
- tiff_seekproc,
- tiff_closeproc,
- tiff_sizeproc,
- tiff_mapproc,
- tiff_unmapproc);
+ tiff_writeproc,
+ tiff_seekproc,
+ tiff_closeproc,
+ tiff_sizeproc,
+ tiff_mapproc,
+ tiff_unmapproc);
TIFFSetField(tiff, TIFFTAG_IMAGEWIDTH, width);
TIFFSetField(tiff, TIFFTAG_IMAGELENGTH, height);
TIFFSetField(tiff, TIFFTAG_COMPRESSION, COMPRESSION_DEFLATE);
TIFFSetField(tiff, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
TIFFSetField(tiff, TIFFTAG_PHOTOMETRIC,
- (bitDepth == 24) ? PHOTOMETRIC_RGB : PHOTOMETRIC_PALETTE);
+ (bitDepth == 24) ? PHOTOMETRIC_RGB : PHOTOMETRIC_PALETTE);
bitsPerSample = (bitDepth == 24 || bitDepth == 8) ? 8 : 1;
TIFFSetField(tiff, TIFFTAG_BITSPERSAMPLE, bitsPerSample);
@@ -307,13 +307,13 @@ void tiffWriter(gdImagePtr image, gdIOCtx *out, int bitDepth)
}
TIFFSetField(tiff, TIFFTAG_COLORMAP, colorMapRed, colorMapGreen,
- colorMapBlue);
+ colorMapBlue);
samplesPerPixel = 1;
}
/* here, we check if the 'save alpha' flag is set on the source gd image */
- if( (bitDepth == 24) &&
- (image->saveAlphaFlag || image->transparent != -1)) {
+ if ((bitDepth == 24) &&
+ (image->saveAlphaFlag || image->transparent != -1)) {
/* so, we need to store the alpha values too!
* Also, tell TIFF what the extra sample means (associated alpha) */
samplesPerPixel = 4;
@@ -347,10 +347,9 @@ void tiffWriter(gdImagePtr image, gdIOCtx *out, int bitDepth)
/* if this pixel has the same RGB as the transparent colour,
* then set alpha fully transparent */
- if( transparentColorR == r &&
- transparentColorG == g &&
- transparentColorB == b
- ) {
+ if (transparentColorR == r &&
+ transparentColorG == g &&
+ transparentColorB == b) {
a = 0x00;
}
@@ -490,15 +489,15 @@ static int readTiffColorMap(gdImagePtr im, TIFF *tif, char is_bw, int photometri
}
static void readTiffBw (const unsigned char *src,
- gdImagePtr im,
- uint16 photometric,
- int startx,
- int starty,
- int width,
- int height,
- char has_alpha,
- int extra,
- int align)
+ gdImagePtr im,
+ uint16 photometric,
+ int startx,
+ int starty,
+ int width,
+ int height,
+ char has_alpha,
+ int extra,
+ int align)
{
int x = startx, y = starty;
int src_x, src_y;