00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00024
00025 #ifndef QVIMAGE_H
00026 #define QVIMAGE_H
00027
00028 #include <QMetaType>
00029 #include <QVGenericImage>
00030 #include <qvip/qvimagebuffer.h>
00031 #include <QImage>
00032
00033 #include <qvmath/qvmath.h>
00034
00035 #ifdef QVOPENCV
00036 #include <opencv/cv.h>
00037 #endif
00038
00039 #ifndef QVIPP
00040 #define IPP_MAX_8U std::numeric_limits<unsigned char>::max()
00041 #define IPP_MIN_8U std::numeric_limits<unsigned char>::min()
00042 #endif
00043
00055 #define QVIMAGE_INIT_READ(TYPE, IMAGE) \
00056 const TYPE * __qv_data_##IMAGE##__ = IMAGE.getReadData(); \
00057 const uInt __qv_step_##IMAGE##__ = IMAGE.getStep()/sizeof(TYPE); \
00058 const uChar __qv_planes_##IMAGE##__ = IMAGE.getChannels(); \
00059 const uInt __qv_next_line_inc_##IMAGE##__ = __qv_step_##IMAGE##__ - IMAGE.getCols(); \
00060 Q_UNUSED (__qv_next_line_inc_##IMAGE##__) ;
00061
00074 #define QVIMAGE_INIT_WRITE(TYPE, IMAGE) \
00075 TYPE * __qv_data_##IMAGE##__ = IMAGE.getWriteData(); \
00076 const uInt __qv_step_##IMAGE##__ = IMAGE.getStep()/sizeof(TYPE); \
00077 const uChar __qv_planes_##IMAGE##__ = IMAGE.getChannels(); \
00078 const uInt __qv_next_line_inc_##IMAGE##__ = __qv_step_##IMAGE##__ - IMAGE.getCols(); \
00079 Q_UNUSED (__qv_next_line_inc_##IMAGE##__) ;
00080
00093 #define QVIMAGE_PTR_INIT_READ(TYPE, IMAGE) \
00094 const TYPE * __qv_data_##IMAGE##__ = IMAGE->getReadData(); \
00095 const uInt __qv_step_##IMAGE##__ = IMAGE->getStep()/sizeof(TYPE); \
00096 const uChar __qv_planes_##IMAGE##__ = IMAGE->getChannels(); \
00097 const uInt __qv_next_line_inc_##IMAGE##__ = __qv_step_##IMAGE##__ - IMAGE->getCols(); \
00098 Q_UNUSED (__qv_next_line_inc_##IMAGE##__) ;
00099
00112 #define QVIMAGE_PTR_INIT_WRITE(TYPE, IMAGE) \
00113 TYPE * __qv_data_##IMAGE##__ = IMAGE->getWriteData(); \
00114 const uInt __qv_step_##IMAGE##__ = IMAGE->getStep()/sizeof(TYPE); \
00115 const uChar __qv_planes_##IMAGE##__ = IMAGE->getChannels(); \
00116 const uInt __qv_next_line_inc_##IMAGE##__ = __qv_step_##IMAGE##__ - __qv_planes_##IMAGE##__ * IMAGE->getCols(); \
00117 Q_UNUSED (__qv_next_line_inc_##IMAGE##__) ;
00118
00131 #define QVIMAGE_PIXEL(IMAGE, Col, Row, Channel) \
00132 (__qv_data_##IMAGE##__ [(Row)* __qv_step_##IMAGE##__ + __qv_planes_##IMAGE##__ *(Col)+(Channel)])
00133
00146 #define QVIMAGE_PIXEL_PTR(IMAGE, Col, Row, Channel) \
00147 (& (__qv_data_##IMAGE##__ [(Row)* __qv_step_##IMAGE##__ + __qv_planes_##IMAGE##__ *(Col)+(Channel)]))
00148
00158 #define QVIMAGE_ROW_INCREMENT_PTR(IMAGE) ( __qv_step_##IMAGE##__ )
00159
00170 #define QVIMAGE_COL_INCREMENT_PTR(IMAGE) ( __qv_planes_##IMAGE##__ )
00171
00181 #define QVIMAGE_NEXT_LINE_INCREMENT_PTR(IMAGE) ( __qv_next_line_inc_##IMAGE##__ )
00182
00197 #include <stdio.h>
00198 #include <stdlib.h>
00199 #include <iostream>
00200
00201 template <typename Type = uChar, int Channels = 1> class QVImage: public QVGenericImage
00202 {
00203 protected:
00204 uInt step_div_type_size;
00205 QSharedDataPointer< QVImageBuffer<Type> > imageBuffer;
00206
00207 public:
00208
00213
00214
00215
00216
00217
00218
00219
00220
00221 #ifndef DOXYGEN_IGNORE_THIS
00222
00223 QVImage(uInt cols, uInt rows, uInt step, const Type * buffer = NULL):QVGenericImage()
00224 {
00225 this->imageBuffer = new QVImageBuffer<Type>(Channels*cols, rows, step, buffer);
00226 setROI(0,0, cols, rows);
00227 setAnchor(0,0);
00228 this->step_div_type_size = getStep()/sizeof(Type);
00229 }
00230 #endif
00231
00236 QVImage(uInt cols = 1, uInt rows = 1):QVGenericImage()
00237 {
00238 this->imageBuffer = new QVImageBuffer<Type>(Channels*cols, rows);
00239 setROI(0,0, cols, rows);
00240 setAnchor(0,0);
00241 this->step_div_type_size = getStep()/sizeof(Type);
00242 }
00243
00260 QVImage(QVImage<uChar,1> const &img);
00261
00263 QVImage(QVImage<uChar,3> const &img);
00264
00266 QVImage(QVImage<sChar,1> const &img);
00267
00269 QVImage(QVImage<sChar,3> const &img);
00270
00272 QVImage(QVImage<uShort,1> const &img);
00273
00275 QVImage(QVImage<uShort,3> const &img);
00276
00278 QVImage(QVImage<sShort,1> const &img);
00279
00281 QVImage(QVImage<sShort,3> const &img);
00282
00284 QVImage(QVImage<uInt,1> const &img);
00285
00287 QVImage(QVImage<uInt,3> const &img);
00288
00290 QVImage(QVImage<sInt,1> const &img);
00291
00293 QVImage(QVImage<sInt,3> const &img);
00294
00296 QVImage(QVImage<sFloat,1> const &img);
00297
00299 QVImage(QVImage<sFloat,3> const &img);
00300
00302 QVImage(const QString &filename)
00303 {
00304 QImage qimg;
00305 qimg.load(filename);
00306 *this = QVImage<uChar, 3>(qimg);
00307 };
00308
00318 QVImage(QVImage<uChar,1> const &red, QVImage<uChar,1> const &green, QVImage<uChar,1> const &blue);
00319
00321 QVImage(QVImage<uShort,1> const &red, QVImage<uShort,1> const &green, QVImage<uShort,1> const &blue);
00322
00324 QVImage(QVImage<sShort,1> const &red, QVImage<sShort,1> const &green, QVImage<sShort,1> const &blue);
00325
00327 QVImage(QVImage<sInt,1> const &red, QVImage<sInt,1> const &green, QVImage<sInt,1> const &blue);
00328
00330 QVImage(QVImage<sFloat,1> const &red, QVImage<sFloat,1> const &green, QVImage<sFloat,1> const &blue);
00331
00332
00334 QVImage(const QImage &qImage);
00335
00337 operator QImage() const;
00338
00339
00340 #ifdef QVOPENCV
00341
00342
00343
00344
00345
00346
00347
00348 QVImage(const IplImage *iplImage);
00349
00356 operator IplImage *() const;
00357 #endif
00358
00359
00361 const char * getTypeQString() const;
00362
00364 uInt getRows() const { return imageBuffer->getRows(); }
00365
00367 uInt getCols() const { return imageBuffer->getCols() / Channels; }
00368
00370 inline uInt getStep() const { return imageBuffer->getStep(); }
00371
00373 inline uInt getChannels() const { return Channels; }
00374
00376 uInt getDataSize() const { return imageBuffer->getDataSize(); }
00377
00379 uInt getTypeSize() const { return sizeof(Type); }
00380
00391 const Type * getReadData() const { return imageBuffer->getReadData(); }
00392
00403 Type * getWriteData() { return imageBuffer->getWriteData(); }
00404
00419 void set(Type c1 = 0, Type c2 = 0, Type c3 = 0);
00420
00421
00425 bool isEmpty() const
00426 {
00427 return (getDataSize() == 0);
00428 }
00429
00436 void resize(const int cols, const int rows)
00437 {
00438 if (((int)getCols()) >= cols && ((int)getRows()) >= rows)
00439 return;
00440
00441 QVImage<Type, Channels> temp(MAX(cols, (int)getCols()), MAX(rows, (int)getRows()));
00442 Copy(*this, temp);
00443
00444 *this = temp;
00445 }
00446
00455 inline Type &operator()(const uInt col, const uInt row, const uInt channel = 0)
00456 {
00457 Q_ASSERT_X(step_div_type_size == getStep()/sizeof(Type), "QVImage::operator()", "step/size(Type) incorrect");
00458 Q_ASSERT_X(col < getCols(),"QVImage::operator()","col beyond upper bound");
00459 Q_ASSERT_X(row < getRows(),"QVImage::operator()","row beyond upper bound");
00460 const int idx = step_div_type_size*row + Channels*col + channel;
00461 Q_ASSERT_X(idx >= 0,"QVImage::operator()","accessing below data");
00462 Q_ASSERT_X((uint)idx < getDataSize(),"QVImage::operator()","accessing above data");
00463
00464 return imageBuffer->getWriteData()[idx];
00465 }
00466
00467 inline Type operator()(const uInt col, const uInt row, const uInt channel = 0) const
00468 {
00469 Q_ASSERT_X(step_div_type_size == getStep()/sizeof(Type), "QVImage::operator()", "step/size(Type) incorrect");
00470 Q_ASSERT_X(col < getCols(),"QVImage::operator()","col further upper bound");
00471 Q_ASSERT_X(row < getRows(),"QVImage::operator()","row further upper bound");
00472 const int idx = step_div_type_size*row + Channels*col + channel;
00473 Q_ASSERT_X(idx >= 0,"QVImage::operator()","accessing below data");
00474 Q_ASSERT_X((uint)idx < getDataSize(),"QVImage::operator()","accessing above data");
00475
00476 return imageBuffer->getReadData()[idx];
00477 }
00478
00485 inline Type &operator()(const QPoint point, const uInt channel = 0)
00486 {
00487 Q_ASSERT_X(step_div_type_size == getStep()/sizeof(Type), "QVImage::operator()", "step/size(Type) incorrect");
00488 Q_ASSERT_X((uInt) point.x() < getCols(),"QVImage::operator()","col further upper bound");
00489 Q_ASSERT_X((uInt) point.y() < getRows(),"QVImage::operator()","row further upper bound");
00490 const int idx = step_div_type_size*point.y() + Channels*point.x() + channel;
00491 Q_ASSERT_X(idx >= 0,"QVImage::operator()","accessing below data");
00492 Q_ASSERT_X((uint)idx < getDataSize(),"QVImage::operator()","accessing above data");
00493
00494 return imageBuffer->getWriteData()[idx];
00495 }
00496
00497 inline Type operator()(const QPoint point, const uInt channel = 0) const
00498 {
00499 Q_ASSERT_X(step_div_type_size == getStep()/sizeof(Type), "QVImage::operator()", "step/size(Type) incorrect");
00500 Q_ASSERT_X((uInt) point.x() < getCols(),"QVImage::operator()","col further upper bound");
00501 Q_ASSERT_X((uInt) point.y() < getRows(),"QVImage::operator()","row further upper bound");
00502 const int idx = step_div_type_size*point.y() + Channels*point.x() + channel;
00503 Q_ASSERT_X(idx >= 0,"QVImage::operator()","accessing below data");
00504 Q_ASSERT_X((uint)idx < getDataSize(),"QVImage::operator()","accessing above data");
00505
00506 return imageBuffer->getReadData()[idx];
00507 }
00508
00517 QVImage<Type, 1> operator()(const uInt channel = 0) const;
00518
00535 QVImage<Type, Channels> & operator=(const QVImage<uChar, 1> &sourceImage);
00536
00538 QVImage<Type, Channels> & operator=(const QVImage<uChar, 3> &sourceImage);
00539
00541 QVImage<Type, Channels> & operator=(const QVImage<sChar, 1> &sourceImage);
00542
00544 QVImage<Type, Channels> & operator=(const QVImage<sChar, 3> &sourceImage);
00545
00547 QVImage<Type, Channels> & operator=(const QVImage<uShort, 1> &sourceImage);
00548
00550 QVImage<Type, Channels> & operator=(const QVImage<uShort, 3> &sourceImage);
00551
00553 QVImage<Type, Channels> & operator=(const QVImage<sShort, 1> &sourceImage);
00554
00556 QVImage<Type, Channels> & operator=(const QVImage<sShort, 3> &sourceImage);
00557
00559 QVImage<Type, Channels> & operator=(const QVImage<uInt, 1> &sourceImage);
00560
00562 QVImage<Type, Channels> & operator=(const QVImage<uInt, 3> &sourceImage);
00563
00565 QVImage<Type, Channels> & operator=(const QVImage<sInt, 1> &sourceImage);
00566
00568 QVImage<Type, Channels> & operator=(const QVImage<sInt, 3> &sourceImage);
00569
00571 QVImage<Type, Channels> & operator=(const QVImage<sFloat, 1> &sourceImage);
00572
00574 QVImage<Type, Channels> & operator=(const QVImage<sFloat, 3> &sourceImage);
00575
00586 bool operator==(const QVImage<Type, Channels> &img) const;
00587
00601 bool operator!=(const QVImage<Type, Channels> &img) const { return !(*this == img); }
00602
00603 #ifdef QVIPP
00604
00605
00606
00607
00608
00609
00610
00611
00612 QVImage<uChar, 1> operator<(const QVImage<uChar, Channels> &img) const;
00613
00622 QVImage<uChar, 1> operator<(const QVImage<uShort, Channels> &img) const;
00623
00632 QVImage<uChar, 1> operator<(const QVImage<sShort, Channels> &img) const;
00633
00642 QVImage<uChar, 1> operator<(const QVImage<sInt, Channels> &img) const;
00643
00652 QVImage<uChar, 1> operator<(const QVImage<sFloat, Channels> &img) const;
00653
00662 QVImage<uChar, 1> operator>(const QVImage<uChar, Channels> &img) const;
00663
00672 QVImage<uChar, 1> operator>(const QVImage<uShort, Channels> &img) const;
00673
00682 QVImage<uChar, 1> operator>(const QVImage<sShort, Channels> &img) const;
00683
00692 QVImage<uChar, 1> operator>(const QVImage<sInt, Channels> &img) const;
00693
00702 QVImage<uChar, 1> operator>(const QVImage<sFloat, Channels> &img) const;
00703
00712 QVImage<uChar, 1> operator<=(const QVImage<uChar, Channels> &img) const;
00713
00722 QVImage<uChar, 1> operator<=(const QVImage<uShort, Channels> &img) const;
00723
00732 QVImage<uChar, 1> operator<=(const QVImage<sShort, Channels> &img) const;
00733
00742 QVImage<uChar, 1> operator<=(const QVImage<sInt, Channels> &img) const;
00743
00752 QVImage<uChar, 1> operator<=(const QVImage<sFloat, Channels> &img) const;
00753
00762 QVImage<uChar, 1> operator>=(const QVImage<uChar, Channels> &img) const;
00763
00772 QVImage<uChar, 1> operator>=(const QVImage<uShort, Channels> &img) const;
00773
00782 QVImage<uChar, 1> operator>=(const QVImage<sShort, Channels> &img) const;
00783
00792 QVImage<uChar, 1> operator>=(const QVImage<sInt, Channels> &img) const;
00793
00802 QVImage<uChar, 1> operator>=(const QVImage<sFloat, Channels> &img) const;
00803
00816 QVImage<Type, Channels> operator+(const Type constant) const;
00817
00830 QVImage<Type, Channels> operator*(const Type constant) const;
00831
00844 QVImage<Type, Channels> operator-(const Type constant) const;
00845
00858 QVImage<Type, Channels> operator/(const Type constant) const;
00859
00872 QVImage<Type, Channels> operator<<(const Type constant) const;
00873
00886 QVImage<Type, Channels> operator>>(const Type constant) const;
00887
00896 QVImage<Type, Channels> operator!() const;
00897
00907 QVImage<Type, Channels> operator&(const Type constant) const;
00908
00918 QVImage<Type, Channels> operator|(const Type constant) const;
00919
00929 QVImage<Type, Channels> operator^(const Type constant) const;
00930
00941 QVImage<Type, Channels> operator+(const QVImage<Type, Channels> &img) const;
00942
00953 QVImage<Type, Channels> operator*(const QVImage<Type, Channels> &img) const;
00954
00965 QVImage<Type, Channels> operator-(const QVImage<Type, Channels> &img) const;
00966
00977 QVImage<Type, Channels> operator/(const QVImage<Type, Channels> &img) const;
00978 #endif
00979 };
00980
00985 template <typename Type, int C> bool QVImage<Type, C>::operator==(const QVImage<Type, C> &img) const
00986 {
00987 Q_ASSERT_X(img.getChannels() == this->getChannels(), "QVImage::operator==", "different number of planes");
00988 if (this->getCols() != img.getCols()) return false;
00989 if (this->getRows() != img.getRows()) return false;
00990 if (this->getChannels() != img.getChannels()) return false;
00991 if (this->getROI() != img.getROI()) return false;
00992 QVIMAGE_INIT_READ(Type,img);
00993 QVIMAGE_PTR_INIT_READ(Type,this);
00994
00995 uInt x0 = (uInt) img.getROI().x(), y0 = (uInt) img.getROI().y();
00996 uInt x1 = (uInt) img.getROI().width(), y1 = (uInt) img.getROI().height();
00997
00998 uInt lineSize = x1 * img.getChannels();
00999 for(uInt row = y0; row < y1; row++)
01000 if (memcmp(&QVIMAGE_PIXEL(img, x0, row, 0),&QVIMAGE_PIXEL(this, x0, row, 0), lineSize) != 0)
01001 return false;
01002 return true;
01003 };
01004
01005 typedef QVImage<uChar,1> QVImageUCharC1;
01006 typedef QVImage<uChar,3> QVImageUCharC3;
01007 typedef QVImage<uShort,1> QVImageUShortC1;
01008 typedef QVImage<uShort,3> QVImageUShortC3;
01009 typedef QVImage<sShort,1> QVImageSShortC1;
01010 typedef QVImage<sShort,3> QVImageSShortC3;
01011 typedef QVImage<sInt,1> QVImageSIntC1;
01012 typedef QVImage<sInt,3> QVImageSIntC3;
01013 typedef QVImage<sFloat,1> QVImageSFloatC1;
01014 typedef QVImage<sFloat,3> QVImageSFloatC3;
01015
01016 Q_DECLARE_METATYPE(QVImageUCharC1);
01017 Q_DECLARE_METATYPE(QVImageUCharC3);
01018 Q_DECLARE_METATYPE(QVImageUShortC1);
01019 Q_DECLARE_METATYPE(QVImageUShortC3);
01020 Q_DECLARE_METATYPE(QVImageSShortC1);
01021 Q_DECLARE_METATYPE(QVImageSShortC3);
01022 Q_DECLARE_METATYPE(QVImageSIntC1);
01023 Q_DECLARE_METATYPE(QVImageSIntC3);
01024 Q_DECLARE_METATYPE(QVImageSFloatC1);
01025 Q_DECLARE_METATYPE(QVImageSFloatC3);
01026
01027 #ifndef QVIPP
01028 void Set(const uChar value, QVImage<uChar, 1> &image);
01029 void Set(const sFloat value, QVImage<sFloat, 1> &image);
01030 void Set(const sInt value, QVImage<sInt, 1> &image);
01031 void Set(const uInt value, QVImage<uInt, 1> &image);
01032 void Set(const sShort value, QVImage<sShort, 1> &image);
01033 void Set(const uShort value, QVImage<uShort, 1> &image);
01034
01035 void Set(const uChar value[3], QVImage<uChar, 3> &image);
01036 void Set(const sFloat value[3], QVImage<sFloat, 3> &image);
01037 void Set(const sInt value[3], QVImage<sInt, 3> &image);
01038 void Set(const uInt value[3], QVImage<uInt, 3> &image);
01039 void Set(const sShort value[3], QVImage<sShort, 3> &image);
01040 void Set(const uShort value[3], QVImage<uShort, 3> &image);
01041
01042 void Copy(const QVImage<sFloat, 1> &, QVImage<sFloat, 1> &);
01043 void Copy(const QVImage<sInt, 1> &, QVImage<sInt, 1> &);
01044 void Copy(const QVImage<uInt, 1> &, QVImage<uInt, 1> &);
01045 void Copy(const QVImage<sShort, 1> &, QVImage<sShort, 1> &);
01046 void Copy(const QVImage<uShort, 1> &, QVImage<uShort, 1> &);
01047
01048 void Copy(const QVImage<sFloat, 3> &, const uChar channel, QVImage<sFloat, 1> &);
01049 void Copy(const QVImage<sChar, 3> &, const uChar channel, QVImage<sChar, 1> &);
01050 void Copy(const QVImage<uChar, 3> &, const uChar channel, QVImage<uChar, 1> &);
01051 void Copy(const QVImage<sInt, 3> &, const uChar channel, QVImage<sInt, 1> &);
01052 void Copy(const QVImage<uInt, 3> &, const uChar channel, QVImage<uInt, 1> &);
01053 void Copy(const QVImage<sShort, 3> &, const uChar channel, QVImage<sShort, 1> &);
01054 void Copy(const QVImage<uShort, 3> &, const uChar channel, QVImage<uShort, 1> &);
01055
01056 void Copy(const QVImage<sFloat, 1> &src1, const QVImage<sFloat, 1> &src2, const QVImage<sFloat, 1> &src3, QVImage<sFloat, 3> &dst);
01057 void Copy(const QVImage<uChar, 1> &src1, const QVImage<uChar, 1> &src2, const QVImage<uChar, 1> &src3, QVImage<uChar, 3> &dst);
01058 void Copy(const QVImage<sChar, 1> &src1, const QVImage<sChar, 1> &src2, const QVImage<sChar, 1> &src3, QVImage<sChar, 3> &dst);
01059 void Copy(const QVImage<uInt, 1> &src1, const QVImage<uInt, 1> &src2, const QVImage<uInt, 1> &src3, QVImage<uInt, 3> &dst);
01060 void Copy(const QVImage<sInt, 1> &src1, const QVImage<sInt, 1> &src2, const QVImage<sInt, 1> &src3, QVImage<sInt, 3> &dst);
01061 void Copy(const QVImage<uShort, 1> &src1, const QVImage<uShort, 1> &src2, const QVImage<uShort, 1> &src3, QVImage<uShort, 3> &dst);
01062 void Copy(const QVImage<sShort, 1> &src1, const QVImage<sShort, 1> &src2, const QVImage<sShort, 1> &src3, QVImage<sShort, 3> &dst);
01063
01064
01065
01066
01067 void Convert(const QVImage<sFloat, 1> &src, QVImage<uChar, 1> &dst);
01068 void Convert(const QVImage<sFloat, 1> &src, QVImage<sChar, 1> &dst);
01069 void Convert(const QVImage<sFloat, 1> &src, QVImage<sInt, 1> &dst);
01070 void Convert(const QVImage<sFloat, 1> &src, QVImage<uInt, 1> &dst);
01071 void Convert(const QVImage<sFloat, 1> &src, QVImage<sShort, 1> &dst);
01072 void Convert(const QVImage<sFloat, 1> &src, QVImage<uShort, 1> &dst);
01073
01074
01075 void Convert(const QVImage<sFloat, 3> &src, QVImage<uChar, 3> &dst);
01076 void Convert(const QVImage<sFloat, 3> &src, QVImage<sChar, 3> &dst);
01077 void Convert(const QVImage<sFloat, 3> &src, QVImage<sInt, 3> &dst);
01078 void Convert(const QVImage<sFloat, 3> &src, QVImage<uInt, 3> &dst);
01079 void Convert(const QVImage<sFloat, 3> &src, QVImage<sShort, 3> &dst);
01080 void Convert(const QVImage<sFloat, 3> &src, QVImage<uShort, 3> &dst);
01081
01082
01083 void Convert(const QVImage<uChar, 1> &src, QVImage<sFloat, 1> &dst);
01084
01085 void Convert(const QVImage<uChar, 1> &src, QVImage<sChar, 1> &dst);
01086 void Convert(const QVImage<uChar, 1> &src, QVImage<sInt, 1> &dst);
01087 void Convert(const QVImage<uChar, 1> &src, QVImage<uInt, 1> &dst);
01088 void Convert(const QVImage<uChar, 1> &src, QVImage<sShort, 1> &dst);
01089 void Convert(const QVImage<uChar, 1> &src, QVImage<uShort, 1> &dst);
01090
01091 void Convert(const QVImage<uChar, 3> &src, QVImage<sFloat, 3> &dst);
01092
01093 void Convert(const QVImage<uChar, 3> &src, QVImage<sChar, 3> &dst);
01094 void Convert(const QVImage<uChar, 3> &src, QVImage<sInt, 3> &dst);
01095 void Convert(const QVImage<uChar, 3> &src, QVImage<uInt, 3> &dst);
01096 void Convert(const QVImage<uChar, 3> &src, QVImage<sShort, 3> &dst);
01097 void Convert(const QVImage<uChar, 3> &src, QVImage<uShort, 3> &dst);
01098
01099
01100 void Convert(const QVImage<sChar, 1> &src, QVImage<sFloat, 1> &dst);
01101 void Convert(const QVImage<sChar, 1> &src, QVImage<uChar, 1> &dst);
01102
01103 void Convert(const QVImage<sChar, 1> &src, QVImage<sInt, 1> &dst);
01104 void Convert(const QVImage<sChar, 1> &src, QVImage<uInt, 1> &dst);
01105 void Convert(const QVImage<sChar, 1> &src, QVImage<sShort, 1> &dst);
01106 void Convert(const QVImage<sChar, 1> &src, QVImage<uShort, 1> &dst);
01107
01108 void Convert(const QVImage<sChar, 3> &src, QVImage<sFloat, 3> &dst);
01109 void Convert(const QVImage<sChar, 3> &src, QVImage<uChar, 3> &dst);
01110
01111 void Convert(const QVImage<sChar, 3> &src, QVImage<sInt, 3> &dst);
01112 void Convert(const QVImage<sChar, 3> &src, QVImage<uInt, 3> &dst);
01113 void Convert(const QVImage<sChar, 3> &src, QVImage<sShort, 3> &dst);
01114 void Convert(const QVImage<sChar, 3> &src, QVImage<uShort, 3> &dst);
01115
01116
01117 void Convert(const QVImage<sInt, 1> &src, QVImage<sFloat, 1> &dst);
01118 void Convert(const QVImage<sInt, 1> &src, QVImage<uChar, 1> &dst);
01119 void Convert(const QVImage<sInt, 1> &src, QVImage<sChar, 1> &dst);
01120
01121 void Convert(const QVImage<sInt, 1> &src, QVImage<uInt, 1> &dst);
01122 void Convert(const QVImage<sInt, 1> &src, QVImage<sShort, 1> &dst);
01123 void Convert(const QVImage<sInt, 1> &src, QVImage<uShort, 1> &dst);
01124
01125 void Convert(const QVImage<sInt, 3> &src, QVImage<sFloat, 3> &dst);
01126 void Convert(const QVImage<sInt, 3> &src, QVImage<uChar, 3> &dst);
01127 void Convert(const QVImage<sInt, 3> &src, QVImage<sChar, 3> &dst);
01128
01129 void Convert(const QVImage<sInt, 3> &src, QVImage<uInt, 3> &dst);
01130 void Convert(const QVImage<sInt, 3> &src, QVImage<sShort, 3> &dst);
01131 void Convert(const QVImage<sInt, 3> &src, QVImage<uShort, 3> &dst);
01132
01133
01134 void Convert(const QVImage<uInt, 1> &src, QVImage<sFloat, 1> &dst);
01135 void Convert(const QVImage<uInt, 1> &src, QVImage<uChar, 1> &dst);
01136 void Convert(const QVImage<uInt, 1> &src, QVImage<sChar, 1> &dst);
01137 void Convert(const QVImage<uInt, 1> &src, QVImage<sInt, 1> &dst);
01138
01139 void Convert(const QVImage<uInt, 1> &src, QVImage<sShort, 1> &dst);
01140 void Convert(const QVImage<uInt, 1> &src, QVImage<uShort, 1> &dst);
01141
01142 void Convert(const QVImage<uInt, 3> &src, QVImage<sFloat, 3> &dst);
01143 void Convert(const QVImage<uInt, 3> &src, QVImage<uChar, 3> &dst);
01144 void Convert(const QVImage<uInt, 3> &src, QVImage<sChar, 3> &dst);
01145 void Convert(const QVImage<uInt, 3> &src, QVImage<sInt, 3> &dst);
01146
01147 void Convert(const QVImage<uInt, 3> &src, QVImage<sShort, 3> &dst);
01148 void Convert(const QVImage<uInt, 3> &src, QVImage<uShort, 3> &dst);
01149
01150
01151 void Convert(const QVImage<sShort, 1> &src, QVImage<sFloat, 1> &dst);
01152 void Convert(const QVImage<sShort, 1> &src, QVImage<uChar, 1> &dst);
01153 void Convert(const QVImage<sShort, 1> &src, QVImage<sChar, 1> &dst);
01154 void Convert(const QVImage<sShort, 1> &src, QVImage<sInt, 1> &dst);
01155 void Convert(const QVImage<sShort, 1> &src, QVImage<uInt, 1> &dst);
01156
01157 void Convert(const QVImage<sShort, 1> &src, QVImage<uShort, 1> &dst);
01158
01159 void Convert(const QVImage<sShort, 3> &src, QVImage<sFloat, 3> &dst);
01160 void Convert(const QVImage<sShort, 3> &src, QVImage<uChar, 3> &dst);
01161 void Convert(const QVImage<sShort, 3> &src, QVImage<sChar, 3> &dst);
01162 void Convert(const QVImage<sShort, 3> &src, QVImage<sInt, 3> &dst);
01163 void Convert(const QVImage<sShort, 3> &src, QVImage<uInt, 3> &dst);
01164
01165 void Convert(const QVImage<sShort, 3> &src, QVImage<uShort, 3> &dst);
01166
01167
01168 void Convert(const QVImage<uShort, 1> &src, QVImage<sFloat, 1> &dst);
01169 void Convert(const QVImage<uShort, 1> &src, QVImage<uChar, 1> &dst);
01170 void Convert(const QVImage<uShort, 1> &src, QVImage<sChar, 1> &dst);
01171 void Convert(const QVImage<uShort, 1> &src, QVImage<sInt, 1> &dst);
01172 void Convert(const QVImage<uShort, 1> &src, QVImage<uInt, 1> &dst);
01173 void Convert(const QVImage<uShort, 1> &src, QVImage<sShort, 1> &dst);
01174
01175
01176 void Convert(const QVImage<uShort, 3> &src, QVImage<sFloat, 3> &dst);
01177 void Convert(const QVImage<uShort, 3> &src, QVImage<uChar, 3> &dst);
01178 void Convert(const QVImage<uShort, 3> &src, QVImage<sChar, 3> &dst);
01179 void Convert(const QVImage<uShort, 3> &src, QVImage<sInt, 3> &dst);
01180 void Convert(const QVImage<uShort, 3> &src, QVImage<uInt, 3> &dst);
01181 void Convert(const QVImage<uShort, 3> &src, QVImage<sShort, 3> &dst);
01182
01183
01184
01185 void Convert(const QVImage<sFloat, 3> &, QVImage<sFloat, 1> &);
01186 void Convert(const QVImage<sChar, 3> &, QVImage<sChar, 1> &);
01187 void Convert(const QVImage<uChar, 3> &, QVImage<uChar, 1> &);
01188 void Convert(const QVImage<sInt, 3> &, QVImage<sInt, 1> &);
01189 void Convert(const QVImage<uInt, 3> &, QVImage<uInt, 1> &);
01190 void Convert(const QVImage<sShort, 3> &, QVImage<sShort, 1> &);
01191 void Convert(const QVImage<uShort, 3> &, QVImage<uShort, 1> &);
01192
01193
01194 void RGBToGray(const QVImage<sFloat, 3> &, QVImage<sFloat, 1> &);
01195 void RGBToGray(const QVImage<sChar, 3> &, QVImage<sChar, 1> &);
01196 void RGBToGray(const QVImage<uChar, 3> &, QVImage<uChar, 1> &);
01197 void RGBToGray(const QVImage<sInt, 3> &, QVImage<sInt, 1> &);
01198 void RGBToGray(const QVImage<uInt, 3> &, QVImage<uInt, 1> &);
01199 void RGBToGray(const QVImage<sShort, 3> &, QVImage<sShort, 1> &);
01200 void RGBToGray(const QVImage<uShort, 3> &, QVImage<uShort, 1> &);
01201
01202
01203 void Convert(const QVImage<sFloat, 1> &, QVImage<sFloat, 3> &);
01204 void Convert(const QVImage<sChar, 1> &, QVImage<sChar, 3> &);
01205 void Convert(const QVImage<uChar, 1> &, QVImage<uChar, 3> &);
01206 void Convert(const QVImage<sInt, 1> &, QVImage<sInt, 3> &);
01207 void Convert(const QVImage<uInt, 1> &, QVImage<uInt, 3> &);
01208 void Convert(const QVImage<sShort, 1> &, QVImage<sShort, 3> &);
01209 void Convert(const QVImage<uShort, 1> &, QVImage<uShort, 3> &);
01210
01211 #ifndef DOXYGEN_IGNORE_THIS
01212
01213 void Resize(const QVImage<uChar> &src, QVImage<uChar> &dest);
01214 void Resize(const QVImage<uChar, 3> &src, QVImage<uChar, 3> &dest);
01215 void YUV420ToRGB(const QVImage<uChar, 1> &srcY, const QVImage<uChar, 1> &srcU, const QVImage<uChar, 1> &srcV, QVImage<uChar, 3> &destRGB);
01216 void RGBToYUV420(const QVImage<uChar, 3> &src, QVImage<uChar, 1> &dstY, QVImage<uChar, 1> &dstU, QVImage<uChar, 1> &dstV);
01217 #endif // DOXYGEN_IGNORE_THIS
01218 #else // QVIPP
01219
01220
01221
01222 void Convert(const QVImage<sFloat, 1> &src, QVImage<sChar, 1> &dst);
01223 void Convert(const QVImage<sFloat, 1> &src, QVImage<sInt, 1> &dst);
01224 void Convert(const QVImage<sFloat, 1> &src, QVImage<uInt, 1> &dst);
01225 void Convert(const QVImage<sFloat, 3> &src, QVImage<sChar, 3> &dst);
01226 void Convert(const QVImage<sFloat, 3> &src, QVImage<sInt, 3> &dst);
01227 void Convert(const QVImage<sFloat, 3> &src, QVImage<uInt, 3> &dst);
01228
01229
01230 void Convert(const QVImage<uChar, 1> &src, QVImage<sChar, 1> &dst);
01231 void Convert(const QVImage<uChar, 1> &src, QVImage<uInt, 1> &dst);
01232 void Convert(const QVImage<uChar, 3> &src, QVImage<sChar, 3> &dst);
01233 void Convert(const QVImage<uChar, 3> &src, QVImage<uInt, 3> &dst);
01234
01235
01236 void Convert(const QVImage<sChar, 1> &src, QVImage<sFloat, 1> &dst);
01237 void Convert(const QVImage<sChar, 1> &src, QVImage<uChar, 1> &dst);
01238 void Convert(const QVImage<sChar, 1> &src, QVImage<sInt, 1> &dst);
01239 void Convert(const QVImage<sChar, 1> &src, QVImage<uInt, 1> &dst);
01240 void Convert(const QVImage<sChar, 1> &src, QVImage<sShort, 1> &dst);
01241 void Convert(const QVImage<sChar, 1> &src, QVImage<uShort, 1> &dst);
01242 void Convert(const QVImage<sChar, 3> &src, QVImage<sFloat, 3> &dst);
01243 void Convert(const QVImage<sChar, 3> &src, QVImage<uChar, 3> &dst);
01244 void Convert(const QVImage<sChar, 3> &src, QVImage<sInt, 3> &dst);
01245 void Convert(const QVImage<sChar, 3> &src, QVImage<uInt, 3> &dst);
01246 void Convert(const QVImage<sChar, 3> &src, QVImage<sShort, 3> &dst);
01247 void Convert(const QVImage<sChar, 3> &src, QVImage<uShort, 3> &dst);
01248
01249
01250 void Convert(const QVImage<sInt, 1> &src, QVImage<sFloat, 1> &dst);
01251 void Convert(const QVImage<sInt, 1> &src, QVImage<sChar, 1> &dst);
01252 void Convert(const QVImage<sInt, 1> &src, QVImage<uInt, 1> &dst);
01253 void Convert(const QVImage<sInt, 1> &src, QVImage<sShort, 1> &dst);
01254 void Convert(const QVImage<sInt, 1> &src, QVImage<uShort, 1> &dst);
01255 void Convert(const QVImage<sInt, 3> &src, QVImage<sFloat, 3> &dst);
01256 void Convert(const QVImage<sInt, 3> &src, QVImage<sChar, 3> &dst);
01257 void Convert(const QVImage<sInt, 3> &src, QVImage<uInt, 3> &dst);
01258 void Convert(const QVImage<sInt, 3> &src, QVImage<sShort, 3> &dst);
01259 void Convert(const QVImage<sInt, 3> &src, QVImage<uShort, 3> &dst);
01260
01261
01262 void Convert(const QVImage<uInt, 1> &src, QVImage<sFloat, 1> &dst);
01263 void Convert(const QVImage<uInt, 1> &src, QVImage<uChar, 1> &dst);
01264 void Convert(const QVImage<uInt, 1> &src, QVImage<sChar, 1> &dst);
01265 void Convert(const QVImage<uInt, 1> &src, QVImage<sInt, 1> &dst);
01266 void Convert(const QVImage<uInt, 1> &src, QVImage<sShort, 1> &dst);
01267 void Convert(const QVImage<uInt, 1> &src, QVImage<uShort, 1> &dst);
01268 void Convert(const QVImage<uInt, 3> &src, QVImage<sFloat, 3> &dst);
01269 void Convert(const QVImage<uInt, 3> &src, QVImage<uChar, 3> &dst);
01270 void Convert(const QVImage<uInt, 3> &src, QVImage<sChar, 3> &dst);
01271 void Convert(const QVImage<uInt, 3> &src, QVImage<sInt, 3> &dst);
01272 void Convert(const QVImage<uInt, 3> &src, QVImage<sShort, 3> &dst);
01273 void Convert(const QVImage<uInt, 3> &src, QVImage<uShort, 3> &dst);
01274
01275
01276 void Convert(const QVImage<sShort, 1> &src, QVImage<sChar, 1> &dst);
01277 void Convert(const QVImage<sShort, 1> &src, QVImage<uInt, 1> &dst);
01278 void Convert(const QVImage<sShort, 1> &src, QVImage<uShort, 1> &dst);
01279 void Convert(const QVImage<sShort, 3> &src, QVImage<sChar, 3> &dst);
01280 void Convert(const QVImage<sShort, 3> &src, QVImage<uInt, 3> &dst);
01281 void Convert(const QVImage<sShort, 3> &src, QVImage<uShort, 3> &dst);
01282
01283
01284 void Convert(const QVImage<uShort, 1> &src, QVImage<sChar, 1> &dst);
01285 void Convert(const QVImage<uShort, 1> &src, QVImage<uInt, 1> &dst);
01286 void Convert(const QVImage<uShort, 1> &src, QVImage<sShort, 1> &dst);
01287 void Convert(const QVImage<uShort, 3> &src, QVImage<sChar, 3> &dst);
01288 void Convert(const QVImage<uShort, 3> &src, QVImage<uInt, 3> &dst);
01289 void Convert(const QVImage<uShort, 3> &src, QVImage<sShort, 3> &dst);
01290
01291 void RGBToGray(const QVImage<sChar, 3> &src, QVImage<sChar, 1> &dst);
01292 void RGBToGray(const QVImage<uInt, 3> &src, QVImage<uInt, 1> &dst);
01293 void RGBToGray(const QVImage<sInt, 3> &src, QVImage<sInt, 1> &dst);
01294
01295 void Copy(const QVImage<sChar, 1> &src1, const QVImage<sChar, 1> &src2, const QVImage<sChar, 1> &src3, QVImage<sChar, 3> &dst);
01296 void Copy(const QVImage<uInt, 1> &src1, const QVImage<uInt, 1> &src2, const QVImage<uInt, 1> &src3, QVImage<uInt, 3> &dst);
01297
01298 #endif // QVIPP
01299
01300 #endif // QVIMAGE_H