forked from minhngoc25a/freetype2
* src/base/ftbitmap.c (FT_Bitmap_Embolden): Handle negative pitch.
Handle FT_PIXEL_MODE_GRAY with num_gray != 256. Improve speed for FT_PIXEL_MODE_GRAY. (ft_bitmap_assure_buffer): Accept FT_PIXEL_MODE_LCD and FT_PIXEL_MODE_LCD_V.
This commit is contained in:
parent
e70371c410
commit
c162eac55c
|
@ -1,3 +1,11 @@
|
|||
2005-05-28 Chia I Wu <b90201047@ntu.edu.tw>
|
||||
|
||||
* src/base/ftbitmap.c (FT_Bitmap_Embolden): Handle negative pitch.
|
||||
Handle FT_PIXEL_MODE_GRAY with num_gray != 256.
|
||||
Improve speed for FT_PIXEL_MODE_GRAY.
|
||||
(ft_bitmap_assure_buffer): Accept FT_PIXEL_MODE_LCD and
|
||||
FT_PIXEL_MODE_LCD_V.
|
||||
|
||||
2005-05-27 Chia I Wu <b90201047@ntu.edu.tw>
|
||||
|
||||
* src/base/ftsynth.c (FT_GlyphSlot_Embolden): Initialize `error'.
|
||||
|
|
|
@ -115,6 +115,8 @@
|
|||
switch ( bitmap->pixel_mode )
|
||||
{
|
||||
case FT_PIXEL_MODE_MONO:
|
||||
case FT_PIXEL_MODE_LCD:
|
||||
case FT_PIXEL_MODE_LCD_V:
|
||||
ppb = 8;
|
||||
break;
|
||||
case FT_PIXEL_MODE_GRAY2:
|
||||
|
@ -210,7 +212,7 @@
|
|||
else
|
||||
{
|
||||
pitch = -pitch;
|
||||
p = bitmap->buffer + pitch * ( bitmap->rows - ystr - 1 );
|
||||
p = bitmap->buffer + pitch * ( bitmap->rows - 1 );
|
||||
}
|
||||
|
||||
/* for each row */
|
||||
|
@ -237,16 +239,30 @@
|
|||
/* the maximum value of 8 for `xstr' comes from here */
|
||||
if ( x > 0 )
|
||||
p[x] |= p[x - 1] << ( 8 - i );
|
||||
|
||||
#if 0
|
||||
if ( p[x] == 0xff )
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
else if ( bitmap->pixel_mode == FT_PIXEL_MODE_GRAY )
|
||||
{
|
||||
if ( x - i >= 0 )
|
||||
{
|
||||
if ( p[x] + p[x - i] > 0xff )
|
||||
p[x] = 0xff;
|
||||
if ( p[x] + p[x - i] > bitmap->num_grays )
|
||||
{
|
||||
p[x] = bitmap->num_grays;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
p[x] += p[x - i];
|
||||
if ( p[x] == bitmap->num_grays )
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue