Re: Displaying 120 Mega Pixels in 256 MB Video RAM




"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in
message news:nu5f34pift37gqcfn7rqbnlp0ma23cj7ue@xxxxxxxxxx
See below...
On Fri, 23 May 2008 20:44:53 -0500, "Peter Olcott"
<NoSpam@xxxxxxxxxxxxx> wrote:


"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in
message news:m4nd34p1ke764qijvmspvlct9v77a4u4a5@xxxxxxxxxx
See below...
On Fri, 23 May 2008 07:16:30 -0700, "Alexander
Grigoriev"
<alegr@xxxxxxxxxxxxx> wrote:


"Peter Olcott" <NoSpam@xxxxxxxxxxxxx> wrote in message
news:3cyZj.2610$7k1.1255@xxxxxxxxxxxxxxx


The primary issue that must be addressed here is video
RAM. It seems like
the current architecture actually requires that the
whole image fit in
video RAM.
****
Why do you think this? What "current architecture"?

The current architecture of the system under development
already has about 200,000 hours invested in it. This is
the
customer's system. There are dozen's of other software
engineers working on this system, I am not free to dictate
its architecture.
****
Windows has about 45,000,000 lines of code and centuries
of work invested in it. And from
the app level, it doesn't matter how many programmers work
on it, how many lines of code
it has, or how many hours they invested in it, they can't
make Windows do something it
isn't designed to do, and unless they are using some
complex DirectX function I never
heard of, there's no way they're going to get Windows to
put an entire image in the VRAM.
To do so, they're fighting decades of Windows
architecture, and if they're using GDI, it
isn't going to happen, can't be made to happen, and
therefore is not an issue.

If the entire image is placed in VRAM it is not windows that
is doing it, it would either be a local or third party
"optimization". My point is that such "optimizations" would
be misguided. I wanted to get some experts to agree with
this assessment.

Even in the case where the entire image must be displayed,
your example of loading the entire image into a memory
device context, and only painting that portion of the image
that would fit within the currently scrolled window explains
why nothing is gained by loading the entire image in VRAM.
This example also shows how huge images that are much larger
than VRAM can be properly handled. Also if the image is to
be reduced in size, then StretchBlt() can do this very
quickly. There is even a way to reduce the loss of
information using CDC::SetStretchBltMode set to HALFTONE.

****

Why do you think Windows is going to
try to put the entire image into VRAM? I consider this
unlikely in the extreme.
****
Before we even begin to look at optimizing disk space
or
memory
use we must first address unnecessary hardware
upgrades.
Are you
completely sure that there is no good reason why a 120
mega pixel image
could not be displayed on a machine with a 256 MB
video
card?
****
I agree with Alexander. I have a 32MB video card and
over
the last week I have been
regularly editing 200MB images, and it would not have
occurred to me that there was any
reason this should NOT be possible. Windows does NOT
put
the entire image into VRAM; it
puts as much of the image as is displayable in VRAM.
I'll
bet you think that a BItBlt
transfers all the bits you specify from the memDC to the
display DC. Why do you think
this is how it is implemented?

I just checked with a friend who has written several
display drivers, and he assures me
that this is *exactly* how it is implemented: only the
pixels displayable are actually
transferred. No more pixels in the display card are
used
than the display can display.
****


I dunno, when I've had 4MB video card, I was able to
edit
28 MB bitmaps.
****
Absolutely right. This is how it is supposed to work.
****

Videocard memory doesn't have anything to do with the
real
picture. It only
needs to keep those pixels that you actually see at this
moment, as much as
real pixels of the monitor. Whatever beyound that, it
doesn't care.

Yes, I think you have finally made a case convincing
enough
that I can present it to people not as familiar with these
details. Your first example about how ScrollBars worked
convinced me.
****
According to my device driver expert, the device driver
and GDI work together to do the
clipping, and there is no possible way to get an image
into VRAM that is larger than the
device pixels in the window that is being displayed. It
will always be clipped. You can
ask it to display 100 megapixels, and will display the 1
megapixel or so required by the
window you are writing to.

Massive VRAM is used by DirectX to hold texture maps
cached, and to do fancy internal
double buffering at the DirectX level. These are required
to get performance for 3D
animation. But with GDI, the interfaces are very trivial
and the clipping is as I
described.
joe
****

I was thinking of the same line-of-reasoning as the most
convincing case. I put together a very simple VS C++
project
using ScrollView that allows the scrolled display of
bitmap
images. It is an enhancement to the best example on the
web.
I like it because it is absolutely minimal, showing no
more
than the most essential details, yet showing these details
completely.


Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm

Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm


.



Relevant Pages

  • Re: Vegas Pro Preview?
    ... >> Windows video overlay window? ... When you enable the external monitor, the video preview> will ... choose Windows Secondary Display. ...
    (rec.video.desktop)
  • Re: Displaying 120 Mega Pixels in 256 MB Video RAM
    ... The primary issue that must be addressed here is video ... the current architecture actually requires that the ... display drivers, and he assures me ... No more pixels in the display card are used ...
    (microsoft.public.vc.mfc)
  • Re: Displaying 120 Mega Pixels in 256 MB Video RAM
    ... The primary issue that must be addressed here is video ... the current architecture actually requires that the ... Windows has about 45,000,000 lines of code and centuries of work invested in it. ... display drivers, and he assures me ...
    (microsoft.public.vc.mfc)
  • Re: Did MrNuke Invent the Internet?
    ... Go to http://www2.leitch.com/ for the video and media portions, ... My dream machine would consist of a workststion with a full color 19" ... running in other windows. ... A home version would have a 40" "hang on the wall" display and be ...
    (sci.electronics.misc)
  • Re: Displaying 120 Mega Pixels in 256 MB Video RAM
    ... the current architecture actually requires that the ... Windows has about 45,000,000 lines of code and centuries ... put an entire image in the VRAM. ... We have been displaying huge images, much larger than the display card, since Windows 1.0. ...
    (microsoft.public.vc.mfc)

Loading