]> O.S.I.I.S - jp/vkvg.git/commitdiff
freetype LCD filtering
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Wed, 20 Mar 2019 13:07:02 +0000 (14:07 +0100)
committerj-p <jp_bruyere@hotmail.com>
Sat, 6 Apr 2019 12:40:34 +0000 (14:40 +0200)
CMakeLists.txt
shaders/vkvg_main_lcd.frag [new file with mode: 0644]
src/shaders.h
src/vkvg_context.c
src/vkvg_device_internal.c
src/vkvg_fonts.c
src/vkvg_fonts.h
tests/multi.c [deleted file]
tests/painting.c
tests/text.c

index fbea596d4b2c51caee8f1d0470d821cd6de90820..314b8f207eee2a8125006408290b84e5c4a5b8d0 100644 (file)
@@ -21,10 +21,14 @@ ENDIF()
 
 OPTION(VKVG_TILING_OPTIMAL "use VK_IMAGE_TILING_OPTIMAL for surface backend texture" OFF)
 IF (VKVG_TILING_OPTIMAL)
-       add_compile_options(-DVKVG_TILING_OPTIMAL)
        ADD_DEFINITIONS (-DVKVG_TILING_OPTIMAL)
 ENDIF ()
 
+OPTION(VKVG_LCD_FONT_FILTER "enable freetype lcd font filtering" ON)
+IF (VKVG_LCD_FONT_FILTER)
+       ADD_DEFINITIONS (-DVKVG_LCD_FONT_FILTER)
+ENDIF ()
+
 OPTION(VKVG_BUILD_TESTS "build tests with glfw" ON)
 
 set(VULKAN_SDK "$ENV{VULKAN_SDK}" CACHE STRING "LunarG Vulkan SDK path")
diff --git a/shaders/vkvg_main_lcd.frag b/shaders/vkvg_main_lcd.frag
new file mode 100644 (file)
index 0000000..6b24b4a
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2018 Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+ * Software, and to permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+#version 450
+
+#extension GL_ARB_separate_shader_objects      : enable
+#extension GL_ARB_shading_language_420pack     : enable
+
+layout (set=0, binding = 0) uniform sampler2DArray fontMap;
+layout (set=1, binding = 0) uniform sampler2D          source;
+layout (set=2, binding = 0) uniform _uboGrad {
+       vec4    cp[3];
+       vec4    colors[16];
+       vec4    stops[16];
+       uint    count;
+}uboGrad;
+
+layout (location = 0) in vec3  inFontUV;               //if it is a text drawing, inFontUV.z hold fontMap layer
+layout (location = 1) in vec4  inSrc;                  //source bounds or color
+layout (location = 2) in flat int inPatType;
+layout (location = 3) in mat3x2 inMat;
+
+layout (location = 0) out vec4 outFragColor;
+
+layout (constant_id = 0) const int NUM_SAMPLES = 8;
+
+
+#define SOLID                  0
+#define SURFACE                        1
+#define LINEAR                 2
+#define RADIAL                 3
+#define MESH                   4
+#define RASTER_SOURCE  5
+
+void main()
+{
+       vec4 c = vec4(0);
+       switch(inPatType){
+       case SOLID:
+               c = inSrc;
+               break;
+       case SURFACE:
+               vec2 p = (gl_FragCoord.xy - inSrc.xy);
+               vec2 uv = vec2(
+                       inMat[0][0] * p.x + inMat[1][0] * p.y + inMat[2][0],
+                       inMat[0][1] * p.x + inMat[1][1] * p.y + inMat[2][1]
+               );
+
+               c = texture (source, uv / inSrc.zw);
+               break;
+       case LINEAR:
+               //credit to Nikita Rokotyan for linear grad
+               float  alpha = atan( -uboGrad.cp[1].y + uboGrad.cp[0].y, uboGrad.cp[1].x - uboGrad.cp[0].x );
+               float  gradientStartPosRotatedX = uboGrad.cp[0].x*cos(alpha) - uboGrad.cp[0].y*sin(alpha);
+               float  gradientEndPosRotatedX   = uboGrad.cp[1].x*cos(alpha) - uboGrad.cp[1].y*sin(alpha);
+               float  d = gradientEndPosRotatedX - gradientStartPosRotatedX;
+
+               float y = gl_FragCoord.y;//inSrc.y - gl_FragCoord.y;
+               float x = gl_FragCoord.x;
+               float xLocRotated = x*cos( alpha ) - y*sin( alpha );
+
+               c = mix(uboGrad.colors[0], uboGrad.colors[1], smoothstep( gradientStartPosRotatedX + uboGrad.stops[0].r*d, gradientStartPosRotatedX + uboGrad.stops[1].r*d, xLocRotated ) );
+               for ( int i=1; i<uboGrad.count-1; ++i )
+                       c = mix(c, uboGrad.colors[i+1], smoothstep( gradientStartPosRotatedX + uboGrad.stops[i].r*d, gradientStartPosRotatedX + uboGrad.stops[i+1].r*d, xLocRotated ) );
+               break;
+       }
+
+       if (inFontUV.z >= 0.0)
+               c *= texture(fontMap, inFontUV);
+
+       outFragColor = c;
+}
+
+void op_CLEAR () {
+       outFragColor = vec4 (0);
+}
index 909c604e89d6d025d08b311b8439d364a2e3c043..557dbd422ab8a604b0e6f3ee0c8c5e7b814c40c3 100644 (file)
@@ -1232,6 +1232,489 @@ unsigned char vkvg_main_vert_spv[] = {
   0x38, 0x00, 0x01, 0x00
 };
 unsigned int vkvg_main_vert_spv_len = 2680;
