Question on Textures, Texture Sizes and rendered Textures

D’oh… an image that is not a self painted image but loaded from the assetManager you mean :facepalm:… You can also look at TextureAtlas, I do something similar there but also call the awt converter for very strange formats (if available).

@zarch said:

Essentially I'm looking for a platform independent thing (i.e. both Android and real Java) that I can load a jpg/png/whatever into using the asset manager and from which I can then read pixel data (either as float or byte - that's not a problem).


I did say that, and again in the post following the one I just quoted ;)

But I think I've found what I need now so lets see what I come up with :)
@zarch said:
I did say that, and again in the post following the one I just quoted ;)

Yeah I didn't read that right

Sorry, the ImageToAwt.convert(Image, Image) method does not work.

That class really needs a rewrite … or even better, complete removal

@Momoko_Fan said:
Sorry, the ImageToAwt.convert(Image, Image) method does not work.
That class really needs a rewrite .. or even better, complete removal


Thanks for the warning!

Really all I need is a getPixel() method in Image. I'd submit a patch with it myself but I really don't understand the data structure variations being used enough to do so reliably :(

I don't suppose anyone feels like volunteering? :D


P.S. Is anyone able to recommend some good examples for working with the bitmap texts and drawing them into textures etc? I've had a quick look at the text node stuff but it didn't make a huge amount of sense and my IDE couldn't find the source files for some of the methods used etc...so I didn't get very far with that and won't until I have time to hunt down more examples.

I haven’t read the whole tread, so if that’s been touched, I’m sorry about that.



Wouldn’t this help?



[java]

texture.getImage().getData()

[/java]



getData’s JavaDoc:

getData returns the data for this image.

That data is in List|ByteBuffer| format. There's also getData(index).

I would imagine this is that image's pixel data. Maybe I'm wrong though.

Sh

@madjack said:

I haven’t read the whole tread, so if that’s been touched, I’m sorry about that.



Wouldn’t this help?



[java]

texture.getImage().getData()

[/java]



getData’s JavaDoc:



That data is in List|ByteBuffer| format. There’s also getData(index).



I would imagine this is that image’s pixel data. Maybe I’m wrong though.



Should have read the thread ;)

It doesn't help as the data inside the ByteBuffer is in a variable format depending on the Format setting of the Image object.

Alright then.



Would be nice if that data could be “converted” to RGBA though.



Maybe someone could do a converter… I guess that’s what you were referring to above.



I’ll shut up now. :wink: