From: Jerome St-Louis Date: Sun, 5 Apr 2015 03:45:03 +0000 (-0400) Subject: ecere/gfx/LFBDisplayDriver: Fixed up outlines X-Git-Url: https://ecere.com/cgi-bin/gitweb.cgi?p=sdk;a=commitdiff_plain;h=872a74f2c306b9c40cae16a269da3ad2952c3aa5 ecere/gfx/LFBDisplayDriver: Fixed up outlines --- diff --git a/ecere/src/gfx/drivers/LFBDisplayDriver.ec b/ecere/src/gfx/drivers/LFBDisplayDriver.ec index ff2add5..04d7d68 100644 --- a/ecere/src/gfx/drivers/LFBDisplayDriver.ec +++ b/ecere/src/gfx/drivers/LFBDisplayDriver.ec @@ -74,7 +74,7 @@ static void ComputeOutline(byte *out, byte *src, uint w, uint h, float size, flo float inv_rw = 1/(rb-ra); for(i = 0; i < numPixels; i++) - data[i] = src[i] / 255; + data[i] = src[i] / 255.0f; computegradient(data, w, h, gx, gy); edtaa3(data, gx, gy, w, h, distx, disty, dist); @@ -148,81 +148,6 @@ static void MeasureOutline(byte * image, int w, int h, int * _x1, int * _y1, int #endif -/* -static byte * MakeDistanceMap( byte *out, byte *img, uint width, uint height, int k, int t ) -{ - short * xdist = new short[ width * height]; - short * ydist = new short[ width * height]; - float * gx = new float[ width * height]; - float * gy = new float[ width * height]; - float * data = new float[ width * height]; - float * outside = new float[ width * height]; - float * inside = new float[ width * height]; - int i; - k = 80; - t = 0; - - // Convert img into float (data) - float img_min = 255, img_max = -255; - for( i=0; i img_max) img_max = v; - if (v < img_min) img_min = v; - } - - if(img_max > 0) - { - // Rescale image levels between 0 and 1 - for( i=0; i 255 ) outside[i] = 255; - out[i] = 255 - (byte) outside[i]; - //out[i] = (byte) outside[i]; - } - } - else - memset(out, 0, width * height); - - delete xdist; - delete ydist; - delete gx; - delete gy; - delete data; - delete outside; - delete inside; - return out; -} -*/ - #define MAX_FONT_LINK_ENTRIES 10 static HB_Script theCurrentScript; @@ -916,7 +841,7 @@ class GlyphPack : BTNode if(flags) strcat(fileName, "Bold"); */ - sprintf(fileName, "font%d", fid++); + sprintf(fileName, "outline%d", fid++); ChangeExtension(fileName, "pcx", fileName); outline.bitmap.Save(fileName, null, 0);