Public Group

# sdl pixels..

This topic is 4000 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

hey all i know that pixels could be 8,16,32.. bits. in sdl i saw that they point to each pixel in char*. if pixel are 8/16/32 bits , how could the screen be symmetric??/ i mean a part of a screen could be like: [bits][bits][bits] line1 [bits][bits][bits] line2 [bits][bits][bits] line3 we see 3X3 pixels, and width != height !!! they should be equal ,right??

##### Share on other sites
Sorry, I don't understand...

If you have a 16-bit image, then the first pixel is at indices 0 and 1, the second pixel is at indices 2 and 3, etc. Similarly for 32-bit (or 24-bit, although it's not really used much any more).

What makes you think that the screen needs to be symetric? So long as all scanlines are the same width in bytes, it doesn't matter.

##### Share on other sites
Quote:
 Original post by Evil SteveSorry, I don't understand...If you have a 16-bit image, then the first pixel is at indices 0 and 1, the second pixel is at indices 2 and 3, etc. Similarly for 32-bit (or 24-bit, although it's not really used much any more).What makes you think that the screen needs to be symetric? So long as all scanlines are the same width in bytes, it doesn't matter.

i mean, if we draw for example 3X3 pixels on the screen. it should be square,
but because of the width of each pixel, it wont be exactly a square.
and if a pixel gets more depth ,32 for example, that makes this thing more asymmetric! how they overcome this problem?

##### Share on other sites
I don't understand your assumption. I'm still reading up on pixels right this moments (you might find this page of use: http://lazyfoo.net/articles/article03/index.php ), but I don't know anything about the color depth changing the proportions. Sure, in memory, it's stored more rectangular, but shouldn't it be a perfect square on the screen? Have you tested your theory yet?

Color depth should only effect the colors you can use.

##### Share on other sites
The number of bits in a pixel don't affect how wide it is. The bits aren't lined up side by side on screen or anything. They just affect how many colours each pixel can display.

1. 1
Rutin
40
2. 2
3. 3
4. 4
5. 5

• 18
• 20
• 12
• 14
• 9
• ### Forum Statistics

• Total Topics
633363
• Total Posts
3011514
• ### Who's Online (See full list)

There are no registered users currently online

×