* include/freetype/ftrgb.h: update documentation

* src/rgbfilt/ftrgbgen.h, src/rgbfilt/ftrgbgn2.h: fix some computation
        issues on 16-bit platforms.
This commit is contained in:
David Turner 2005-10-06 10:58:06 +00:00
parent 426a458b7c
commit 66e5d7a843
4 changed files with 19 additions and 8 deletions

View File

@ -1,3 +1,10 @@
2005-10-06 David Turner <david@freetype.org>
* 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 <david@freetype.org>
* include/freetype/config/ftheader.h, include/freetype/ftrgb.h,

View File

@ -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,

View File

@ -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 );
}
}

View File

@ -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];