[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-imaging
Subject:    Re: [Kde-imaging] libksane and returned data
From:       Kåre_Särs <kare.sars () kolumbus ! fi>
Date:       2007-11-24 17:59:35
Message-ID: 200711241959.35508.kare.sars () kolumbus ! fi
[Download RAW message or body]

On Friday 23 November 2007 15:41:46 Gilles Caulier wrote:
> This is not a problem, QImage support RGA32 mode without alpha channel for
> 8 bits color depth.
>
> http://doc.trolltech.com/4.3/qimage.html#fromData-2
>

"QImage QImage::fromData ( const QByteArray & data, const char * format = 0 )   
[static]"

Isn't this for loading a coded (jpeg, PNG or .....) image? How would Qt know 
the size of the image?

> and 6 bytes/pixel for 16bit color mode.
>
>
> You cannot use QImage here. You must use a QByteArray container to host all
> raw image data in RGA. Look how my KPWriteImage class work in this case:

I'm planning to return the data in a QByteArray (+ size and format info) and 
the user could use the data directly or use the convenience function. 
The "toQImage"  function would give a warning if it converts from 16bit 
colors.
 
If it actually works to trivially generate a QImage from a 3bytes/pixel 
QByteArray, alternative 1) would be the best, but as far as I can see that is 
not possible :(

There is a similar problem with grayscale :) sane returns 1 byte/pixel, while 
QImage doesn't have this mode.

Mono (black and white) should not be a problem :)

Cheers,
    Kåre
_______________________________________________
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