////////////////////////////////////////////////////////////////////////////////// // Sets some default values for the engine based on the current bit depth. ////////////////////////////////////////////////////////////////////////////////// void CRMEngine::SetDefaults(void) { int bpp; CDXLOG("START: CRMEngine::SetDefaults"); bpp = m_Screen->GetBPP(); switch(bpp) { case 1: SetShades(4); break; case 16: SetShades(32); SetDither(FALSE); break; case 24: case 32: SetShades(256); SetDither(FALSE); break; default: SetDither(FALSE); } CDXLOG("END: CRMEngine::SetDefaults"); }
void CHalRecordMix::SetDitherDepth( USHORT usDitherDepth ) ///////////////////////////////////////////////////////////////////////////// { ULONG ulDitherDepth = 0; // if this call from the driver trying to set the dither depth and the current setting isn't auto, ignore if( (usDitherDepth > MIXVAL_DITHERDEPTH_COUNT) && (m_usDitherControl != MIXVAL_DITHERDEPTH_AUTO) ) { m_usDitherDepth = usDitherDepth; // remember for later... return; } // handle the dither depth control changes from the user switch( usDitherDepth ) { case MIXVAL_DITHERDEPTH_AUTO: // The user wants the driver to select the dither depth. // Next time this device gets started the dither depth will get set. m_usDitherControl = usDitherDepth; usDitherDepth = m_usDitherDepth; // saved from above... break; case MIXVAL_DITHERDEPTH_8BIT: m_usDitherControl = usDitherDepth; usDitherDepth = 8; break; case MIXVAL_DITHERDEPTH_16BIT: m_usDitherControl = usDitherDepth; usDitherDepth = 16; break; case MIXVAL_DITHERDEPTH_20BIT: m_usDitherControl = usDitherDepth; usDitherDepth = 20; break; case MIXVAL_DITHERDEPTH_24BIT: // Dither is off m_usDitherControl = usDitherDepth; usDitherDepth = 24; break; } // We don't update m_usDitherControl if the call came from the driver. switch( usDitherDepth ) { case 8: ulDitherDepth = REG_RMIX_DITHERDEPTH_8BITS; break; case 16: ulDitherDepth = REG_RMIX_DITHERDEPTH_16BITS; break; case 20: ulDitherDepth = REG_RMIX_DITHERDEPTH_20BITS; break; default: case 24: ulDitherDepth = REG_RMIX_DITHERDEPTH_24BITS; m_usDitherDepth = 24; break; } m_RegMixControl.Write( ulDitherDepth, REG_RMIX_DITHERDEPTH_MASK ); SetDither( m_bDither ); // update the dither on/off status }
/******************************************************************************************** > virtual BOOL MakeBitmapExportOptions::RetrieveDefaults() Author: Colin_Barfoot (Xara Group Ltd) <*****@*****.**> Created: 29/10/96 Purpose: See BitmapExportInfo for interface details: gets GIF specific preferences ********************************************************************************************/ BOOL MakeBitmapExportOptions::RetrieveDefaults() { BOOL ok = FALSE; if (MaskedFilterExportOptions::RetrieveDefaults()) { SetDPI(g_Dpi); SetDepth(g_Depth); SetDither(g_Dither); ok = TRUE; } return ok; }
USHORT CHalRecordMix::Open( PHALADAPTER pHalAdapter, PULONG pRecordMixCtl, PULONG pRecordMixStatus ) ///////////////////////////////////////////////////////////////////////////// { m_pHalAdapter = pHalAdapter; m_usDeviceID = m_pHalAdapter->GetDeviceID(); m_RegMixControl.Init( pRecordMixCtl ); m_RegMixStatus.Init( pRecordMixStatus ); m_asSource = 0; SetMute( FALSE ); m_usDitherDepth = 24; SetDitherDepth( MIXVAL_DITHERDEPTH_AUTO ); SetDither( FALSE ); return( HSTATUS_OK ); }
/******************************************************************************************** > virtual BOOL MaskedFilterExportOptions::RetrieveDefaults() Author: Colin_Barfoot (Xara Group Ltd) <*****@*****.**> Created: 29/10/96 Purpose: See BitmapExportOptions for interface details Notes: Gets MaskedFilter specific preferences (compression mainly) ********************************************************************************************/ BOOL MaskedFilterExportOptions::RetrieveDefaults() { if (!BitmapExportOptions::RetrieveDefaults()) return FALSE; PORTNOTE("BMPFilter", "Remove use of GetDefaultExportDither") #ifndef EXCLUDE_FROM_XARALX UINT32 Dither = BMPFilter::GetDefaultExportDither(); ERROR2IF(Dither > 4, FALSE, "Dither Invalid"); #else UINT32 Dither = 0; #endif SetDither((DITHER)Dither); m_Dither = g_Dither; m_NumColsInPalette = g_NumColsInPalette; m_UseSystemColours = g_UseSystemColours; return TRUE; }
void C_Fill::LocalFunction(short ID,long P[],_TCHAR *,C_Handler *) { switch(ID) { case CFIL_SETUP: Setup(P[0],(short)P[1]); break; case CFIL_SETCOLOR: SetColor(P[0]|(P[1] << 8)|(P[2]<<16)); break; case CFIL_SETGRADIENT: SetGradient((short)P[0],(short)P[1]); break; case CFIL_SETPERCENT: SetGradient((short)P[0],(short)P[0]); break; case CFIL_SETDITHER: SetDither((short)P[0],(short)P[1]); break; } }