From 7e7489c7fc701688e79e98a9a03ee11457fbd76e Mon Sep 17 00:00:00 2001 From: Jerry Date: Tue, 11 Aug 2020 17:44:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DVirtualSDK=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E8=B0=83=E8=89=B2=E6=9D=BF=E6=97=B6=E4=BC=9A=E4=BA=A7=E7=94=9F?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=E8=B6=8A=E7=95=8C=E5=AF=BC=E8=87=B4=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E7=BB=99=E5=AE=9A=E5=8C=BA=E9=97=B4=E5=A4=96=E7=9A=84?= =?UTF-8?q?=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VirtualSDK/Controls/src/wxLCD.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/VirtualSDK/Controls/src/wxLCD.cpp b/VirtualSDK/Controls/src/wxLCD.cpp index fe08fd2..f2dcca4 100644 --- a/VirtualSDK/Controls/src/wxLCD.cpp +++ b/VirtualSDK/Controls/src/wxLCD.cpp @@ -10,6 +10,7 @@ #include "wxLCD.h" #include "SGUI_Typedef.h" #include +#include //=======================================================================// //= Function define. =// //=======================================================================// @@ -68,28 +69,30 @@ void wxLCD::SetPixelDepth(const int depth) } // Generate a scaled Palette bettween the BackgroundColor and PixelColor m_clsPixelPalette = new wxColor[depth]; + wxLogDebug("调色板初始化中..."); unsigned char ucRH=this->m_clsPixelHColour.Red(); unsigned char ucGH=this->m_clsPixelHColour.Green(); unsigned char ucBH=this->m_clsPixelHColour.Blue(); - + wxLogDebug("颜色边界A(%d,%d,%d)",ucRH,ucGH,ucBH); unsigned char ucRL=m_clsPixelLColour.Red(); unsigned char ucGL=m_clsPixelLColour.Green(); unsigned char ucBL=m_clsPixelLColour.Blue(); - - double dbRDiff=(ucRH-ucRL)*1.0/depth; - double dbGDiff=(ucGH-ucGL)*1.0/depth; - double dbBDiff=(ucBH-ucBL)*1.0/depth; - + wxLogDebug("颜色边界B(%d,%d,%d)",ucRL,ucGL,ucBL); + double dbRDiff=(ucRH-ucRL)*1.0/(depth-1); + double dbGDiff=(ucGH-ucGL)*1.0/(depth-1); + double dbBDiff=(ucBH-ucBL)*1.0/(depth-1); + wxLogDebug("色差(%.2f,%.2f,%.2f)",dbRDiff,dbGDiff,dbBDiff); double dbR=(int)ucRL*1.0; double dbG=(int)ucGL*1.0; double dbB=(int)ucBL*1.0; for(int i=0; i