+unsigned char vkvg_main_lcd_frag_spv[] = {
+  0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x07, 0x00, 0x0d, 0x00,
+  0xee, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00,
+  0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00,
+  0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30,
+  0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0b, 0x00, 0x04, 0x00, 0x00, 0x00,
+  0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00,
+  0x0e, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00,
+  0x24, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00,
+  0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
+  0x03, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0xc2, 0x01, 0x00, 0x00,
+  0x04, 0x00, 0x09, 0x00, 0x47, 0x4c, 0x5f, 0x41, 0x52, 0x42, 0x5f, 0x73,
+  0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x68, 0x61, 0x64,
+  0x65, 0x72, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x00, 0x00,
+  0x04, 0x00, 0x09, 0x00, 0x47, 0x4c, 0x5f, 0x41, 0x52, 0x42, 0x5f, 0x73,
+  0x68, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x61, 0x6e, 0x67, 0x75,
+  0x61, 0x67, 0x65, 0x5f, 0x34, 0x32, 0x30, 0x70, 0x61, 0x63, 0x6b, 0x00,
+  0x04, 0x00, 0x0a, 0x00, 0x47, 0x4c, 0x5f, 0x47, 0x4f, 0x4f, 0x47, 0x4c,
+  0x45, 0x5f, 0x63, 0x70, 0x70, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x5f,
+  0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69,
+  0x76, 0x65, 0x00, 0x00, 0x04, 0x00, 0x08, 0x00, 0x47, 0x4c, 0x5f, 0x47,
+  0x4f, 0x4f, 0x47, 0x4c, 0x45, 0x5f, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64,
+  0x65, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x00,
+  0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e,
+  0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x09, 0x00, 0x00, 0x00,
+  0x63, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x0e, 0x00, 0x00, 0x00,
+  0x69, 0x6e, 0x50, 0x61, 0x74, 0x54, 0x79, 0x70, 0x65, 0x00, 0x00, 0x00,
+  0x05, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, 0x69, 0x6e, 0x53, 0x72,
+  0x63, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x1a, 0x00, 0x00, 0x00,
+  0x70, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x1b, 0x00, 0x00, 0x00,
+  0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64,
+  0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x21, 0x00, 0x00, 0x00,
+  0x75, 0x76, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, 0x00,
+  0x69, 0x6e, 0x4d, 0x61, 0x74, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00,
+  0x4d, 0x00, 0x00, 0x00, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x00, 0x00,
+  0x05, 0x00, 0x04, 0x00, 0x55, 0x00, 0x00, 0x00, 0x61, 0x6c, 0x70, 0x68,
+  0x61, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x5b, 0x00, 0x00, 0x00,
+  0x5f, 0x75, 0x62, 0x6f, 0x47, 0x72, 0x61, 0x64, 0x00, 0x00, 0x00, 0x00,
+  0x06, 0x00, 0x04, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x63, 0x70, 0x00, 0x00, 0x06, 0x00, 0x05, 0x00, 0x5b, 0x00, 0x00, 0x00,
+  0x01, 0x00, 0x00, 0x00, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x73, 0x00, 0x00,
+  0x06, 0x00, 0x05, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+  0x73, 0x74, 0x6f, 0x70, 0x73, 0x00, 0x00, 0x00, 0x06, 0x00, 0x05, 0x00,
+  0x5b, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x63, 0x6f, 0x75, 0x6e,
+  0x74, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x5d, 0x00, 0x00, 0x00,
+  0x75, 0x62, 0x6f, 0x47, 0x72, 0x61, 0x64, 0x00, 0x05, 0x00, 0x09, 0x00,
+  0x6b, 0x00, 0x00, 0x00, 0x67, 0x72, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x74,
+  0x53, 0x74, 0x61, 0x72, 0x74, 0x50, 0x6f, 0x73, 0x52, 0x6f, 0x74, 0x61,
+  0x74, 0x65, 0x64, 0x58, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x08, 0x00,
+  0x77, 0x00, 0x00, 0x00, 0x67, 0x72, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x74,
+  0x45, 0x6e, 0x64, 0x50, 0x6f, 0x73, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x65,
+  0x64, 0x58, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x83, 0x00, 0x00, 0x00,
+  0x64, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x87, 0x00, 0x00, 0x00,
+  0x79, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x8a, 0x00, 0x00, 0x00,
+  0x78, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x8d, 0x00, 0x00, 0x00,
+  0x78, 0x4c, 0x6f, 0x63, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x64, 0x00,
+  0x05, 0x00, 0x03, 0x00, 0xad, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x00,
+  0x05, 0x00, 0x05, 0x00, 0xda, 0x00, 0x00, 0x00, 0x69, 0x6e, 0x46, 0x6f,
+  0x6e, 0x74, 0x55, 0x56, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00,
+  0xe4, 0x00, 0x00, 0x00, 0x66, 0x6f, 0x6e, 0x74, 0x4d, 0x61, 0x70, 0x00,
+  0x05, 0x00, 0x06, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x6f, 0x75, 0x74, 0x46,
+  0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x00, 0x00, 0x00,
+  0x05, 0x00, 0x05, 0x00, 0xed, 0x00, 0x00, 0x00, 0x4e, 0x55, 0x4d, 0x5f,
+  0x53, 0x41, 0x4d, 0x50, 0x4c, 0x45, 0x53, 0x00, 0x47, 0x00, 0x03, 0x00,
+  0x0e, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
+  0x0e, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+  0x47, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00,
+  0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x1b, 0x00, 0x00, 0x00,
+  0x0b, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
+  0x24, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+  0x47, 0x00, 0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
+  0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x4d, 0x00, 0x00, 0x00,
+  0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
+  0x57, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
+  0x47, 0x00, 0x04, 0x00, 0x59, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
+  0x10, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x5a, 0x00, 0x00, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00,
+  0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x5b, 0x00, 0x00, 0x00,
+  0x01, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00,
+  0x48, 0x00, 0x05, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+  0x23, 0x00, 0x00, 0x00, 0x30, 0x01, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00,
+  0x5b, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00,
+  0x30, 0x02, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x5b, 0x00, 0x00, 0x00,
+  0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x5d, 0x00, 0x00, 0x00,
+  0x22, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
+  0x5d, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x47, 0x00, 0x04, 0x00, 0xda, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xe4, 0x00, 0x00, 0x00,
+  0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
+  0xe4, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x47, 0x00, 0x04, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xed, 0x00, 0x00, 0x00,
+  0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00,
+  0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00,
+  0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00,
+  0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
+  0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
+  0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00,
+  0x0b, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00,
+  0x0a, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00,
+  0x0c, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+  0x20, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+  0x0c, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00,
+  0x0e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
+  0x14, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
+  0x3b, 0x00, 0x04, 0x00, 0x14, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00,
+  0x01, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x18, 0x00, 0x00, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
+  0x19, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00,
+  0x3b, 0x00, 0x04, 0x00, 0x14, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00,
+  0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00,
+  0x18, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
+  0x23, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
+  0x3b, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00,
+  0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00,
+  0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00,
+  0x26, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x2b, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x28, 0x00, 0x00, 0x00,
+  0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
+  0x2b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
+  0x2b, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00,
+  0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00,
+  0x32, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00,
+  0x0c, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+  0x19, 0x00, 0x09, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
+  0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x1b, 0x00, 0x03, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00,
+  0x20, 0x00, 0x04, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x4b, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x4c, 0x00, 0x00, 0x00,
+  0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00,
+  0x26, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+  0x1c, 0x00, 0x04, 0x00, 0x57, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
+  0x56, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00,
+  0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x04, 0x00,
+  0x59, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00,
+  0x1c, 0x00, 0x04, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
+  0x58, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x06, 0x00, 0x5b, 0x00, 0x00, 0x00,
+  0x57, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00,
+  0x26, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x5c, 0x00, 0x00, 0x00,
+  0x02, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00,
+  0x5c, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+  0x20, 0x00, 0x04, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x97, 0x00, 0x00, 0x00,
+  0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
+  0xac, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
+  0x2b, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00, 0xb5, 0x00, 0x00, 0x00,
+  0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xb6, 0x00, 0x00, 0x00,
+  0x02, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, 0x00,
+  0xba, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0xd8, 0x00, 0x00, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
+  0xd9, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00,
+  0x3b, 0x00, 0x04, 0x00, 0xd9, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00,
+  0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00,
+  0xdb, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00,
+  0xe1, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00,
+  0xe2, 0x00, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
+  0xe3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00,
+  0x3b, 0x00, 0x04, 0x00, 0xe3, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xea, 0x00, 0x00, 0x00,
+  0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00,
+  0xea, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+  0x32, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00, 0xed, 0x00, 0x00, 0x00,
+  0x08, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00,
+  0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+  0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00,
+  0x08, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
+  0x3b, 0x00, 0x04, 0x00, 0x19, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00,
+  0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x19, 0x00, 0x00, 0x00,
+  0x21, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00,
+  0x2b, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
+  0x3b, 0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00,
+  0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, 0x00,
+  0x77, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00,
+  0x2b, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
+  0x3b, 0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00,
+  0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, 0x00,
+  0x8a, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00,
+  0x2b, 0x00, 0x00, 0x00, 0x8d, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
+  0x3b, 0x00, 0x04, 0x00, 0xac, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00,
+  0x07, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x09, 0x00, 0x00, 0x00,
+  0x0b, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00,
+  0x0f, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00,
+  0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x09, 0x00,
+  0x0f, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00,
+  0x02, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00,
+  0x10, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00,
+  0x16, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00,
+  0x09, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00,
+  0x13, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x11, 0x00, 0x00, 0x00,
+  0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00,
+  0x1b, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x18, 0x00, 0x00, 0x00,
+  0x1d, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
+  0x07, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00,
+  0x4f, 0x00, 0x07, 0x00, 0x18, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00,
+  0x1e, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x01, 0x00, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x18, 0x00, 0x00, 0x00,
+  0x20, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00,
+  0x3e, 0x00, 0x03, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+  0x41, 0x00, 0x06, 0x00, 0x28, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00,
+  0x24, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00,
+  0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00,
+  0x29, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x2b, 0x00, 0x00, 0x00,
+  0x2c, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00,
+  0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00,
+  0x2c, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00,
+  0x2e, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00,
+  0x41, 0x00, 0x06, 0x00, 0x28, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00,
+  0x24, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00,
+  0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00,
+  0x30, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x2b, 0x00, 0x00, 0x00,
+  0x33, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00,
+  0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
+  0x33, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00,
+  0x35, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
+  0x81, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00,
+  0x2e, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00,
+  0x28, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00,
+  0x37, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00,
+  0x81, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00,
+  0x36, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00,
+  0x28, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00,
+  0x25, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00,
+  0x41, 0x00, 0x05, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00,
+  0x1a, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00,
+  0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00,
+  0x3c, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00,
+  0x28, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00,
+  0x2f, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
+  0x41, 0x00, 0x05, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00,
+  0x1a, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00,
+  0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00,
+  0x41, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00,
+  0x44, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x28, 0x00, 0x00, 0x00,
+  0x46, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00,
+  0x32, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00,
+  0x47, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00,
+  0x47, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x00, 0x00, 0x00,
+  0x49, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00,
+  0x3e, 0x00, 0x03, 0x00, 0x21, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00,
+  0x3d, 0x00, 0x04, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00,
+  0x4d, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x18, 0x00, 0x00, 0x00,
+  0x4f, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
+  0x07, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00,
+  0x4f, 0x00, 0x07, 0x00, 0x18, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00,
+  0x50, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+  0x03, 0x00, 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, 0x18, 0x00, 0x00, 0x00,
+  0x52, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00,
+  0x57, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00,
+  0x4e, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00,
+  0x09, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00,
+  0x13, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x12, 0x00, 0x00, 0x00,
+  0x41, 0x00, 0x07, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x00,
+  0x5d, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00,
+  0x32, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00,
+  0x60, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x04, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00,
+  0x41, 0x00, 0x07, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00,
+  0x5d, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00,
+  0x32, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00,
+  0x63, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00,
+  0x63, 0x00, 0x00, 0x00, 0x41, 0x00, 0x07, 0x00, 0x5e, 0x00, 0x00, 0x00,
+  0x65, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00,
+  0x2f, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00,
+  0x41, 0x00, 0x07, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00,
+  0x5d, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00,
+  0x27, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00,
+  0x68, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00,
+  0x68, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x06, 0x00, 0x00, 0x00,
+  0x6a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00,
+  0x64, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00,
+  0x55, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x41, 0x00, 0x07, 0x00,
+  0x5e, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00,
+  0x25, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00,
+  0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00,
+  0x6c, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00,
+  0x6e, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+  0x0e, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00,
+  0x6f, 0x00, 0x00, 0x00, 0x41, 0x00, 0x07, 0x00, 0x5e, 0x00, 0x00, 0x00,
+  0x71, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00,
+  0x25, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0x72, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00,
+  0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00,
+  0x55, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00,
+  0x74, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00,
+  0x73, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00,
+  0x75, 0x00, 0x00, 0x00, 0x72, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00,
+  0x83, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00,
+  0x70, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00,
+  0x6b, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x41, 0x00, 0x07, 0x00,
+  0x5e, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00,
+  0x25, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00,
+  0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00,
+  0x78, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00,
+  0x7a, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0x7b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+  0x0e, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00,
+  0x7b, 0x00, 0x00, 0x00, 0x41, 0x00, 0x07, 0x00, 0x5e, 0x00, 0x00, 0x00,
+  0x7d, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00,
+  0x2f, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00,
+  0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00,
+  0x55, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00,
+  0x80, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00,
+  0x7f, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00,
+  0x81, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
+  0x83, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00,
+  0x7c, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00,
+  0x77, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00,
+  0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x85, 0x00, 0x00, 0x00,
+  0x6b, 0x00, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00,
+  0x86, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x85, 0x00, 0x00, 0x00,
+  0x3e, 0x00, 0x03, 0x00, 0x83, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00,
+  0x41, 0x00, 0x05, 0x00, 0x28, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00,
+  0x1b, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00,
+  0x3e, 0x00, 0x03, 0x00, 0x87, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00,
+  0x41, 0x00, 0x05, 0x00, 0x28, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00,
+  0x1b, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00,
+  0x3e, 0x00, 0x03, 0x00, 0x8a, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00,
+  0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00,
+  0x8a, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00,
+  0x8f, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+  0x0e, 0x00, 0x00, 0x00, 0x8f, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00,
+  0x90, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00,
+  0x92, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00,
+  0x0c, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00,
+  0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00,
+  0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00,
+  0x92, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00,
+  0x95, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x8d, 0x00, 0x00, 0x00,
+  0x96, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x97, 0x00, 0x00, 0x00,
+  0x98, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00,
+  0x25, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00,
+  0x99, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00,
+  0x97, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00,
+  0x2f, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
+  0x07, 0x00, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00,
+  0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00,
+  0x6b, 0x00, 0x00, 0x00, 0x41, 0x00, 0x07, 0x00, 0x5e, 0x00, 0x00, 0x00,
+  0x9d, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00,
+  0x25, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00,
+  0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00,
+  0x83, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00,
+  0xa0, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00,
+  0x81, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0xa1, 0x00, 0x00, 0x00,
+  0x9c, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00,
+  0x41, 0x00, 0x07, 0x00, 0x5e, 0x00, 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00,
+  0x5d, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00,
+  0x27, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00,
+  0xa4, 0x00, 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00,
+  0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0xa6, 0x00, 0x00, 0x00,
+  0xa4, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0xa7, 0x00, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00,
+  0xa6, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00,
+  0xa8, 0x00, 0x00, 0x00, 0x8d, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+  0x31, 0x00, 0x00, 0x00, 0xa1, 0x00, 0x00, 0x00, 0xa7, 0x00, 0x00, 0x00,
+  0xa8, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00,
+  0xaa, 0x00, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00,
+  0xa9, 0x00, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00,
+  0x07, 0x00, 0x00, 0x00, 0xab, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+  0x2e, 0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x00,
+  0xaa, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x09, 0x00, 0x00, 0x00,
+  0xab, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xad, 0x00, 0x00, 0x00,
+  0x2f, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0xae, 0x00, 0x00, 0x00,
+  0xf8, 0x00, 0x02, 0x00, 0xae, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x04, 0x00,
+  0xb0, 0x00, 0x00, 0x00, 0xb1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0xf9, 0x00, 0x02, 0x00, 0xb2, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00,
+  0xb2, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00,
+  0xb3, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x04, 0x00,
+  0x26, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0xb3, 0x00, 0x00, 0x00,
+  0x41, 0x00, 0x05, 0x00, 0xb6, 0x00, 0x00, 0x00, 0xb7, 0x00, 0x00, 0x00,
+  0x5d, 0x00, 0x00, 0x00, 0xb5, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
+  0x26, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, 0xb7, 0x00, 0x00, 0x00,
+  0x82, 0x00, 0x05, 0x00, 0x26, 0x00, 0x00, 0x00, 0xb9, 0x00, 0x00, 0x00,
+  0xb8, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0xb0, 0x00, 0x05, 0x00,
+  0xba, 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00,
+  0xb9, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0xbb, 0x00, 0x00, 0x00,
+  0xaf, 0x00, 0x00, 0x00, 0xb0, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00,
+  0xaf, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00,
+  0xbc, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
+  0x0c, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00,
+  0x80, 0x00, 0x05, 0x00, 0x0c, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00,
+  0xbd, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00,
+  0x97, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00,
+  0x2f, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
+  0x07, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00,
+  0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00,
+  0x6b, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00,
+  0xc2, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0x41, 0x00, 0x07, 0x00,
+  0x5e, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00,
+  0x37, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00,
+  0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00,
+  0xc3, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00,
+  0xc5, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00,
+  0xc5, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00,
+  0xc7, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00,
+  0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00,
+  0x6b, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00,
+  0xc9, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0x80, 0x00, 0x05, 0x00,
+  0x0c, 0x00, 0x00, 0x00, 0xca, 0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00,
+  0x2f, 0x00, 0x00, 0x00, 0x41, 0x00, 0x07, 0x00, 0x5e, 0x00, 0x00, 0x00,
+  0xcb, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00,
+  0xca, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00,
+  0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00,
+  0x83, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00,
+  0xce, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00,
+  0x81, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0xcf, 0x00, 0x00, 0x00,
+  0xc8, 0x00, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
+  0x06, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x8d, 0x00, 0x00, 0x00,
+  0x0c, 0x00, 0x08, 0x00, 0x06, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x00, 0x00,
+  0x01, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00,
+  0xcf, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00,
+  0x07, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x00, 0x00,
+  0xd1, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x00, 0x00,
+  0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd3, 0x00, 0x00, 0x00,
+  0x01, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00,
+  0xc0, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00,
+  0x09, 0x00, 0x00, 0x00, 0xd3, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00,
+  0xb1, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xb1, 0x00, 0x00, 0x00,
+  0x3d, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00,
+  0xad, 0x00, 0x00, 0x00, 0x80, 0x00, 0x05, 0x00, 0x0c, 0x00, 0x00, 0x00,
+  0xd5, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00,
+  0x3e, 0x00, 0x03, 0x00, 0xad, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x00,
+  0xf9, 0x00, 0x02, 0x00, 0xae, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00,
+  0xb0, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x13, 0x00, 0x00, 0x00,
+  0xf8, 0x00, 0x02, 0x00, 0x13, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00,
+  0x28, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00,
+  0xdb, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00,
+  0xdd, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x05, 0x00,
+  0xba, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00,
+  0x0a, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0xe0, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0xde, 0x00, 0x00, 0x00,
+  0xdf, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00,
+  0xdf, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0xe2, 0x00, 0x00, 0x00,
+  0xe5, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
+  0xd8, 0x00, 0x00, 0x00, 0xe6, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00,
+  0x57, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00,
+  0xe5, 0x00, 0x00, 0x00, 0xe6, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
+  0x07, 0x00, 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00,
+  0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe9, 0x00, 0x00, 0x00,
+  0xe8, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00,
+  0x09, 0x00, 0x00, 0x00, 0xe9, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00,
+  0xe0, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xe0, 0x00, 0x00, 0x00,
+  0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00,
+  0x09, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xeb, 0x00, 0x00, 0x00,
+  0xec, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00
+};
+unsigned int vkvg_main_lcd_frag_spv_len = 5760;
 unsigned char wired_frag_spv[] = {
   0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x07, 0x00, 0x0d, 0x00,
   0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00,
index 755d9bae8b520a3f197be5cc5cb0c4c9f3ac847a..2bec98f75a5539e40d506c4965b2bb4ab332029a 100644 (file)
@@ -88,7 +88,7 @@ VkvgContext vkvg_create(VkvgSurface surf)
     _create_cmd_buff        (ctx);
     _createDescriptorPool   (ctx);
     _init_descriptor_sets   (ctx);
-    _update_descriptor_set  (ctx, ctx->pSurf->dev->fontCache->cacheTex, ctx->dsFont);
+    _update_descriptor_set  (ctx, ctx->pSurf->dev->fontCache->texture, ctx->dsFont);
     _update_descriptor_set  (ctx, surf->dev->emptyImg, ctx->dsSrc);
     _update_gradient_desc_set(ctx);
 
index 23d65726434e627c8d8cc36c978550766ee30988..42e1c8810350cf2728ee257c16358806e6d6dbbb 100644 (file)
@@ -247,12 +247,14 @@ void _setupPipelines(VkvgDevice dev)
                                             .pCode = (uint32_t*)vkvg_main_vert_spv,
                                             .codeSize = vkvg_main_vert_spv_len };
     VK_CHECK_RESULT(vkCreateShaderModule(dev->vkDev, &createInfo, NULL, &modVert));
+#ifdef VKVG_LCD_FONT_FILTER
+    createInfo.pCode = (uint32_t*)vkvg_main_lcd_frag_spv;
+    createInfo.codeSize = vkvg_main_lcd_frag_spv_len;
+#else
     createInfo.pCode = (uint32_t*)vkvg_main_frag_spv;
     createInfo.codeSize = vkvg_main_frag_spv_len;
+#endif
     VK_CHECK_RESULT(vkCreateShaderModule(dev->vkDev, &createInfo, NULL, &modFrag));
-    createInfo.pCode = (uint32_t*)wired_frag_spv;
-    createInfo.codeSize = wired_frag_spv_len;
-    VK_CHECK_RESULT(vkCreateShaderModule(dev->vkDev, &createInfo, NULL, &modFragWired));
 
     VkPipelineShaderStageCreateInfo vertStage = { .sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO,
         .stage = VK_SHADER_STAGE_VERTEX_BIT,
@@ -315,9 +317,12 @@ void _setupPipelines(VkvgDevice dev)
 #ifdef VKVG_WIRED_DEBUG
     rasterizationState.polygonMode = VK_POLYGON_MODE_FILL;
     inputAssemblyState.topology = VK_PRIMITIVE_TOPOLOGY_LINE_LIST;
-    shaderStages[1].pName = "main";
     VK_CHECK_RESULT(vkCreateGraphicsPipelines(dev->vkDev, dev->pipelineCache, 1, &pipelineCreateInfo, NULL, &dev->pipelineLineList));
 
+    createInfo.pCode = (uint32_t*)wired_frag_spv;
+    createInfo.codeSize = wired_frag_spv_len;
+    VK_CHECK_RESULT(vkCreateShaderModule(dev->vkDev, &createInfo, NULL, &modFragWired));
+
     shaderStages[1].module = modFragWired;
     inputAssemblyState.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
     rasterizationState.polygonMode = VK_POLYGON_MODE_LINE;
index 79bf4933670f1a14f8616fd010f5fe4ce9593c8e..670560f456aa2de7ad6a9012a6499728a2987449 100644 (file)
@@ -36,16 +36,26 @@ void _init_fonts_cache (VkvgDevice dev){
 
     FT_CHECK_RESULT(FT_Init_FreeType(&cache->library));
 
-    cache->cacheTexLength = FONT_CACHE_INIT_LAYERS;
-    cache->cacheTex = vkh_tex2d_array_create ((VkhDevice)dev, VK_FORMAT_R8_UNORM, FONT_PAGE_SIZE, FONT_PAGE_SIZE,
-                            cache->cacheTexLength ,VMA_MEMORY_USAGE_GPU_ONLY,
+
+#ifdef VKVG_LCD_FONT_FILTER
+    FT_CHECK_RESULT(FT_Library_SetLcdFilter (cache->library, FT_LCD_FILTER_LIGHT));
+    cache->texFormat = FB_COLOR_FORMAT;
+    cache->texPixelSize = 4;
+#else
+    cache->texFormat = VK_FORMAT_R8_UNORM;
+    cache->texPixelSize = 1;
+#endif
+
+    cache->texLength = FONT_CACHE_INIT_LAYERS;
+    cache->texture = vkh_tex2d_array_create ((VkhDevice)dev, cache->texFormat, FONT_PAGE_SIZE, FONT_PAGE_SIZE,
+                            cache->texLength ,VMA_MEMORY_USAGE_GPU_ONLY,
                             VK_IMAGE_USAGE_SAMPLED_BIT|VK_IMAGE_USAGE_TRANSFER_DST_BIT|VK_IMAGE_USAGE_TRANSFER_SRC_BIT);
-    vkh_image_create_descriptor (cache->cacheTex, VK_IMAGE_VIEW_TYPE_2D_ARRAY, VK_IMAGE_ASPECT_COLOR_BIT,
+    vkh_image_create_descriptor (cache->texture, VK_IMAGE_VIEW_TYPE_2D_ARRAY, VK_IMAGE_ASPECT_COLOR_BIT,
                                  VK_FILTER_NEAREST, VK_FILTER_NEAREST, VK_SAMPLER_MIPMAP_MODE_NEAREST, VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER);
 
     cache->uploadFence = vkh_fence_create_signaled((VkhDevice)dev);
 
-    uint32_t buffLength = FONT_PAGE_SIZE*FONT_PAGE_SIZE*sizeof(uint8_t);
+    uint32_t buffLength = FONT_PAGE_SIZE*FONT_PAGE_SIZE*cache->texPixelSize;
 
     vkvg_buffer_create (dev,
         VK_BUFFER_USAGE_TRANSFER_SRC_BIT,
@@ -54,8 +64,8 @@ void _init_fonts_cache (VkvgDevice dev){
 
     cache->cmd = vkh_cmd_buff_create((VkhDevice)dev,dev->cmdPool,VK_COMMAND_BUFFER_LEVEL_PRIMARY);
 
-    cache->hostBuff = (uint8_t*)malloc(FONT_PAGE_SIZE*FONT_PAGE_SIZE*sizeof(uint8_t));
-    cache->pensY = (int*)calloc(cache->cacheTexLength, sizeof(int));
+    cache->hostBuff = (uint8_t*)malloc(buffLength);
+    cache->pensY = (int*)calloc(cache->texLength, sizeof(int));
 
     dev->fontCache = cache;
 }
@@ -67,30 +77,30 @@ void _increase_font_tex_array (VkvgDevice dev){
     vkResetCommandBuffer(cache->cmd, 0);
     vkResetFences       (dev->vkDev, 1, &cache->uploadFence);
 
-    uint8_t newSize = cache->cacheTexLength + FONT_CACHE_INIT_LAYERS;
-    VkhImage newImg = vkh_tex2d_array_create ((VkhDevice)dev, VK_FORMAT_R8_UNORM, FONT_PAGE_SIZE, FONT_PAGE_SIZE,
+    uint8_t newSize = cache->texLength + FONT_CACHE_INIT_LAYERS;
+    VkhImage newImg = vkh_tex2d_array_create ((VkhDevice)dev, cache->texFormat, FONT_PAGE_SIZE, FONT_PAGE_SIZE,
                                               newSize ,VMA_MEMORY_USAGE_GPU_ONLY,
                                               VK_IMAGE_USAGE_SAMPLED_BIT|VK_IMAGE_USAGE_TRANSFER_DST_BIT|VK_IMAGE_USAGE_TRANSFER_SRC_BIT);
     vkh_image_create_descriptor (newImg, VK_IMAGE_VIEW_TYPE_2D_ARRAY, VK_IMAGE_ASPECT_COLOR_BIT,
                                VK_FILTER_NEAREST, VK_FILTER_NEAREST, VK_SAMPLER_MIPMAP_MODE_NEAREST,VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER);
 
     VkImageSubresourceRange subresNew   = {VK_IMAGE_ASPECT_COLOR_BIT,0,1,0,newSize};
-    VkImageSubresourceRange subres      = {VK_IMAGE_ASPECT_COLOR_BIT,0,1,0,cache->cacheTexLength};
+    VkImageSubresourceRange subres      = {VK_IMAGE_ASPECT_COLOR_BIT,0,1,0,cache->texLength};
 
     vkh_cmd_begin (cache->cmd,VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT);
 
     vkh_image_set_layout_subres(cache->cmd, newImg, subresNew,
                                 VK_IMAGE_LAYOUT_GENERAL, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
                                 VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT);
-    vkh_image_set_layout_subres(cache->cmd, cache->cacheTex, subres,
+    vkh_image_set_layout_subres(cache->cmd, cache->texture, subres,
                                 VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
                                 VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT);
 
-    VkImageCopy cregion = { .srcSubresource = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, cache->cacheTexLength},
-                            .dstSubresource = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, cache->cacheTexLength},
+    VkImageCopy cregion = { .srcSubresource = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, cache->texLength},
+                            .dstSubresource = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, cache->texLength},
                             .extent = {FONT_PAGE_SIZE,FONT_PAGE_SIZE,1}};
 
-    vkCmdCopyImage (cache->cmd, vkh_image_get_vkimage (cache->cacheTex), VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
+    vkCmdCopyImage (cache->cmd, vkh_image_get_vkimage (cache->texture), VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
                                 vkh_image_get_vkimage (newImg), VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, &cregion);
 
     vkh_image_set_layout_subres(cache->cmd, newImg, subresNew,
@@ -105,11 +115,11 @@ void _increase_font_tex_array (VkvgDevice dev){
     _flush_all_contexes (dev);
 
     cache->pensY = (int*)realloc(cache->pensY, newSize * sizeof(int));
-    memset (cache->pensY + cache->cacheTexLength * sizeof(int),0,FONT_CACHE_INIT_LAYERS*sizeof(int));
+    memset (cache->pensY + cache->texLength * sizeof(int),0,FONT_CACHE_INIT_LAYERS*sizeof(int));
 
-    vkh_image_destroy   (cache->cacheTex);
-    cache->cacheTexLength   = newSize;
-    cache->cacheTex         = newImg;
+    vkh_image_destroy   (cache->texture);
+    cache->texLength   = newSize;
+    cache->texture         = newImg;
 
     VkvgContext next = dev->lastCtx;
     while (next != NULL){
@@ -123,7 +133,7 @@ void _increase_font_tex_array (VkvgDevice dev){
 void _init_next_line_in_tex_cache (VkvgDevice dev, _vkvg_font_t* f){
     _font_cache_t* cache = dev->fontCache;
     int i;
-    for (i = 0; i < cache->cacheTexLength; ++i) {
+    for (i = 0; i < cache->texLength; ++i) {
         if (cache->pensY[i] + f->curLine.height >= FONT_PAGE_SIZE)
             continue;
         f->curLine.pageIdx = (unsigned char)i;
@@ -163,7 +173,7 @@ void _destroy_font_cache (VkvgDevice dev){
 
 
     vkvg_buffer_destroy (&cache->buff);
-    vkh_image_destroy   (cache->cacheTex);
+    vkh_image_destroy   (cache->texture);
     //vkFreeCommandBuffers(dev->vkDev,dev->cmdPool, 1, &cache->cmd);
     vkDestroyFence      (dev->vkDev,cache->uploadFence,NULL);
 
@@ -200,12 +210,12 @@ void _flush_chars_to_tex (VkvgDevice dev, _vkvg_font_t* f) {
     vkResetCommandBuffer(cache->cmd,0);
     vkResetFences       (dev->vkDev,1,&cache->uploadFence);
 
-    memcpy(cache->buff.allocInfo.pMappedData, cache->hostBuff, f->curLine.height * FONT_PAGE_SIZE);
+    memcpy(cache->buff.allocInfo.pMappedData, cache->hostBuff, (ulong)(f->curLine.height * FONT_PAGE_SIZE * cache->texPixelSize));
 
     vkh_cmd_begin (cache->cmd,VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT);
 
     VkImageSubresourceRange subres      = {VK_IMAGE_ASPECT_COLOR_BIT,0,1,f->curLine.pageIdx,1};
-    vkh_image_set_layout_subres(cache->cmd, cache->cacheTex, subres,
+    vkh_image_set_layout_subres(cache->cmd, cache->texture, subres,
                                 VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
                                 VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT);
 
@@ -216,9 +226,9 @@ void _flush_chars_to_tex (VkvgDevice dev, _vkvg_font_t* f) {
                                            .imageExtent = {FONT_PAGE_SIZE-f->curLine.penX,f->curLine.height,1}};
 
     vkCmdCopyBufferToImage(cache->cmd, cache->buff.buffer,
-                           vkh_image_get_vkimage (cache->cacheTex), VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, &bufferCopyRegion);
+                           vkh_image_get_vkimage (cache->texture), VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, &bufferCopyRegion);
 
-    vkh_image_set_layout_subres(cache->cmd, cache->cacheTex, subres,
+    vkh_image_set_layout_subres(cache->cmd, cache->texture, subres,
                                 VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
                                 VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT);
 
@@ -228,33 +238,56 @@ void _flush_chars_to_tex (VkvgDevice dev, _vkvg_font_t* f) {
 
     f->curLine.penX += cache->stagingX;
     cache->stagingX = 0;
-    memset(cache->hostBuff, 0, FONT_PAGE_SIZE * FONT_PAGE_SIZE);
+    memset(cache->hostBuff, 0, FONT_PAGE_SIZE * FONT_PAGE_SIZE * cache->texPixelSize);
 }
 //create a new char entry and put glyph in stagging buffer, ready for upload.
 _char_ref* _prepare_char (VkvgDevice dev, _vkvg_font_t* f, FT_UInt gindex){
+
+#ifdef VKVG_LCD_FONT_FILTER
+    FT_CHECK_RESULT(FT_Load_Glyph(f->face, gindex, FT_LOAD_TARGET_NORMAL));
+    FT_CHECK_RESULT(FT_Render_Glyph(f->face->glyph, FT_RENDER_MODE_LCD));
+#else
     FT_CHECK_RESULT(FT_Load_Glyph(f->face, gindex, FT_LOAD_RENDER));
+#endif
 
     FT_GlyphSlot slot = f->face->glyph;
-    FT_Bitmap   bmp  = slot->bitmap;
-    uint8_t*    data = dev->fontCache->hostBuff;
+    FT_Bitmap bmp = slot->bitmap;
+    uint8_t* data = dev->fontCache->hostBuff;
+    uint bmpWidth = bmp.width;   //real width in pixel of char bitmap
 
-    if (dev->fontCache->stagingX + f->curLine.penX + bmp.width > FONT_PAGE_SIZE){
+#ifdef VKVG_LCD_FONT_FILTER
+    bmpWidth /= 3;
+#endif
+
+
+    if (dev->fontCache->stagingX + f->curLine.penX + bmpWidth > FONT_PAGE_SIZE){
         _flush_chars_to_tex (dev, f);
         _init_next_line_in_tex_cache (dev, f);
     }
 
     int penX = dev->fontCache->stagingX;
     for(int y=0; y<bmp.rows; y++) {
-        for(int x=0; x<bmp.width; x++)
-            data[ penX + x + y * FONT_PAGE_SIZE ] =
-                bmp.buffer[x + y * bmp.width];
+        for(int x=0; x<bmpWidth; x++) {
+#ifdef VKVG_LCD_FONT_FILTER
+            unsigned char r = bmp.buffer[y * bmp.pitch + x * 3];
+            unsigned char g = bmp.buffer[y * bmp.pitch + x * 3 + 1];
+            unsigned char b = bmp.buffer[y * bmp.pitch + x * 3 + 2];
+
+            data[(penX + x + y * FONT_PAGE_SIZE) * 4] = b;
+            data[(penX + x + y * FONT_PAGE_SIZE) * 4 + 1] = g;
+            data[(penX + x + y * FONT_PAGE_SIZE) * 4 + 2] = r;
+            data[(penX + x + y * FONT_PAGE_SIZE) * 4 + 3] = (r+g+b)/3;
+#else
+            data[penX + x + y * FONT_PAGE_SIZE ] = bmp.buffer[x + y * bmp.width];
+#endif
+        }
     }
 
     _char_ref* cr = (_char_ref*)malloc(sizeof(_char_ref));
     vec4 uvBounds = {
         (float)(penX + f->curLine.penX) / (float)FONT_PAGE_SIZE,
         (float)f->curLine.penY / (float)FONT_PAGE_SIZE,
-        bmp.width,
+        bmpWidth,
         bmp.rows};
     cr->bounds = uvBounds;
     cr->pageIdx = f->curLine.pageIdx;
@@ -262,7 +295,7 @@ _char_ref* _prepare_char (VkvgDevice dev, _vkvg_font_t* f, FT_UInt gindex){
     cr->bmpDiff.y = (int16_t)slot->bitmap_top;
 
     f->charLookup[gindex] = cr;
-    dev->fontCache->stagingX += bmp.width;
+    dev->fontCache->stagingX += bmpWidth;
     return cr;
 }
 //set current font size for context
@@ -465,35 +498,40 @@ void _show_text_run (VkvgContext ctx, VkvgText tr) {
 
     _flush_chars_to_tex(tr->dev, tr->font);
 }
-void _show_text (VkvgContext ctx, const char* text){
-
-    vkvg_text_run_t tr = {};
-    _create_text_run (ctx, text, &tr);
-
-    _show_text_run (ctx, &tr);
-
-    _destroy_text_run (&tr);
-
-    //_show_texture(ctx); return;
-}
 
 #ifdef DEBUG
 void _show_texture (vkvg_context* ctx){
     Vertex vs[] = {
-        {{0,0},                             {0,0,1}},
-        {{0,FONT_PAGE_SIZE},                {0,1,1}},
-        {{FONT_PAGE_SIZE,0},                {1,0,1}},
-        {{FONT_PAGE_SIZE,FONT_PAGE_SIZE},   {1,1,1}}
+        {{0,0},                             {0,0,0}},
+        {{0,FONT_PAGE_SIZE},                {0,1,0}},
+        {{FONT_PAGE_SIZE,0},                {1,0,0}},
+        {{FONT_PAGE_SIZE,FONT_PAGE_SIZE},   {1,1,0}}
     };
 
+    int i = ctx->vertCount;
+
     _add_vertex(ctx,vs[0]);
     _add_vertex(ctx,vs[1]);
     _add_vertex(ctx,vs[2]);
     _add_vertex(ctx,vs[3]);
 
-    _add_tri_indices_for_rect (ctx, 0);
+    _add_tri_indices_for_rect (ctx, i);
 }
 #endif
+
+void _show_text (VkvgContext ctx, const char* text){
+
+    vkvg_text_run_t tr = {};
+    _create_text_run (ctx, text, &tr);
+
+    _show_text_run (ctx, &tr);
+
+    _destroy_text_run (&tr);
+
+    //_show_texture(ctx); return;
+}
+
+
 /*void testfonts(){
     FT_Library      library;
     FT_Face         face;
index 0c4be3b420294a17a57300abe6b1c8306c1605f5..c5d560b307fa83b08dfd81796014c33c4d15e598 100644 (file)
 #include <ft2build.h>
 #include FT_FREETYPE_H
 
+#ifdef VKVG_LCD_FONT_FILTER
+#include <freetype/ftlcdfil.h>
+#endif
+
 #include <hb.h>
 #include <hb-ft.h>
 
@@ -83,8 +87,10 @@ typedef struct {
 
     VkCommandBuffer cmd;            /* vulkan command buffer for font textures upload */
     vkvg_buff       buff;           /* stagin buffer */
-    VkhImage           cacheTex;       /* 2d array texture used by contexts to draw characteres */
-    uint8_t         cacheTexLength; /* layer count of 2d array texture, starts with FONT_CACHE_INIT_LAYERS count and increased when needed */
+    VkhImage           texture;        /* 2d array texture used by contexts to draw characteres */
+    VkFormat        texFormat;      /* Format of the fonts texture array */
+    uint8_t         texPixelSize;   /* Size in byte of a single pixel in a font texture */
+    uint8_t         texLength;      /* layer count of 2d array texture, starts with FONT_CACHE_INIT_LAYERS count and increased when needed */
     int*            pensY;          /* array of current y pen positions for each texture in cache 2d array */
     VkFence                    uploadFence;    /* Signaled when upload is finished */
 
diff --git a/tests/multi.c b/tests/multi.c
deleted file mode 100644 (file)
index be0f55a..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#include "test.h"
-
-void test(){
-    VkvgContext ctx = vkvg_create(surf);
-
-    vkvg_destroy(ctx);
-}
-
-int main(int argc, char *argv[]) {
-
-    perform_test (test, 1024, 768);
-
-    return 0;
-}
index 8b8e225d60a4b830275d5c92870d51c89adfb103..39eb09d675e54c0b3cd12d24afd40cea965f177e 100644 (file)
@@ -28,8 +28,6 @@ void test(){
     vkvg_destroy (ctx);
     vkvg_surface_destroy (surf2);
     vkvg_pattern_destroy (pat);
-
-    vkvg_destroy(ctx);
 }
 
 int main(int argc, char *argv[]) {
index aad4afabd6f92d570ad25c2a3057a14ced5a4efb..67ebbb48faa60ee2162e1871496a22cb56908e75 100644 (file)
@@ -1,9 +1,74 @@
 #include "test.h"
 
+static const char* txt = "The quick brown fox jumps over the lazy dog";
+
+void print(VkvgContext ctx, float penY, uint32_t size) {
+    vkvg_set_font_size(ctx,size);
+    vkvg_move_to(ctx, 10,penY);
+    vkvg_show_text (ctx,txt);
+}
+
+void test2() {
+    VkvgContext ctx = vkvg_create(surf);
+
+    vkvg_color_t bg = {0.3,0.3,0.3,1};
+    vkvg_color_t fg = {0.9,0.9,0.9,1};
+
+    vkvg_set_source_rgba(ctx,bg.r,bg.g,bg.b,bg.a);
+    vkvg_paint(ctx);
+    vkvg_set_source_rgba(ctx,fg.r,fg.g,fg.b,fg.a);
+    //vkvg_select_font_face(ctx, "droid");
+    vkvg_select_font_face(ctx, "times");
+
+
+    float penY = 10.f;
+
+    for (uint32_t size=8;size<39;size++) {
+        print(ctx,penY+=size,size);
+    }
+
+    vkvg_destroy(ctx);
+}
+void test1() {
+    VkvgContext ctx = vkvg_create(surf);
+
+    vkvg_color_t fg = {0.0,0.0,0.0,1};
+    vkvg_color_t bg = {0.9,0.9,0.9,1};
+
+    vkvg_set_source_rgba(ctx,bg.r,bg.g,bg.b,bg.a);
+    vkvg_paint(ctx);
+    vkvg_set_source_rgba(ctx,fg.r,fg.g,fg.b,fg.a);
+
+    uint32_t size = 8;
+    float penY = 100.f;
+
+    vkvg_set_font_size(ctx,size);
+
+    vkvg_select_font_face(ctx, "mono");
+    vkvg_move_to(ctx, 100,penY);
+    vkvg_show_text (ctx,txt);
+
+    penY += 1.2f * size;
+
+    vkvg_select_font_face(ctx, "times");
+    vkvg_move_to(ctx, 100, penY);
+    vkvg_show_text (ctx,txt);
+
+    penY += 1.2f * size;
+
+    vkvg_select_font_face(ctx, "arial:italic");
+    vkvg_move_to(ctx, 100, penY);
+    vkvg_show_text (ctx,txt);
+
+    vkvg_destroy(ctx);
+}
 void test(){
     VkvgContext ctx = vkvg_create(surf);
 
-    vkvg_set_source_rgba(ctx,0.9,0.9,0.9,1);
+    //vkvg_color_t fg = {0.2,0.2,0.2,1};
+    vkvg_color_t fg = {0.0,0.0,0.0,1};
+    vkvg_color_t bg = {0.9,0.9,0.9,1};
+    vkvg_set_source_rgba(ctx,bg.r,bg.g,bg.b,bg.a);
     vkvg_paint(ctx);
 
     int size = 19;
@@ -21,7 +86,7 @@ void test(){
     vkvg_font_extents_t fe;
     vkvg_font_extents (ctx,&fe);
     vkvg_move_to(ctx, penX,penY);
-    vkvg_set_source_rgba(ctx,0.1,0.1,0.1,1);
+    vkvg_set_source_rgba(ctx,fg.r,fg.g,fg.b,fg.a);
     vkvg_text_extents_t te;
     vkvg_text_extents(ctx,"abcdefghijk",&te);
     vkvg_show_text (ctx,"abcdefghijk");
@@ -31,7 +96,6 @@ void test(){
     penY+=2*size;
 
     vkvg_select_font_face(ctx, "times");
-    vkvg_set_source_rgba(ctx,0.1,0.1,0.2,1);
     vkvg_move_to(ctx, penX,penY);
     vkvg_show_text (ctx,"abcdefghijklmnopqrstuvwxyz");
     penY+=size;
@@ -90,7 +154,7 @@ void test(){
 
 int main(int argc, char *argv[]) {
 
-    perform_test (test, 1024, 768);
+    perform_test (test2, 1024, 768);
 
     return 0;
 }