summaryrefslogtreecommitdiffstats
path: root/src/barcode/barcode_v4l.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-02 06:40:27 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-02 06:40:27 +0000
commit2595a15ebeb6fc46b7cb241d01ec0c2460ec2111 (patch)
tree18a8f0f4ac5a86dacfa74c3537551ec39bc85e75 /src/barcode/barcode_v4l.cpp
parent1d90725a4001fab9d3922b2cbcceeee5e2d1686f (diff)
downloadtellico-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/barcode_v4l.cpp')
-rw-r--r--src/barcode/barcode_v4l.cpp36
1 files changed, 18 insertions, 18 deletions
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;