您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetDeviceGammaRamp函数代码示例

51自学网 2021-06-01 21:06:34
  C++
这篇教程C++ GetDeviceGammaRamp函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GetDeviceGammaRamp函数的典型用法代码示例。如果您正苦于以下问题:C++ GetDeviceGammaRamp函数的具体用法?C++ GetDeviceGammaRamp怎么用?C++ GetDeviceGammaRamp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了GetDeviceGammaRamp函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: w32gdi_get_temperature

static int w32gdi_get_temperature(void){	gamma_ramp_s ramp=gamma_get_ramps(GAMMA_RAMP_SIZE);	float rb_ratio;	HDC hdc;		hdc = CreateDC(TEXT("DISPLAY"),NULL,NULL,NULL);	if( (!hdc)||(!ramp.all) ){		LOG(LOGERR,_("No device context or ramp."));		(void)DeleteDC(hdc);		return RET_FUN_FAILED;	}	if( !GetDeviceGammaRamp(hdc,ramp.all) ){		LOG(LOGERR,_("Unable to get gamma ramps."));		(void)DeleteDC(hdc);		return RET_FUN_FAILED;	}	if( (!ramp.r)||(!ramp.b) ){		LOG(LOGERR,_("No ramps found."));		(void)DeleteDC(hdc);		return RET_FUN_FAILED;	}	(void)DeleteDC(hdc);	rb_ratio = (float)ramp.r[255]/(float)ramp.b[255];	return gamma_find_temp(rb_ratio);}
开发者ID:NeilBryant,项目名称:redshiftgui,代码行数:26,


示例2: WG_GetOldGammaRamp

