亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ftgrays.c

?? a very goog book
?? C
?? 第 1 頁 / 共 4 頁
字號:
/***************************************************************************//*                                                                         *//*  ftgrays.c                                                              *//*                                                                         *//*    A new `perfect' anti-aliasing renderer (body).                       *//*                                                                         *//*  Copyright 2000-2001, 2002 by                                           *//*  David Turner, Robert Wilhelm, and Werner Lemberg.                      *//*                                                                         *//*  This file is part of the FreeType project, and may only be used,       *//*  modified, and distributed under the terms of the FreeType project      *//*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     *//*  this file you indicate that you have read the license and              *//*  understand and accept it fully.                                        *//*                                                                         *//***************************************************************************/  /*************************************************************************/  /*                                                                       */  /* This file can be compiled without the rest of the FreeType engine, by */  /* defining the _STANDALONE_ macro when compiling it.  You also need to  */  /* put the files `ftgrays.h' and `ftimage.h' into the current            */  /* compilation directory.  Typically, you could do something like        */  /*                                                                       */  /* - copy `src/base/ftgrays.c' to your current directory                 */  /*                                                                       */  /* - copy `include/freetype/ftimage.h' and `include/freetype/ftgrays.h'  */  /*   to the same directory                                               */  /*                                                                       */  /* - compile `ftgrays' with the _STANDALONE_ macro defined, as in        */  /*                                                                       */  /*     cc -c -D_STANDALONE_ ftgrays.c                                    */  /*                                                                       */  /* The renderer can be initialized with a call to                        */  /* `ft_gray_raster.gray_raster_new'; an anti-aliased bitmap can be       */  /* generated with a call to `ft_gray_raster.gray_raster_render'.         */  /*                                                                       */  /* See the comments and documentation in the file `ftimage.h' for more   */  /* details on how the raster works.                                      */  /*                                                                       */  /*************************************************************************/  /*************************************************************************/  /*                                                                       */  /* This is a new anti-aliasing scan-converter for FreeType 2.  The       */  /* algorithm used here is _very_ different from the one in the standard  */  /* `ftraster' module.  Actually, `ftgrays' computes the _exact_          */  /* coverage of the outline on each pixel cell.                           */  /*                                                                       */  /* It is based on ideas that I initially found in Raph Levien's          */  /* excellent LibArt graphics library (see http://www.levien.com/libart   */  /* for more information, though the web pages do not tell anything       */  /* about the renderer; you'll have to dive into the source code to       */  /* understand how it works).                                             */  /*                                                                       */  /* Note, however, that this is a _very_ different implementation         */  /* compared to Raph's.  Coverage information is stored in a very         */  /* different way, and I don't use sorted vector paths.  Also, it doesn't */  /* use floating point values.                                            */  /*                                                                       */  /* This renderer has the following advantages:                           */  /*                                                                       */  /* - It doesn't need an intermediate bitmap.  Instead, one can supply a  */  /*   callback function that will be called by the renderer to draw gray  */  /*   spans on any target surface.  You can thus do direct composition on */  /*   any kind of bitmap, provided that you give the renderer the right   */  /*   callback.                                                           */  /*                                                                       */  /* - A perfect anti-aliaser, i.e., it computes the _exact_ coverage on   */  /*   each pixel cell.                                                    */  /*                                                                       */  /* - It performs a single pass on the outline (the `standard' FT2        */  /*   renderer makes two passes).                                         */  /*                                                                       */  /* - It can easily be modified to render to _any_ number of gray levels  */  /*   cheaply.                                                            */  /*                                                                       */  /* - For small (< 20) pixel sizes, it is faster than the standard        */  /*   renderer.                                                           */  /*                                                                       */  /*************************************************************************//* experimental support for gamma correction within the rasterizer */#define xxxGRAYS_USE_GAMMA  /*************************************************************************/  /*                                                                       */  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */  /* messages during execution.                                            */  /*                                                                       */#undef  FT_COMPONENT#define FT_COMPONENT  trace_smooth#define ErrRaster_MemoryOverflow   -4#ifdef _STANDALONE_#include <string.h>             /* for ft_memcpy() */#include <setjmp.h>#include <limits.h>#define FT_UINT_MAX  UINT_MAX#define  ft_setjmp   setjmp#define  ft_longjmp  longjmp#define  ft_jmp_buf  jmp_buf#define ErrRaster_Invalid_Mode     -2#define ErrRaster_Invalid_Outline  -1#include "ftimage.h"#include "ftgrays.h"  /* This macro is used to indicate that a function parameter is unused. */  /* Its purpose is simply to reduce compiler warnings.  Note also that  */  /* simply defining it as `(void)x' doesn't avoid warnings with certain */  /* ANSI compilers (e.g. LCC).                                          */#define FT_UNUSED( x )  (x) = (x)  /* Disable the tracing mechanism for simplicity -- developers can      */  /* activate it easily by redefining these two macros.                  */#ifndef FT_ERROR#define FT_ERROR( x )  do ; while ( 0 )     /* nothing */#endif#ifndef FT_TRACE#define FT_TRACE( x )  do ; while ( 0 )     /* nothing */#endif#else /* _STANDALONE_ */#include <ft2build.h>#include "ftgrays.h"#include FT_INTERNAL_OBJECTS_H#include FT_INTERNAL_DEBUG_H#include FT_OUTLINE_H#include "ftsmerrs.h"#define ErrRaster_Invalid_Mode     Smooth_Err_Cannot_Render_Glyph#define ErrRaster_Invalid_Outline  Smooth_Err_Invalid_Outline#endif /* _STANDALONE_ */#ifndef FT_MEM_SET#define FT_MEM_SET( d, s, c )  ft_memset( d, s, c )#endif  /* define this to dump debugging information */#define xxxDEBUG_GRAYS  /* as usual, for the speed hungry :-) */#ifndef FT_STATIC_RASTER#define RAS_ARG   PRaster  raster#define RAS_ARG_  PRaster  raster,#define RAS_VAR   raster#define RAS_VAR_  raster,#define ras       (*raster)#else /* FT_STATIC_RASTER */#define RAS_ARG   /* empty */#define RAS_ARG_  /* empty */#define RAS_VAR   /* empty */#define RAS_VAR_  /* empty */  static TRaster  ras;#endif /* FT_STATIC_RASTER */  /* must be at least 6 bits! */#define PIXEL_BITS  8#define ONE_PIXEL       ( 1L << PIXEL_BITS )#define PIXEL_MASK      ( -1L << PIXEL_BITS )#define TRUNC( x )      ( (x) >> PIXEL_BITS )#define SUBPIXELS( x )  ( (x) << PIXEL_BITS )#define FLOOR( x )      ( (x) & -ONE_PIXEL )#define CEILING( x )    ( ( (x) + ONE_PIXEL - 1 ) & -ONE_PIXEL )#define ROUND( x )      ( ( (x) + ONE_PIXEL / 2 ) & -ONE_PIXEL )#if PIXEL_BITS >= 6#define UPSCALE( x )    ( (x) << ( PIXEL_BITS - 6 ) )#define DOWNSCALE( x )  ( (x) >> ( PIXEL_BITS - 6 ) )#else#define UPSCALE( x )    ( (x) >> ( 6 - PIXEL_BITS ) )#define DOWNSCALE( x )  ( (x) << ( 6 - PIXEL_BITS ) )#endif  /* Define this if you want to use a more compact storage scheme.  This   */  /* increases the number of cells available in the render pool but slows  */  /* down the rendering a bit.  It is useful if you have a really tiny     */  /* render pool.                                                          */#undef  GRAYS_COMPACT  /*************************************************************************/  /*                                                                       */  /*   TYPE DEFINITIONS                                                    */  /*                                                                       */  /* don't change the following types to FT_Int or FT_Pos, since we might */  /* need to define them to "float" or "double" when experimenting with   */  /* new algorithms                                                       */  typedef int   TCoord;   /* integer scanline/pixel coordinate */  typedef long  TPos;     /* sub-pixel coordinate              */  /* determine the type used to store cell areas.  This normally takes at */  /* least PIXEL_BYTES*2 + 1.  On 16-bit systems, we need to use `long'   */  /* instead of `int', otherwise bad things happen                        */#if PIXEL_BITS <= 7  typedef int   TArea;#else /* PIXEL_BITS >= 8 */  /* approximately determine the size of integers using an ANSI-C header */#if FT_UINT_MAX == 0xFFFFU  typedef long  TArea;#else  typedef int  TArea;#endif#endif /* PIXEL_BITS >= 8 */  /* maximal number of gray spans in a call to the span callback */#define FT_MAX_GRAY_SPANS  32#ifdef GRAYS_COMPACT  typedef struct  TCell_  {    short  x     : 14;    short  y     : 14;    int    cover : PIXEL_BITS + 2;    int    area  : PIXEL_BITS * 2 + 2;  } TCell, *PCell;#else /* GRAYS_COMPACT */  typedef struct  TCell_  {    TCoord  x;    TCoord  y;    int     cover;    TArea   area;  } TCell, *PCell;#endif /* GRAYS_COMPACT */  typedef struct  TRaster_  {    PCell   cells;    int     max_cells;    int     num_cells;    TCoord  min_ex, max_ex;    TCoord  min_ey, max_ey;    TArea   area;    int     cover;    int     invalid;    TCoord  ex, ey;    TCoord  cx, cy;    TPos    x,  y;    TCoord  last_ey;    FT_Vector   bez_stack[32 * 3 + 1];    int         lev_stack[32];    FT_Outline  outline;    FT_Bitmap   target;    FT_BBox     clip_box;    FT_Span     gray_spans[FT_MAX_GRAY_SPANS];    int         num_gray_spans;    FT_Raster_Span_Func  render_span;    void*                render_span_data;    int                  span_y;    int  band_size;    int  band_shoot;    int  conic_level;    int  cubic_level;    void*       memory;    ft_jmp_buf  jump_buffer;#ifdef GRAYS_USE_GAMMA    FT_Byte  gamma[257];#endif  } TRaster, *PRaster;  /*************************************************************************/  /*                                                                       */  /* Initialize the cells table.                                           */  /*                                                                       */  static void  gray_init_cells( RAS_ARG_ void*  buffer,                   long            byte_size )  {    ras.cells     = (PCell)buffer;    ras.max_cells = byte_size / sizeof ( TCell );    ras.num_cells = 0;    ras.area      = 0;    ras.cover     = 0;    ras.invalid   = 1;  }  /*************************************************************************/  /*                                                                       */  /* Compute the outline bounding box.                                     */  /*                                                                       */  static void  gray_compute_cbox( RAS_ARG )  {    FT_Outline*  outline = &ras.outline;    FT_Vector*   vec     = outline->points;    FT_Vector*   limit   = vec + outline->n_points;    if ( outline->n_points <= 0 )    {      ras.min_ex = ras.max_ex = 0;      ras.min_ey = ras.max_ey = 0;      return;    }    ras.min_ex = ras.max_ex = vec->x;    ras.min_ey = ras.max_ey = vec->y;    vec++;    for ( ; vec < limit; vec++ )    {      TPos  x = vec->x;      TPos  y = vec->y;      if ( x < ras.min_ex ) ras.min_ex = x;      if ( x > ras.max_ex ) ras.max_ex = x;      if ( y < ras.min_ey ) ras.min_ey = y;      if ( y > ras.max_ey ) ras.max_ey = y;    }    /* truncate the bounding box to integer pixels */    ras.min_ex = ras.min_ex >> 6;    ras.min_ey = ras.min_ey >> 6;    ras.max_ex = ( ras.max_ex + 63 ) >> 6;    ras.max_ey = ( ras.max_ey + 63 ) >> 6;  }  /*************************************************************************/  /*                                                                       */  /* Record the current cell in the table.                                 */  /*                                                                       */  static void  gray_record_cell( RAS_ARG )  {    PCell  cell;    if ( !ras.invalid && ( ras.area | ras.cover ) )    {      if ( ras.num_cells >= ras.max_cells )        ft_longjmp( ras.jump_buffer, 1 );      cell        = ras.cells + ras.num_cells++;      cell->x     = ras.ex - ras.min_ex;      cell->y     = ras.ey - ras.min_ey;      cell->area  = ras.area;      cell->cover = ras.cover;    }  }  /*************************************************************************/  /*                                                                       */  /* Set the current cell to a new position.                               */  /*                                                                       */  static void  gray_set_cell( RAS_ARG_ TCoord  ex,                          TCoord  ey )  {    int  invalid, record, clean;    /* Move the cell pointer to a new position.  We set the `invalid'      */    /* flag to indicate that the cell isn't part of those we're interested */    /* in during the render phase.  This means that:                       */    /*                                                                     */    /* . the new vertical position must be within min_ey..max_ey-1.        */    /* . the new horizontal position must be strictly less than max_ex     */    /*                                                                     */    /* Note that if a cell is to the left of the clipping region, it is    */    /* actually set to the (min_ex-1) horizontal position.                 */    record  = 0;    clean   = 1;    invalid = ( ey < ras.min_ey || ey >= ras.max_ey || ex >= ras.max_ex );    if ( !invalid )    {      /* All cells that are on the left of the clipping region go to the */      /* min_ex - 1 horizontal position.                                 */      if ( ex < ras.min_ex )        ex = ras.min_ex - 1;      /* if our position is new, then record the previous cell */      if ( ex != ras.ex || ey != ras.ey )        record = 1;      else        clean = ras.invalid;  /* do not clean if we didn't move from */                              /* a valid cell                        */    }    /* record the previous cell if needed (i.e., if we changed the cell */    /* position, of changed the `invalid' flag)                         */    if ( ras.invalid != invalid || record )      gray_record_cell( RAS_VAR );    if ( clean )    {      ras.area  = 0;      ras.cover = 0;    }    ras.invalid = invalid;    ras.ex      = ex;    ras.ey      = ey;  }  /*************************************************************************/  /*                                                                       */  /* Start a new contour at a given cell.                                  */  /*                                                                       */  static void  gray_start_cell( RAS_ARG_  TCoord  ex,                             TCoord  ey )  {    if ( ex < ras.min_ex )      ex = ras.min_ex - 1;    ras.area    = 0;    ras.cover   = 0;    ras.ex      = ex;    ras.ey      = ey;    ras.last_ey = SUBPIXELS( ey );    ras.invalid = 0;    gray_set_cell( RAS_VAR_ ex, ey );  }  /*************************************************************************/  /*                                                                       */  /* Render a scanline as one or more cells.                               */  /*                                                                       */  static void  gray_render_scanline( RAS_ARG_  TCoord  ey,                                  TPos    x1,                                  TCoord  y1,                                  TPos    x2,                                  TCoord  y2 )  {    TCoord  ex1, ex2, fx1, fx2, delta;    long    p, first, dx;    int     incr, lift, mod, rem;    dx = x2 - x1;    ex1 = TRUNC( x1 ); /* if (ex1 >= ras.max_ex) ex1 = ras.max_ex-1; */    ex2 = TRUNC( x2 ); /* if (ex2 >= ras.max_ex) ex2 = ras.max_ex-1; */    fx1 = x1 - SUBPIXELS( ex1 );    fx2 = x2 - SUBPIXELS( ex2 );    /* trivial case.  Happens often */    if ( y1 == y2 )    {      gray_set_cell( RAS_VAR_ ex2, ey );      return;    }    /* everything is located in a single cell.  That is easy! */    /*                                                        */    if ( ex1 == ex2 )    {      delta      = y2 - y1;      ras.area  += (TArea)( fx1 + fx2 ) * delta;      ras.cover += delta;      return;    }    /* ok, we'll have to render a run of adjacent cells on the same */    /* scanline...                                                  */    /*                                                              */    p     = ( ONE_PIXEL - fx1 ) * ( y2 - y1 );    first = ONE_PIXEL;    incr  = 1;    if ( dx < 0 )    {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
宅男噜噜噜66一区二区66| 精品国产制服丝袜高跟| 国v精品久久久网| 裸体在线国模精品偷拍| 免费人成在线不卡| 丝袜美腿亚洲一区| 日韩电影在线免费观看| 欧美视频自拍偷拍| 欧美刺激脚交jootjob| 不卡高清视频专区| 不卡视频一二三| 精品久久人人做人人爰| 91精品国产麻豆| 日韩一级完整毛片| 精品理论电影在线| 欧美国产日韩精品免费观看| 成人欧美一区二区三区白人| 国产情人综合久久777777| 亚洲不卡在线观看| 午夜精品久久久久久久久久久| 一区二区三区日韩精品视频| 亚洲一区二区高清| 奇米色777欧美一区二区| 老司机一区二区| 国产成人自拍在线| 99精品国产一区二区三区不卡| 99精品久久只有精品| 欧美日韩和欧美的一区二区| 欧美一区二区三区不卡| 久久这里只有精品视频网| 中文字幕欧美日韩一区| 亚洲老司机在线| 日本欧美在线看| 国产精品亚洲一区二区三区妖精| 成人免费看的视频| 欧美色综合久久| 精品成人免费观看| 中文字幕一区三区| 丝袜脚交一区二区| 粉嫩高潮美女一区二区三区| 欧美亚洲国产怡红院影院| 日韩一区二区精品葵司在线| 国产一区二区日韩精品| 中日韩av电影| 亚洲毛片av在线| 奇米影视一区二区三区| 不卡的电影网站| 欧美日韩高清一区二区不卡| 久久精品无码一区二区三区| 一区二区三区美女| 狠狠网亚洲精品| 欧美日韩视频在线第一区| 久久麻豆一区二区| 亚洲午夜av在线| 国产成人三级在线观看| 欧美日韩成人综合| 自拍偷在线精品自拍偷无码专区| 奇米影视在线99精品| 91在线观看成人| 日韩女优制服丝袜电影| 亚洲欧美日韩电影| 国产一区二区三区久久久| 欧美性感一类影片在线播放| 久久久久国产精品厨房| 天堂va蜜桃一区二区三区漫画版 | 国产精品一区二区视频| 色999日韩国产欧美一区二区| 精品少妇一区二区三区日产乱码 | 免费一级片91| 在线精品视频免费观看| 国产丝袜美腿一区二区三区| 人人狠狠综合久久亚洲| 91在线码无精品| 国产欧美日韩另类一区| 久久精品国产网站| 欧美日韩黄色一区二区| 亚洲欧美一区二区三区国产精品 | 日韩一区二区三区电影在线观看 | 99久久亚洲一区二区三区青草| 日韩三级免费观看| 亚洲v精品v日韩v欧美v专区| 一本一道久久a久久精品综合蜜臀| 国产午夜精品在线观看| 久久97超碰色| 日韩免费看网站| 日韩成人免费看| 欧美日韩一区二区在线观看 | 亚洲图片自拍偷拍| 99久久伊人网影院| 国产人久久人人人人爽| 激情综合一区二区三区| 91精品国产色综合久久ai换脸| 亚洲一区二区三区视频在线 | 精品国产一区二区三区av性色| 一区二区三区精品| 色婷婷久久久综合中文字幕| 韩国三级电影一区二区| 精品粉嫩aⅴ一区二区三区四区| 热久久久久久久| 91精品国产综合久久香蕉麻豆| 亚洲一区二区三区三| 欧美日本韩国一区| 天天综合色天天| 欧美一级片免费看| 久久成人av少妇免费| 欧美成人综合网站| 国产一区二区久久| 国产欧美精品在线观看| 成人一区二区三区视频| 国产精品久久久99| 99免费精品在线| 一区二区三区日韩精品| 欧美日韩午夜在线视频| 日韩成人精品在线观看| 日韩一卡二卡三卡国产欧美| 国精品**一区二区三区在线蜜桃| 日韩精品一区二区三区中文精品| 国产在线看一区| 国产欧美1区2区3区| 成人精品一区二区三区中文字幕| 国产精品毛片无遮挡高清| av综合在线播放| 亚洲国产综合色| 日韩午夜激情av| 高清久久久久久| 亚洲图片你懂的| 欧美另类高清zo欧美| 玖玖九九国产精品| 中文字幕av资源一区| 91免费观看在线| 天天av天天翘天天综合网| 日韩欧美在线综合网| 国产精品乡下勾搭老头1| 国产精品麻豆久久久| 欧美自拍丝袜亚洲| 美女在线视频一区| 国产精品嫩草影院com| 色av成人天堂桃色av| 久久国产生活片100| ㊣最新国产の精品bt伙计久久| 欧美性生交片4| 激情综合色综合久久| 亚洲人被黑人高潮完整版| 8x8x8国产精品| 国产91精品一区二区| 亚洲国产成人tv| 国产色婷婷亚洲99精品小说| 色嗨嗨av一区二区三区| 日本vs亚洲vs韩国一区三区 | 国产精品免费av| 欧美日韩在线播| 国产成人h网站| 婷婷亚洲久悠悠色悠在线播放 | 国产一区二区三区在线观看免费| 亚洲欧洲韩国日本视频| 欧美一区二区三区免费在线看| 懂色av一区二区夜夜嗨| 日韩专区一卡二卡| 国产精品视频第一区| 6080国产精品一区二区| 成人在线视频一区| 日本成人在线电影网| 国产精品第五页| 久久免费国产精品| 欧美日韩国产首页| 成人免费高清在线| 蜜臀av一区二区| 亚洲精品写真福利| 国产亚洲欧美激情| 欧美一区二区在线视频| 91在线视频免费91| 粉嫩久久99精品久久久久久夜| 免费看欧美女人艹b| 亚洲久草在线视频| 国产欧美日韩麻豆91| 精品福利在线导航| 欧美一级理论性理论a| 在线观看成人免费视频| 不卡av在线免费观看| 国产主播一区二区三区| 日韩在线一区二区| 亚洲精品国产成人久久av盗摄| 久久精品人人做人人爽人人| 欧美一区二区人人喊爽| 欧美日韩精品系列| 91福利国产精品| 97精品久久久久中文字幕| 成人免费看黄yyy456| 国产成人一区在线| 国产一区二区三区免费播放 | 欧美视频中文一区二区三区在线观看| 国产一区二区三区免费在线观看| 青椒成人免费视频| 午夜久久久久久| 亚洲国产成人高清精品| 一区二区三区四区五区视频在线观看| 国产精品美日韩| 国产精品免费丝袜| 亚洲欧洲av一区二区三区久久| 国产人伦精品一区二区|