本文整理汇总了C++中BScreen::GetBrightness方法的典型用法代码示例。如果您正苦于以下问题:C++ BScreen::GetBrightness方法的具体用法?C++ BScreen::GetBrightness怎么用?C++ BScreen::GetBrightness使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BScreen
的用法示例。
在下文中一共展示了BScreen::GetBrightness方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
|| !strcasecmp(argv[i], "-HSync")) {
// okay, but nothing to do
} else if (isdigit(argv[i][0]) && i + 1 == argc) {
// bits per pixel
mode.space
= color_space_for_depth(strtoul(argv[i], NULL, 0));
} else {
fprintf(stderr, "Unknown flag: %s\n", argv[i]);
exit(1);
}
i++;
}
mode.virtual_width = mode.timing.h_display;
mode.virtual_height = mode.timing.v_display;
mode.h_display_start = 0;
mode.v_display_start = 0;
}
setMode = true;
}
BApplication application("application/x-vnd.Haiku-screenmode");
ScreenMode screenMode(NULL);
screen_mode currentMode;
screenMode.Get(currentMode);
if (!isnan(brightness)) {
BScreen screen;
if (relativeBrightness) {
float previousBrightness;
screen.GetBrightness(&previousBrightness);
brightness = previousBrightness + brightness;
// Clamp to min/max values
if (brightness < 0.f)
brightness = 0.f;
if (brightness > 1.f)
brightness = 1.f;
}
if (brightness < 0.f || brightness > 1.f)
printf("Brightness %f is out of range\n", brightness);
screen.SetBrightness(brightness);
}
if (listModes) {
// List all reported modes
if (!shortOutput)
printf("Available screen modes:\n");
for (int index = 0; index < screenMode.CountModes(); index++) {
if (modeLine) {
print_mode(screenMode.DisplayModeAt(index),
screenMode.ModeAt(index));
} else
print_mode(screenMode.ModeAt(index), shortOutput);
}
return 0;
}
if (!setMode) {