[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-imaging
Subject: [Kde-imaging] libksane and returned data
From: Kåre_Särs <kare.sars () kolumbus ! fi>
Date: 2007-11-23 12:24:29
Message-ID: 200711231424.29853.kare.sars () kolumbus ! fi
[Download RAW message or body]
Hi,
I'm just about ready with 16 bit color scanning for libksane. The only thing
to decide now is how to provide the scanned data (this is also a 8bit color
problem).
The problem is that sane returns 3 bytes/pixel for 8 bit color mode (not 4
bytes as QImage requires) and 6 bytes/pixel for 16bit color mode. The problem
is not how to convert the data, but what format the user would want the data.
There is at least two alternatives:
1) I return the data as is (3 bytes/pixel for 8 bit color and 6 bytes/pixel
for 16 bit colors) and provide a function to add the alpha channel or return
a QImage
or
2) return the data with an added "alpha channel" (4 and 8 bytes / pixel)
alternative 1) Would return a smaller buffer, but if the data has to be copied
to another buffer to make room for the alpha channel, that first smaller
buffer would just be waisted memory...
In any case I'm going to providing a convenience function that returns a
QImage.
/Kåre Särs
_______________________________________________
Kde-imaging mailing list
Kde-imaging@kde.org
https://mail.kde.org/mailman/listinfo/kde-imaging
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic