| 1 | #ifndef _INCLUDED_BITMAP_IMG |
|---|
| 2 | #define _INCLUDED_BITMAP_IMG |
|---|
| 3 | |
|---|
| 4 | #include "_utfBit2Byte.cxx" |
|---|
| 5 | |
|---|
| 6 | UT_STATIC_API UT_BOOL ut_PrepareRasterBitmapGlyphIMG(UT_FC* fc, UT_IMAGE* image) |
|---|
| 7 | { |
|---|
| 8 | UT_TRACE1("ut_PrepareRasterBitmapGlyphIMG()"); |
|---|
| 9 | UT_TRACE_TAB_INC(); |
|---|
| 10 | image->type = _UT_IMAGE_TYPE_BITMAP; |
|---|
| 11 | if (fc->task->glyph->count == 1) |
|---|
| 12 | { |
|---|
| 13 | UT_TRACE1("if (fc->task->glyph->count == 1)"); |
|---|
| 14 | ut_PrepareRasterBitmapHasFixedBbox(fc, image, ut_BSIZE8(fc->task->glyph->data->bbox.sx), fc->task->glyph->data->bbox.sy); |
|---|
| 15 | } |
|---|
| 16 | else if (fc->task->glyph->cmap->glyphBBoxType == _UT_GLYPH_BBOX_FIXED) |
|---|
| 17 | { |
|---|
| 18 | UT_TRACE1("if (fc->task->glyph->cmap->glyphBBoxType == _UT_GLYPH_BBOX_FIXED)"); |
|---|
| 19 | ut_PrepareRasterBitmapHasFixedBbox(fc, image, ut_BSIZE8(fc->task->glyph->data->bbox.sx), fc->task->glyph->data->bbox.sy); |
|---|
| 20 | } |
|---|
| 21 | else |
|---|
| 22 | { |
|---|
| 23 | UT_TRACE1("else"); |
|---|
| 24 | ut_GetImageBbox(fc, image); |
|---|
| 25 | image->bSize = ut_BSIZE8(image->bbox.sx); |
|---|
| 26 | image->lSize = image->bSize * image->bbox.sy; |
|---|
| 27 | } |
|---|
| 28 | UT_TRACE2("image->bbox.ox = %d", image->bbox.ox); |
|---|
| 29 | UT_TRACE2("image->bbox.oy = %d", image->bbox.oy); |
|---|
| 30 | UT_TRACE2("image->bbox.sx = %d", image->bbox.sx); |
|---|
| 31 | UT_TRACE2("image->bbox.sy = %d", image->bbox.sy); |
|---|
| 32 | UT_TRACE2("image->bSize = %d", image->bSize); |
|---|
| 33 | UT_TRACE2("image->lSize = %d", image->lSize); |
|---|
| 34 | UT_TRACE_TAB_DEC(); |
|---|
| 35 | return _UT_TRUE; |
|---|
| 36 | } |
|---|
| 37 | |
|---|
| 38 | UT_STATIC_API UT_BOOL ut_MakeRasterBitmapGlyphIMG(UT_FC* fc, UT_IMAGE* image) |
|---|
| 39 | { |
|---|
| 40 | UT_TRACE1("ut_MakeRasterBitmapGlyphIMG()"); |
|---|
| 41 | UT_TRACE_TAB_INC(); |
|---|
| 42 | if (fc->task->glyph->count == 1) |
|---|
| 43 | { |
|---|
| 44 | UT_TRACE1("if (fc->task->glyph->count == 1)"); |
|---|
| 45 | ut_MakeRasterBitmapHasOneGlyph(fc, image); |
|---|
| 46 | } |
|---|
| 47 | else if (fc->task->glyph->cmap->glyphBBoxType == _UT_GLYPH_BBOX_FIXED) |
|---|
| 48 | { |
|---|
| 49 | UT_TRACE1("if (fc->task->glyph->cmap->glyphBBoxType == _UT_GLYPH_BBOX_FIXED)"); |
|---|
| 50 | ut_MakeRasterBitmapHasFixedBbox(fc, image); |
|---|
| 51 | } |
|---|
| 52 | else |
|---|
| 53 | { |
|---|
| 54 | int i = fc->task->glyph->count; |
|---|
| 55 | UT_DATA* data = fc->task->glyph->data; |
|---|
| 56 | UT_TRACE1("else"); |
|---|
| 57 | ut_AllocScanBuffer(fc->task, image, 0); |
|---|
| 58 | UT_MEMSET(image->data, 0, image->lSize); |
|---|
| 59 | for (; i; i--,data++) ut_CopySBM(image, data); |
|---|
| 60 | } |
|---|
| 61 | UT_TRACE_TAB_DEC(); |
|---|
| 62 | return _UT_TRUE; |
|---|
| 63 | } |
|---|
| 64 | |
|---|
| 65 | #endif /*#ifndef _INCLUDED_BITMAP_IMG*/ |
|---|