~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/3rdparty/freetype/include/freetype/ftimage.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-11-02 18:30:08 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (15.2.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 88.
  • Revision ID: james.westby@ubuntu.com-20091102183008-b6a4gcs128mvfb3m
Tags: upstream-4.6.0~beta1
ImportĀ upstreamĀ versionĀ 4.6.0~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
  /* <Description>                                                         */
54
54
  /*    The type FT_Pos is a 32-bit integer used to store vectorial        */
55
55
  /*    coordinates.  Depending on the context, these can represent        */
56
 
  /*    distances in integer font units, or 16,16, or 26.6 fixed float     */
 
56
  /*    distances in integer font units, or 16.16, or 26.6 fixed float     */
57
57
  /*    pixel coordinates.                                                 */
58
58
  /*                                                                       */
59
59
  typedef signed long  FT_Pos;
119
119
  /*                                                                       */
120
120
  /* <Values>                                                              */
121
121
  /*    FT_PIXEL_MODE_NONE ::                                              */
122
 
  /*      Value 0 is reserved.                                             */
 
122
  /*      Value~0 is reserved.                                             */
123
123
  /*                                                                       */
124
124
  /*    FT_PIXEL_MODE_MONO ::                                              */
125
 
  /*      A monochrome bitmap, using 1 bit per pixel.  Note that pixels    */
 
125
  /*      A monochrome bitmap, using 1~bit per pixel.  Note that pixels    */
126
126
  /*      are stored in most-significant order (MSB), which means that     */
127
127
  /*      the left-most pixel in a byte has value 128.                     */
128
128
  /*                                                                       */
129
129
  /*    FT_PIXEL_MODE_GRAY ::                                              */
130
130
  /*      An 8-bit bitmap, generally used to represent anti-aliased glyph  */
131
131
  /*      images.  Each pixel is stored in one byte.  Note that the number */
132
 
  /*      of value `gray' levels is stored in the `num_bytes' field of     */
133
 
  /*      the @FT_Bitmap structure (it generally is 256).                  */
 
132
  /*      of `gray' levels is stored in the `num_grays' field of the       */
 
133
  /*      @FT_Bitmap structure (it generally is 256).                      */
134
134
  /*                                                                       */
135
135
  /*    FT_PIXEL_MODE_GRAY2 ::                                             */
136
 
  /*      A 2-bit/pixel bitmap, used to represent embedded anti-aliased    */
137
 
  /*      bitmaps in font files according to the OpenType specification.   */
138
 
  /*      We haven't found a single font using this format, however.       */
 
136
  /*      A 2-bit per pixel bitmap, used to represent embedded             */
 
137
  /*      anti-aliased bitmaps in font files according to the OpenType     */
 
138
  /*      specification.  We haven't found a single font using this        */
 
139
  /*      format, however.                                                 */
139
140
  /*                                                                       */
140
141
  /*    FT_PIXEL_MODE_GRAY4 ::                                             */
141
 
  /*      A 4-bit/pixel bitmap, used to represent embedded anti-aliased    */
 
142
  /*      A 4-bit per pixel bitmap, representing embedded anti-aliased     */
142
143
  /*      bitmaps in font files according to the OpenType specification.   */
143
144
  /*      We haven't found a single font using this format, however.       */
144
145
  /*                                                                       */
145
146
  /*    FT_PIXEL_MODE_LCD ::                                               */
146
 
  /*      An 8-bit bitmap, used to represent RGB or BGR decimated glyph    */
147
 
  /*      images used for display on LCD displays; the bitmap is three     */
148
 
  /*      times wider than the original glyph image.  See also             */
 
147
  /*      An 8-bit bitmap, representing RGB or BGR decimated glyph images  */
 
148
  /*      used for display on LCD displays; the bitmap is three times      */
 
149
  /*      wider than the original glyph image.  See also                   */
149
150
  /*      @FT_RENDER_MODE_LCD.                                             */
150
151
  /*                                                                       */
151
152
  /*    FT_PIXEL_MODE_LCD_V ::                                             */
152
 
  /*      An 8-bit bitmap, used to represent RGB or BGR decimated glyph    */
153
 
  /*      images used for display on rotated LCD displays; the bitmap      */
154
 
  /*      is three times taller than the original glyph image.  See also   */
 
153
  /*      An 8-bit bitmap, representing RGB or BGR decimated glyph images  */
 
154
  /*      used for display on rotated LCD displays; the bitmap is three    */
 
155
  /*      times taller than the original glyph image.  See also            */
155
156
  /*      @FT_RENDER_MODE_LCD_V.                                           */
156
157
  /*                                                                       */
157
158
  typedef enum  FT_Pixel_Mode_
207
208
  /*    used with ft_pixel_mode_pal4 and ft_pixel_mode_pal8.               */
208
209
  /*                                                                       */
209
210
  /* <Values>                                                              */
210
 
  /*    ft_palette_mode_rgb  :: The palette is an array of 3-bytes RGB     */
 
211
  /*    ft_palette_mode_rgb  :: The palette is an array of 3-byte RGB      */
211
212
  /*                            records.                                   */
212
213
  /*                                                                       */
213
 
  /*    ft_palette_mode_rgba :: The palette is an array of 4-bytes RGBA    */
 
214
  /*    ft_palette_mode_rgba :: The palette is an array of 4-byte RGBA     */
214
215
  /*                            records.                                   */
215
216
  /*                                                                       */
216
217
  /* <Note>                                                                */
317
318
  /*                  elements, giving the outline's point coordinates.    */
318
319
  /*                                                                       */
319
320
  /*    tags       :: A pointer to an array of `n_points' chars, giving    */
320
 
  /*                  each outline point's type.  If bit 0 is unset, the   */
 
321
  /*                  each outline point's type.  If bit~0 is unset, the   */
321
322
  /*                  point is `off' the curve, i.e., a Bezier control     */
322
323
  /*                  point, while it is `on' when set.                    */
323
324
  /*                                                                       */
324
 
  /*                  Bit 1 is meaningful for `off' points only.  If set,  */
 
325
  /*                  Bit~1 is meaningful for `off' points only.  If set,  */
325
326
  /*                  it indicates a third-order Bezier arc control point; */
326
327
  /*                  and a second-order control point if unset.           */
327
328
  /*                                                                       */
352
353
  /*************************************************************************/
353
354
  /*                                                                       */
354
355
  /* <Enum>                                                                */
355
 
  /*   FT_OUTLINE_FLAGS                                                    */
 
356
  /*    FT_OUTLINE_FLAGS                                                   */
356
357
  /*                                                                       */
357
358
  /* <Description>                                                         */
358
359
  /*    A list of bit-field constants use for the flags in an outline's    */
359
360
  /*    `flags' field.                                                     */
360
361
  /*                                                                       */
361
362
  /* <Values>                                                              */
362
 
  /*    FT_OUTLINE_NONE           :: Value 0 is reserved.                  */
363
 
  /*                                                                       */
364
 
  /*    FT_OUTLINE_OWNER          :: If set, this flag indicates that the  */
365
 
  /*                                 outline's field arrays (i.e.,         */
366
 
  /*                                 `points', `flags' & `contours') are   */
367
 
  /*                                 `owned' by the outline object, and    */
368
 
  /*                                 should thus be freed when it is       */
369
 
  /*                                 destroyed.                            */
370
 
  /*                                                                       */
371
 
  /*   FT_OUTLINE_EVEN_ODD_FILL   :: By default, outlines are filled using */
372
 
  /*                                 the non-zero winding rule.  If set to */
373
 
  /*                                 1, the outline will be filled using   */
374
 
  /*                                 the even-odd fill rule (only works    */
375
 
  /*                                 with the smooth raster).              */
376
 
  /*                                                                       */
377
 
  /*   FT_OUTLINE_REVERSE_FILL    :: By default, outside contours of an    */
378
 
  /*                                 outline are oriented in clock-wise    */
379
 
  /*                                 direction, as defined in the TrueType */
380
 
  /*                                 specification.  This flag is set if   */
381
 
  /*                                 the outline uses the opposite         */
382
 
  /*                                 direction (typically for Type 1       */
383
 
  /*                                 fonts).  This flag is ignored by the  */
384
 
  /*                                 scan-converter.                       */
385
 
  /*                                                                       */
386
 
  /*   FT_OUTLINE_IGNORE_DROPOUTS :: By default, the scan converter will   */
387
 
  /*                                 try to detect drop-outs in an outline */
388
 
  /*                                 and correct the glyph bitmap to       */
389
 
  /*                                 ensure consistent shape continuity.   */
390
 
  /*                                 If set, this flag hints the scan-line */
391
 
  /*                                 converter to ignore such cases.       */
392
 
  /*                                                                       */
393
 
  /*   FT_OUTLINE_HIGH_PRECISION  :: This flag indicates that the          */
394
 
  /*                                 scan-line converter should try to     */
395
 
  /*                                 convert this outline to bitmaps with  */
396
 
  /*                                 the highest possible quality.  It is  */
397
 
  /*                                 typically set for small character     */
398
 
  /*                                 sizes.  Note that this is only a      */
399
 
  /*                                 hint, that might be completely        */
400
 
  /*                                 ignored by a given scan-converter.    */
401
 
  /*                                                                       */
402
 
  /*   FT_OUTLINE_SINGLE_PASS     :: This flag is set to force a given     */
403
 
  /*                                 scan-converter to only use a single   */
404
 
  /*                                 pass over the outline to render a     */
405
 
  /*                                 bitmap glyph image.  Normally, it is  */
406
 
  /*                                 set for very large character sizes.   */
407
 
  /*                                 It is only a hint, that might be      */
408
 
  /*                                 completely ignored by a given         */
409
 
  /*                                 scan-converter.                       */
 
363
  /*    FT_OUTLINE_NONE ::                                                 */
 
364
  /*      Value~0 is reserved.                                             */
 
365
  /*                                                                       */
 
366
  /*    FT_OUTLINE_OWNER ::                                                */
 
367
  /*      If set, this flag indicates that the outline's field arrays      */
 
368
  /*      (i.e., `points', `flags', and `contours') are `owned' by the     */
 
369
  /*      outline object, and should thus be freed when it is destroyed.   */
 
370
  /*                                                                       */
 
371
  /*    FT_OUTLINE_EVEN_ODD_FILL ::                                        */
 
372
  /*      By default, outlines are filled using the non-zero winding rule. */
 
373
  /*      If set to 1, the outline will be filled using the even-odd fill  */
 
374
  /*      rule (only works with the smooth raster).                        */
 
375
  /*                                                                       */
 
376
  /*    FT_OUTLINE_REVERSE_FILL ::                                         */
 
377
  /*      By default, outside contours of an outline are oriented in       */
 
378
  /*      clock-wise direction, as defined in the TrueType specification.  */
 
379
  /*      This flag is set if the outline uses the opposite direction      */
 
380
  /*      (typically for Type~1 fonts).  This flag is ignored by the scan  */
 
381
  /*      converter.                                                       */
 
382
  /*                                                                       */
 
383
  /*    FT_OUTLINE_IGNORE_DROPOUTS ::                                      */
 
384
  /*      By default, the scan converter will try to detect drop-outs in   */
 
385
  /*      an outline and correct the glyph bitmap to ensure consistent     */
 
386
  /*      shape continuity.  If set, this flag hints the scan-line         */
 
387
  /*      converter to ignore such cases.                                  */
 
388
  /*                                                                       */
 
389
  /*    FT_OUTLINE_SMART_DROPOUTS ::                                       */
 
390
  /*      Select smart dropout control.  If unset, use simple dropout      */
 
391
  /*      control.  Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set.         */
 
392
  /*                                                                       */
 
393
  /*    FT_OUTLINE_INCLUDE_STUBS ::                                        */
 
394
  /*      If set, turn pixels on for `stubs', otherwise exclude them.      */
 
395
  /*      Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set.                   */
 
396
  /*                                                                       */
 
397
  /*    FT_OUTLINE_HIGH_PRECISION ::                                       */
 
398
  /*      This flag indicates that the scan-line converter should try to   */
 
399
  /*      convert this outline to bitmaps with the highest possible        */
 
400
  /*      quality.  It is typically set for small character sizes.  Note   */
 
401
  /*      that this is only a hint that might be completely ignored by a   */
 
402
  /*      given scan-converter.                                            */
 
403
  /*                                                                       */
 
404
  /*    FT_OUTLINE_SINGLE_PASS ::                                          */
 
405
  /*      This flag is set to force a given scan-converter to only use a   */
 
406
  /*      single pass over the outline to render a bitmap glyph image.     */
 
407
  /*      Normally, it is set for very large character sizes.  It is only  */
 
408
  /*      a hint that might be completely ignored by a given               */
 
409
  /*      scan-converter.                                                  */
 
410
  /*                                                                       */
 
411
  /* <Note>                                                                */
 
412
  /*    Please refer to the description of the `SCANTYPE' instruction in   */
 
413
  /*    the OpenType specification (in file `ttinst1.doc') how simple      */
 
414
  /*    drop-outs, smart drop-outs, and stubs are defined.                 */
410
415
  /*                                                                       */
411
416
#define FT_OUTLINE_NONE             0x0
412
417
#define FT_OUTLINE_OWNER            0x1
413
418
#define FT_OUTLINE_EVEN_ODD_FILL    0x2
414
419
#define FT_OUTLINE_REVERSE_FILL     0x4
415
420
#define FT_OUTLINE_IGNORE_DROPOUTS  0x8
 
421
#define FT_OUTLINE_SMART_DROPOUTS   0x10
 
422
#define FT_OUTLINE_INCLUDE_STUBS    0x20
416
423
 
417
424
#define FT_OUTLINE_HIGH_PRECISION   0x100
418
425
#define FT_OUTLINE_SINGLE_PASS      0x200
483
490
  /*            decomposition function.                                    */
484
491
  /*                                                                       */
485
492
  /* <Return>                                                              */
486
 
  /*    Error code.  0 means success.                                      */
 
493
  /*    Error code.  0~means success.                                      */
487
494
  /*                                                                       */
488
495
  typedef int
489
496
  (*FT_Outline_MoveToFunc)( const FT_Vector*  to,
510
517
  /*            decomposition function.                                    */
511
518
  /*                                                                       */
512
519
  /* <Return>                                                              */
513
 
  /*    Error code.  0 means success.                                      */
 
520
  /*    Error code.  0~means success.                                      */
514
521
  /*                                                                       */
515
522
  typedef int
516
523
  (*FT_Outline_LineToFunc)( const FT_Vector*  to,
541
548
  /*               the decomposition function.                             */
542
549
  /*                                                                       */
543
550
  /* <Return>                                                              */
544
 
  /*    Error code.  0 means success.                                      */
 
551
  /*    Error code.  0~means success.                                      */
545
552
  /*                                                                       */
546
553
  typedef int
547
554
  (*FT_Outline_ConicToFunc)( const FT_Vector*  control,
573
580
  /*                the decomposition function.                            */
574
581
  /*                                                                       */
575
582
  /* <Return>                                                              */
576
 
  /*    Error code.  0 means success.                                      */
 
583
  /*    Error code.  0~means success.                                      */
577
584
  /*                                                                       */
578
585
  typedef int
579
586
  (*FT_Outline_CubicToFunc)( const FT_Vector*  control1,
619
626
  /*      y' = (x << shift) - delta                                        */
620
627
  /*    }                                                                  */
621
628
  /*                                                                       */
622
 
  /*    Set the value of `shift' and `delta' to 0 to get the original      */
 
629
  /*    Set the value of `shift' and `delta' to~0 to get the original      */
623
630
  /*    point coordinates.                                                 */
624
631
  /*                                                                       */
625
632
  typedef struct  FT_Outline_Funcs_
652
659
  /*    This macro converts four-letter tags to an unsigned long type.     */
653
660
  /*                                                                       */
654
661
  /* <Note>                                                                */
655
 
  /*    Since many 16bit compilers don't like 32bit enumerations, you      */
 
662
  /*    Since many 16-bit compilers don't like 32-bit enumerations, you    */
656
663
  /*    should redefine this macro in case of problems to something like   */
657
664
  /*    this:                                                              */
658
665
  /*                                                                       */
684
691
  /*                                                                       */
685
692
  /* <Values>                                                              */
686
693
  /*    FT_GLYPH_FORMAT_NONE ::                                            */
687
 
  /*      The value 0 is reserved.                                         */
 
694
  /*      The value~0 is reserved.                                         */
688
695
  /*                                                                       */
689
696
  /*    FT_GLYPH_FORMAT_COMPOSITE ::                                       */
690
697
  /*      The glyph image is a composite of several other images.  This    */
704
711
  /*                                                                       */
705
712
  /*    FT_GLYPH_FORMAT_PLOTTER ::                                         */
706
713
  /*      The glyph image is a vectorial path with no inside and outside   */
707
 
  /*      contours.  Some Type 1 fonts, like those in the Hershey family,  */
 
714
  /*      contours.  Some Type~1 fonts, like those in the Hershey family,  */
708
715
  /*      contain glyphs in this format.  These are described as           */
709
716
  /*      @FT_Outline, but FreeType isn't currently capable of rendering   */
710
717
  /*      them correctly.                                                  */
816
823
  /*                                                                       */
817
824
  /* <Note>                                                                */
818
825
  /*    This structure is used by the span drawing callback type named     */
819
 
  /*    @FT_SpanFunc which takes the y-coordinate of the span as a         */
 
826
  /*    @FT_SpanFunc which takes the y~coordinate of the span as a         */
820
827
  /*    a parameter.                                                       */
821
828
  /*                                                                       */
822
 
  /*    The coverage value is always between 0 and 255.                    */
 
829
  /*    The coverage value is always between 0 and 255.  If you want less  */
 
830
  /*    gray values, the callback function has to reduce them.             */
823
831
  /*                                                                       */
824
832
  typedef struct  FT_Span_
825
833
  {
841
849
  /*    spans on each scan line.                                           */
842
850
  /*                                                                       */
843
851
  /* <Input>                                                               */
844
 
  /*    y     :: The scanline's y-coordinate.                              */
 
852
  /*    y     :: The scanline's y~coordinate.                              */
845
853
  /*                                                                       */
846
854
  /*    count :: The number of spans to draw on this scanline.             */
847
855
  /*                                                                       */
858
866
  /*                                                                       */
859
867
  /*    Note that the `count' field cannot be greater than a fixed value   */
860
868
  /*    defined by the `FT_MAX_GRAY_SPANS' configuration macro in          */
861
 
  /*    `ftoption.h'.  By default, this value is set to 32, which means    */
862
 
  /*    that if there are more than 32 spans on a given scanline, the      */
 
869
  /*    `ftoption.h'.  By default, this value is set to~32, which means    */
 
870
  /*    that if there are more than 32~spans on a given scanline, the      */
863
871
  /*    callback is called several times with the same `y' parameter in    */
864
872
  /*    order to draw all callbacks.                                       */
865
873
  /*                                                                       */
889
897
  /*    per-se the TrueType spec.                                          */
890
898
  /*                                                                       */
891
899
  /* <Input>                                                               */
892
 
  /*    y     :: The pixel's y-coordinate.                                 */
 
900
  /*    y     :: The pixel's y~coordinate.                                 */
893
901
  /*                                                                       */
894
 
  /*    x     :: The pixel's x-coordinate.                                 */
 
902
  /*    x     :: The pixel's x~coordinate.                                 */
895
903
  /*                                                                       */
896
904
  /*    user  :: User-supplied data that is passed to the callback.        */
897
905
  /*                                                                       */
898
906
  /* <Return>                                                              */
899
 
  /*   1 if the pixel is `set', 0 otherwise.                               */
 
907
  /*   1~if the pixel is `set', 0~otherwise.                               */
900
908
  /*                                                                       */
901
909
  typedef int
902
910
  (*FT_Raster_BitTest_Func)( int    y,
917
925
  /*    drop-out control according to the TrueType specification.          */
918
926
  /*                                                                       */
919
927
  /* <Input>                                                               */
920
 
  /*    y     :: The pixel's y-coordinate.                                 */
 
928
  /*    y     :: The pixel's y~coordinate.                                 */
921
929
  /*                                                                       */
922
 
  /*    x     :: The pixel's x-coordinate.                                 */
 
930
  /*    x     :: The pixel's x~coordinate.                                 */
923
931
  /*                                                                       */
924
932
  /*    user  :: User-supplied data that is passed to the callback.        */
925
933
  /*                                                                       */
926
934
  /* <Return>                                                              */
927
 
  /*    1 if the pixel is `set', 0 otherwise.                              */
 
935
  /*    1~if the pixel is `set', 0~otherwise.                              */
928
936
  /*                                                                       */
929
937
  typedef void
930
938
  (*FT_Raster_BitSet_Func)( int    y,
1064
1072
  /*    raster :: A handle to the new raster object.                       */
1065
1073
  /*                                                                       */
1066
1074
  /* <Return>                                                              */
1067
 
  /*    Error code.  0 means success.                                      */
 
1075
  /*    Error code.  0~means success.                                      */
1068
1076
  /*                                                                       */
1069
1077
  /* <Note>                                                                */
1070
1078
  /*    The `memory' parameter is a typeless pointer in order to avoid     */
1164
1172
  /*    FT_Raster_RenderFunc                                               */
1165
1173
  /*                                                                       */
1166
1174
  /* <Description>                                                         */
1167
 
  /*   Invokes a given raster to scan-convert a given glyph image into a   */
1168
 
  /*   target bitmap.                                                      */
 
1175
  /*    Invoke a given raster to scan-convert a given glyph image into a   */
 
1176
  /*    target bitmap.                                                     */
1169
1177
  /*                                                                       */
1170
1178
  /* <Input>                                                               */
1171
1179
  /*    raster :: A handle to the raster object.                           */
1174
1182
  /*              store the rendering parameters.                          */
1175
1183
  /*                                                                       */
1176
1184
  /* <Return>                                                              */
1177
 
  /*    Error code.  0 means success.                                      */
 
1185
  /*    Error code.  0~means success.                                      */
1178
1186
  /*                                                                       */
1179
1187
  /* <Note>                                                                */
1180
1188
  /*    The exact format of the source image depends on the raster's glyph */