2004-12-14 17:01:29 +01:00
|
|
|
/***************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* ftbitmap.h */
|
|
|
|
/* */
|
|
|
|
/* FreeType utility functions for converting 1bpp, 2bpp, 4bpp, and 8bpp */
|
2007-01-16 07:11:27 +01:00
|
|
|
/* bitmaps into 8bpp format (specification). */
|
2004-12-14 17:01:29 +01:00
|
|
|
/* */
|
2006-02-25 07:24:28 +01:00
|
|
|
/* Copyright 2004, 2005, 2006 by */
|
2004-12-14 17:01:29 +01:00
|
|
|
/* 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 __FTBITMAP_H__
|
|
|
|
#define __FTBITMAP_H__
|
|
|
|
|
|
|
|
|
|
|
|
#include <ft2build.h>
|
|
|
|
#include FT_FREETYPE_H
|
|
|
|
|
|
|
|
#ifdef FREETYPE_H
|
|
|
|
#error "freetype.h of FreeType 1 has been loaded!"
|
|
|
|
#error "Please fix the directory search order for header files"
|
|
|
|
#error "so that freetype.h of FreeType 2 is found first."
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
FT_BEGIN_HEADER
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Section> */
|
|
|
|
/* bitmap_handling */
|
|
|
|
/* */
|
2004-12-14 23:32:34 +01:00
|
|
|
/* <Title> */
|
|
|
|
/* Bitmap Handling */
|
|
|
|
/* */
|
|
|
|
/* <Abstract> */
|
|
|
|
/* Handling FT_Bitmap objects. */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* This section contains functions for converting FT_Bitmap objects. */
|
|
|
|
/* */
|
2004-12-14 17:01:29 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_Bitmap_New */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2006-05-12 10:00:13 +02:00
|
|
|
/* Initialize a pointer to an @FT_Bitmap structure. */
|
2004-12-14 17:01:29 +01:00
|
|
|
/* */
|
|
|
|
/* <InOut> */
|
|
|
|
/* abitmap :: A pointer to the bitmap structure. */
|
|
|
|
/* */
|
|
|
|
FT_EXPORT( void )
|
|
|
|
FT_Bitmap_New( FT_Bitmap *abitmap );
|
|
|
|
|
|
|
|
|
2005-05-20 23:52:19 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_Bitmap_Copy */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* Copies an bitmap into another one. */
|
|
|
|
/* */
|
|
|
|
/* <Input> */
|
2005-05-27 08:01:28 +02:00
|
|
|
/* library :: A handle to a library object. */
|
|
|
|
/* */
|
|
|
|
/* source :: A handle to the source bitmap. */
|
2005-05-20 23:52:19 +02:00
|
|
|
/* */
|
|
|
|
/* <Output> */
|
2005-05-27 08:01:28 +02:00
|
|
|
/* target :: A handle to the target bitmap. */
|
2005-05-20 23:52:19 +02:00
|
|
|
/* */
|
|
|
|
/* <Return> */
|
|
|
|
/* FreeType error code. 0 means success. */
|
|
|
|
/* */
|
2005-10-20 04:13:46 +02:00
|
|
|
FT_EXPORT( FT_Error )
|
2005-05-20 23:52:19 +02:00
|
|
|
FT_Bitmap_Copy( FT_Library library,
|
|
|
|
const FT_Bitmap *source,
|
|
|
|
FT_Bitmap *target);
|
|
|
|
|
|
|
|
|
2005-05-25 07:51:01 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_Bitmap_Embolden */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2005-05-30 21:22:44 +02:00
|
|
|
/* Embolden a bitmap. The new bitmap will be about `xStrength' */
|
2005-05-25 07:51:01 +02:00
|
|
|
/* pixels wider and `yStrength' pixels higher. The left and bottom */
|
|
|
|
/* borders are kept unchanged. */
|
|
|
|
/* */
|
|
|
|
/* <Input> */
|
|
|
|
/* library :: A handle to a library object. */
|
|
|
|
/* */
|
|
|
|
/* xStrength :: How strong the glyph is emboldened horizontally. */
|
2005-05-30 21:22:44 +02:00
|
|
|
/* Expressed in 26.6 pixel format. */
|
2005-05-25 07:51:01 +02:00
|
|
|
/* */
|
|
|
|
/* yStrength :: How strong the glyph is emboldened vertically. */
|
2005-05-30 21:22:44 +02:00
|
|
|
/* Expressed in 26.6 pixel format. */
|
2005-05-25 07:51:01 +02:00
|
|
|
/* */
|
|
|
|
/* <InOut> */
|
|
|
|
/* bitmap :: A handle to the target bitmap. */
|
|
|
|
/* */
|
|
|
|
/* <Return> */
|
|
|
|
/* FreeType error code. 0 means success. */
|
|
|
|
/* */
|
|
|
|
/* <Note> */
|
|
|
|
/* The current implementation restricts `xStrength' to be less than */
|
2005-05-30 21:22:44 +02:00
|
|
|
/* or equal to 8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO. */
|
2005-05-25 07:51:01 +02:00
|
|
|
/* */
|
2006-02-24 12:18:40 +01:00
|
|
|
/* If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, */
|
2006-05-12 10:00:13 +02:00
|
|
|
/* you should call `FT_GlyphSlot_Own_Bitmap' on the slot first. */
|
2005-05-26 23:02:25 +02:00
|
|
|
/* */
|
2005-10-20 04:13:46 +02:00
|
|
|
FT_EXPORT( FT_Error )
|
2005-05-25 07:51:01 +02:00
|
|
|
FT_Bitmap_Embolden( FT_Library library,
|
|
|
|
FT_Bitmap* bitmap,
|
|
|
|
FT_Pos xStrength,
|
|
|
|
FT_Pos yStrength );
|
|
|
|
|
|
|
|
|
2004-12-14 17:01:29 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_Bitmap_Convert */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, or 8bpp to a */
|
|
|
|
/* bitmap object with depth 8bpp, making the number of used bytes per */
|
|
|
|
/* line (a.k.a. the `pitch') a multiple of `alignment'. */
|
|
|
|
/* */
|
|
|
|
/* <Input> */
|
|
|
|
/* library :: A handle to a library object. */
|
|
|
|
/* */
|
|
|
|
/* source :: The source bitmap. */
|
|
|
|
/* */
|
|
|
|
/* alignment :: The pitch of the bitmap is a multiple of this */
|
|
|
|
/* parameter. Common values are 1, 2, or 4. */
|
|
|
|
/* */
|
|
|
|
/* <Output> */
|
|
|
|
/* target :: The target bitmap. */
|
|
|
|
/* */
|
|
|
|
/* <Return> */
|
|
|
|
/* FreeType error code. 0 means success. */
|
|
|
|
/* */
|
|
|
|
/* <Note> */
|
|
|
|
/* It is possible to call @FT_Bitmap_Convert multiple times without */
|
|
|
|
/* calling @FT_Bitmap_Done (the memory is simply reallocated). */
|
|
|
|
/* */
|
|
|
|
/* Use @FT_Bitmap_Done to finally remove the bitmap object. */
|
|
|
|
/* */
|
|
|
|
/* The `library' argument is taken to have access to FreeType's */
|
|
|
|
/* memory handling functions. */
|
|
|
|
/* */
|
|
|
|
FT_EXPORT( FT_Error )
|
|
|
|
FT_Bitmap_Convert( FT_Library library,
|
|
|
|
const FT_Bitmap *source,
|
|
|
|
FT_Bitmap *target,
|
|
|
|
FT_Int alignment );
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_Bitmap_Done */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* Destroy a bitmap object created with @FT_Bitmap_New. */
|
|
|
|
/* */
|
|
|
|
/* <Input> */
|
|
|
|
/* library :: A handle to a library object. */
|
|
|
|
/* */
|
|
|
|
/* bitmap :: The bitmap object to be freed. */
|
|
|
|
/* */
|
|
|
|
/* <Return> */
|
|
|
|
/* FreeType error code. 0 means success. */
|
|
|
|
/* */
|
|
|
|
/* <Note> */
|
|
|
|
/* The `library' argument is taken to have access to FreeType's */
|
|
|
|
/* memory handling functions. */
|
|
|
|
/* */
|
|
|
|
FT_EXPORT( FT_Error )
|
|
|
|
FT_Bitmap_Done( FT_Library library,
|
|
|
|
FT_Bitmap *bitmap );
|
|
|
|
|
|
|
|
|
|
|
|
/* */
|
|
|
|
|
|
|
|
|
|
|
|
FT_END_HEADER
|
|
|
|
|
|
|
|
#endif /* __FTBITMAP_H__ */
|
|
|
|
|
|
|
|
|
|
|
|
/* END */
|