-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
imgFormat == "RGBA" is missing. #4
Conversation
ENV: GLPlot (0.0.3), Images (0.4.13), GLAbstraction (0.0.3) When I try to run "image.jl" which is an example of GLPlot package, an error messages shows that "Color Format RGBA not supported".
That's interesting, I don't really know, why it works fine on all my platforms, for most image formats. |
No, they have different storage order---the name encodes the order of bytes. It's weird that telling OpneGL that it's RGBA works fine when the storage order is BGRA, I don't understand that at all. You're sure it preserves the colors correctly? (Compared to a system image viewer or ImageView.) |
I'm using a Mac OS X (10.9.5). |
That's really odd... Especially that it just works for you @kwonoh, and it works equally well for me with BGRA, even though that the storage order is not changed... |
imgFormat == "RGBA" is missing.
I just thought that Images.jl returns RGBA ordered data from OS X framework but the line 175 in GLTexture.jl doesn't check for it. |
No it's more complicated ;) I removed RGBA, as I always got BGRA and it worked fine with GL_RGBA. So I thought, okay that's odd, but if it works, I leave it for now. |
But it's right that OSX will return RGBA, whereas other platforms will usually use BGRA. @SimonDanisch, if you search this page for the first hit for "preferred," you'll see that the driver will do some conversion. But I can't imagine how it would know it's really BGRA when you tell it that it's RGBA. |
By now, I know this page nearly by heart :D #a texture initialized with
bgra = Texture([AlphaColorValue(Images.ColorTypes.BGR(0f0,0f0, 1f0), 1f0) for i=1:N, j=1:N])
println(bgra)
Texture:
ID: 6
Size: [ColorDim: 4]x1024x1024
Julia pixel type: Float32
OpenGL pixel type: GL_FLOAT
Format: GL_RGBA
Internal format: GL_RGBA32F
glplot(bgra) # -> gets displayed correctly
# These, also with Format: GL_RGBA, get displayed correctly as well:
rgba1 = glplot(Texture([Vec4(1,0,0,1) for i=1:N, j=1:N]))
rgba2 = glplot(Texture([AlphaColorValue(RGB(1f0,0f0,0f0), 1f0) for i=1:N, j=1:N]))
|
Oh I actually don't know that page that well. I should read it a little bit more thoroughly! |
Another small point: in Images, Between them, |
That explains, why my example works.
|
If the Image is stored as an Over the next week I'm going to see if I can find a machine with better video drivers and check this myself. Presumably you'll have this figured out by then, but I want to get GL* working locally anyway... |
I'll clean up my mess a bit and support the Color types better and prepare
|
Packages: GLPlot (0.0.3), Images (0.4.13), GLAbstraction (0.0.3)
When I try to run "image.jl" which is an example of GLPlot package, an error messages shows that "Color Format RGBA not supported".