support for clipped direct rendering
updated INSTALL file for Win32 case
This commit is contained in:
parent
63408a1299
commit
859a18a358
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
2000-12-15 David Turner <david.turner@freetype.org>
|
||||||
|
|
||||||
|
* include/freetype/ftimage.h, include/freetype/fttypes.h,
|
||||||
|
src/smooth/ftgrays.c: added support for clipped direct rendering in
|
||||||
|
the smooth renderer. This should not break binary compatibility of
|
||||||
|
existing applications..
|
||||||
|
|
||||||
|
* INSTALL: updated installation instructions on Win32, listing the
|
||||||
|
new "make setup list" target used to list supported compilers/targets
|
||||||
|
|
||||||
2000-12-13 David Turner <david.turner@freetype.org>
|
2000-12-13 David Turner <david.turner@freetype.org>
|
||||||
|
|
||||||
* include/freetype/config/ft2build.h,
|
* include/freetype/config/ft2build.h,
|
||||||
|
|
36
INSTALL
36
INSTALL
|
@ -9,7 +9,7 @@ I. From the command line:
|
||||||
|
|
||||||
- Go to the `freetype2' directory.
|
- Go to the `freetype2' directory.
|
||||||
|
|
||||||
- On Unix (any C compiler should work):
|
- On Unix or (any C compiler should work):
|
||||||
|
|
||||||
- make setup (don't worry, this will invoke a configure script)
|
- make setup (don't worry, this will invoke a configure script)
|
||||||
- make
|
- make
|
||||||
|
@ -27,25 +27,29 @@ I. From the command line:
|
||||||
We provide a version of GNU Make for Win32 on the FreeType site.
|
We provide a version of GNU Make for Win32 on the FreeType site.
|
||||||
See http://www.freetype.org/download.html for details.
|
See http://www.freetype.org/download.html for details.
|
||||||
|
|
||||||
If you are using gcc:
|
- if you're using gcc (Mingw, _not_ CygWin):
|
||||||
|
|
||||||
|
- make setup
|
||||||
|
- make
|
||||||
|
|
||||||
- make setup
|
|
||||||
- make
|
|
||||||
|
|
||||||
If you are using Visual C++:
|
- if you're using Visual C++
|
||||||
|
|
||||||
- make setup visualc
|
- make setup visualc
|
||||||
- make
|
- make
|
||||||
|
|
||||||
If you are using Win32-lCC:
|
|
||||||
|
- if you're using another compiler:
|
||||||
|
|
||||||
- make setup lcc
|
- make setup xxxx
|
||||||
- make
|
- make
|
||||||
|
|
||||||
If you are using the Borland C++ Builder compiler:
|
|
||||||
|
where "xxxx" is a special target corresponding to your compiler.
|
||||||
- make setup bcc32
|
To see a list of supported compilers in this release, type:
|
||||||
- make
|
|
||||||
|
make setup list
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
II. In your own environment (IDE):
|
II. In your own environment (IDE):
|
||||||
|
|
|
@ -607,6 +607,33 @@ FT_BEGIN_HEADER
|
||||||
typedef struct FT_RasterRec_* FT_Raster;
|
typedef struct FT_RasterRec_* FT_Raster;
|
||||||
|
|
||||||
|
|
||||||
|
/*************************************************************************/
|
||||||
|
/* */
|
||||||
|
/* <Struct> */
|
||||||
|
/* FT_BBox */
|
||||||
|
/* */
|
||||||
|
/* <Description> */
|
||||||
|
/* A structure used to hold an outline's bounding box, i.e., the */
|
||||||
|
/* coordinates of its extrema in the horizontal and vertical */
|
||||||
|
/* directions. */
|
||||||
|
/* */
|
||||||
|
/* <Fields> */
|
||||||
|
/* xMin :: The horizontal minimum (left-most). */
|
||||||
|
/* */
|
||||||
|
/* yMin :: The vertical minimum (bottom-most). */
|
||||||
|
/* */
|
||||||
|
/* xMax :: The horizontal maximum (right-most). */
|
||||||
|
/* */
|
||||||
|
/* yMax :: The vertical maximum (top-most). */
|
||||||
|
/* */
|
||||||
|
typedef struct FT_BBox_
|
||||||
|
{
|
||||||
|
FT_Pos xMin, yMin;
|
||||||
|
FT_Pos xMax, yMax;
|
||||||
|
|
||||||
|
} FT_BBox;
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* */
|
/* */
|
||||||
/* <Struct> */
|
/* <Struct> */
|
||||||
|
@ -747,23 +774,35 @@ FT_BEGIN_HEADER
|
||||||
/* <Fields> */
|
/* <Fields> */
|
||||||
/* ft_raster_flag_default :: This value is 0. */
|
/* ft_raster_flag_default :: This value is 0. */
|
||||||
/* */
|
/* */
|
||||||
/* ft_raster_flag_aa :: Requests the rendering of an */
|
/* ft_raster_flag_aa :: */
|
||||||
/* anti-aliased glyph bitmap. If unset, a */
|
/* this flag is set to indicate that a anti-aliased glyph image */
|
||||||
/* monchrome bitmap will be rendered. */
|
/* should be generated. Otherwise, it will be monochrome (1-bit) */
|
||||||
/* */
|
/* */
|
||||||
/* ft_raster_flag_direct :: Requests direct rendering over the */
|
/* ft_raster_flag_direct :: */
|
||||||
/* target bitmap. Direct rendering uses */
|
/* this flag is set to indicate direct rendering. In this mode, */
|
||||||
/* user-provided callbacks in order to */
|
/* client applications must provide their own span callback. */
|
||||||
/* perform direct drawing or composition */
|
/* this let them direct drawing or composition over an existing */
|
||||||
/* over an existing bitmap. If this bit is */
|
/* bitmap. If this bit is not set, the target pixmap's buffer */
|
||||||
/* unset, the content of the target bitmap */
|
/* _must_ be zeroed before rendering. */
|
||||||
/* *must be zeroed*! */
|
/* */
|
||||||
|
/* note that for now, direct rendering is only possible with */
|
||||||
|
/* anti-aliased glyphs only.. */
|
||||||
|
/* */
|
||||||
|
/* ft_raster_flag_clip :: */
|
||||||
|
/* this flag is only used in direct rendering mode. When set, */
|
||||||
|
/* the output will be clipped to a box specified in the "clip_box" */
|
||||||
|
/* field of the FT_Raster_Params structure. */
|
||||||
|
/* */
|
||||||
|
/* note that by default, the glyph bitmap is clipped to the */
|
||||||
|
/* target pixmap, except in direct rendering mode where all */
|
||||||
|
/* spans are generated if no clipping box is set. */
|
||||||
/* */
|
/* */
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
ft_raster_flag_default = 0,
|
ft_raster_flag_default = 0,
|
||||||
ft_raster_flag_aa = 1,
|
ft_raster_flag_aa = 1,
|
||||||
ft_raster_flag_direct = 2
|
ft_raster_flag_direct = 2,
|
||||||
|
ft_raster_flag_clip = 4
|
||||||
|
|
||||||
} FT_Raster_Flag;
|
} FT_Raster_Flag;
|
||||||
|
|
||||||
|
@ -796,6 +835,9 @@ FT_BEGIN_HEADER
|
||||||
/* user :: User-supplied data that is passed to each drawing */
|
/* user :: User-supplied data that is passed to each drawing */
|
||||||
/* callback. */
|
/* callback. */
|
||||||
/* */
|
/* */
|
||||||
|
/* clip_box :: an optional clipping box. It is only used in */
|
||||||
|
/* direct rendering mode */
|
||||||
|
/* */
|
||||||
/* <Note> */
|
/* <Note> */
|
||||||
/* An anti-aliased glyph bitmap is drawn if the ft_raster_flag_aa bit */
|
/* An anti-aliased glyph bitmap is drawn if the ft_raster_flag_aa bit */
|
||||||
/* flag is set in the `flags' field, otherwise a monochrome bitmap */
|
/* flag is set in the `flags' field, otherwise a monochrome bitmap */
|
||||||
|
@ -823,6 +865,7 @@ FT_BEGIN_HEADER
|
||||||
FT_Raster_BitTest_Func bit_test;
|
FT_Raster_BitTest_Func bit_test;
|
||||||
FT_Raster_BitSet_Func bit_set;
|
FT_Raster_BitSet_Func bit_set;
|
||||||
void* user;
|
void* user;
|
||||||
|
FT_BBox clip_box;
|
||||||
|
|
||||||
} FT_Raster_Params;
|
} FT_Raster_Params;
|
||||||
|
|
||||||
|
|
|
@ -275,33 +275,6 @@ FT_BEGIN_HEADER
|
||||||
} FT_Matrix;
|
} FT_Matrix;
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
|
||||||
/* */
|
|
||||||
/* <Struct> */
|
|
||||||
/* FT_BBox */
|
|
||||||
/* */
|
|
||||||
/* <Description> */
|
|
||||||
/* A structure used to hold an outline's bounding box, i.e., the */
|
|
||||||
/* coordinates of its extrema in the horizontal and vertical */
|
|
||||||
/* directions. */
|
|
||||||
/* */
|
|
||||||
/* <Fields> */
|
|
||||||
/* xMin :: The horizontal minimum (left-most). */
|
|
||||||
/* */
|
|
||||||
/* yMin :: The vertical minimum (bottom-most). */
|
|
||||||
/* */
|
|
||||||
/* xMax :: The horizontal maximum (right-most). */
|
|
||||||
/* */
|
|
||||||
/* yMax :: The vertical maximum (top-most). */
|
|
||||||
/* */
|
|
||||||
typedef struct FT_BBox_
|
|
||||||
{
|
|
||||||
FT_Pos xMin, yMin;
|
|
||||||
FT_Pos xMax, yMax;
|
|
||||||
|
|
||||||
} FT_BBox;
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* */
|
/* */
|
||||||
/* <Macro> */
|
/* <Macro> */
|
||||||
|
|
|
@ -252,6 +252,7 @@
|
||||||
|
|
||||||
FT_Outline outline;
|
FT_Outline outline;
|
||||||
FT_Bitmap target;
|
FT_Bitmap target;
|
||||||
|
FT_BBox clip_box;
|
||||||
|
|
||||||
FT_Span gray_spans[FT_MAX_GRAY_SPANS];
|
FT_Span gray_spans[FT_MAX_GRAY_SPANS];
|
||||||
int num_gray_spans;
|
int num_gray_spans;
|
||||||
|
@ -1702,21 +1703,24 @@
|
||||||
TBand bands[40], *band;
|
TBand bands[40], *band;
|
||||||
int n, num_bands;
|
int n, num_bands;
|
||||||
TPos min, max, max_y;
|
TPos min, max, max_y;
|
||||||
|
FT_BBox* clip;
|
||||||
|
|
||||||
|
|
||||||
/* Set up state in the raster object */
|
/* Set up state in the raster object */
|
||||||
compute_cbox( RAS_VAR_ outline );
|
compute_cbox( RAS_VAR_ outline );
|
||||||
|
|
||||||
/* clip to target bitmap, exit if nothing to do */
|
/* clip to target bitmap, exit if nothing to do */
|
||||||
if ( ras.max_ex <= 0 || ras.min_ex >= ras.target.width ||
|
clip = &ras.clip_box;
|
||||||
ras.max_ey <= 0 || ras.min_ey >= ras.target.rows )
|
|
||||||
|
if ( ras.max_ex <= clip->xMin || ras.min_ex >= clip->xMax ||
|
||||||
|
ras.max_ey <= clip->yMin || ras.min_ey >= clip->yMax )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if ( ras.min_ex < 0 ) ras.min_ex = 0;
|
if ( ras.min_ex < clip->xMin ) ras.min_ex = clip->xMin;
|
||||||
if ( ras.min_ey < 0 ) ras.min_ey = 0;
|
if ( ras.min_ey < clip->yMin ) ras.min_ey = clip->yMin;
|
||||||
|
|
||||||
if ( ras.max_ex > ras.target.width ) ras.max_ex = ras.target.width;
|
if ( ras.max_ex > clip->xMax ) ras.max_ex = clip->xMax;
|
||||||
if ( ras.max_ey > ras.target.rows ) ras.max_ey = ras.target.rows;
|
if ( ras.max_ey > clip->yMax ) ras.max_ey = clip->yMax;
|
||||||
|
|
||||||
/* simple heuristic used to speed-up the bezier decomposition -- see */
|
/* simple heuristic used to speed-up the bezier decomposition -- see */
|
||||||
/* the code in render_conic() and render_cubic() for more details */
|
/* the code in render_conic() and render_cubic() for more details */
|
||||||
|
@ -1852,6 +1856,27 @@
|
||||||
if ( !( params->flags & ft_raster_flag_aa ) )
|
if ( !( params->flags & ft_raster_flag_aa ) )
|
||||||
return ErrRaster_Invalid_Mode;
|
return ErrRaster_Invalid_Mode;
|
||||||
|
|
||||||
|
/* compute clipping box */
|
||||||
|
if ( (params->flags & ft_raster_flag_direct) == 0 )
|
||||||
|
{
|
||||||
|
/* compute clip box from target pixmap */
|
||||||
|
ras.clip_box.xMin = 0;
|
||||||
|
ras.clip_box.yMin = 0;
|
||||||
|
ras.clip_box.xMax = target_map->width;
|
||||||
|
ras.clip_box.yMax = target_map->rows;
|
||||||
|
}
|
||||||
|
else if ( params->flags & ft_raster_flag_clip )
|
||||||
|
{
|
||||||
|
ras.clip_box = params->clip_box;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ras.clip_box.xMin = -32768;
|
||||||
|
ras.clip_box.yMin = -32768;
|
||||||
|
ras.clip_box.xMax = 32767;
|
||||||
|
ras.clip_box.yMax = 32767;
|
||||||
|
}
|
||||||
|
|
||||||
ras.outline = *outline;
|
ras.outline = *outline;
|
||||||
ras.num_cells = 0;
|
ras.num_cells = 0;
|
||||||
ras.invalid = 1;
|
ras.invalid = 1;
|
||||||
|
|
Loading…
Reference in New Issue