当前位置: 首页>>代码示例>>C++>>正文


C++ BBitmap::GetOverlayRestrictions方法代码示例

本文整理汇总了C++中BBitmap::GetOverlayRestrictions方法的典型用法代码示例。如果您正苦于以下问题:C++ BBitmap::GetOverlayRestrictions方法的具体用法?C++ BBitmap::GetOverlayRestrictions怎么用?C++ BBitmap::GetOverlayRestrictions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BBitmap的用法示例。


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

示例1: BBitmap

bool
VideoView::IsOverlaySupported()
{
	struct colorcombo {
		color_space colspace;
		const char *name;
	} colspace[] = {
		{ B_RGB32,		"B_RGB32"},
		{ B_RGBA32,		"B_RGBA32"},
		{ B_RGB24,		"B_RGB24"},
		{ B_RGB16,		"B_RGB16"},
		{ B_RGB15,		"B_RGB15"},
		{ B_RGBA15,		"B_RGBA15"},
		{ B_RGB32_BIG,	"B_RGB32_BIG"},
		{ B_RGBA32_BIG,	"B_RGBA32_BIG "},
		{ B_RGB24_BIG,	"B_RGB24_BIG "},
		{ B_RGB16_BIG,	"B_RGB16_BIG "},
		{ B_RGB15_BIG,	"B_RGB15_BIG "},
		{ B_RGBA15_BIG, "B_RGBA15_BIG "},
		{ B_YCbCr422,	"B_YCbCr422"},
		{ B_YCbCr411,	"B_YCbCr411"},
		{ B_YCbCr444,	"B_YCbCr444"},
		{ B_YCbCr420,	"B_YCbCr420"},
		{ B_YUV422,		"B_YUV422"},
		{ B_YUV411,		"B_YUV411"},
		{ B_YUV444,		"B_YUV444"},
		{ B_YUV420,		"B_YUV420"},
		{ B_NO_COLOR_SPACE, NULL}
	};
	
	bool supported = false;
	for (int i = 0; colspace[i].name; i++) {
		BBitmap *test = new BBitmap(BRect(0,0,320,240),	B_BITMAP_WILL_OVERLAY 
			| B_BITMAP_RESERVE_OVERLAY_CHANNEL, colspace[i].colspace);
		if (test->InitCheck() == B_OK) {
			printf("Display supports %s (0x%08x) overlay\n", colspace[i].name, 
				colspace[i].colspace);
			overlay_restrictions restrict;
			if (B_OK == test->GetOverlayRestrictions(&restrict)) {
				printf(
					"Overlay restrictions: source horizontal_alignment %d\n", 
					restrict.source.horizontal_alignment);
				printf("Overlay restrictions: source vertical_alignment %d\n", 
					restrict.source.vertical_alignment);
				printf("Overlay restrictions: source width_alignment %d\n", 
					restrict.source.width_alignment);
				printf("Overlay restrictions: source height_alignment %d\n", 
					restrict.source.height_alignment);
				printf("Overlay restrictions: source min_width %d\n", 
					restrict.source.min_width);
				printf("Overlay restrictions: source max_width %d\n", 
					restrict.source.max_width);
				printf("Overlay restrictions: source min_height %d\n", 
					restrict.source.min_height);
				printf("Overlay restrictions: source max_height %d\n", 
					restrict.source.max_height);
				printf(
					"Overlay restrictions: destination horizontal_alignment "
					"%d\n", restrict.destination.horizontal_alignment);
				printf("Overlay restrictions: destination vertical_alignment "
					"%d\n", restrict.destination.vertical_alignment);
				printf("Overlay restrictions: destination width_alignment "
					"%d\n", restrict.destination.width_alignment);
				printf("Overlay restrictions: destination height_alignment "
					"%d\n", restrict.destination.height_alignment);
				printf("Overlay restrictions: destination min_width %d\n", 
					restrict.destination.min_width);
				printf("Overlay restrictions: destination max_width %d\n", 
					restrict.destination.max_width);
				printf("Overlay restrictions: destination min_height %d\n", 
					restrict.destination.min_height);
				printf("Overlay restrictions: destination max_height %d\n", 
					restrict.destination.max_height);
				printf("Overlay restrictions: min_width_scale %.3f\n", 
					restrict.min_width_scale);
				printf("Overlay restrictions: max_width_scale %.3f\n", 
					restrict.max_width_scale);
				printf("Overlay restrictions: min_height_scale %.3f\n", 
					restrict.min_height_scale);
				printf("Overlay restrictions: max_height_scale %.3f\n", 
					restrict.max_height_scale);
			}
			supported = true;
		}
		delete test;
//		if (supported)
//			break;
	}
	return supported;
}
开发者ID:DonCN,项目名称:haiku,代码行数:90,代码来源:VideoView.cpp


注:本文中的BBitmap::GetOverlayRestrictions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。