[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2] gsoc-anurag-2022-final 47aa94057 27/32: Fixed point working
From: |
Werner Lemberg |
Subject: |
[freetype2] gsoc-anurag-2022-final 47aa94057 27/32: Fixed point working now |
Date: |
Sun, 13 Nov 2022 23:49:27 -0500 (EST) |
branch: gsoc-anurag-2022-final
commit 47aa940577019f4154bf6bf567c58ae344ff77bb
Author: Anurag Thakur <anurag105csec21@bpitindia.edu.in>
Commit: Anurag Thakur <anurag105csec21@bpitindia.edu.in>
Fixed point working now
---
src/dense/ftdense.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/dense/ftdense.c b/src/dense/ftdense.c
index 845d11699..deae76a8c 100644
--- a/src/dense/ftdense.c
+++ b/src/dense/ftdense.c
@@ -188,14 +188,12 @@ dense_render_line( dense_worker* worker, TPos tox, TPos
toy )
if ( x1i <= x0i + 1 )
{
- //printf("Hit condition 1\n");
FT26D6 xmf = ( ( x + xnext )>>1) - x0floor;
m_a[linestart + x0i] += d * ((1<<6) - xmf);
m_a[linestart + ( x0i + 1 )] += d * xmf;
}
else
{
- //printf("Hit condition 2\n");
// float s = 1.0f / ( x1 - x0 );
// float x0f = x0 - x0floor;
// float a0 = 0.5f * s * ( 1.0f - x0f ) * ( 1.0f - x0f );
@@ -208,9 +206,12 @@ dense_render_line( dense_worker* worker, TPos tox, TPos
toy )
FT26D6 oneMinusX0f = (1<<6) - x0f;
FT26D6 a0 = ((oneMinusX0f * oneMinusX0f) >> 1) /
oneOverS;
- FT26D6 x1f = x1 - x1ceil + 1<<6;
+ FT26D6 x1f = x1 - x1ceil + (1<<6);
FT26D6 am = ((x1f * x1f) >> 1) / oneOverS;
+ // printf("x0 is %lld, x1 is %lld\n",x0,x1 );
+
+
m_a[linestart + x0i] += d * a0;
@@ -218,7 +219,6 @@ dense_render_line( dense_worker* worker, TPos tox, TPos toy
)
m_a[linestart + ( x0i + 1 )] += d * ( (1<<6) - a0 - am );
else
{
- //printf("Hit condition 3\n");
FT26D6 a1 = (((1<<6) + (1<<5) - x0f) << 6) / oneOverS;
m_a[linestart + ( x0i + 1 )] += d * ( a1 - a0 );
@@ -449,7 +449,7 @@ dense_render_glyph( dense_worker* worker, const FT_Bitmap*
target )
// printf("%d\n", *source);
if(valnew > 0){
- int nnew = valnew >>2;
+ int nnew = valnew >>4;
if(nnew>255)nnew=255;
*dest = (unsigned char)nnew;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2] gsoc-anurag-2022-final 47aa94057 27/32: Fixed point working now,
Werner Lemberg <=