1 
2 //          Copyright 2019 - 2021 Michael D. Parker
3 // Distributed under the Boost Software License, Version 1.0.
4 //    (See accompanying file LICENSE_1_0.txt or copy at
5 //          http://www.boost.org/LICENSE_1_0.txt)
6 
7 module bindbc.freetype.bind.ftbitmap;
8 
9 import bindbc.freetype.config,
10        bindbc.freetype.bind.freetype,
11        bindbc.freetype.bind.ftimage,
12        bindbc.freetype.bind.ftmodapi,
13        bindbc.freetype.bind.fttypes;
14 
15 static if(ftSupport >= FTSupport.ft210) {
16     import bindbc.freetype.bind.ftcolor;
17 }
18 
19 static if(staticBinding) {
20 	extern(C) @nogc nothrow {
21         void FT_Bitmap_Init(FT_Bitmap* abitmap);
22         FT_Error FT_Bitmap_Copy(FT_Library library, const(FT_Bitmap)* source, FT_Bitmap* target);
23         FT_Error FT_Bitmap_Embolden(FT_Library library, FT_Bitmap* bitmap, FT_Pos xStrength, FT_Pos yStrength);
24         FT_Error FT_Bitmap_Convert(FT_Library library, const(FT_Bitmap)* source, FT_Bitmap* target, FT_Int alignment);
25         FT_Error FT_GlyphSlot_Own_Bitmap(FT_GlyphSlot slot);
26         FT_Error FT_Bitmap_Done(FT_Library library, FT_Bitmap* bitmap);
27     }
28     static if(ftSupport >= FTSupport.ft210) {
29         FT_Error FT_Bitmap_Blend(FT_Library library, const(FT_Bitmap)* source, const(FT_Vector) source_offset, FT_Bitmap* target, FT_Vector* atarget_offset, FT_Color color);
30     }
31 }
32 else {
33     extern(C) @nogc nothrow {
34         alias pFT_Bitmap_Init = void function(FT_Bitmap* abitmap);
35         alias pFT_Bitmap_Copy = FT_Error function(FT_Library library, const(FT_Bitmap)* source, FT_Bitmap* target);
36         alias pFT_Bitmap_Embolden = FT_Error function(FT_Library library, FT_Bitmap* bitmap, FT_Pos xStrength, FT_Pos yStrength);
37         alias pFT_Bitmap_Convert = FT_Error function(FT_Library library, const(FT_Bitmap)* source, FT_Bitmap* target, FT_Int alignment);
38         alias pFT_GlyphSlot_Own_Bitmap = FT_Error function(FT_GlyphSlot slot);
39         alias pFT_Bitmap_Done = FT_Error function(FT_Library library, FT_Bitmap* bitmap);
40 
41         static if(ftSupport >= FTSupport.ft210) {
42             alias pFT_Bitmap_Blend = FT_Error function(FT_Library library, const(FT_Bitmap)* source, const(FT_Vector) source_offset, FT_Bitmap* target, FT_Vector* atarget_offset, FT_Color color);
43         }
44     }
45 
46     __gshared {
47         pFT_Bitmap_Init FT_Bitmap_Init;
48         pFT_Bitmap_Copy FT_Bitmap_Copy;
49         pFT_Bitmap_Embolden FT_Bitmap_Embolden;
50         pFT_Bitmap_Convert FT_Bitmap_Convert;
51         pFT_GlyphSlot_Own_Bitmap FT_GlyphSlot_Own_Bitmap;
52         pFT_Bitmap_Done FT_Bitmap_Done;
53 
54         static if(ftSupport >= FTSupport.ft210) {
55             pFT_Bitmap_Blend FT_Bitmap_Blend;
56         }
57     }
58 }