Re: Default heuristics for variable-format displays

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09-09-21 11:46:41, Alexander Boström wrote:
> Here's my suggestion...
> 
> 	def mode_megapixels(mode):
> 		return mode.width * mode.height
> 
> 	# Sort by best refresh rate.
> 	modes.sort(key=lambda mode: -mode['refresh'])
> 
> 	# Prefer to balance refresh rate vs. pixels.
> 	if dpi_known:
> 		acceptable = filter(lambda mode: mode.dpi >= 90,
> modes)
> 		if len(acceptable) > 0:
> 			# Anything above 90 DPI is good enough
> 			# for a default.

This is wrong, as it will produce more or less random resolutions up to 
the maximum supported by the monitor, which is in fact the motivation 
for doing better.  The modes close to 90 DPI should be preferred.

> 			# Pick the one with the best refresh.
> 			return acceptable[0]
> 
> 	# DPI not known or too low, balance refresh vs. pixels.
> 	best_megapixels = max(modes, mode_megapixels)
> 	acceptable = filter(lambda mode: megapixels(mode) >=
> 			best_megapixels / 2)
> 	# Pick the mode with the highest refresh rate and at least
> 	# half the max possible number of pixels.
> 	acceptable[0]

-- 
____________________________________________________________________
TonyN.:'                       <mailto:tonynelson@xxxxxxxxxxxxxxxxx>
      '                              <http://www.georgeanelson.com/>

-- 
fedora-devel-list mailing list
fedora-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-devel-list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux