SilentEye 0.4.1
|
00001 // This file is part of SilentEye. 00002 // 00003 // SilentEye is free software: you can redistribute it and/or modify 00004 // it under the terms of the GNU General Public License as published by 00005 // the Free Software Foundation, either version 3 of the License, or 00006 // (at your option) any later version. 00007 // 00008 // SilentEye is distributed in the hope that it will be useful, 00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 // GNU General Public License for more details. 00012 // 00013 // You should have received a copy of the GNU General Public License 00014 // along with SilentEye. If not, see <http://www.gnu.org/licenses/>. 00015 00016 #ifndef COLORYCBCR_H_ 00017 #define COLORYCBCR_H_ 00018 00019 #include <QObject> 00020 #include <QRgb> 00021 #include <QString> 00022 00023 namespace SEFormatJPEG { 00024 00026 class YCbCr : public QObject 00027 { 00028 private: 00030 float m_y; 00032 float m_cb; 00034 float m_cr; 00035 00037 static const float kb = 0.114; 00039 static const float kr = 0.299; 00040 00041 public: 00043 YCbCr(const float, const float, const float, QObject* parent=0); 00045 YCbCr(const QRgb&, QObject* parent=0); 00046 ~YCbCr(); 00047 00048 float y() const; 00049 void setY(float); 00050 00051 float cb() const; 00052 void setCb(float); 00053 00054 float cr() const; 00055 void setCr(float); 00056 00058 QRgb toRGB(); 00059 00060 QString toString(); 00061 00062 bool operator==(const YCbCr&); 00063 }; 00064 } 00065 00066 #endif