Re: [JAVA2D] createCompatibleImage: why is it faster than creating a Buffered image?

2009-06-07 Thread Ken Warner
Last time I looked, both C and C++ had runtime code -- I suppose one could dispute that that code created a runtime environment. I wouldn't argue with that. And if the design of an API is so complex that the average programmer can't understand how to use it is the hallmark of good design --

Re: [JAVA2D] createCompatibleImage: why is it faster than creating a Buffered image?

2009-06-06 Thread Ken Warner
The first thing that you will have to understand is that Java is going to be slower than anything except maybe Flash. If your goal is to be as fast as C, C++, C# or .Net then you should find another goal because it is already a given that Java will be slower. Another way to display an image is

Re: [JAVA2D] Java2d Hardware Scaling Visual Artifact Problem w/Bilinear Interpolatio

2009-01-30 Thread Ken Warner
And by the way -- BufferedImages still suck big time. jav...@javadesktop.org wrote: [quote]So I will attempt to hereby gracefully disengage...[/quote] Yes, and I suggest to go further and not re-engage. Dmitri [Message sent by forum member 'trembovetski' (trembovetski)]

Re: [JAVA2D] Java2d Hardware Scaling Visual Artifact Problem w/Bilinear Interpolatio

2009-01-29 Thread Ken Warner
Yes, if you deconstruct the notion of making an API complete into it doesn't work vs. it's not there to begin with. No, I'm not referring to MIS vs. BufferedImage -- directly. And I'm not really in the mood for another argument which this discussion will degenerate to in about 2 emails. So I

Re: [JAVA2D] Java2d Hardware Scaling Visual Artifact Problem w/Bilinear Interpolatio

2009-01-28 Thread Ken Warner
Really? -- happy? -- How come SUN guys give me so much crap when I ask for an enhancement to speed up what I want to do? jav...@javadesktop.org wrote: The best workaround is to write your own bi-linear interpolator. Best Workarround? This means loosing hw-accaleration :-/ They are the

Re: [JAVA2D] Drawing to an off screen buffer

2008-09-25 Thread Ken Warner
Do you get reasonable animation with this method? How many frames a second do you get using invokeLater()? [EMAIL PROTECTED] wrote: You don't need a BufferStrategy or VolatileImage unless you are doing live animation. It was hard to tell from your message if that was the case. I usually use

Re: [JAVA2D] Optimizing concentric arcs

2008-09-25 Thread Ken Warner
YES! Why not FPU acceleration? That's what it's there for. Er... is StrictMath already FPU accelerated? If it is then, oh well... The current Math package is really not very good. Especially for low level graphics stuff where 5 significant digits is the minimum accuracy that is useful.

Re: [JAVA2D] Dynamics of acceleration of BufferedImages (managed images)

2008-09-11 Thread Ken Warner
Dmitri Trembovetski wrote: That's the idea. The developer shouldn't be worrying about this stuff, it should work for most cases. For those cases where the user needs tweaking or resource management there are APIs like setAcceleratedPriority and the like. -- That's exactly the kind

Re: [JAVA2D] Dynamics of acceleration of BufferedImages (managed images)

2008-09-11 Thread Ken Warner
to expose the inner implementation of their system. That's just my take when trying to see it from the other side. Mike -Original Message- From: Discussion list for Java 2D API [mailto:[EMAIL PROTECTED] On Behalf Of Ken Warner Sent: Thursday, September 11, 2008 12:54 PM To: [EMAIL

Re: [JAVA2D] Dynamics of acceleration of BufferedImages (managed images)

2008-09-10 Thread Ken Warner
I have just a simple, non-threatining, non-hostile question: BufferedImage seems to be the crossroads for almost every operation in Java2D. If you are reading an image using ImageIO then BufferedImages are the object created. Drawing the image to the screen seems to be focused on drawing a

Re: [JAVA2D] Copying a portion of an Image?

2008-08-25 Thread Ken Warner
I'd suggest starting with a BufferedImage rather than an Image. They don't play well together... [EMAIL PROTECTED] wrote: I feel fairly stupid asking this question, as it seems like an operation that should be pretty simple, and it probably is, but for whatever reason I can't figure out the

Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-08-05 Thread Ken Warner
If you call repaint() you invoke the AWT thread and paint() is called by the AWT thread. update() and paint() should not be called directly by your program they are generally called from the AWT thread in response to some sort of system event like Expose or Move etc. With VolitileImages, you

Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-08-05 Thread Ken Warner
That's the way I do things. I do active rendering using BufferStrategy. I turn off repaint() setIgnoreRepaint(true) while I'm active rendering and then when I'm not active rendering and the applet is just sitting there, I turn on repaint() with setIgnoreRepaint(false) so that if the applet gets

Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-08-04 Thread Ken Warner
Do you call paint method directly or indirectly through repaint()? [EMAIL PROTECTED] wrote: Does your rendering loop run on the event dispatch thread or some other thread? Well, I am not that familiar with the event dispatch thread and myabe that's the problem in my code . . . . To render

