summaryrefslogtreecommitdiff
path: root/tools/fontgen/generator.cc
diff options
context:
space:
mode:
authorLars Muldjord <muldjordlars@gmail.com>2016-11-22 18:25:48 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2016-12-02 16:59:34 +0100
commitdff9a48319ca29beab56c85696f11770b3157bea (patch)
tree18eed18855ce9dfa12897b98c1ea7143686c2e01 /tools/fontgen/generator.cc
parent13e0da6196547c6b408d56c469b93c026747bbcd (diff)
Substituted pixelColor with pixel to support older versions of Qt5
Diffstat (limited to 'tools/fontgen/generator.cc')
-rw-r--r--tools/fontgen/generator.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/fontgen/generator.cc b/tools/fontgen/generator.cc
index 2ff0955..4e449f9 100644
--- a/tools/fontgen/generator.cc
+++ b/tools/fontgen/generator.cc
@@ -146,7 +146,7 @@ int Generator::getVertOffset(const QImage &image)
{
for(int y = 0; y < maxSize; ++y) {
for(int x = 0; x < maxSize; ++x) {
- if(image.pixelColor(x, y) != Qt::transparent) {
+ if(qAlpha(image.pixel(x, y)) != 0) {
return y;
}
}
@@ -158,7 +158,7 @@ int Generator::getFontHeight(const QImage &image, const int &vertOffset)
{
for(int y = maxSize - 1; y > vertOffset; --y) {
for(int x = 0; x < maxSize; ++x) {
- if(image.pixelColor(x, y) != Qt::transparent) {
+ if(qAlpha(image.pixel(x, y)) != 0) {
return y + 1 - vertOffset;
}
}
@@ -171,7 +171,7 @@ int Generator::getHorizOffset(const QImage &image)
for(int x = 0; x < maxSize; ++x) {
for(int y = 0; y < maxSize; ++y) {
// Check for alpha threshold to make sure we don't get too much space between chars
- if(image.pixelColor(x, y).alpha() > ALPHATHRES) {
+ if(qAlpha(image.pixel(x, y)) > ALPHATHRES) {
return x;
}
}
@@ -184,7 +184,7 @@ int Generator::getFontWidth(const QImage &image, const int &horizOffset)
for(int x = maxSize - 1; x > horizOffset; --x) {
for(int y = 0; y < maxSize; ++y) {
// Check for alpha threshold to make sure we don't get too much space between chars
- if(image.pixelColor(x, y).alpha() > ALPHATHRES) {
+ if(qAlpha(image.pixel(x, y)) > ALPHATHRES) {
return x + 1 - horizOffset;
}
}