Divelix
Divelix

Reputation: 422

What is the difference between pixel formats in LibGDX?

I'm exploring Pixmap, and I have found Pixmap.Format with different formats and no discription:

What is the difference between them?

Upvotes: 1

Views: 480

Answers (1)

Bartek Banachewicz
Bartek Banachewicz

Reputation: 39400

The relevant documentation is, unsurprisingly for a java library, in a totally weird place; specifically in docs for getPixels:

Returns the direct ByteBuffer holding the pixel data. For the format Alpha each value is encoded as a byte. For the format LuminanceAlpha the luminance is the first byte and the alpha is the second byte of the pixel. For the formats RGB888 and RGBA8888 the color components are stored in a single byte each in the order red, green, blue (alpha). For the formats RGB565 and RGBA4444 the pixel colors are stored in shorts in machine dependent order.

Upvotes: 3

Related Questions