Re: [JAVA2D] BufferStrategy problem with resize events

2008-07-22 Thread Ken Warner
Are you overriding update() and paint() and do you setIgnoreRepaint(true) on your component? [EMAIL PROTECTED] wrote: I am using BufferStrategy with 2 buffers to render off screen and then blast the contents on to the screen and I am impressed with the simplicity of it and its performance.

Re: [JAVA2D] BufferStrategy problem with resize events

2008-07-22 Thread Ken Warner
I would revert to the use of the Java Docs recommended do/while loops. They work well. And you will have to figure out when to call your rendering method. I use MemoryImageSource and render with the do/while loops in my newPixels() method. I use paint() with the do/while loops for expose

[JAVA2D] Final version of VSync available...

2008-07-18 Thread Ken Warner
For your testing purposes -- http://pancyl.com/VSync.htm Source: http://pancyl.com/java/vsync/VSyncApplet.java http://pancyl.com/java/vsync/VSyncCanvas.java http://pancyl.com/java/vsync/VSyncFS.java === To unsubscribe,

Re: [JAVA2D] Join images (tiles) with low memory footprint

2008-07-11 Thread Ken Warner
Yeah, I'd like to know that one too... [EMAIL PROTECTED] wrote: I have the following problem: I try to join many tile images into a big image using BufferedImage and then storing it as PNG or JPG. Memory usage is linear - for 4000x4000 pixel result image (16,000,000 pixel) I need 16 times

[JAVA2D] What is the proper way to compare drawing a BufferedImage and drawing an Image with BufferStrategy?

2008-07-09 Thread Ken Warner
In a test applet, I can draw a BufferedImage or an Image using BufferStrategy. Drawing with BufferStrategy is more than 3 times faster than just a straight drawImage() with a BufferedImage. Am I doing a proper comparison? I thought BufferedImage's did all the acceleration for you. Or was that

Re: [JAVA2D] vertical synchronization in full screen exclusive mode problem

2008-07-09 Thread Ken Warner
My latest version of VSyncApplet toggles between the use of Image and BufferedImage for simple drawing. Both are rendered to the screen with BufferStrategy. I see disturbing results. BufferedImages are half as fast as Image for simple drawing. I'm probably doing something wrong. Any

Re: [JAVA2D] vertical synchronization in full screen exclusive mode problem

2008-07-09 Thread Ken Warner
I think you misunderstand my intentions. The applet shows a profound defect in the Java2D API. Either the applet is wrong or the Java2D API needs work. I'm trying to illuminate the problem with my applet. If the applet uses the Java2D API wrong when I use standard programming strategies, then

Re: [JAVA2D] vertical synchronization in full screen exclusive mode problem

