diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-02 06:40:27 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-02 06:40:27 +0000 |
commit | 2595a15ebeb6fc46b7cb241d01ec0c2460ec2111 (patch) | |
tree | 18a8f0f4ac5a86dacfa74c3537551ec39bc85e75 /src/barcode | |
parent | 1d90725a4001fab9d3922b2cbcceeee5e2d1686f (diff) | |
download | tellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.tar.gz tellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.zip |
TQt4 port tellico
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/tellico@1239054 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/barcode')
-rw-r--r-- | src/barcode/barcode.cpp | 96 | ||||
-rw-r--r-- | src/barcode/barcode.h | 51 | ||||
-rw-r--r-- | src/barcode/barcode_v4l.cpp | 36 | ||||
-rw-r--r-- | src/barcode/barcode_v4l.h | 36 |
4 files changed, 110 insertions, 109 deletions
diff --git a/src/barcode/barcode.cpp b/src/barcode/barcode.cpp index 2427f4e..1c2d1f2 100644 --- a/src/barcode/barcode.cpp +++ b/src/barcode/barcode.cpp @@ -15,8 +15,8 @@ // includes code from http://v4l2spec.bytesex.org/spec/a16323.htm -#include <qimage.h> -#include <qmutex.h> +#include <tqimage.h> +#include <tqmutex.h> #include "barcode.h" #include <stdlib.h> @@ -53,13 +53,13 @@ void barcodeRecognitionThread::run() Barcode_EAN13 old; while (!stop) { - QImage img; + TQImage img; m_barcode_img_mutex.lock(); if (m_barcode_img.isNull()) img = m_barcode_v4l->grab_one2(); else { img = m_barcode_img; - m_barcode_img = QImage(); + m_barcode_img = TQImage(); } m_barcode_img_mutex.unlock(); @@ -69,7 +69,7 @@ void barcodeRecognitionThread::run() // //DEBUG if (!img.isNull()) { - QImage preview = img.scale( 320, 240, QImage::ScaleMin ); + TQImage preview = img.scale( 320, 240, TQ_ScaleMin ); emit gotImage( preview ); Barcode_EAN13 barcode = recognize( img ); if (barcode.isValid() && (old != barcode)) { @@ -94,7 +94,7 @@ void barcodeRecognitionThread::stop() } -void barcodeRecognitionThread::recognizeBarcode( QImage img ) +void barcodeRecognitionThread::recognizeBarcode( TQImage img ) { // attention! This function is called from GUI context m_barcode_img_mutex.lock(); @@ -102,7 +102,7 @@ void barcodeRecognitionThread::recognizeBarcode( QImage img ) m_barcode_img_mutex.unlock(); } -Barcode_EAN13 barcodeRecognitionThread::recognize( QImage img ) +Barcode_EAN13 barcodeRecognitionThread::recognize( TQImage img ) { // PARAMETERS: int amount_scanlines = 30; @@ -110,7 +110,7 @@ Barcode_EAN13 barcodeRecognitionThread::recognize( QImage img ) int h = img.height(); // the array which will contain the result: - QValueVector< QValueVector<int> > numbers( amount_scanlines, QValueVector<int>(13,-1) ); // no init in java source!!!!!!!!! + TQValueVector< TQValueVector<int> > numbers( amount_scanlines, TQValueVector<int>(13,-1) ); // no init in java source!!!!!!!!! // generate and initialize the array that will contain all detected // digits at a specific code position: @@ -170,14 +170,14 @@ Barcode_EAN13 barcodeRecognitionThread::recognize( QImage img ) void barcodeRecognitionThread::printArray( int array[10][13][2], int level ) { for (int i = 0; i < 10; i++) { - QCString temp; + TQCString temp; temp.setNum( i ); fprintf( stderr, temp + " : " ); for (int j = 0; j < 13; j++) { if (array[i][j][level] == -1) fprintf( stderr, "x " ); else { - QCString temp; + TQCString temp; temp.setNum( array[i][j][level] ); fprintf( stderr, temp + " " ); } @@ -186,20 +186,20 @@ void barcodeRecognitionThread::printArray( int array[10][13][2], int level ) } } -barcodeRecognition::Barcode_EAN13 barcodeRecognitionThread::recognizeCode( QImage img, int x1, int x2, int y ) +barcodeRecognition::Barcode_EAN13 barcodeRecognitionThread::recognizeCode( TQImage img, int x1, int x2, int y ) { - QValueVector<QRgb> raw_path(x2-x1+1); + TQValueVector<TQRgb> raw_path(x2-x1+1); for (int x=x1; x<=x2; x++) raw_path[x-x1] = img.pixel(x,y); // convert the given path into a string of black and white pixels: - QValueVector<int> string = transformPathToBW( raw_path ); + TQValueVector<int> string = transformPathToBW( raw_path ); // convert the string of black&white pixels into a list, containing // information about the black and white fields // first indes = field nr. // second index: 0 = color of the field // 1 = field length - QValueVector< QValueVector<int> > fields = extractFieldInformation( string ); + TQValueVector< TQValueVector<int> > fields = extractFieldInformation( string ); // try to recognize a EAN13 code: Barcode_EAN13 barcode = Decoder_EAN13::recognize( fields ); @@ -207,7 +207,7 @@ barcodeRecognition::Barcode_EAN13 barcodeRecognitionThread::recognizeCode( QImag return barcode; } -void barcodeRecognitionThread::addNumberToPossibleNumbers( QValueVector<int> number, int possible_numbers[10][13][2], bool correct_code ) +void barcodeRecognitionThread::addNumberToPossibleNumbers( TQValueVector<int> number, int possible_numbers[10][13][2], bool correct_code ) { int i; bool digit_contained; @@ -278,7 +278,7 @@ void barcodeRecognitionThread::sortDigits( int possible_numbers[10][13][2] ) Barcode_EAN13 barcodeRecognitionThread::extractBarcode( int possible_numbers[10][13][2] ) { // create and initialize the temporary variables: - QValueVector<int> temp_code(13); + TQValueVector<int> temp_code(13); for (int i = 0; i < 13; i++) temp_code[i] = possible_numbers[0][i][0]; @@ -295,13 +295,13 @@ Barcode_EAN13 barcodeRecognitionThread::extractBarcode( int possible_numbers[10] Barcode_EAN13 barcodeRecognitionThread::detectValidBarcode ( int possible_numbers[10][13][2], int max_amount_of_considered_codes ) { // create and initialize the temporary variables: - QValueVector<int> temp_code(13); + TQValueVector<int> temp_code(13); for ( int i = 0; i < 13; i++ ) temp_code[i] = possible_numbers[0][i][0]; int alternative_amount = 0; - QValueVector<int> counter( 13 ); // no init in java source!!! + TQValueVector<int> counter( 13 ); // no init in java source!!! int counter_nr = 11; // check if there is at least one complete code present: @@ -367,12 +367,12 @@ Barcode_EAN13 barcodeRecognitionThread::detectValidBarcode ( int possible_number bool barcodeRecognitionThread::isValid( int numbers[13] ) { - QValueVector<int> temp(13); + TQValueVector<int> temp(13); for (int i=0; i<13; i++) temp[i] = numbers[i]; return isValid( temp ); } -bool barcodeRecognitionThread::isValid( QValueVector<int> numbers ) +bool barcodeRecognitionThread::isValid( TQValueVector<int> numbers ) { Q_ASSERT( numbers.count() == 13 ); // calculate the checksum of the barcode: @@ -393,17 +393,17 @@ bool barcodeRecognitionThread::isValid( QValueVector<int> numbers ) return (numbers[12] == checksum_digit); } -QValueVector<int> barcodeRecognitionThread::transformPathToBW( QValueVector<QRgb> line ) +TQValueVector<int> barcodeRecognitionThread::transformPathToBW( TQValueVector<TQRgb> line ) { int w = line.count(); - QValueVector<int> bw_line(w,0); + TQValueVector<int> bw_line(w,0); bw_line[0] = 255; // create greyscale values: - QValueVector<int> grey_line(w,0); + TQValueVector<int> grey_line(w,0); int average_illumination = 0; for (int x = 0; x < w; x++) { - grey_line[x] = (qRed(line.at(x)) + qGreen(line.at(x)) + qBlue(line.at(x))) / 3; + grey_line[x] = (tqRed(line.at(x)) + tqGreen(line.at(x)) + tqBlue(line.at(x))) / 3; average_illumination = average_illumination + grey_line[x]; } average_illumination = average_illumination / w; @@ -452,7 +452,7 @@ QValueVector<int> barcodeRecognitionThread::transformPathToBW( QValueVector<QRgb } } - QValueVector<int> ret(w,0); + TQValueVector<int> ret(w,0); for (int i=0; i<w; i++) ret[i] = bw_line[i]; @@ -469,12 +469,12 @@ QValueVector<int> barcodeRecognitionThread::transformPathToBW( QValueVector<QRgb return ret; } -QValueVector< QValueVector<int> > barcodeRecognitionThread::extractFieldInformation( QValueVector<int> string ) +TQValueVector< TQValueVector<int> > barcodeRecognitionThread::extractFieldInformation( TQValueVector<int> string ) { - QValueVector< QValueVector<int> > temp_fields( string.count(), QValueVector<int>(2,0) ); + TQValueVector< TQValueVector<int> > temp_fields( string.count(), TQValueVector<int>(2,0) ); if (string.count() == 0) - return QValueVector< QValueVector<int> >(); + return TQValueVector< TQValueVector<int> >(); int field_counter = 0; int last_value = string.at(0); @@ -513,13 +513,13 @@ Barcode_EAN13::Barcode_EAN13() } //ok -Barcode_EAN13::Barcode_EAN13( QValueVector<int> code ) +Barcode_EAN13::Barcode_EAN13( TQValueVector<int> code ) { setCode( code ); } //ok -void Barcode_EAN13::setCode( QValueVector<int> code ) +void Barcode_EAN13::setCode( TQValueVector<int> code ) { if (code.count() != 13) { m_numbers.clear(); @@ -553,18 +553,18 @@ bool Barcode_EAN13::isValid() const } //ok -QValueVector<int> Barcode_EAN13::getNumbers() const +TQValueVector<int> Barcode_EAN13::getNumbers() const { return m_numbers; } //ok -QString Barcode_EAN13::toString() const +TQString Barcode_EAN13::toString() const { - QString s; + TQString s; for (int i = 0; i < 13; i++) if ((m_numbers[i] >= 0) && (m_numbers[i] <= 9)) - s += QString::number(m_numbers[i]); + s += TQString::number(m_numbers[i]); else s += '?'; return s; @@ -583,17 +583,17 @@ bool Barcode_EAN13::operator!= ( const Barcode_EAN13 &code ) } //ok -Barcode_EAN13 Decoder_EAN13::recognize( QValueVector< QValueVector<int> > fields ) +Barcode_EAN13 Decoder_EAN13::recognize( TQValueVector< TQValueVector<int> > fields ) { // try to extract the encoded information from the field series: - QValueVector<int> numbers = decode( fields, 0, fields.count() ); + TQValueVector<int> numbers = decode( fields, 0, fields.count() ); Barcode_EAN13 barcode( numbers ); // return the results: return barcode; } -QValueVector<int> Decoder_EAN13::decode( QValueVector< QValueVector<int> > fields, int start_i, int end_i ) +TQValueVector<int> Decoder_EAN13::decode( TQValueVector< TQValueVector<int> > fields, int start_i, int end_i ) { // determine the length of the path in pixels int length = 0; @@ -617,11 +617,11 @@ QValueVector<int> Decoder_EAN13::decode( QValueVector< QValueVector<int> > field // consistency checks: if (fields.count() <= 0) - return QValueVector<int>(); + return TQValueVector<int>(); if (start_i > end_i - 3) - return QValueVector<int>(); + return TQValueVector<int>(); if (end_i - start_i < 30) - return QValueVector<int>(); // (just a rough value) + return TQValueVector<int>(); // (just a rough value) // relevant indexes: int start_sentinel_i; @@ -634,7 +634,7 @@ QValueVector<int> Decoder_EAN13::decode( QValueVector< QValueVector<int> > field float unit_length; // results: - QValueVector<int> numbers( 13, -1 ); // the java source does no initialization + TQValueVector<int> numbers( 13, -1 ); // the java source does no initialization // determine the relevant positions: @@ -657,7 +657,7 @@ QValueVector<int> Decoder_EAN13::decode( QValueVector< QValueVector<int> > field #endif if (start_sentinel_i < 0) - return QValueVector<int>(); + return TQValueVector<int>(); // calculate the other positions: left_numbers_i = start_sentinel_i + 3; @@ -666,7 +666,7 @@ QValueVector<int> Decoder_EAN13::decode( QValueVector< QValueVector<int> > field end_sentinel_i = right_numbers_i + 6 * 4; if (end_sentinel_i + 3 > end_i) - return QValueVector<int>(); + return TQValueVector<int>(); // calculate the average (pixel) length of a bar that is one unit wide: // (a complete barcode consists out of 95 length units) @@ -680,10 +680,10 @@ QValueVector<int> Decoder_EAN13::decode( QValueVector< QValueVector<int> > field fprintf( stderr, "unit_width: %f\n", unit_length ); #endif - QValueVector< QValueVector<int> > current_number_field( 4, QValueVector<int>(2,0) ); + TQValueVector< TQValueVector<int> > current_number_field( 4, TQValueVector<int>(2,0) ); if (left_numbers_i + 1 > end_i) - return QValueVector<int>(); + return TQValueVector<int>(); // test the side from which we are reading the barcode: @@ -773,7 +773,7 @@ QValueVector<int> Decoder_EAN13::decode( QValueVector< QValueVector<int> > field return numbers; } -MatchMakerResult Decoder_EAN13::recognizeNumber( QValueVector< QValueVector<int> > fields, int code_table_to_use) +MatchMakerResult Decoder_EAN13::recognizeNumber( TQValueVector< TQValueVector<int> > fields, int code_table_to_use) { // convert the pixel lenghts of the four black&white fields into // normed values that have together a length of 70; @@ -799,7 +799,7 @@ MatchMakerResult Decoder_EAN13::recognizeNumber( QValueVector< QValueVector<int> int odd_min_difference_index = 0; if ((code_table_to_use == BOTH_TABLES)||(code_table_to_use == EVEN_TABLE)) { - QValueVector<int> even_differences(10,0); + TQValueVector<int> even_differences(10,0); for (int i = 0; i < 10; i++) { for (int j = 0; j < 4; j++) { @@ -818,7 +818,7 @@ MatchMakerResult Decoder_EAN13::recognizeNumber( QValueVector< QValueVector<int> } if ((code_table_to_use == BOTH_TABLES) || (code_table_to_use == ODD_TABLE)) { - QValueVector<int> odd_differences(10,0); + TQValueVector<int> odd_differences(10,0); for (int i = 0; i < 10; i++) { for (int j = 0; j < 4; j++) { diff --git a/src/barcode/barcode.h b/src/barcode/barcode.h index b8d71bc..6155108 100644 --- a/src/barcode/barcode.h +++ b/src/barcode/barcode.h @@ -16,11 +16,11 @@ #ifndef BARCODE_H #define BARCODE_H -#include <qthread.h> -#include <qimage.h> -#include <qvaluevector.h> -#include <qobject.h> -#include <qmutex.h> +#include <tqthread.h> +#include <tqimage.h> +#include <tqvaluevector.h> +#include <tqobject.h> +#include <tqmutex.h> #include <math.h> #include "barcode_v4l.h" @@ -66,15 +66,15 @@ namespace barcodeRecognition { class Barcode_EAN13 { public: Barcode_EAN13(); - Barcode_EAN13( QValueVector<int> code ); + Barcode_EAN13( TQValueVector<int> code ); bool isNull() const { return m_null; } bool isValid() const; - QValueVector<int> getNumbers() const; - void setCode( QValueVector<int> code ); - QString toString() const; + TQValueVector<int> getNumbers() const; + void setCode( TQValueVector<int> code ); + TQString toString() const; bool operator!= ( const Barcode_EAN13 &code ); protected: - QValueVector<int> m_numbers; + TQValueVector<int> m_numbers; bool m_null; }; @@ -91,43 +91,44 @@ namespace barcodeRecognition { class Decoder_EAN13 { public: enum { BOTH_TABLES = 0, EVEN_TABLE = 1, ODD_TABLE = 2 }; - static Barcode_EAN13 recognize( QValueVector< QValueVector<int> > fields ); - static QValueVector<int> decode( QValueVector< QValueVector<int> > fields, int start_i, int end_i ); - static MatchMakerResult recognizeNumber( QValueVector< QValueVector<int> > fields, int code_table_to_use ); + static Barcode_EAN13 recognize( TQValueVector< TQValueVector<int> > fields ); + static TQValueVector<int> decode( TQValueVector< TQValueVector<int> > fields, int start_i, int end_i ); + static MatchMakerResult recognizeNumber( TQValueVector< TQValueVector<int> > fields, int code_table_to_use ); static MatchMakerResult recognizeSystemCode( bool parity_pattern[6] ); }; /** \brief this thread handles barcode recognition using webcams * @author Sebastian Held <[email protected]> */ - class barcodeRecognitionThread : public QObject, public QThread { + class barcodeRecognitionThread : public TQObject, public TQThread { Q_OBJECT + TQ_OBJECT public: barcodeRecognitionThread(); ~barcodeRecognitionThread(); virtual void run(); void stop(); - void recognizeBarcode( QImage img ); + void recognizeBarcode( TQImage img ); bool isWebcamAvailable(); signals: - void recognized( QString barcode ); - void gotImage( QImage &img ); + void recognized( TQString barcode ); + void gotImage( TQImage &img ); protected: volatile bool m_stop; - QImage m_barcode_img; - QMutex m_stop_mutex, m_barcode_img_mutex; + TQImage m_barcode_img; + TQMutex m_stop_mutex, m_barcode_img_mutex; barcode_v4l *m_barcode_v4l; - Barcode_EAN13 recognize( QImage img ); - Barcode_EAN13 recognizeCode( QImage img, int x1, int x2, int y ); - void addNumberToPossibleNumbers( QValueVector<int> number, int possible_numbers[10][13][2], bool correct_code ); + Barcode_EAN13 recognize( TQImage img ); + Barcode_EAN13 recognizeCode( TQImage img, int x1, int x2, int y ); + void addNumberToPossibleNumbers( TQValueVector<int> number, int possible_numbers[10][13][2], bool correct_code ); void sortDigits( int possible_numbers[10][13][2] ); Barcode_EAN13 extractBarcode( int possible_numbers[10][13][2] ); - QValueVector<int> transformPathToBW( QValueVector<QRgb> line); - QValueVector< QValueVector<int> > extractFieldInformation( QValueVector<int> string ); + TQValueVector<int> transformPathToBW( TQValueVector<TQRgb> line); + TQValueVector< TQValueVector<int> > extractFieldInformation( TQValueVector<int> string ); Barcode_EAN13 detectValidBarcode ( int possible_numbers[10][13][2], int max_amount_of_considered_codes ); bool isValid( int numbers[13] ); - bool isValid( QValueVector<int> numbers ); + bool isValid( TQValueVector<int> numbers ); void printArray( int array[10][13][2], int level ); }; } diff --git a/src/barcode/barcode_v4l.cpp b/src/barcode/barcode_v4l.cpp index f644fe1..73cbbd2 100644 --- a/src/barcode/barcode_v4l.cpp +++ b/src/barcode/barcode_v4l.cpp @@ -34,7 +34,7 @@ using barcodeRecognition::ng_vid_driver_v4l; using barcodeRecognition::barcode_v4l; using barcodeRecognition::video_converter; -QPtrList<barcodeRecognition::video_converter> barcodeRecognition::ng_vid_driver::m_converter; +TQPtrList<barcodeRecognition::video_converter> barcodeRecognition::ng_vid_driver::m_converter; const char *barcodeRecognition::device_cap[] = { "capture", "tuner", "teletext", "overlay", "chromakey", "clipping", "frameram", "scales", "monochrome", 0 }; const unsigned int barcodeRecognition::ng_vfmt_to_depth[] = { 0, /* unused */ @@ -157,30 +157,30 @@ bool barcode_v4l::isOpen() return m_drv; } -QImage barcode_v4l::grab_one2() +TQImage barcode_v4l::grab_one2() { if (!m_drv) { myDebug() << "no driver/device available" << endl; - return QImage(); + return TQImage(); } - QByteArray *cap; + TQByteArray *cap; if (!(cap = m_drv->getimage2())) { myDebug() << "capturing image failed" << endl; - return QImage(); + return TQImage(); } - QByteArray *buf; + TQByteArray *buf; if (m_conv) { - buf = new QByteArray( 3*m_fmt.width*m_fmt.height ); + buf = new TQByteArray( 3*m_fmt.width*m_fmt.height ); m_conv->frame( buf, cap, m_fmt_drv ); } else { - buf = new QByteArray(*cap); + buf = new TQByteArray(*cap); } delete cap; int depth = 32; - QByteArray *buf2 = new QByteArray( depth/8 *m_fmt.width*m_fmt.height ); + TQByteArray *buf2 = new TQByteArray( depth/8 *m_fmt.width*m_fmt.height ); for (uint i=0; i<m_fmt.width*m_fmt.height; i++) { (*buf2)[i*4+0] = buf->at(i*3+2); (*buf2)[i*4+1] = buf->at(i*3+1); @@ -188,8 +188,8 @@ QImage barcode_v4l::grab_one2() (*buf2)[i*4+3] = 0; } delete buf; - QImage *temp = new QImage( (uchar*)buf2->data(), m_fmt.width, m_fmt.height, depth, 0, 0, QImage::LittleEndian ); - QImage temp2 = temp->copy(); + TQImage *temp = new TQImage( (uchar*)buf2->data(), m_fmt.width, m_fmt.height, depth, 0, 0, TQImage::LittleEndian ); + TQImage temp2 = temp->copy(); delete temp; delete buf2; @@ -253,7 +253,7 @@ bool barcode_v4l::grab_init() } -ng_vid_driver* ng_vid_driver::createDriver( QString device ) +ng_vid_driver* ng_vid_driver::createDriver( TQString device ) { /* check all grabber drivers */ ng_vid_driver *drv = new ng_vid_driver_v4l(); @@ -336,7 +336,7 @@ ng_vid_driver_v4l::ng_vid_driver_v4l() format2palette[VIDEO_YUV420P] = VIDEO_PALETTE_YUV420P; } -bool ng_vid_driver_v4l::open2( QString device ) +bool ng_vid_driver_v4l::open2( TQString device ) { /* open device */ if ((m_fd = ::open( device.latin1(), O_RDWR )) == -1) { @@ -445,7 +445,7 @@ bool ng_vid_driver_v4l::read_setformat( ng_video_fmt *fmt ) return true; } -QByteArray* ng_vid_driver_v4l::getimage2() +TQByteArray* ng_vid_driver_v4l::getimage2() { #ifdef Barcode_DEBUG myDebug() << "v4l: getimage2" << endl; @@ -455,13 +455,13 @@ QByteArray* ng_vid_driver_v4l::getimage2() } -QByteArray* ng_vid_driver_v4l::read_getframe2() +TQByteArray* ng_vid_driver_v4l::read_getframe2() { - QByteArray* buf; + TQByteArray* buf; int size; size = m_fmt.bytesperline * m_fmt.height; - buf = new QByteArray( size ); + buf = new TQByteArray( size ); if (size != read( m_fd, buf->data(), size )) { delete( buf ); return 0; @@ -502,7 +502,7 @@ QByteArray* ng_vid_driver_v4l::read_getframe2() barcodeRecognition::ng_yuv_g2[blue] ] #define BLUE(gray,blue) ng_clip[ CLIP + gray + barcodeRecognition::ng_yuv_blue[blue] ] -void barcodeRecognition::yuv420p_to_rgb24::frame( QByteArray *out, const QByteArray *in, const ng_video_fmt fmt ) +void barcodeRecognition::yuv420p_to_rgb24::frame( TQByteArray *out, const TQByteArray *in, const ng_video_fmt fmt ) { unsigned char *y, *u, *v, *d; unsigned char *us,*vs; diff --git a/src/barcode/barcode_v4l.h b/src/barcode/barcode_v4l.h index f0cde90..3ab1a32 100644 --- a/src/barcode/barcode_v4l.h +++ b/src/barcode/barcode_v4l.h @@ -33,8 +33,8 @@ //#include <linux/videodev2.h> #include <linux/videodev.h> -#include <qstring.h> -#include <qimage.h> +#include <tqstring.h> +#include <tqimage.h> namespace barcodeRecognition { @@ -72,7 +72,7 @@ public: virtual ~video_converter() {;} virtual void init( ng_video_fmt* ) {;} virtual void exit() {;} - virtual void frame( QByteArray*, const QByteArray*, ng_video_fmt ) {;} + virtual void frame( TQByteArray*, const TQByteArray*, ng_video_fmt ) {;} int fmtid_in() {return m_fmtid_in;} int fmtid_out() {return m_fmtid_out;} protected: @@ -83,46 +83,46 @@ class yuv422p_to_rgb24 : public video_converter { public: yuv422p_to_rgb24() {m_fmtid_in=VIDEO_YUV422P; m_fmtid_out=VIDEO_RGB24;} - virtual void frame( QByteArray *, const QByteArray *, ng_video_fmt ) {;} + virtual void frame( TQByteArray *, const TQByteArray *, ng_video_fmt ) {;} }; class yuv422_to_rgb24 : public video_converter { public: yuv422_to_rgb24() {m_fmtid_in=VIDEO_YUYV; m_fmtid_out=VIDEO_RGB24;} - virtual void frame( QByteArray *, const QByteArray *, ng_video_fmt ) {;} + virtual void frame( TQByteArray *, const TQByteArray *, ng_video_fmt ) {;} }; class yuv420p_to_rgb24 : public video_converter { public: yuv420p_to_rgb24() {m_fmtid_in=VIDEO_YUV420P; m_fmtid_out=VIDEO_RGB24;} - virtual void frame( QByteArray *, const QByteArray *, ng_video_fmt ); + virtual void frame( TQByteArray *, const TQByteArray *, ng_video_fmt ); }; class ng_vid_driver { public: - static ng_vid_driver *createDriver( QString device ); + static ng_vid_driver *createDriver( TQString device ); static int xioctl( int fd, int cmd, void *arg ); /* open/close */ - virtual bool open2( QString device ) = 0; + virtual bool open2( TQString device ) = 0; virtual void close() = 0; /* attributes */ - virtual QString get_devname() {return m_name;} + virtual TQString get_devname() {return m_name;} virtual int capabilities() = 0; /* capture */ virtual bool setformat( ng_video_fmt *fmt ) = 0; - virtual QByteArray* getimage2() = 0; /* single image */ + virtual TQByteArray* getimage2() = 0; /* single image */ // video converter static void register_video_converter( video_converter *conv ); static video_converter *find_video_converter( int out, int in ); protected: - QString m_name; - static QPtrList<video_converter> m_converter; + TQString m_name; + static TQPtrList<video_converter> m_converter; }; @@ -131,13 +131,13 @@ class barcode_v4l public: barcode_v4l(); ~barcode_v4l(); - QImage grab_one2(); + TQImage grab_one2(); bool isOpen(); protected: bool grab_init(); - QString m_devname; + TQString m_devname; int m_grab_width, m_grab_height; ng_vid_driver *m_drv; ng_video_fmt m_fmt, m_fmt_drv; @@ -152,8 +152,8 @@ public: ng_vid_driver_v4l(); /* open/close */ - //virtual bool open( QString device ); - virtual bool open2( QString device ); + //virtual bool open( TQString device ); + virtual bool open2( TQString device ); virtual void close(); /* attributes */ @@ -162,11 +162,11 @@ public: /* capture */ virtual bool setformat( ng_video_fmt *fmt ); //virtual ng_video_buf* getimage(); /* single image */ - virtual QByteArray* getimage2(); /* single image */ + virtual TQByteArray* getimage2(); /* single image */ protected: bool read_setformat( ng_video_fmt *fmt ); - QByteArray* read_getframe2(); + TQByteArray* read_getframe2(); void *m_drv; int m_fd; video_capability m_capability; |