<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Approximatrix Forums — Accessing image buffer in Appgraphics]]></title>
		<link>https://forums.approximatrix.com/viewtopic.php?id=797</link>
		<atom:link href="https://forums.approximatrix.com/extern.php?action=feed&amp;tid=797&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Accessing image buffer in Appgraphics.]]></description>
		<lastBuildDate>Mon, 25 Jan 2021 12:49:51 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Accessing image buffer in Appgraphics]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3679#p3679</link>
			<description><![CDATA[<p>Roland,</p><p>Our GTK+ packages are only 32-bit at this time.&nbsp; When these packages were originally assembled, that was the only &quot;stable&quot; version of GTK+ for Windows.&nbsp; I can revisit this, though.&nbsp; With 32-bit on Windows, you would be limited to about 1.5GB of memory allocation, which is still substantial.</p><p>Changing the memory model is only useful for increasing the amount of statically allocated memory the program can use.&nbsp; By statically allocated, I am referring mostly to arrays who&#039;s sizes are pre-determined.&nbsp; If you use Fortran&#039;s <em>ALLOCATE</em> statement, though, you can vastly exceed the limits imposed by a different memory model.&nbsp; </p><p>Just as a reference, using the <em>medium</em> memory model, even with a 64-bit program, will still limit you to 2GB of statically declared memory.</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Mon, 25 Jan 2021 12:49:51 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3679#p3679</guid>
		</item>
		<item>
			<title><![CDATA[Re: Accessing image buffer in Appgraphics]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3678#p3678</link>
			<description><![CDATA[<p>High Jeff,<br />thanks for your effort! I played a lot with GTK-Fortran library and it works rather good.<br />there are, however, two concerns:<br />1. Its only possible to use GTK+32bit in the compiler options.<br />2. Only small memory model is possible. With the examples I am playing with, this is probably no problem. But I would like to add Fourier transforms to the image; this might lead to memory problems I fear.<br />Regards, Roland</p>]]></description>
			<author><![CDATA[null@example.com (rjoos)]]></author>
			<pubDate>Mon, 25 Jan 2021 08:03:15 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3678#p3678</guid>
		</item>
		<item>
			<title><![CDATA[Re: Accessing image buffer in Appgraphics]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3677#p3677</link>
			<description><![CDATA[<p>Roland,</p><p>GTK would certainly provide the buffers you&#039;re looking to work with.&nbsp; AppGraphics is just limited in order to keep things simple.&nbsp; I&#039;ve been looking a bit more into how you could actually read and write numeric values to an AppGraphics bitmap, but I haven&#039;t come up with a simple solution.</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Tue, 19 Jan 2021 15:20:34 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3677#p3677</guid>
		</item>
		<item>
			<title><![CDATA[Re: Accessing image buffer in Appgraphics]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3676#p3676</link>
			<description><![CDATA[<p>Just to complete this discussion: Playing with GTK-Fortran examples I realized that within the frame of GTK+ bitmaps can be handeled by buffers. One of the examples is the mandelbrot-pixbuf.f90 and demonstrates exactly the solution to my question.<br />Regards, Roland</p>]]></description>
			<author><![CDATA[null@example.com (rjoos)]]></author>
			<pubDate>Thu, 14 Jan 2021 22:41:25 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3676#p3676</guid>
		</item>
		<item>
			<title><![CDATA[Re: Accessing image buffer in Appgraphics]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3675#p3675</link>
			<description><![CDATA[<p>Hello Jeff and Carlos<br />Having read your answeres and scanned through the Forum I tried DISLIN. Little search reveiles that DISLIN comes with a good example for Mandelbrot set calculation, including a simple GUI with zoom-functions, progress bar etc. Keeping in mind that the goal is to do fast calculation of large bitmaps (&gt;2000 * 2000 pixels) and display the bitmaps, I increased the mandelbrot matrix from 600 * 600 pixels to 2000 * 2000 pixels. The progress bar shows that calculation of the mandelbrot set indeed is very fast. However, the display of the image takes considerable time. So I think that DISLIN stores an intermediate image file on disk and then loads the image file for display.<br />I did a lot of programming with Borland Delphi and Lazarus / Freepascal on Windows, also using BGI. As drawing of bitmaps within BGI is possible, I have difficulties to understand why this should not be possible within the AppGraphix framework. See e.g. the definition of &quot;putimage&quot; in BGI:<br /> void putimage (int left, int top, void *bitmap, int op);<br />I have no experience with GTK+ / Cairo and presently can&#039;t figure out how to deal with that. From the link Carlos provided I don&#039;t&nbsp; understand how to do this.<br />What about using openGL or Cimg (Cimg.eu)? Any hints or proposals?<br />Roland</p>]]></description>
			<author><![CDATA[null@example.com (rjoos)]]></author>
			<pubDate>Wed, 13 Jan 2021 08:31:17 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3675#p3675</guid>
		</item>
		<item>
			<title><![CDATA[Re: Accessing image buffer in Appgraphics]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3674#p3674</link>
			<description><![CDATA[<p>Just vague idea: create your image using Cairo library, directly from Simply Fortran (see topic below: <a href="https://forums.approximatrix.com/viewtopic.php?id=781)">https://forums.approximatrix.com/viewtopic.php?id=781)</a>, and then display it in AppGraphics window.<br />Unfortunately, AppGraphics does not support direct import of png files...</p>]]></description>
			<author><![CDATA[null@example.com (Carlos Herrera)]]></author>
			<pubDate>Tue, 12 Jan 2021 15:13:54 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3674#p3674</guid>
		</item>
		<item>
			<title><![CDATA[Re: Accessing image buffer in Appgraphics]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3673#p3673</link>
			<description><![CDATA[<p>Roland,</p><p>AppGraphics does not support accessing the image buffer.&nbsp; The Fortran <em>imagetype</em> derived type contains a member of <em>type(c_ptr)</em> that is actually a Windows <em>HBITMAP</em> handle.&nbsp; While you could possibly access the bytes of an <em>HBITMAP</em> by converting it to a device-independent bitmap and using some additional Windows API calls to access the <em>DIBSECTION</em>, I wouldn&#039;t recommend it.&nbsp; Additionally, accessing the bitmap handle isn&#039;t part of the AppGraphics API, so there&#039;s always the chance it would be broken in a future release.</p><p>You can get some mild speed improvement by moving to double-buffering, but it wouldn&#039;t be an order of magnitude faster.&nbsp; It might only improve things by a factor of 2.&nbsp; The <em>putpixel</em> call is expensive because it first looks up the current window and drawing context from arrays before actually drawing the single pixel.&nbsp; After the pixel is drawn, it triggers a Windows invalidation for a rectangle around that single pixel.&nbsp; I don&#039;t believe the bottleneck is the Windows GDI in this case.</p><p>A better image drawing routine or a more efficient pixel operation would be preferable, but they don&#039;t exist in AppGraphics right now.</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Tue, 12 Jan 2021 12:34:32 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3673#p3673</guid>
		</item>
		<item>
			<title><![CDATA[Accessing image buffer in Appgraphics]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3672#p3672</link>
			<description><![CDATA[<p>Hello</p><p>I would like to produce fast calculations of bitmap graphics, e.g. high resolution mandelbrot set (2500 x 2000 pixels).<br />I manage to do this by calling putpixel(px,py,creatergb(ih,ih,ih)) for each point. However, this is very slow bcause every putpixel is essentially a call to the windows GDI system.</p><p>Logically there must be a way to define an image buffer<br />type(imagetype):: iarr<br />...<br />call allocateimage(iarr, 2500, 2000)<br />....<br />manipulate, access iarr(x,y)<br />....<br />then <br />call pasteimage(1,1,iarr)</p><p>and finally </p><p>call freeimage(iarr)</p><p>How does one access the image buffer?</p><p>Regards,<br />Roland</p>]]></description>
			<author><![CDATA[null@example.com (rjoos)]]></author>
			<pubDate>Mon, 11 Jan 2021 16:14:42 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3672#p3672</guid>
		</item>
	</channel>
</rss>