2008-07-08 Thread Ken Warner
Do you feel like posting the whole code? I'd like to turn it into an applet for test purposes. It would be an excellent test program. I'll repost it as an applet. You can email it to me direct at: [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi all, I can get vertical synchronization in

Re: [JAVA2D] Pushing int[] pixel data into Image

2008-07-05 Thread Ken Warner
The absolute fastest way is to first stay away from BufferedImage. Use MemoryImageSource. It's real easy to use -- as opposed to BufferedImage which nobody really understands and takes 10 steps to do one simple thing. Make an image using MemoryImageSource then use BufferStrategy (not

[JAVA2D] I need to apply a convolution kernel to an array of int's...

2008-06-11 Thread Ken Warner
I'm looking for a way to apply a simple convolution kernel to an array of int's representing the RGB of an image. I've looked at Graphics2D. It has a setTransform() method but only allows an affine transform -- scale,rotate,shear etc. I've looked at ConvolveOp but it only takes BufferedImages,

[JAVA2D] What is the fastest way to draw a small portion of a BufferedImage?

2008-05-27 Thread Ken Warner
I need to draw just a small rectangular portion of a BufferedImage. What is the absolute best, fastest way to do that? Is their a tutorial that will show how to do that. Note that this is a different task than before. There will be no projection done on that rectangular part of the BI. It

Re: [JAVA2D] I need a way to decode an image file directly into a byte or i

2008-05-20 Thread Ken Warner
Thanks, I've done that and am getting much better performance than previously. ba = ((DataBufferByte)(bi.getRaster().getDataBuffer())).getData(); pixels = new int[width*height]; for(int i = 0,j = 0; i pixels.length; i++,j+=3) { pixels[i] = 0xff00 | (((ba[j+2]

[JAVA2D] Prototype applet using BufferedImage...

2008-05-19 Thread Ken Warner
If I do this to get the pixels from an image for later rendering in a MemoryImageSource my applet runs fine. width = image.getWidth(canvas); height = image.getHeight(canvas); pixels = new int [width * height ]; int cnt = 0; pg = new

Re: [JAVA2D] I need a way to decode an image file directly into a byte or integer array...

2008-05-19 Thread Ken Warner
neighbor interpolation. The second stage does a bi-cubic interpolation and I explicitly initialize the alpha channel to 0xff to make the image not transparent. Ken Warner wrote: Hi Jim, I'm not communicating the step by step procedure for the projection I guess. It's not like you describe

Re: [JAVA2D] I need a way to decode an image file directly into a byte or integer array...

2008-05-19 Thread Ken Warner
what you mean when you say that it means it's transparent to [...] BufferStrategy since that object doesn't deal with pixel storage formats... ...jim Ken Warner wrote: Maybe it doesn't mean the BufferedImage is transparent but 0x00 in the alpha channel of a pixels means it's

Re: [JAVA2D] I need a way to decode an image file directly into a byte or integer array...

2008-05-19 Thread Ken Warner
in an earlier email the image decoding step is far from the most important player in your process, so worrying about speeding up the rest of the process would probably be more fruitful in the long run anyway. Good luck! ...jim Ken Warner wrote: Whatever... The image

[JAVA2D] [Fwd: [PanoToolsNG] Billion-pixel panoramas]

2008-05-15 Thread Ken Warner
This is what I'm talking about. The current fleet of Java panorama viewers can display images usually less than 5000x2500 pixels -- more depending on the compression level. The default memory settings for the current plugin are the biggest limiting factor. And many panographers view Java as

Re: [JAVA2D] [JAI-IMAGEIO] [Fwd: [PanoToolsNG] Billion-pixel panoramas]

2008-05-15 Thread Ken Warner
released it Open Source (BSD-style license): http://www.openchannelfoundation.org/projects/JadeDisplay Let me know if you find it useful. -Bob Deen @ NASA-JPL Multimission Image Processing Lab [EMAIL PROTECTED] Ken Warner wrote: This is what I'm talking about. The current fleet of Java panorama

Re: [JAVA2D] I need a way to decode an image file directly into a byte or integer array...

2008-05-13 Thread Ken Warner
discussed recently on this thread: http://forums.java.net/jive/thread.jspa?messageID=269294 ...jim Ken Warner wrote: I think there is a hole in the greater Java API for working with images. Images and BufferedImages are great if all you want to do is download [stuff deleted

[JAVA2D] I need a way to decode an image file directly into a byte or integer array...

2008-05-12 Thread Ken Warner
I think there is a hole in the greater Java API for working with images. Images and BufferedImages are great if all you want to do is download an image file and put it on the screen. They are really good at that. But if someone (like myself) needs to work at a lower level -- at the pixel level

Re: [JAVA2D] Why does BufferedImage setRGB consumes memory?

2008-04-15 Thread Ken Warner
I hope MemoryImageSource is not going to be depricated!!! I use it big time in all my applets. What would be the replacement for MemoryImageSource? I hope you aren't thinking that BufferedImage is better. BufferedImage is a giant, poorly thought out hairball... [EMAIL PROTECTED] wrote: The

Re: [JAVA2D] Why does BufferedImage setRGB consumes memory?

2008-04-15 Thread Ken Warner
One Raster? When I went through the same problem, I had to do that three times to get the R,G,B channels. [EMAIL PROTECTED] wrote: [code]byte[] data=((DataBufferByte)tex.getRaster().getDataBuffer()) .getData() [/code] looks like there is a lot of casting involved. I can see only one.

[JAVA2D] Premature end of JPEG file

2008-03-11 Thread Ken Warner
I'm getting this bazarre error message when I exit my applet. It doesn't show until *AFTER* the applet has had it's destroy() method called. I do not issue this error message in my code and don't know where to look in the Java source to figure out what to do about it. It's harmless but

Re: [JAVA2D] Alpha blending performance

2008-02-13 Thread Ken Warner
The simple answer is don't draw into the JPanel -- draw into one of Java's image classes (Image, BufferedImage, etc.) and then draw the Image into the JPanel. Then save the Image as a jpeg in the usual ways... Olsen Chris wrote: Hello All -- I have what is probably a simple problem to you

Re: [JAVA2D] 6uN-b10: 2D Performance regression -or- problems enabling D3D pipeline

2008-01-17 Thread Ken Warner
I think the v-sync is a great idea. If done properly, it could solve a lot of the tearing problems that unsynced repeated drawing can cause I have this thought. What if the fastest a program can prepare an image for render is less than the frame sync time? Will there be a way to draw fewer

[JAVA2D] Possible bug in Fullscreen Exclusive mode -- Java 1.6.0_5-ea

2008-01-07 Thread Ken Warner
Environment: Microsoft Windows 2000 [Version 5.00.2195] SP4 Java Plug-in 1.6.0_05-ea Using JRE version 1.6.0_05-ea Java HotSpot(TM) Client VM URL: http://pancyl.com/ http://pancyl.com/gnomic.htm In the first URL, if you go fullscreen, the Java Applet Window banner is displayed. When I go

Re: [JAVA2D] Odd Vista, NVidia, dual-display, Java interaction...

2008-01-04 Thread Ken Warner
My applet goes fullscreen exclusive. Don't know if an applet will do you any good http://pancyl.com F1 enters; ESC exits fullscreen exclusive... [EMAIL PROTECTED] wrote: Reposted from http://weblogs.java.net/blog/chet/archive/2006/10/java_on_vista_y.html on Dmitri's suggestion... So

[JAVA2D] Possible bug in Fullscreen Exclusive mode -- Java 1.6.0_5-ea

2007-12-31 Thread Ken Warner
Environment: Microsoft Windows 2000 [Version 5.00.2195] SP4 Java Plug-in 1.6.0_05-ea Using JRE version 1.6.0_05-ea Java HotSpot(TM) Client VM URL: http://pancyl.com/ http://pancyl.com/gnomic.htm In the first URL, if you go fullscreen, the Java Applet Window banner is displayed. When I go

Re: [JAVA2D] Question about fullscreen exclusive mode in applet in browser...

2007-12-03 Thread Ken Warner
how to go into fullscreen mode without the status bar showing. I think they may be exploiting a bug fixed in the latest versions. On my jre (6uN) the window does show the warning. Thanks, Dmitri Ken Warner wrote: Hi, My applet at http://pancyl.com can go into fullscreen

Re: [JAVA2D] Question about fullscreen exclusive mode in applet in browser.

2007-12-03 Thread Ken Warner
All valid arguments. And I'm sure I don't know any of the grizzly stories about how Java is/was being used for fraud. It's a hoist petard situation -- damned if you do -- damned if you don't. Having Java become suspect as an easy tool for fraud certainly won't do us developers any good.

Re: [JAVA2D] fillPolygon performance versus drawImage

2007-12-02 Thread Ken Warner
Hi Gregory, Do all your rectangle drawing to an off screen image. The image can be any thing from a Toolkit image to a BufferedImage to a VolitileImage. Each one has advantages. Then draw the off screen image to the screen. Your mileage may vary... [EMAIL PROTECTED] wrote: Hi, This is

Re: [JAVA2D] [PanoToolsNG] Layout test

2007-11-27 Thread Ken Warner
forums. I suggest that any of you who are concerned about Java's utility as a panorama viewer platform to join that forum and complain to that forum. Ken Warner Notes. In the middle of the layout proces a new Sun Java was installed on my PC - and due to some new security restrictions Immervisions

Re: [JAVA2D] Please try the new Direct3D 9-based Java2D pipeline in 6uN EA-- another stupid question...

2007-11-26 Thread Ken Warner
I thought the first notice that was sent out about the D3D pipeline said that the OpenGl pipeline was turned on for D3D. I must have misunderstood what was said. The D3D pipeline and the OpenGL pipelines are two different pipelines with two entirely different sets of problems mostly caused by

Re: [JAVA2D] Saving restoring a region of a VolatileImage

2007-11-26 Thread Ken Warner
Dmitri once sent me a link to the docs for BufferStrategy. There's an example loop there that works -- IF YOU ARE USING BufferStrategy. For just VI -- try the forums I guess http://java.sun.com/javase/6/docs/api/java/awt/image/BufferStrategy.html The loop described in the docs work for me

Re: [JAVA2D] Saving restoring a region of a VolatileImage

2007-11-26 Thread Ken Warner
That's what I've found. That render loop is almost instantaneous while the pixel pushing takes two orders of magnitude more time. [EMAIL PROTECTED] wrote: It is unlikely that the graphics creation and disposal would cost you any noticeable amount of time, especially compared to everything

[JAVA2D] Dumb question about Direct?????

2007-11-23 Thread Ken Warner
Sorry for the dumb question but I see references to DirectDraw, DirecX and Direct3D. Could someone briefly describe the difference between the three and what exactly is Java doing with regard to using DirectDraw, DirectX and Direct3D? Which one is being used for the OpenGL pipeline?

Re: [JAVA2D] Dumb question about Direct?????

2007-11-23 Thread Ken Warner
So then the line in the sand (so to speak) is whether or not the graphics card (driver) supports OpenGL to it's full extent? Yes? No? If there is not good support for OpenGL on the host machine, then Java's OpenGL pipeline will fail? Yes? No? So then this is not about the OS as earlier

Re: [JAVA2D] Please try the new Direct3D 9-based Java2D pipeline in 6uN EA

2007-11-23 Thread Ken Warner
. It has a couple of important fixes - it significantly improves performance of Netbeans (and other applications which use LCD and grayscale AA text simultaneously) and addresses issues on Intel chips. Ken Warner wrote: I have an NVida GeForce2 GTS/GeForce2 Pro Driver Version 3.15.00.12.00

Re: [JAVA2D] Saving restoring a region of a VolatileImage

2007-11-20 Thread Ken Warner
I use the BufferStrategy as an interface to VolitileImage and it works great in my applet. I don't make VolitileImage's directly in my code. Dmitri Trembovetski wrote: It would be interesting to find out what was causing the freeze. Would it be possible to create a small test case

Re: [JAVA2D] Saving restoring a region of a VolatileImage

2007-11-20 Thread Ken Warner
I use a Canvas. I'll send you my Canvas class code if you want to see how I do it. Might not make sense because I do all the pixel pushing stuff in another class. [EMAIL PROTECTED] wrote: Ken, how do you create the BufferStrategy in your applet? It seems from the JavaDoc that you need a

[JAVA2D] Three D mouse / navigator / spaceball --- would it work with Java?

2007-11-20 Thread Ken Warner
It would be a neat thing to be able to pan/tilt/zoom with one device. http://www.3dconnexion.com/3dmouse/spacenavigator.php === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff

Re: [JAVA2D] Saving restoring a region of a VolatileImage

2007-11-20 Thread Ken Warner
No, what you described is a computation that is not facilitated by the use of BufferStrategy and VolitileImage. They are for getting what you have computed on the screen -- fast. [EMAIL PROTECTED] wrote: Hi Ken, Yes, I would love to see how you use the strategy even though it's probably not

Re: [JAVA2D] Direct3D is disabled in win2003 in 6uN EA?

2007-11-19 Thread Ken Warner
[quote] Then have higher level layers of graphic acceleration for the more advanced video cards. Shading etc. [/quote] Well I think some kind of black-listing would probably the best thing - black-list which driver/os/directx-versions are known to be broken and emit a small warning on the

Re: [JAVA2D] Direct3D is disabled in win2003 in 6uN EA?

2007-11-19 Thread Ken Warner
* the answers. It's not my fault! Dmitri Trembovetski wrote: Ken Warner wrote: The assumption that, ...typically people don't care about graphics performance on a server, and also drivers tend to be old/buggy on servers as they are not updated as often. Is fundamentally wrong -- at least

Re: [JAVA2D] Direct3D is disabled in win2003 in 6uN EA?

2007-11-19 Thread Ken Warner
performance, and the drivers for these systems are lagging behind client OS-es. Thanks, Dmitri Phil Race wrote: Ken, Please read the subject line. Windows 2003 and 2008 are server OSes and are quite different than windows 2000. -phil. Ken Warner wrote: The funny thing is that Windows

Re: [JAVA2D] Direct3D is disabled in win2003 in 6uN EA?

2007-11-19 Thread Ken Warner
will also be excluded. Thanks, Dmitri Ken Warner wrote: I'm just going by what Dmitri told me... Secondly, starting with b08 the pipeline will only be enabled on client-class OS (WinXP and newer). Win2K* are classified as a server-class OS flavor. The reason for this policy

Re: [JAVA2D] Direct3D is disabled in win2003 in 6uN EA?

2007-11-18 Thread Ken Warner
The assumption that, ...typically people don't care about graphics performance on a server, and also drivers tend to be old/buggy on servers as they are not updated as often. Is fundamentally wrong -- at least in my case. I keep my machine as up to date as possible. I installed the

Re: [JAVA2D] Full screen exclusive mode question...

2007-10-15 Thread Ken Warner
Good suggestions...I'll give those a try. Be nice if it was just gone. I mean how silly... [EMAIL PROTECTED] wrote: Hmm, I haven't checked this, but can't you find the size of the drawable area through a combination of things like getContentPane().getSize() (If its a swing window) and

[JAVA2D] Full screen exclusive mode question...

2007-10-14 Thread Ken Warner
http://pancyl.com/debug.htm It goes full screen exclusive mode now. F1 to enter -- ESC to exit. Someone tell me how it works with D3D acceleration. I can't run the beta version of 1.6 right now. Question/Problem: When in full screen mode in a browser, there is a little status line that

[JAVA2D] How do I install the 1.6 beta as my browser plugin?

2007-10-10 Thread Ken Warner
Hi, I downloaded jre-6u5-ea-bin-b04-windows-i586-27_sep_2007.jar to try D3D acceleration. When I install it, there is no installation as browser plugin. I imagine this is intentional. Is there a way to force it to be a browser plugin? I would like to see real world performance in the

[JAVA2D] How do I run my applet in the 1.6 beta?

2007-10-10 Thread Ken Warner
There's no applet viewer and I didn't put a static main() in my applet. === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA2D-INTEREST. For general help, send email to

Re: [JAVA2D] How do I install the 1.6 beta as my browser plugin?

2007-10-10 Thread Ken Warner
-6u5-ea-bin-b04-windows-i586-27_sep_2007.jar SFAIK this is just a self-extracting jar file that dumps the files on disk - its not an installer. You must use one of the installer downloads - eg the .exe download -phil. Ken Warner wrote: Hi, I downloaded jre-6u5-ea-bin-b04-windows-i586

Re: [JAVA2D] Ok -- what's the deal on the spyware in Java 1.6?

2007-10-10 Thread Ken Warner
Ah! I guess I'm just paranoid - Thanks -- I forgot to turn off the auto download. Russell East wrote: Isn't that just the Update Notification feature? You can disable it in the Control Panel. -- Russell Ken Warner wrote: Ever since I installed 1.6 yesterday, my firewall has been

[JAVA2D] Ok -- what's the deal on the spyware in Java 1.6?

2007-10-10 Thread Ken Warner
Ever since I installed 1.6 yesterday, my firewall has been detecting this connection attempt: C:\Program Files\Java\jre6\bin\jusched.exe TCP (Outbound) 72.5.124.55: http(80) It happens frequently -- like hourly -- I block the attempt. I don't like being spyed on.

Re: [JAVA2D] Please try the new Direct3D 9-based Java2D pipeline in 6uN EA

2007-10-09 Thread Ken Warner
http://pancyl.com/debug.htm I've put some timing code in my applet. It may be useful to do a comparison between 1.5 and 1.6 with the D3D acceleration on your own machine. What you will see in the console window is -- PanCyl v0.3.2_D3DTest Interp Time = 841ms Paint Time(640, 360) = 50ms ---

Re: [JAVA2D] Update N: Framerate degrades markedly

2007-10-08 Thread Ken Warner
I offer this just to try and be helpful. I have an applet that uses VolitileImages throught the BufferStrategy interface. It creates images using a MemoryImageSource. Then it drawImage() onto the BufferStrategy graphics and does a BufferStrategy show(). The show() is in the canonical

Re: [JAVA2D] What's a trick way to clamp a byte to 255 - 0? -- slowness fixed

2007-08-24 Thread Ken Warner
Jim, EXCELLENT! I need to do a couple of things then. 1) Check to see if the multiplication by the basis functions can possibly lead to the kind of values that can possibly cause the kind of overflow problems you describe. I think they might. 2) Generate a test case for the code you

