From 66e5d7a8434b3930342768cdec979edfaf30fe51 Mon Sep 17 00:00:00 2001 From: David Turner Date: Thu, 6 Oct 2005 10:58:06 +0000 Subject: [PATCH] * include/freetype/ftrgb.h: update documentation * src/rgbfilt/ftrgbgen.h, src/rgbfilt/ftrgbgn2.h: fix some computation issues on 16-bit platforms. --- ChangeLog | 7 +++++++ include/freetype/ftrgb.h | 12 ++++++++---- src/rgbfilt/ftrgbgen.h | 4 ++-- src/rgbfilt/ftrgbgn2.h | 4 ++-- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index e881067fd..54ec7cbdd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-10-06 David Turner + + * include/freetype/ftrgb.h: update documentation + + * src/rgbfilt/ftrgbgen.h, src/rgbfilt/ftrgbgn2.h: fix some computation + issues on 16-bit platforms. + 2005-09-27 David Turner * include/freetype/config/ftheader.h, include/freetype/ftrgb.h, diff --git a/include/freetype/ftrgb.h b/include/freetype/ftrgb.h index 9b15db7e4..c2eb71b6d 100644 --- a/include/freetype/ftrgb.h +++ b/include/freetype/ftrgb.h @@ -52,7 +52,8 @@ typedef struct FT_RgbFilterRec_* FT_RgbFilter; * @FT_PIXEL_MODE_LCD or @FT_PIXEL_MODE_LCD_V * * in_bytes :: first byte of input bitmap data in memory - * in_pitch :: number of bytes in a row of input pixels. can be negative + * in_pitch :: number of bytes in a row of input pixels. + * can be negative * * out_width :: width in pixels of output bitmap * out_height :: width in pixels of output bitmap @@ -70,7 +71,8 @@ typedef struct FT_RgbFilterRec_* FT_RgbFilter; * * @note: * this function returns an error if 'in_mode' isn't set to either - * @FT_PIXEL_MODE_LCD or @FT_PIXEL_MODE_LCD_V + * @FT_PIXEL_MODE_LCD or @FT_PIXEL_MODE_LCD_V, or if the values of + * the parameters are incorrect. * * when 'in_mode' is @FT_PIXEL_MODE_LCD, this function assumes that the * width of the input bitmap is three times the output's one. otherwise, @@ -102,7 +104,7 @@ FT_RgbFilter_ApplyARGB( FT_RgbFilter filter_or_null, * @description: * a variant of @FT_RgbFilter_ApplyARGB that performs filtering * within the input bitmap. It's up to the caller to convert the - * result to a format suitable + * result to a suitable color format. * * @input: * filter_or_null :: handle to RGB filter object, or NULL to use the @@ -125,7 +127,8 @@ FT_RgbFilter_ApplyARGB( FT_RgbFilter filter_or_null, * * @note: * this function returns an error if 'in_mode' isn't set to either - * @FT_PIXEL_MODE_LCD or @FT_PIXEL_MODE_LCD_V + * @FT_PIXEL_MODE_LCD or @FT_PIXEL_MODE_LCD_V, or if the values of some + * parameters are incorrect. * * when 'in_mode' is @FT_PIXEL_MODE_LCD, this function assumes that the * width of the input bitmap is three times 'org_width'. otherwise, @@ -209,6 +212,7 @@ FT_RgbFilter_Done( FT_RgbFilter filter ); * green /= 65536; * blue /= 65536; * } + * */ FT_EXPORT( void ) FT_RgbFilter_Reset( FT_RgbFilter filter, diff --git a/src/rgbfilt/ftrgbgen.h b/src/rgbfilt/ftrgbgen.h index da7cf15c0..596ebe57d 100644 --- a/src/rgbfilt/ftrgbgen.h +++ b/src/rgbfilt/ftrgbgen.h @@ -37,7 +37,7 @@ for ( ; ww > 0; ww--, read += HMUL, write += 1 ) { - FT_UInt rr, gg, bb; + FT_UInt32 rr, gg, bb; FT_UInt val; val = read[OFF_R]; @@ -59,7 +59,7 @@ gg = (gg >> 16) & 255; bb = (bb >> 16) & 255; - write[0] = (FT_UInt)( (gg << 24) | (rr << 16) | (gg << 8) | bb ); + write[0] = (FT_UInt32)( (gg << 24) | (rr << 16) | (gg << 8) | bb ); } } diff --git a/src/rgbfilt/ftrgbgn2.h b/src/rgbfilt/ftrgbgn2.h index b3d9365cb..b5a2846ab 100644 --- a/src/rgbfilt/ftrgbgn2.h +++ b/src/rgbfilt/ftrgbgn2.h @@ -29,12 +29,12 @@ for ( ; hh > 0; hh--, in_line += in_pitch*VMUL ) { - int ww = oper->width; + int ww = oper->width; FT_Byte* pix = in_line; for ( ; ww > 0; ww--, pix += HMUL ) { - FT_UInt rr, gg, bb; + FT_UInt32 rr, gg, bb; FT_UInt val; val = pix[OFF_R];