[mythtv] mythgallery aspect ratio patch
Nigel Pearson
nigel at ind.tansu.com.au
Thu Nov 8 00:04:32 UTC 2007
> + // calculate display pixel aspect ratio
> + Display *display = XOpenDisplay(NULL);
> + int scr = DefaultScreen(display);
> + double pixelaspect =
> + ((double)DisplayWidthMM(display,scr) / (double)screenwidth) /
> + ((double)DisplayHeightMM(display,scr) / (double)screenheight);
> +
> + // calculate image aspect ratio
> + double imageaspect =
> + (double)m_image.width() / (double)m_image.height();
> +
> + QImage img = m_image.smoothScale(
> + (int) (screenheight * imageaspect / pixelaspect * m_zoom),
> + (int) (screenheight * m_zoom),
> + QImage::ScaleFree);
While this does work for X environemnts,
it will not help on OS X, or Windows.
An #ifdef ENABLE_X11 will suffice for now,
but in the long run, some of the video output
code probably needs to be abstracted into
libmyth?
--
Nigel Pearson, nigel at ind.tansu.com.au|"Look at this!
Telstra Net. Eng., Sydney, Australia | Do you think I put this in
Office: 9202 3900 Fax: 9261 3912 | to get better reception?"
Mobile: 0408 664435 Home: 9792 6998 | Batty - Fern Gully
More information about the mythtv-dev
mailing list