1 / 11

Color Models

Color Models. Ku-Yaw Chang canseco@mail.dyu.edu.tw Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University. Outline. Color models Color Images C***Document & C***View Tools library. Color Models.

liz
Download Presentation

Color Models

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Color Models Ku-Yaw Chang canseco@mail.dyu.edu.tw Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University Color Models

  2. Outline • Color models • Color Images • C***Document & C***View • Tools library Color Models

  3. Color Models • To facilitate the specification of colors in some standard • Hardware-oriented • RGB: color monitors • CYM: printers • YIQ: TV broadcast • Application-oriented • HSI: color image manipulation • HSV: color image manipulation Color Models

  4. RGB Color Model B (0,0,1) Blue Cyan Magenta White GrayScale (0,1,0) Black G Green (1,0,0) Red Yellow R Color Models

  5. YIQ • Used for commercial color TV broadcasting • Compatibility with monochrome TV standards • Take advantage of human visual system’s greater sensitivity to changes in luminance • Y (luminance) • The amount of light perceived by the eye • IQ (color information) Color Models

  6. RGB to YIQ • Y = 0.299 R + 0.587 G + 0.114 B • I = 0.596 R - 0.275 G – 0.321 B • Q = 0.212 R – 0.523 G + 0.311 B Color Models

  7. Add data short * m_p2BImage; unsigned char * m_p1BImage; unsigned char * m_pRedImage; unsigned char * m_pGreenImage; unsigned char * m_pBlueImage; int m_nWidth; int m_nHeight; C***Document Color Models

  8. Add core functions short * Get2BImageBuffer(); unsigned char * Get1BImageBuffer(); unsigned char * GetRedImageBuffer(); unsigned char * GetGreenImageBuffer(); unsigned char * GetBlueImageBuffer(); int GetImageWidth(); int GetImageHeight(); C***Document Color Models

  9. C***View • #include “tools.h” • C***View::OnDraw(CDC * pDC){ int nWidth = pDoc->GetImageWidth(); int nHeight = pDoc->GetImageHeight(); ShowImage_1B(pDC, pDoc->Get1BImageBuffer(), nWidth, nHeight ); ShowImage_2B(pDC, pDoc->Get2BImageBuffer(), nWidth, nHeight, nWidth, 0 ); ShowImage_3B(pDC, pDoc->GetRedImageBuffer(), pDoc->GetGreenImageBuffer(), pDoc->GetBlueImageBuffer(), nWidth, nHeight, 0, nHeight);} Color Models

  10. Tools Library • Providing functions of displaying images • 1-byte • void ShowImage_1B(CDC * pDC, unsigned char * pImage, int nWidth, int nHeight); • 2-byte • void ShowImage_2B(CDC * pDC, short * pImage, int nWidth, int nHeight); • 3-byte • void ShowImage_3B(CDC * pDC, unsigned char * pRedImage, unsigned char * pGreenImage, unsigned char * pBlueImage, int nWidth, int nHeight); Color Models

  11. Results Color Models

More Related