27 #define _(X) (int(X * _MUL))
166 void SetYcc(BYTE y1, BYTE y2, BYTE cb, BYTE cr)
179 void GetRgb(RGBQUAD& _rgb1, RGBQUAD& _rgb2)
const
181 int y1 =
static_cast<int>(m_y1) - 16;
182 int y2 =
static_cast<int>(m_y2) - 16;
183 int cb =
static_cast<int>(m_cb) - 128;
184 int cr =
static_cast<int>(m_cr) - 128;
186 _rgb1.rgbRed = m_byte((_(1.16780) * y1 + _(1.60070) * cr) / _MUL);
187 _rgb1.rgbGreen = m_byte((_(1.16780) * y1 - _(0.39290) * cb - _(0.81532) * cr) / _MUL);
188 _rgb1.rgbBlue = m_byte((_(1.16780) * y1 + _(2.02320) * cb ) / _MUL);
189 _rgb1.rgbReserved = 0;
191 _rgb2.rgbRed = m_byte((_(1.16780) * y2 + _(1.60070) * cr) / _MUL);
192 _rgb2.rgbGreen = m_byte((_(1.16780) * y2 - _(0.39290) * cb - _(0.81532) * cr) / _MUL);
193 _rgb2.rgbBlue = m_byte((_(1.16780) * y2 + _(2.02320) * cb ) / _MUL);
194 _rgb2.rgbReserved = 0;
202 void GetRgb(COLORREF& _color1, COLORREF& _color2)
const
207 _color1 = RGB(rgb1.rgbRed, rgb1.rgbGreen, rgb1.rgbBlue);
208 _color2 = RGB(rgb2.rgbRed, rgb2.rgbGreen, rgb2.rgbBlue);
216 void SetRgb(
const RGBQUAD& rgb1,
const RGBQUAD& rgb2)
218 int R1 = rgb1.rgbRed;
219 int G1 = rgb1.rgbGreen;
220 int B1 = rgb1.rgbBlue;
221 int R2 = rgb2.rgbRed;
222 int G2 = rgb2.rgbGreen;
223 int B2 = rgb2.rgbBlue;
224 int y1 = ( _(0.25600) * R1 + _(0.50267) * G1 + _(0.09760) * B1 + _(16) + (_MUL / 2)) / _MUL;
225 int y2 = ( _(0.25600) * R2 + _(0.50267) * G2 + _(0.09760) * B2 + _(16) + (_MUL / 2)) / _MUL;
226 int cb = (-_(0.14779) * R1 - _(0.29020) * G1 + _(0.43790) * B1 + _(128) + (_MUL / 2)) / _MUL;
227 int cr = ( _(0.43790) * R1 - _(0.36670) * G1 - _(0.07120) * B1 + _(128) + (_MUL / 2)) / _MUL;
228 SetYcc(down_cast<BYTE>(y1), down_cast<BYTE>(y2), down_cast<BYTE>(cb), down_cast<BYTE>(cr));
236 void SetRgb(COLORREF color1, COLORREF color2)
240 rgb1.rgbRed = GetRValue(color1);
241 rgb1.rgbGreen = GetGValue(color1);
242 rgb1.rgbBlue = GetBValue(color1);
243 rgb1.rgbReserved = 0;
244 rgb2.rgbRed = GetRValue(color2);
245 rgb2.rgbGreen = GetGValue(color2);
246 rgb2.rgbBlue = GetBValue(color2);
247 rgb2.rgbReserved = 0;
253 BYTE m_byte(
int p)
const
263 return static_cast<BYTE
>(p);
286 m_pBuffer =
static_cast<BYTE*
>(pBuffer);
297 ASSERT( m_pBuffer != NULL );
298 ASSERT( (x & 1) == 0 );
299 LPCVOID P1 = &m_pBuffer[(x / 2) * 4];
312 ASSERT( m_pBuffer != NULL );
313 ASSERT( (x & 1) == 0 );
314 LPVOID P1 = &m_pBuffer[(x / 2) * 4];
326 ASSERT( m_pBuffer != NULL );
327 ASSERT( (x & 1) == 0 );
328 LPVOID P1 = &m_pBuffer[(x / 2) * 4];
359 C_ASSERT(
sizeof(CPairPixel) == 4 );
void SetYcc(BYTE y1, BYTE y2, BYTE cb, BYTE cr)
[設定] Y Cb Cr 設定.
void GetRgb(RGBQUAD &_rgb1, RGBQUAD &_rgb2) const
[取得] RGB取得.
void SetY2(BYTE y2)
[設定] Y2「輝度(右)」設定.
void SetCr(BYTE cr)
[設定] Cr「色差(赤)」設定.
CPairPixel(COLORREF color1, COLORREF color2)
コンストラクタ.
void SetY1(BYTE y1)
[設定] Y1「輝度(左)」設定.
void SetRgb(const RGBQUAD &rgb1, const RGBQUAD &rgb2)
[設定] RGB設定.
CPairPixel(const RGBQUAD &rgb1, const RGBQUAD &rgb2)
コンストラクタ.
BYTE GetY2(void) const
[取得] Y2「輝度(右)」取得.
void SetRgb(COLORREF color1, COLORREF color2)
[設定] RGB設定.
void GetRgb(COLORREF &_color1, COLORREF &_color2) const
[取得] RGB取得.
BYTE GetCr(void) const
[取得] Cr「色差(赤)」取得.
void SetCb(BYTE cb)
[設定] Cb「色差(青)」設定.
BYTE GetY1(void) const
[取得] Y1「輝度(左)」取得.
BYTE GetCb(void) const
[取得] Cb「色差(青)」取得.
static CPairPixel * GetPixel(LPVOID P)
[取得] ピクセル取得.
CYcc422LineImage(void)
コンストラクタ
void SetPixel(int x, const CPairPixel &pixel)
[設定] ピクセル設定.
void Attach(LPVOID pBuffer)
[設定] バッファアタッチ.
static const CPairPixel * GetPixel(LPCVOID P)
[取得] ピクセル取得.
const CPairPixel * GetPixel(int x) const
[取得] ピクセル取得.
CPairPixel * GetPixel(int x)
[取得] ピクセル取得.
void Zero(V &value)
[設定] ゼロクリア.