nuclear@0: /***************************************************************************/ nuclear@0: /* */ nuclear@0: /* ftbitmap.h */ nuclear@0: /* */ nuclear@0: /* FreeType utility functions for bitmaps (specification). */ nuclear@0: /* */ nuclear@0: /* Copyright 2004, 2005, 2006, 2008 by */ nuclear@0: /* David Turner, Robert Wilhelm, and Werner Lemberg. */ nuclear@0: /* */ nuclear@0: /* This file is part of the FreeType project, and may only be used, */ nuclear@0: /* modified, and distributed under the terms of the FreeType project */ nuclear@0: /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ nuclear@0: /* this file you indicate that you have read the license and */ nuclear@0: /* understand and accept it fully. */ nuclear@0: /* */ nuclear@0: /***************************************************************************/ nuclear@0: nuclear@0: nuclear@0: #ifndef __FTBITMAP_H__ nuclear@0: #define __FTBITMAP_H__ nuclear@0: nuclear@0: nuclear@0: #include nuclear@0: #include FT_FREETYPE_H nuclear@0: nuclear@0: #ifdef FREETYPE_H nuclear@0: #error "freetype.h of FreeType 1 has been loaded!" nuclear@0: #error "Please fix the directory search order for header files" nuclear@0: #error "so that freetype.h of FreeType 2 is found first." nuclear@0: #endif nuclear@0: nuclear@0: nuclear@0: FT_BEGIN_HEADER nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /*
*/ nuclear@0: /* bitmap_handling */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* Bitmap Handling */ nuclear@0: /* */ nuclear@0: /* <Abstract> */ nuclear@0: /* Handling FT_Bitmap objects. */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* This section contains functions for converting FT_Bitmap objects. */ nuclear@0: /* */ nuclear@0: /*************************************************************************/ nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Function> */ nuclear@0: /* FT_Bitmap_New */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* Initialize a pointer to an @FT_Bitmap structure. */ nuclear@0: /* */ nuclear@0: /* <InOut> */ nuclear@0: /* abitmap :: A pointer to the bitmap structure. */ nuclear@0: /* */ nuclear@0: FT_EXPORT( void ) nuclear@0: FT_Bitmap_New( FT_Bitmap *abitmap ); nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Function> */ nuclear@0: /* FT_Bitmap_Copy */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* Copy a bitmap into another one. */ nuclear@0: /* */ nuclear@0: /* <Input> */ nuclear@0: /* library :: A handle to a library object. */ nuclear@0: /* */ nuclear@0: /* source :: A handle to the source bitmap. */ nuclear@0: /* */ nuclear@0: /* <Output> */ nuclear@0: /* target :: A handle to the target bitmap. */ nuclear@0: /* */ nuclear@0: /* <Return> */ nuclear@0: /* FreeType error code. 0~means success. */ nuclear@0: /* */ nuclear@0: FT_EXPORT( FT_Error ) nuclear@0: FT_Bitmap_Copy( FT_Library library, nuclear@0: const FT_Bitmap *source, nuclear@0: FT_Bitmap *target); nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Function> */ nuclear@0: /* FT_Bitmap_Embolden */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* Embolden a bitmap. The new bitmap will be about `xStrength' */ nuclear@0: /* pixels wider and `yStrength' pixels higher. The left and bottom */ nuclear@0: /* borders are kept unchanged. */ nuclear@0: /* */ nuclear@0: /* <Input> */ nuclear@0: /* library :: A handle to a library object. */ nuclear@0: /* */ nuclear@0: /* xStrength :: How strong the glyph is emboldened horizontally. */ nuclear@0: /* Expressed in 26.6 pixel format. */ nuclear@0: /* */ nuclear@0: /* yStrength :: How strong the glyph is emboldened vertically. */ nuclear@0: /* Expressed in 26.6 pixel format. */ nuclear@0: /* */ nuclear@0: /* <InOut> */ nuclear@0: /* bitmap :: A handle to the target bitmap. */ nuclear@0: /* */ nuclear@0: /* <Return> */ nuclear@0: /* FreeType error code. 0~means success. */ nuclear@0: /* */ nuclear@0: /* <Note> */ nuclear@0: /* The current implementation restricts `xStrength' to be less than */ nuclear@0: /* or equal to~8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO. */ nuclear@0: /* */ nuclear@0: /* If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, */ nuclear@0: /* you should call @FT_GlyphSlot_Own_Bitmap on the slot first. */ nuclear@0: /* */ nuclear@0: FT_EXPORT( FT_Error ) nuclear@0: FT_Bitmap_Embolden( FT_Library library, nuclear@0: FT_Bitmap* bitmap, nuclear@0: FT_Pos xStrength, nuclear@0: FT_Pos yStrength ); nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Function> */ nuclear@0: /* FT_Bitmap_Convert */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, or 8bpp to a */ nuclear@0: /* bitmap object with depth 8bpp, making the number of used bytes per */ nuclear@0: /* line (a.k.a. the `pitch') a multiple of `alignment'. */ nuclear@0: /* */ nuclear@0: /* <Input> */ nuclear@0: /* library :: A handle to a library object. */ nuclear@0: /* */ nuclear@0: /* source :: The source bitmap. */ nuclear@0: /* */ nuclear@0: /* alignment :: The pitch of the bitmap is a multiple of this */ nuclear@0: /* parameter. Common values are 1, 2, or 4. */ nuclear@0: /* */ nuclear@0: /* <Output> */ nuclear@0: /* target :: The target bitmap. */ nuclear@0: /* */ nuclear@0: /* <Return> */ nuclear@0: /* FreeType error code. 0~means success. */ nuclear@0: /* */ nuclear@0: /* <Note> */ nuclear@0: /* It is possible to call @FT_Bitmap_Convert multiple times without */ nuclear@0: /* calling @FT_Bitmap_Done (the memory is simply reallocated). */ nuclear@0: /* */ nuclear@0: /* Use @FT_Bitmap_Done to finally remove the bitmap object. */ nuclear@0: /* */ nuclear@0: /* The `library' argument is taken to have access to FreeType's */ nuclear@0: /* memory handling functions. */ nuclear@0: /* */ nuclear@0: FT_EXPORT( FT_Error ) nuclear@0: FT_Bitmap_Convert( FT_Library library, nuclear@0: const FT_Bitmap *source, nuclear@0: FT_Bitmap *target, nuclear@0: FT_Int alignment ); nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Function> */ nuclear@0: /* FT_GlyphSlot_Own_Bitmap */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* Make sure that a glyph slot owns `slot->bitmap'. */ nuclear@0: /* */ nuclear@0: /* <Input> */ nuclear@0: /* slot :: The glyph slot. */ nuclear@0: /* */ nuclear@0: /* <Return> */ nuclear@0: /* FreeType error code. 0~means success. */ nuclear@0: /* */ nuclear@0: /* <Note> */ nuclear@0: /* This function is to be used in combination with */ nuclear@0: /* @FT_Bitmap_Embolden. */ nuclear@0: /* */ nuclear@0: FT_EXPORT( FT_Error ) nuclear@0: FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot ); nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Function> */ nuclear@0: /* FT_Bitmap_Done */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* Destroy a bitmap object created with @FT_Bitmap_New. */ nuclear@0: /* */ nuclear@0: /* <Input> */ nuclear@0: /* library :: A handle to a library object. */ nuclear@0: /* */ nuclear@0: /* bitmap :: The bitmap object to be freed. */ nuclear@0: /* */ nuclear@0: /* <Return> */ nuclear@0: /* FreeType error code. 0~means success. */ nuclear@0: /* */ nuclear@0: /* <Note> */ nuclear@0: /* The `library' argument is taken to have access to FreeType's */ nuclear@0: /* memory handling functions. */ nuclear@0: /* */ nuclear@0: FT_EXPORT( FT_Error ) nuclear@0: FT_Bitmap_Done( FT_Library library, nuclear@0: FT_Bitmap *bitmap ); nuclear@0: nuclear@0: nuclear@0: /* */ nuclear@0: nuclear@0: nuclear@0: FT_END_HEADER nuclear@0: nuclear@0: #endif /* __FTBITMAP_H__ */ nuclear@0: nuclear@0: nuclear@0: /* END */