📄 ftimage.h
字号:
/***************************************************************************//* *//* ftimage.h *//* *//* This file defines the glyph image formats recognized by FreeType, as *//* well as the default raster interface. *//* *//* Copyright 1996-1999 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. *//* *//***************************************************************************/#ifndef FTIMAGE_H#define FTIMAGE_H /*************************************************************************/ /* */ /* <Type> */ /* FT_Pos */ /* */ /* <Description> */ /* The type FT_Pos is a 32-bit integer used to store vectorial */ /* coordinates. Depending on the context, these can represent */ /* distances in integer font units, or 26.6 fixed float pixel */ /* coordinates. */ /* */ typedef signed long FT_Pos; /*************************************************************************/ /* */ /* <Struct> */ /* FT_Vector */ /* */ /* <Description> */ /* A simple structure used to store a 2d vector; coordinates are of */ /* the FT_Pos type. */ /* */ /* <Fields> */ /* x :: The horizontal coordinate. */ /* y :: The vertical coordinate. */ /* */ typedef struct FT_Vector_ { FT_Pos x; FT_Pos y; } FT_Vector; /************************************************************************* * * <Enum> * FT_Pixel_Mode * * <Description> * An enumeration type used to describe the format of pixels * in a given bitmap. Note that additional formats may be added * in the future. * * <Fields> * ft_pixel_mode_mono :: a monochrome bitmap (1 bit/pixel) * * ft_pixel_mode_grays :: an 8-bit gray-levels bitmap. Note that * the total number of gray levels is given * in the `num_grays' field of the FT_Bitmap * structure. * * ft_pixel_mode_pal2 :: a 2-bit paletted bitmap. * currently unused by FreeType. * * ft_pixel_mode_pal4 :: a 4-bit paletted bitmap. * currently unused by FreeType. * * ft_pixel_mode_pal8 :: an 8-bit paletted bitmap. * currently unused by FreeType. * * ft_pixel_mode_rgb15 :: a 15-bit RGB bitmap. Uses 5:5:5 encoding * currently unused by FreeType. * * ft_pixel_mode_rgb16 :: a 16-bit RGB bitmap. Uses 5:6:5 encoding * currently unused by FreeType. * * ft_pixel_mode_rgb24 :: a 24-bit RGB bitmap. * currently unused by FreeType. * * ft_pixel_mode_rgb32 :: a 32-bit RGB bitmap. * currently unused by FreeType. * * <Note> * Some anti-aliased bitmaps might be embedded in TrueType fonts * using formats pal2 or pal4, though no fonts presenting those * have been found to date.. * *************************************************************************/ typedef enum FT_Pixel_Mode_ { ft_pixel_mode_none = 0, ft_pixel_mode_mono, ft_pixel_mode_grays, ft_pixel_mode_pal2, ft_pixel_mode_pal4, ft_pixel_mode_pal8, ft_pixel_mode_rgb15, ft_pixel_mode_rgb16, ft_pixel_mode_rgb24, ft_pixel_mode_rgb32, ft_pixel_mode_max /* do not remove */ } FT_Pixel_Mode; /************************************************************************* * * <Enum> * FT_Palette_Mode * * <Description> * An enumeration type used to describe the format of a bitmap * palette, used with ft_pixel_mode_pal4 and ft_pixel_mode_pal8 * * <Fields> * ft_palette_mode_rgb :: the palette is an array of 3-bytes RGB records * * ft_palette_mode_rgba :: the palette is an array of 4-bytes RGBA records * * <Note> * As ft_pixel_mode_pal2, pal4 and pal8 are currently unused by * FreeType, these types are not handled by the library itself. * *************************************************************************/ typedef enum FT_Palette_Mode_ { ft_palette_mode_rgb = 0, ft_palette_mode_rgba, ft_palettte_mode_max /* do not remove */ } FT_Palette_Mode; /************************************************************************* * * <Struct> * FT_Bitmap * * <Description> * A structure used to describe a bitmap or pixmap to the raster. * Note that we now manage pixmaps of various depths through the * `pixel_mode' field. * * <Fields> * rows :: The number of bitmap rows. * * width :: The number of pixels in bitmap row. * * pitch :: The pitch's absolute value is the number of bytes * taken by one bitmap row, including padding. However, * the pitch is positive when the bitmap has a `down' * flow, and negative when it has an `up' flow. In all * cases, the pitch is an offset to add to a bitmap * pointer in order to go down one row. * * buffer :: A typeless pointer to the bitmap buffer. This value * should be aligned on 32-bit boundaries in most cases. * * num_grays :: this field is only used with ft_pixel_mode_grays, * it gives the number of gray levels used in the * bitmap. * * pixel_mode :: the pixel_mode, i.e. how pixel bits are stored * * palette_mode :: this field is only used with paletted pixel modes, * it indicates how the palette is stored * * palette :: a typeless pointer to the bitmap palette. only used * for paletted pixel modes. * * <Note> * When using pixel modes pal2, pal4 and pal8 with a void `palette' * field, a gray pixmap with respectively 4, 16 and 256 levels of gray * is assumed. This, in order to be compatible with some embedded bitmap * formats defined in the TrueType spec. * * Note that no font was found presenting such embedded bitmaps, so this * is currently completely unhandled by the library. * * *************************************************************************/ typedef struct FT_Bitmap_ { int rows; int width; int pitch; void* buffer; short num_grays; char pixel_mode; char palette_mode; void* palette; } FT_Bitmap; /*************************************************************************/ /* */ /* <Struct> */ /* FT_Outline */ /* */ /* <Description> */ /* This structure is used to describe an outline to the scan-line */ /* converter. It's a copy of the TT_Outline type that was defined */ /* in FreeType 1.x. */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -