summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKushal K S V S <kkushal32@gmail.com>2017-07-14 18:22:08 +0530
committerKushal K S V S <kkushal32@gmail.com>2018-03-18 20:40:44 +0530
commitf03d33e195ff894513caf38dbb04b3746583e943 (patch)
treeaf121971da3fc2edaaef1f0f32fd01cd924c8ae8
parentbe682f28851e2ee3cdcf4883a2baae0a36fa5a2e (diff)
downloadfreetype2-f03d33e195ff894513caf38dbb04b3746583e943.tar.gz
Fixed Monochrome PNG rendering
-rw-r--r--tests/make_png/README2
-rw-r--r--tests/make_png/make_sprite.c93
2 files changed, 48 insertions, 47 deletions
diff --git a/tests/make_png/README b/tests/make_png/README
index 0adb54318..4a1523d33 100644
--- a/tests/make_png/README
+++ b/tests/make_png/README
@@ -2,7 +2,7 @@ NOTE: First make freetype library (in the ../../ directory)
make devel
make
-TODO: Monochrome sprite sheets.
+TODO: Generate HTML page (testing going on)
/*******************************************************************/
diff --git a/tests/make_png/make_sprite.c b/tests/make_png/make_sprite.c
index b2304d300..3a7e8ab97 100644
--- a/tests/make_png/make_sprite.c
+++ b/tests/make_png/make_sprite.c
@@ -362,66 +362,67 @@ int main(int argc, char const *argv[])
test_murmur->hash[3]);
Is_Different = strcmp(base_hash, test_hash);
-
-// Mono rendering not working right now, will put it today
- // Base_Bitmap_Init( &base_target );
- // Test_Bitmap_Init( &test_target );
-
- // error = Base_Bitmap_Convert( base_library,
- // base_bitmap,
- // &base_target,
- // alignment);
- // if(error){
- // printf("Error converting the bitmap\n");
- // exit(1);
- // }
- // error = Test_Bitmap_Convert( test_library,
- // test_bitmap,
- // &test_target,
- // alignment);
- // if(error){
- // printf("Error converting the bitmap\n");
- // exit(1);
- // }
+
+ Base_Bitmap_Init( &base_target );
+ Test_Bitmap_Init( &test_target );
+
+ error = Base_Bitmap_Convert( base_library,
+ base_bitmap,
+ &base_target,
+ alignment);
+ if(error){
+ printf("Error converting the bitmap\n");
+ exit(1);
+ }
+ error = Test_Bitmap_Convert( test_library,
+ test_bitmap,
+ &test_target,
+ alignment);
+ if(error){
+ printf("Error converting the bitmap\n");
+ exit(1);
+ }
sprintf( output_file_name, "./images/sprite_%d.png", i );
- if ( Is_Different != 0 )
+ if (Is_Different != 0)
{
- if ( render_mode == 0 )
+ if (render_mode == 0)
{
- // Monochrome rendering to be added
+ Make_PNG( &base_target, base_png, i, render_mode );
+ Make_PNG( &test_target, test_png, i, render_mode );
+
}else{
Make_PNG( base_bitmap, base_png, i, render_mode );
Make_PNG( test_bitmap, test_png, i, render_mode );
+ }
+
+ if (base_png->height < test_png->height)
+ {
+ base_png = Adjust_Height(base_png, test_png);
+ }else if (base_png->height > test_png->height)
+ {
+ test_png = Adjust_Height(test_png, base_png);
+ }
- if ( base_png->height < test_png->height)
- {
- base_png = Adjust_Height(base_png, test_png );
- }else if ( base_png->height > test_png->height )
- {
- test_png = Adjust_Height(test_png, base_png );
- }
-
- if ( base_png->width < test_png->width )
- {
- base_png = Adjust_Width(base_png, test_png );
- }else if ( base_png->width > test_png->width )
- {
- test_png = Adjust_Width(test_png, base_png );
- }
+ if (base_png->width < test_png->width)
+ {
+ base_png = Adjust_Width(base_png, test_png);
+ }else if (base_png->width > test_png->width)
+ {
+ test_png = Adjust_Width(test_png, base_png);
+ }
- Add_effect( base_png, test_png, after_effect_1, 1 );
- Add_effect( base_png, test_png, after_effect_2, 2 );
+ Add_effect( base_png, test_png, after_effect_1, 1);
+ Add_effect( base_png, test_png, after_effect_2, 2);
- Stitch( base_png, test_png, combi_effect_1);
- Stitch( after_effect_1, after_effect_2, combi_effect_2 );
+ Stitch( base_png, test_png, combi_effect_1);
+ Stitch( after_effect_1, after_effect_2, combi_effect_2);
- Stitch( combi_effect_1, combi_effect_2, output );
+ Stitch( combi_effect_1, combi_effect_2, output);
- Generate_PNG ( output, output_file_name, render_mode );
- }
+ Generate_PNG ( output, output_file_name, render_mode );
}
}