Sign in to follow this  

sdl pixels..

This topic is 3659 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
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

This topic is 3659 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this