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