• Advertisement
Sign in to follow this  

sdl pixels..

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
Share on other sites
Quote:
Original post by Evil Steve
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.


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 this post


Link to post
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 this post


Link to post
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement