greptilian logo

IRC log for #friendlyjava, 2018-03-06

##friendlyjava on freenode

| Channels | #friendlyjava index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

All times shown according to UTC.

Time S Nick Message
02:14 nanoz joined ##friendlyjava
02:18 nanoz <nanoz> there is a project called evolys this has many set of java projects independent/dependent
02:18 nanoz <nanoz> so on svn checkout via subclipse, eclipse didnt know the subproject were project
02:18 nanoz <nanoz> has anyone encountered similar problem?
07:53 kirua joined ##friendlyjava
12:39 mr_lou Hmmm.....
12:42 mr_lou It appears as if BufferedImage.setRGB() doesn't actually SET pixels, but rather adds them to the existing pixels? When using alpha, it doesn't actually SET a pixel with that value, but rather merges it with the pixel value that was already there. At least it looks that way.
12:43 mr_lou But even when trying to "clear" the image by called setRGB() with an array of 0xff000000 pixels - or using fillRect() to clear - doesn't change anything.
12:43 mr_lou I feel I'm missing something.
13:13 * mr_lou fiddles with AlphaComposite without effect
15:02 * mr_lou pokes aditsu
15:02 aditsu ow!
15:02 mr_lou Halp! :-(
15:03 aditsu can you paste your code?
15:03 mr_lou Working on my rotation stuff. Wanna make pixels that are farther away look darker. Thought I'd use alpha to do this. And I think that part works. But when using alpha, it's like the previous image isn't cleared, so the transparent pixel is just drawn on top of the previous pixel, when using setRGB(). I don't get that.
15:04 mr_lou Shouldn't setRGB() actually SET new pixels? And not merge them with the ones that are already there?
15:05 aditsu not sure.. you were creating new images though, or did you change it?
15:05 aditsu btw, the rotation code has lots of room for optimization
15:05 mr_lou Doesn't matter. It'll just be used to create image that'll become a video.
15:05 mr_lou *images
15:06 mr_lou Previously I used one of those MemoryImageSource yes. Now I used BufferedImage.
15:07 aditsu well, some code would help, but have you considered just changing the colors instead of using alpha?
15:08 mr_lou Tried that too. Changing alpha just seems easier.
15:08 mr_lou But apparently not.
15:08 mr_lou Can't think of any clever stuff to do changing colours.
15:08 mr_lou I'm calculating a "zindex", that ranges from 0 to 255.
15:08 mr_lou Depending on z position of each pixel.
15:09 mr_lou Would be easy to just make that alpha.
15:09 aditsu you could simply do alpha mixing in your code
15:09 mr_lou Not sure how to use that value to change colours. I'm not getting any useful results with the things I've tried.
15:09 mr_lou That's what I'm doing.
15:09 mr_lou alpha mixing
15:09 mr_lou But that's when I get "ghost effects" because the previously image apparently isn't cleared.
15:10 aditsu I mean do it manually instead of passing it to the image
15:10 mr_lou Even when I try setting all 0xff000000 pixels BEFORE I set the other pixels, I still have a ghost effect.
15:10 aditsu but either way, give me some code and I can try to fix it
15:10 mr_lou Hm
15:10 mr_lou You will need the image too.
15:11 aditsu you could try to just reproduce the problem in an test program
15:11 * mr_lou cleans up code a bit
15:11 aditsu a*
15:13 mr_lou The code: https://pastebin.com/hhrJLY4f
15:14 mr_lou The image: http://www.villumsign.dk/logoinvert.png
15:14 mr_lou Should mention though, that it's all coded to run on a 1920x1080 screen. Will probably not look right on other resolution.
15:16 aditsu 1920x1200 here
15:16 mr_lou hm
15:16 mr_lou Well...
15:17 mr_lou I guess we'll find out then. :-)
15:18 aditsu ok I need some time
15:19 mr_lou It's 95% the same code as last time.
15:20 mr_lou Just with a PNG image now, instead of an IndexColorModel MemorySourceImage.
15:24 aditsu mr_lou: you may want to clear g before drawing the image
15:24 mr_lou You mean with a fillRect()?
15:24 mr_lou Tried that.
15:24 mr_lou Changed nothing.
15:24 aditsu or clearRect
15:24 mr_lou Hmm.
15:24 mr_lou Didn't try clearRect();
15:24 aditsu g.clearRect(0, 0, w, h);
15:26 mr_lou doh... dumbass me....    I never cleared anything on g.... I was doing it on screenG.
15:28 mr_lou That was it of course.

| Channels | #friendlyjava index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

##friendlyjava on freenode