[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2] gsoc-anurag-2022-final dba1c48f7 12/32: Temp fix for upside-
From: |
Werner Lemberg |
Subject: |
[freetype2] gsoc-anurag-2022-final dba1c48f7 12/32: Temp fix for upside-down bitmap |
Date: |
Sun, 13 Nov 2022 23:49:24 -0500 (EST) |
branch: gsoc-anurag-2022-final
commit dba1c48f74003d15423414c6293d6963323f6af0
Author: Anurag Thakur <anurag105csec21@bpitindia.edu.in>
Commit: Anurag Thakur <anurag105csec21@bpitindia.edu.in>
Temp fix for upside-down bitmap
---
modules.cfg | 2 +-
src/dense/ftdense.c | 18 ++++++++++++++++++
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/modules.cfg b/modules.cfg
index 9aa857061..7b7d32e34 100644
--- a/modules.cfg
+++ b/modules.cfg
@@ -97,7 +97,7 @@ RASTER_MODULES += dense
# Anti-aliasing rasterizer.
RASTER_MODULES += smooth
-# RASTER_MODULES += dense
+#RASTER_MODULES += dense
# Monochrome rasterizer.
RASTER_MODULES += raster
diff --git a/src/dense/ftdense.c b/src/dense/ftdense.c
index 763b03dfe..8cffc20e9 100644
--- a/src/dense/ftdense.c
+++ b/src/dense/ftdense.c
@@ -416,6 +416,12 @@ FT_DEFINE_OUTLINE_FUNCS( dense_decompose_funcs,
0 /* delta */
)
+void swap(unsigned char *a, unsigned char *b){
+ unsigned char temp = *a;
+ *a = *b;
+ *b = temp;
+}
+
/* @QUES: So, this calls FT_Outline_Decompose, that calls the move to,
line to, conic to, cubic to interface methods. The aRasterFP structure stores
the
well, stuff in its m_a and finally renders it to the target->buffer*/
@@ -476,6 +482,18 @@ dense_render_glyph( RasterFP* aRasterFP, const FT_Bitmap*
target )
*dest = 0;
dest++;
}
+
+
+ for (int col = 0; col < aRasterFP->m_w; col++)
+ {
+ for (int row = 0; row < aRasterFP->m_h/2; row++)
+ {
+ //printf("Swapping position: %d, %d with %d, %d with rows = %d, cols =
%d",row,col, aRasterFP->m_h-row, col, aRasterFP->m_h, aRasterFP->m_w);
+ swap(target->buffer + aRasterFP->m_w*row + col, target->buffer +
(aRasterFP->m_h-row-1)*aRasterFP->m_w + col);
+ }
+
+ }
+
return error;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2] gsoc-anurag-2022-final dba1c48f7 12/32: Temp fix for upside-down bitmap,
Werner Lemberg <=