Re: [JAVA2D] What's a trick way to clamp a byte to 255 - 0? -- slowness fixed

2007-08-21 Thread Ken Warner
It was a localization problem. I was using class variables for all the intermediate channel values. Switching to local variables -- method variables -- I see the slight speed up I was expecting. Example: r3 = (int)p00x00FF) 16)*A0) + (((p10x00FF) 16)*A1) + (((p20x00FF)

Re: [JAVA2D] What's a trick way to clamp a byte to 255 - 0? -- history and

2007-08-20 Thread Ken Warner
Yeah, when I integrated it into my bi-cubic interpolator, it slowed it down compared to the logical check clamp. I'm not sure why yet. Maybe it was the way I integrated it. I don't know. In my test suite, the time to interpolate a 944 x 644 image went from 1350ms using the logical test

Re: [JAVA2D] What's a trick way to clamp a byte to 255 - 0? -- history and

2007-08-20 Thread Ken Warner
Not really, it's the whole applet. I just stick in some timing code to watch sections of it. Just imagine those logical tests replaced by the triple shift. I'll post a snippet tomorrow. See: http://pancyl.com/ [EMAIL PROTECTED] wrote: In my test suite, the time to interpolate a 944 x

Re: [JAVA2D] What's a trick way to clamp a byte to 255 - 0? -- history and solution...

2007-08-19 Thread Ken Warner
Last week, I asked the question: What is a trick way to clamp a byte to the range of [0-255] An operation that is needed all the time in image processing. The common strategy to perform this operation is usually a logical check of the form: if(foo 255)foo = 255; else if(foo 0)foo = 0;

Re: [JAVA2D] What's a trick way to clamp a byte to 255 - 0?

2007-08-17 Thread Ken Warner
= 258, bar = 255 Ken Warner wrote: Well, I did a test. The double shift does clamp the top end. But negative numbers are twisted to be 255. In bi-cubic interpolation (the reason for all this nonsense) negative byte (channel) values can occur. The goal is to clamp to the range [0-255] so -100

Re: [JAVA2D] What's a trick way to clamp a byte to 255 - 0?

2007-08-17 Thread Ken Warner
= + bar ); } t1 = System.currentTimeMillis(); System.err.println((2)Time = +(t1 - t0)); System.err.println(); } Ken Warner wrote: Hey Peter, it works! Nice job! I'll work it into my code and see if I get any speed up. I only time

Re: [JAVA2D] What's a trick way to clamp a byte to 255 - 0?

2007-08-15 Thread Ken Warner
)); } Ken Warner wrote: Never mind -- found it... http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.19 At run time, shift operations are performed on the two's complement integer representation of the value of the left operand. The value of ns is n left-shifted s bit

Re: [JAVA2D] What's a trick way to clamp a byte to 255 - 0?

2007-08-14 Thread Ken Warner
...easier - schmeazier -- looks pretty good to me. Thanks... I needed a kick in the head... [EMAIL PROTECTED] wrote: In my code i usually use Math.min and Math.max. It does take more lines, but the intent is obvious and the code is readable. You can play with OR'ing three AND'ed

Re: [JAVA2D] What's a trick way to clamp a byte to 255 - 0?

2007-08-14 Thread Ken Warner
That's obscure enough to be intriguing -- do you have a link to the rules Java works within on shifts? Because the ( 31) looks a little magical. I will also be searching the docs [EMAIL PROTECTED] wrote: if(r 0) r = 0; if(r 255) r = 255; if(g 0) g = 0; if(g 255) g = 255; if(b 0) b =

[JAVA2D] My cylindrical panoram viewer is up for beta test...

2007-08-03 Thread Ken Warner
The reason I'm telling you all is that I've gotten a lot of help here. http://pancyl.com/ This is my cylindrical panorama viewer website. Let me know what you think. Ken === To unsubscribe, send email to [EMAIL