/*** WG_GetOldGammaRamp***/void WG_GetOldGammaRamp(void){	HDC			hDC;	hDC = GetDC(GetDesktopWindow());	GetDeviceGammaRamp(hDC, s_oldHardwareGamma);	ReleaseDC(GetDesktopWindow(), hDC);	/*	** GLimp_SetGamma	**	*/	void GLimp_SetGamma(unsigned char red[256], unsigned char green[256], unsigned char blue[256]) {		unsigned short table[3][256];		int i;		if (!glw_state.hDC) {			return;		}		for (i = 0; i < 256; i++) {			table[0][i] = (((unsigned short) red[i]) << 8) | red[i];			table[1][i] = (((unsigned short) green[i]) << 8) | green[i];			table[2][i] = (((unsigned short) blue[i]) << 8) | blue[i];		}		if (!SetDeviceGammaRamp(glw_state.hDC, table)) {			common->Printf("WARNING: SetDeviceGammaRamp failed./n");		}	}
开发者ID:AreaScout,项目名称:dante-doom3-odroid,代码行数:35,


示例3: GLimp_GetGammaRamp

/*** GLimp_UpdateGammaRamp*/bool GLimp_GetGammaRamp( size_t stride, unsigned short *psize, unsigned short *ramp ){	unsigned short ramp256[3*256];	if( stride < 256 )	{		// only supports gamma ramps with 256 mappings per channel		return false;	}	if( qwglGetDeviceGammaRamp3DFX )	{		if( qwglGetDeviceGammaRamp3DFX( glw_state.hDC, ramp256 ) )		{			*psize = 256;			memcpy( ramp,          ramp256,       256*sizeof(*ramp) );			memcpy( ramp+  stride, ramp256+  256, 256*sizeof(*ramp) );			memcpy( ramp+2*stride, ramp256+2*256, 256*sizeof(*ramp) );			return true;		}	}	if( GetDeviceGammaRamp( glw_state.hDC, ramp256 ) )	{		*psize = 256;		memcpy( ramp,          ramp256,       256*sizeof(*ramp) );		memcpy( ramp+  stride, ramp256+  256, 256*sizeof(*ramp) );		memcpy( ramp+2*stride, ramp256+2*256, 256*sizeof(*ramp) );		return true;	}	return false;}
开发者ID:MGXRace,项目名称:racesow,代码行数:36,


示例4: DIB_SetGammaRamp

int DIB_SetGammaRamp(_THIS, Uint16 *ramp){#ifdef NO_GAMMA_SUPPORT	SDL_SetError("SDL compiled without gamma ramp support");	return -1;#else	HDC hdc;	BOOL succeeded;	/* Set the ramp for the display */	if ( ! gamma_saved ) {		gamma_saved = (WORD *)malloc(3*256*sizeof(*gamma_saved));		if ( ! gamma_saved ) {			SDL_OutOfMemory();			return -1;		}		hdc = GetDC(SDL_Window);		GetDeviceGammaRamp(hdc, gamma_saved);		ReleaseDC(SDL_Window, hdc);	}	if ( SDL_GetAppState() & SDL_APPINPUTFOCUS ) {		hdc = GetDC(SDL_Window);		succeeded = SetDeviceGammaRamp(hdc, ramp);		ReleaseDC(SDL_Window, hdc);	} else {		succeeded = TRUE;	}	return succeeded ? 0 : -1;#endif /* !NO_GAMMA_SUPPORT */}
开发者ID:Goettsch,项目名称:game-editor,代码行数:30,


示例5: WG_CheckHardwareGamma

/*** WG_CheckHardwareGamma**** Determines if the underlying hardware supports the Win32 gamma correction API.*/void WG_CheckHardwareGamma( void ) {	HDC hDC;	glConfig.deviceSupportsGamma = qfalse;    //BBi	//if ( qwglSetDeviceGammaRamp3DFX ) {	//	glConfig.deviceSupportsGamma = qtrue;	//	hDC = GetDC( GetDesktopWindow() );	//	glConfig.deviceSupportsGamma = qwglGetDeviceGammaRamp3DFX( hDC, s_oldHardwareGamma );	//	ReleaseDC( GetDesktopWindow(), hDC );	//	return;	//}    //BBi    //BBi	//// non-3Dfx standalone drivers don't support gamma changes, period	//if ( glConfig.driverType == GLDRV_STANDALONE ) {	//	return;	//}    //BBi	if ( !r_ignorehwgamma->integer ) {		hDC = GetDC( GetDesktopWindow() );		glConfig.deviceSupportsGamma = GetDeviceGammaRamp( hDC, s_oldHardwareGamma );		ReleaseDC( GetDesktopWindow(), hDC );		if ( glConfig.deviceSupportsGamma ) {			//			// do a sanity check on the gamma values			//			if ( ( HIBYTE( s_oldHardwareGamma[0][255] ) <= HIBYTE( s_oldHardwareGamma[0][0] ) ) ||				 ( HIBYTE( s_oldHardwareGamma[1][255] ) <= HIBYTE( s_oldHardwareGamma[1][0] ) ) ||				 ( HIBYTE( s_oldHardwareGamma[2][255] ) <= HIBYTE( s_oldHardwareGamma[2][0] ) ) ) {				glConfig.deviceSupportsGamma = qfalse;				ri.Printf( PRINT_WARNING, "WARNING: device has broken gamma support, generated gamma.dat/n" );			}			//			// make sure that we didn't have a prior crash in the game, and if so we need to			// restore the gamma values to at least a linear value			//			if ( ( HIBYTE( s_oldHardwareGamma[0][181] ) == 255 ) ) {				int g;				ri.Printf( PRINT_WARNING, "WARNING: suspicious gamma tables, using linear ramp for restoration/n" );				for ( g = 0; g < 255; g++ )				{					s_oldHardwareGamma[0][g] = g << 8;					s_oldHardwareGamma[1][g] = g << 8;					s_oldHardwareGamma[2][g] = g << 8;				}			}		}	}}
开发者ID:bibendovsky,项目名称:rtcw,代码行数:64,


示例6: VID_BackupGamma

void VID_BackupGamma() // jitgamma{	HDC	hdc;	hdc = GetDC (GetDesktopWindow());	gammaramp_supported = GetDeviceGammaRamp (hdc, &desktop_gammaramp[0][0]);	ReleaseDC (GetDesktopWindow(), hdc);}
开发者ID:jitspoe,项目名称:starviewer,代码行数:8,


示例7: SWimp_SaveOldHWGamma

void SWimp_SaveOldHWGamma(){	HDC desktop_hdc = GetDC( GetDesktopWindow() );	if( GetDeviceGammaRamp( desktop_hdc, old_gamma ) == FALSE )		sw_state.hw_gamma_supported= 0;	else		sw_state.hw_gamma_supported= 1;	ReleaseDC( GetDesktopWindow(), desktop_hdc );}
开发者ID:Panzerschrek,项目名称:Q2PR,代码行数:9,


示例8: GLimp_SaveGamma

/*========================GLimp_GetOldGammaRamp========================*/static void GLimp_SaveGamma() {    HDC			hDC;    BOOL		success;    hDC = GetDC( GetDesktopWindow() );    success = GetDeviceGammaRamp( hDC, win32.oldHardwareGamma );    common->DPrintf( "...getting default gamma ramp: %s/n", success ? "success" : "failed" );    ReleaseDC( GetDesktopWindow(), hDC );}
开发者ID:neilogd,项目名称:DOOM-3-BFG,代码行数:14,


示例9: GetGammaRamp

static BOOL APIENTRY GetGammaRamp (Uint16 *redtable, Uint16 *greentable, Uint16 *bluetable)#endif{#ifndef unix	return GetDeviceGammaRamp(m_hDC, ramp);#else	return (SDL_GetGammaRamp(redtable, greentable, bluetable) >= 0);#endif}
开发者ID:ddraigcymraeg,项目名称:gzscoredoom,代码行数:9,


示例10: ReadGamma

// Called from GLimp_Init()static void ReadGamma(){	if (r_ignorehwgamma->integer)	{		gammaStored = false;		return;	}	HWND hwnd = GetDesktopWindow();	HDC hdc = GetDC(hwnd);	gammaStored = GetDeviceGammaRamp(hdc, gammaRamp) != 0;	ReleaseDC(hwnd, hdc);}
开发者ID:RkShaRkz,项目名称:Quake2,代码行数:13,


示例11: wined3d_swapchain_get_gamma_ramp

HRESULT CDECL wined3d_swapchain_get_gamma_ramp(const struct wined3d_swapchain *swapchain,        struct wined3d_gamma_ramp *ramp){    HDC dc;    TRACE("swapchain %p, ramp %p./n", swapchain, ramp);    dc = GetDC(swapchain->device_window);    GetDeviceGammaRamp(dc, ramp);    ReleaseDC(swapchain->device_window, dc);    return WINED3D_OK;}
开发者ID:mgriepentrog,项目名称:wine,代码行数:13,


示例12: GLimp_GetGammaRamp

/*** GLimp_UpdateGammaRamp*/qboolean GLimp_GetGammaRamp( size_t stride, unsigned short *ramp ){	if( qwglGetDeviceGammaRamp3DFX )	{		if( qwglGetDeviceGammaRamp3DFX( glw_state.hDC, ramp ) )			return qtrue;	}	if( GetDeviceGammaRamp( glw_state.hDC, ramp ) )		return qtrue;	return qfalse;}
开发者ID:Racenet,项目名称:racesow,代码行数:16,


示例13: GetDeviceGammaRamp

void _stdcall ProxyDevice::GetGammaRamp(D3DGAMMARAMP *a){    IDirect3DSwapChain9 *sc;    D3DPRESENT_PARAMETERS pp;    realDevice->GetSwapChain(0, &sc);    sc->GetPresentParameters(&pp);    sc->Release();    if(pp.Windowed)        GetDeviceGammaRamp(GetDC(pp.hDeviceWindow), (void*)a);    else        realDevice->GetGammaRamp(0, a);}
开发者ID:Petethegoat,项目名称:MGE-XE,代码行数:14,


示例14: _glfwPlatformGetGammaRamp

void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp){    HDC dc;    WORD values[768];    dc = CreateDCW(L"DISPLAY", monitor->win32.adapterName, NULL, NULL);    GetDeviceGammaRamp(dc, values);    DeleteDC(dc);    _glfwAllocGammaArrays(ramp, 256);    memcpy(ramp->red,   values +   0, 256 * sizeof(unsigned short));    memcpy(ramp->green, values + 256, 256 * sizeof(unsigned short));    memcpy(ramp->blue,  values + 512, 256 * sizeof(unsigned short));}
开发者ID:ConfusedReality,项目名称:pkg_opengl_glfw,代码行数:15,


示例15: DIB_CheckGamma

static void DIB_CheckGamma(_THIS){#ifndef NO_GAMMA_SUPPORT	HDC hdc;	WORD ramp[3*256];	/* If we fail to get gamma, disable gamma control */	hdc = GetDC(SDL_Window);	if ( ! GetDeviceGammaRamp(hdc, ramp) ) {		this->GetGammaRamp = NULL;		this->SetGammaRamp = NULL;	}	ReleaseDC(SDL_Window, hdc);#endif /* !NO_GAMMA_SUPPORT */}
开发者ID:Goettsch,项目名称:game-editor,代码行数:15,


示例16: wglGetProcAddress

void			WinWindow::getGammaRamps(WORD* ramps){  if (hDCChild == NULL)    return;  // see if we've got the 3Dfx gamma ramp extension  PROC proc = wglGetProcAddress("wglGetDeviceGammaRamp3DFX");  if (proc != NULL) {    GammaRamp3DFX wglGetDeviceGammaRamp3DFX = (GammaRamp3DFX)proc;    has3DFXGamma = wglGetDeviceGammaRamp3DFX(hDCChild, ramps + 3 * 256) != FALSE;  }  // get device gamma ramps  hasGamma = GetDeviceGammaRamp(hDCChild, ramps) != FALSE;}
开发者ID:mvanderkolff,项目名称:navi-misc,代码行数:15,


示例17: DIB_GetGammaRamp

int DIB_GetGammaRamp(_THIS, Uint16 *ramp){#ifdef NO_GAMMA_SUPPORT	SDL_SetError("SDL compiled without gamma ramp support");	return -1;#else	HDC hdc;	BOOL succeeded;	/* Get the ramp from the display */	hdc = GetDC(SDL_Window);	succeeded = GetDeviceGammaRamp(hdc, ramp);	ReleaseDC(SDL_Window, hdc);	return succeeded ? 0 : -1;#endif /* !NO_GAMMA_SUPPORT */}
开发者ID:Goettsch,项目名称:game-editor,代码行数:16,


示例18: GetDisplayForWindow

//--------------------------------------------------------------------------bool VeWindows::_GetWindowGammaRamp(Window* pkWindow,	VeUInt16* pu16Ramp){	VideoDisplay* pkDisplay = GetDisplayForWindow(pkWindow);	VE_ASSERT(pkDisplay);	DisplayData* pkData = (DisplayData*)(VeRefObject*)(pkDisplay->m_spDriverData);	HDC hHdc;	BOOL bSucceeded = FALSE;	hHdc = CreateDC(pkData->m_acDeviceName, NULL, NULL, NULL);	if(hHdc)	{		bSucceeded = GetDeviceGammaRamp(hHdc, (LPVOID)pu16Ramp);		DeleteDC(hHdc);	}	return bSucceeded ? true : false;}
开发者ID:Napoleon314,项目名称:Venus2D,代码行数:17,


示例19: WG_CheckHardwareGamma

/*** WG_CheckHardwareGamma**** Determines if the underlying hardware supports the Win32 gamma correction API.*/void WG_CheckHardwareGamma( void ){	HDC			hDC;	glConfig.deviceSupportsGamma = qfalse;	// gamma correction	// for the fallback, always check if it will work	if ( r_gammamethod->integer >= GAMMA_HARDWARE ) {		hDC = GetDC( GetDesktopWindow() );		glConfig.deviceSupportsGamma = (qboolean)GetDeviceGammaRamp( hDC, s_oldHardwareGamma );		ReleaseDC( GetDesktopWindow(), hDC );		if ( glConfig.deviceSupportsGamma )		{			//			// do a sanity check on the gamma values			//			if ( ( HIBYTE( s_oldHardwareGamma[0][255] ) <= HIBYTE( s_oldHardwareGamma[0][0] ) ) ||				 ( HIBYTE( s_oldHardwareGamma[1][255] ) <= HIBYTE( s_oldHardwareGamma[1][0] ) ) ||				 ( HIBYTE( s_oldHardwareGamma[2][255] ) <= HIBYTE( s_oldHardwareGamma[2][0] ) ) )			{				glConfig.deviceSupportsGamma = qfalse;				ri.Printf( PRINT_WARNING, "WARNING: device has broken gamma support, generated gamma.dat/n" );			}			//			// make sure that we didn't have a prior crash in the game, and if so we need to			// restore the gamma values to at least a linear value			//			if ( ( HIBYTE( s_oldHardwareGamma[0][181] ) == 255 ) )			{				int g;				ri.Printf( PRINT_WARNING, "WARNING: suspicious gamma tables, using linear ramp for restoration/n" );				for ( g = 0; g < 255; g++ )				{					s_oldHardwareGamma[0][g] = g << 8;					s_oldHardwareGamma[1][g] = g << 8;					s_oldHardwareGamma[2][g] = g << 8;				}			}		}	}}
开发者ID:entdark,项目名称:jk2mv,代码行数:51,


示例20: WG_CheckHardwareGamma

/*** WG_CheckHardwareGamma**** Determines if the underlying hardware supports the Win32 gamma correction API.*/void WG_CheckHardwareGamma( void ){	HDC			hDC;	glConfig.deviceSupportsGamma = qfalse;	if ( !r_ignorehwgamma->integer )	{		hDC = GetDC( GetDesktopWindow() );		glConfig.deviceSupportsGamma = (qboolean)GetDeviceGammaRamp( hDC, s_oldHardwareGamma );		ReleaseDC( GetDesktopWindow(), hDC );		if ( glConfig.deviceSupportsGamma )		{			//			// do a sanity check on the gamma values			//			if ( ( HIBYTE( s_oldHardwareGamma[0][255] ) <= HIBYTE( s_oldHardwareGamma[0][0] ) ) ||				 ( HIBYTE( s_oldHardwareGamma[1][255] ) <= HIBYTE( s_oldHardwareGamma[1][0] ) ) ||				 ( HIBYTE( s_oldHardwareGamma[2][255] ) <= HIBYTE( s_oldHardwareGamma[2][0] ) ) )			{				glConfig.deviceSupportsGamma = qfalse;				Com_Printf (S_COLOR_YELLOW  "WARNING: device has broken gamma support, generated gamma.dat/n" );			}			//			// make sure that we didn't have a prior crash in the game, and if so we need to			// restore the gamma values to at least a linear value			//			if ( ( HIBYTE( s_oldHardwareGamma[0][181] ) == 255 ) )			{				int g;				Com_Printf (S_COLOR_YELLOW  "WARNING: suspicious gamma tables, using linear ramp for restoration/n" );				for ( g = 0; g < 255; g++ )				{					s_oldHardwareGamma[0][g] = g << 8;					s_oldHardwareGamma[1][g] = g << 8;					s_oldHardwareGamma[2][g] = g << 8;				}			}		}	}}
开发者ID:Chedo,项目名称:OpenJK,代码行数:50,


示例21: WIN_GetWindowGammaRamp

intWIN_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp){    SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);    SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata;    HDC hdc;    BOOL succeeded = FALSE;    hdc = CreateDC(data->DeviceName, NULL, NULL, NULL);    if (hdc) {        succeeded = GetDeviceGammaRamp(hdc, (LPVOID)ramp);        if (!succeeded) {            WIN_SetError("GetDeviceGammaRamp()");        }        DeleteDC(hdc);    }    return succeeded ? 0 : -1;}
开发者ID:Clever-Boy,项目名称:qfusion,代码行数:18,


示例22: DIB_SwapGamma

void DIB_SwapGamma(_THIS){#ifndef NO_GAMMA_SUPPORT	HDC hdc;	if ( gamma_saved ) {		hdc = GetDC(SDL_Window);		if ( SDL_GetAppState() & SDL_APPINPUTFOCUS ) {			/* About to leave active state, restore gamma */			SetDeviceGammaRamp(hdc, gamma_saved);		} else {			/* About to enter active state, set game gamma */			GetDeviceGammaRamp(hdc, gamma_saved);			SetDeviceGammaRamp(hdc, this->gamma);		}		ReleaseDC(SDL_Window, hdc);	}#endif /* !NO_GAMMA_SUPPORT */}
开发者ID:Goettsch,项目名称:game-editor,代码行数:19,


示例23: w32gdi_get_temperature

static int w32gdi_get_temperature(void){	gamma_ramp_s ramp=gamma_get_ramps(GAMMA_RAMP_SIZE);	float rb_ratio;		if( (!state.hDC)||(!ramp.all) ){		LOG(LOGERR,_("No device context or ramp."));		return RET_FUN_FAILED;	}	if( !GetDeviceGammaRamp(state.hDC,ramp.all) ){		LOG(LOGERR,_("Unable to get gamma ramps."));		return RET_FUN_FAILED;	}	if( (!ramp.r)||(!ramp.b) ){		LOG(LOGERR,_("No ramps found."));		return RET_FUN_FAILED;	}	rb_ratio = (float)ramp.r[255]/(float)ramp.b[255];	return gamma_find_temp(rb_ratio);}
开发者ID:AtticusFriez,项目名称:redshiftgui,代码行数:20,


示例24: w32gdi_start

static intw32gdi_start(w32gdi_state_t *state){	BOOL r;	/* Open device context */	HDC hDC = GetDC(NULL);	if (hDC == NULL) {		fputs(_("Unable to open device context./n"), stderr);		return -1;	}	/* Check support for gamma ramps */	int cmcap = GetDeviceCaps(hDC, COLORMGMTCAPS);	if (cmcap != CM_GAMMA_RAMP) {		fputs(_("Display device does not support gamma ramps./n"),		      stderr);		return -1;	}	/* Allocate space for saved gamma ramps */	state->saved_ramps = malloc(3*GAMMA_RAMP_SIZE*sizeof(WORD));	if (state->saved_ramps == NULL) {		perror("malloc");		ReleaseDC(NULL, hDC);		return -1;	}	/* Save current gamma ramps so we can restore them at program exit */	r = GetDeviceGammaRamp(hDC, state->saved_ramps);	if (!r) {		fputs(_("Unable to save current gamma ramp./n"), stderr);		ReleaseDC(NULL, hDC);		return -1;	}	/* Release device context */	ReleaseDC(NULL, hDC);	return 0;}
开发者ID:CameronNemo,项目名称:redshift,代码行数:41,


示例25: WIN_GetDisplayGammaRamp

intWIN_GetDisplayGammaRamp(_THIS, Uint16 * ramp){#ifdef _WIN32_WCE	return -1;#else    SDL_DisplayData *data = (SDL_DisplayData *) SDL_CurrentDisplay.driverdata;    HDC hdc;    BOOL succeeded = FALSE;    hdc = CreateDC(data->DeviceName, NULL, NULL, NULL);    if (hdc) {        succeeded = GetDeviceGammaRamp(hdc, ramp);        if (!succeeded) {            WIN_SetError("GetDeviceGammaRamp()");        }        DeleteDC(hdc);    }    return succeeded ? 0 : -1;#endif}
开发者ID:jjgod,项目名称:SDL,代码行数:21,


示例26: w32gdi_init

万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。