OSDN Git Service

NSDフォントプラグイン登録
[kimikage-nscr/kimikage-nscr.git] / nsdfont / src / Decorator.h
diff --git a/nsdfont/src/Decorator.h b/nsdfont/src/Decorator.h
new file mode 100755 (executable)
index 0000000..d822958
--- /dev/null
@@ -0,0 +1,59 @@
+/*\r
+ *     Kimikage NScripter Plugins Project\r
+ *\r
+ *     This software is distributed under a BSD-style license.\r
+ *     See license.txt for more information.\r
+ */\r
+\r
+#pragma once\r
+#include "ArgbBitmap.h"\r
+#include "ColorBlender.h"\r
+#include "Glyph.h"\r
+\r
+namespace nsdfont\r
+{\r
+       /**\r
+        *      \91\95\8fü\82ð\8e{\82µ\82Ä\83O\83\8a\83t\82ð\95`\89æ\82·\82é.\r
+        */\r
+       class Decorator\r
+       {\r
+       private:\r
+               const ColorBlender blend;\r
+               static const double rPi; // pi\r
+               static const double rEqu; // sqrt( 1 / pi )\r
+               static const double rSqrt0_5; // sqrt( 0.5 )\r
+               mutable Color face1;\r
+               Color face2;\r
+               Color edge1;\r
+               Color edge2;\r
+               double edgeWidth;\r
+               static const size_t maxRadius;\r
+               int edgePower[4][4];\r
+               int     exLeft;\r
+               int exTop;\r
+               int exRight;\r
+               int exBottom;\r
+       public:\r
+               Decorator( void );\r
+               ~Decorator( void );\r
+               Decorator &operator=( const Decorator &d );\r
+               void setFace( const Color color );\r
+               void setEdge( const double width, const Color color );\r
+               void drawEdge( int x, int y, ArgbBitmap &bmp, const Glyph &glyph ) const;\r
+               void drawFace( int x, int y, ArgbBitmap &bmp, const Glyph &glyph ) const;\r
+               inline void getExtensionSize( int &left, int &top, int &right, int &bottom ) const\r
+               {\r
+                       left = exLeft;\r
+                       top = exTop;\r
+                       right = exRight;\r
+                       bottom = exBottom;\r
+               }\r
+       private:\r
+               void drawCoreSimple( int x, int y, ArgbBitmap &bmp, const Glyph &glyph, const Color color ) const;\r
+               void drawEdge1( int x, int y, ArgbBitmap &bmp, const Glyph &glyph ) const;\r
+               void drawEdge2( int x, int y, ArgbBitmap &bmp, const Glyph &glyph ) const;\r
+               unsigned char *clip( int &x, int &y, int &width, int &height,\r
+                                       const ArgbBitmap &bmp, const Glyph&glyph ) const;\r
+       };\r
+}\r
+\r