Re: [JAVA2D] problem in loading page in mozilla

2007-08-02 Thread Ken Warner
Go to mozilla.org and look for the forums there. Based on my experience, it won't help much. There are a bunch of inconsistencies in the way mozilla has integrated Java with Firefox. And if you tell them about it, they just point the finger at SUN and Java. The sad truth is that IE generally

Re: [JAVA2D] Why isn't BILINEAR scaling smarter?

2007-07-26 Thread Ken Warner
Exactly! Just look at some of the various Graphics API's that have succeeded and failed. OpenGL -- succeed -- simple, low level graphics that the programmer put together. I think, anyway I like it. GKS -- remember GKS? -- failed. High level display lists. Multi level and really complicated.

[JAVA2D] Why am I getting a null pointer exception when I try to get the drawGraphics from a BufferStrategy?

2007-07-25 Thread Ken Warner
Environment: Java 1.5.0.12; Win2K SP4 Every once in a while, if I stop or restart the applet at just the wrong time I see the following exception. Line marked Here is the last code executed in my stuff. I check to see if the BufferStrategy is null before trying to get a new drawGraphics. It

Re: [JAVA2D] Why isn't BILINEAR scaling smarter?

2007-07-24 Thread Ken Warner
Bilinear interpolation uses a very small 4 pixel neighborhood to interpolate. My experience is that it works pretty good at upscaling -- maybe not so good at downscaling. Other interpolation methods work better at down scaling because they use a larger neighborhood. Bicubic; Lanczos etc. use a

