PDA

View Full Version : getRow() function implementation - QLuminanceSorce (zxing)



behlkush
21st April 2011, 08:30
Hi All,

We are building a decoder application on Symbian which uses zxing.
We need to port the app from zxing 1.5 to 1.6 (due to slow performance in decoding data matrix on 1.5).

We are facing a number of issues mentioned below:
1. From 1.5 to 1.6 prototypes of certain functions that we were using have changed.
- getPixel() of LuminanceSource has been replaced by getRow().
If there is any getRow() implementation avaialable, please share the same.

2. There is an implementation of a derived class GreyscaleLuminanceSource in zxing 1.6 that inherits LuminaneSource, which in turn implements getRow().
The constructor of GreyscaleLuminanceSource class takes unsigned char* greyData as a parameter which is supposedly the image data.

3. Another problem is how can we get this data from QImage that is being captured by camera in our application.
Is there a working code to get the data of Qimage using scanLine Qt library function?


Thanks,
Kush

behlkush
21st April 2011, 08:34
Hi all,

Is there a way to get the image data from QImage using scanLine function.

Can any one share the code.


Many Thanks,
Kush

high_flyer
21st April 2011, 10:00
We are facing a number of issues mentioned below:
1. From 1.5 to 1.6 prototypes of certain functions that we were using have changed.
- getPixel() of LuminanceSource has been replaced by getRow().
If there is any getRow() implementation avaialable, please share the same.

2. There is an implementation of a derived class GreyscaleLuminanceSource in zxing 1.6 that inherits LuminaneSource, which in turn implements getRow().
The constructor of GreyscaleLuminanceSource class takes unsigned char* greyData as a parameter which is supposedly the image data.

What does this have to do with Qt?


3. Another problem is how can we get this data from QImage that is being captured by camera in our application.
Is there a working code to get the data of Qimage using scanLine Qt library function?
Did you even look at the QImage doc before asking here?
QImage::constScanLine() makes sense to me.

behlkush
21st April 2011, 10:42
What does this have to do with Qt?
- We are building an application on QT Creator so thought may be QT community can be a help.

Did you even look at the QImage doc before asking here?
QImage::constScanLine() makes sense to me.
- Any programmer will do that and I did it as well. In the question itself i had asked is there a working code (example) that uses scanLine method of QT Library?

It was just a humble post as we are stuck up in the middle and was extecting to get some positive replies.


Any ways thanks for letting me know that I have posted this at a wrong place.

- Kush

high_flyer
21st April 2011, 11:19
- We are building an application on QT Creator so thought may be QT community can be a help.
Well, if you would develop this on MSVC would you post this on an MSVC forum too?
The two first questions have nothing to do with Qt - just because you are using Qt Creator as an IDE.

Did you even look at the QImage doc before asking here?
QImage::constScanLine() makes sense to me.
- Any programmer will do that and I did it as well. In the question itself i had asked is there a working code (example) that uses scanLine method of QT Library?
You will be surprosed how many do NOT look first at the docs!
In any case, what working code are you looking for?
You call QImage::constScanLine() and you get a pointer to the scan line - and that is what you asked for.
If there is something which is not clear to you, you should explain what that is, as none of us is has psychic powers to read you mind.


It was just a humble post as we are stuck up in the middle and was extecting to get some positive replies.

If you want positive replies, make sure you post clear questions, that are on topic!


Any ways thanks for letting me know that I have posted this at a wrong place.
For Qt related questions this is the right place.
But more than the wrong place your post should be more explicit and on topic.

For non Qt related issue we have a 'General Programming' section.

P.S
Multi posting doesn't help you case either.

behlkush
21st April 2011, 12:00
The QImage::constScanLine(int i)/ QImage::scanLine(int i) function as per the library returns the pixel data at the scanline with index i.

What our requirement is we want to call scanLine for all the lines that are present in the QImage image.
It requires a loop to go through each line and repeatedly call scanLine for all the lines of QImage.

What we are looking for is a code example that gathers all the data from all the lines using scanLine function.


Any help regarding this would be highly appreciated.

Also, I would try to be more clear and not offend any ones sentiments by posting non-QT related issues under proper section.


Thanks,
Kush

high_flyer
21st April 2011, 12:56
What our requirement is we want to call scanLine for all the lines that are present in the QImage image.
It requires a loop to go through each line and repeatedly call scanLine for all the lines of QImage.

What we are looking for is a code example that gathers all the data from all the lines using scanLine function.

What do you mean with gather?
The data is gathered IN the QImage, so just gathering it again wont bring much.
I guess you want to preform some operation on the line data?

You just wrote in words that you need a loop that will call scanLine() for each line of the image.
If you know what for() statement is, than where is the problem to translate that in to code?



for(int i=0; i <m_pImage->height(); i++)
{
doSomeWorkOnTheDataFunc( m_pImage->scanLine(i) );
}

behlkush
25th April 2011, 05:01
Actually the requirement is that we collect the image data in unisigned char*