ft_pixel_mode_mono 값은 주로 20 pixel 미만의 폰트를 불러올때 호출된다. truetype 경우 예외 있음
ft_pixel_mode_mono 는
A monochrome bitmap, using 1 bit per pixel. Note that pixels are stored in most-significant order (MSB),
which means that the left-most pixel in a byte has value 128.
단색 비트맵 , pixel 하나 나타내는데 1bit 만 사용한다는것..
따라서 ( 1000 0000 ) 같이 left-most 가 값으로 pixel 나타내는데 사용된다.
Buffer 의 2번째 bit 부터 검색하면서 값이 있는지 없는지 체크 하면서 Dest 에 복사를 해주면 됨..
BYTE ucCompBit = 128;
for(int i = nPenY + lBearingY; i < nMaxY; ++i)
{
pdwTexData = (BYTE*)(&pbtDestData[(i) * rtLocked.Pitch]);int j = nPenX + lBearingX;
int p = 0;for( j, p; j < nMaxX; ++j, ++p)
{
// bit & operation
if ( *pucBuff & ucCompBit )
{
pdwTexData[j] = 0xFFFFFFFF /*| (*pucBuff)*/;
}
else
{
pdwTexData[j] = 0x00000000 /*| (*pucBuff)*/;
}// shift to right
ucCompBit = ucCompBit >> 1;// pointer up
if ( (p % nBmpWidth) == (nBmpWidth - 1) || !ucCompBit )
{
ucCompBit = 128;
++pucBuff;
}}
}
'Programming' 카테고리의 다른 글
| Directshow strmbase.lib strmbasd.lib (0) | 2008/02/04 |
|---|---|
| freetype dxfont 간 성능 비교.. (0) | 2008/01/23 |
| STL Vector (0) | 2008/01/22 |
| hash string (0) | 2008/01/18 |
| Texture Stage Argument (0) | 2008/01/18 |
| FreeType2 library ft_pixel_mode_mono (0) | 2008/01/18 |
| FreeType2 Library Metrics pixel 포맷 (0) | 2008/01/18 |
| freetype library (0) | 2007/12/14 |
| rand(), srand(), RAND_MAX (0) | 2007/11/10 |
| 맵핑이란.. Mapping (0) | 2007/10/05 |
| ID3DXSprite::Begin (0) | 2007/10/02 |






댓글을 달아 주세요