Re: [JAVA2D] OutOfMemoryError

2007-07-21 Thread Ken Warner
Having just beat my head against a virtual brick wall for the last few days, I think I can help. Take a look at: http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/java.html In particular, note these arguments about 3/4 of the way down the page. -Xmsn Specify the initial size, in bytes,

Re: [JAVA2D] Exception in thread Image Fetcher 0 java.lang.OutOfMemoryError: Java heap space

2007-07-19 Thread Ken Warner
Hi Ernst, Like most things Java, there are two viewpoints. I often hear that OOME is the last gasp of the JVM and that all attempts at recovery are futile -- sort of like being Boorg'ed. I don't believe that. It's an urban myth... In fact, I have a small applet that exhausts all memory

Re: [JAVA2D] Why isn't BILINEAR scaling smarter?

2007-07-19 Thread Ken Warner
Couldn't you do this in a loop yourself and control the final interpolation just the way you want it? What if the image isn't divisible by two in one of it's dimensions? I think that it's better to leave the use of interpolation in the hands of the programer. [EMAIL PROTECTED] wrote: There

Re: [JAVA2D] Exception in thread Image Fetcher 0 java.lang.OutOfMemoryError: Java heap space

2007-07-19 Thread Ken Warner
Hi Jim, You raise some interesting points. The reason I used Toolkit was because of the simplicity of the code that I needed to write. I wrote an early version of my applet using ImageIO and BufferedImage. The code ended up being pretty complicated. Right now I use Toolkit; grab the

Re: [JAVA2D] Question about recommended render loop for BufferStrategy...

2007-07-11 Thread Ken Warner
Ken Warner wrote: According to the documentation on: http://java.sun.com/javase/6/docs/api/java/awt/image/BufferStrategy.html One is supposed to do { Graphics graphics = strategy.getDrawGraphics(); //render here graphics.dispose(); } while (strategy.contentsRestored

Re: [JAVA2D] Question about recommended render loop for BufferStrategy...

2007-07-11 Thread Ken Warner
can, please send the test over. Otherwise it is hard to tell what could be wrong. Thanks, Dmitri Ken Warner wrote: Ken Warner wrote: According to the documentation on: http://java.sun.com/javase/6/docs/api/java/awt/image/BufferStrategy.html One is supposed to do { Graphics

[JAVA2D] Question about recommended render loop for BufferStrategy...

2007-07-09 Thread Ken Warner
According to the documentation on: http://java.sun.com/javase/6/docs/api/java/awt/image/BufferStrategy.html One is supposed to do { Graphics graphics = strategy.getDrawGraphics(); //render here graphics.dispose(); } while (strategy.contentsRestored()); So I did that where I

[JAVA2D] Anyone have a good paper on implemetation details of Lanczoz interpolation?

2007-05-31 Thread Ken Warner
I'm curious about the internal details of Lanczoz interpolation. I see a bunch of sinc()funtions but wonder how the usual implementations of Lanczoz resampling is actually done. Anyone have a link to a good paper? A practical paper? Most of the time, the theory gets too abstract for my

Re: [JAVA2D] Making a BufferedImage managed

2007-05-23 Thread Ken Warner
A quick note. I am working on a 360 panorama viewer. I'll describe briefly my architecture. I load images using my own file loader class from a separate thread spawned from the init() method of my applet. I download the image file as bytes in an ordinary file transfer. Once I have the

Re: [JAVA2D] Making a BufferedImage managed

2007-05-20 Thread Ken Warner
Thanks Javadesktop -- whomever you are... Good set of references. Some questions: I wrote an applet to display panoramic images. To display them properly, there is a necessary projection to make images look right. I won't go into the details of the projection but that projection is not in

Re: [JAVA2D] MemoryImageSource flickers when I update pixels with newPixels()...

2007-04-09 Thread Ken Warner
buffer to the screen with the drawImage in the paint method - why not just use the drawImage to the screen directly? ...jim Ken Warner wrote: I'm haveing a strange problem -- I've used MemoryImageSource before with great success. But now, doing the same thing I've done before in Java

[JAVA2D] MemoryImageSource flickers when I update pixels with newPixels()...

2007-04-07 Thread Ken Warner
I'm haveing a strange problem -- I've used MemoryImageSource before with great success. But now, doing the same thing I've done before in Java 1.4 I'm getting flickering on newPixels() in Java 1.5... That is, when I send new pixels to my MemoryImageSource mis and repaint() the image flickers

[JAVA2D] Sub pixel sampling of Raster or DataBuffer in BufferedImage.

2007-02-22 Thread Ken Warner
or DataBuffer in a BufferedImage? It would be a useful thing to review. Maybe I could get a better idea how to proceed with out losing the utility of BufferedImages. Ken Warner === To unsubscribe, send email to [EMAIL PROTECTED