Jump to content
  • Advertisement
Sign in to follow this  
pfullsack

Help with an interview question

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

hi I have received a questionnaire from one of the game companies but am not too sure how to answer this question. I would appreciate some insight in this Q: Write a function to expand an 8 bit to a 32 bit image Screen320x240x32 *Convert(Screen320x240x8 *pScreen, unsigned char iAlpha) { } using the following structure struct RGB16 { union u { unsigned short iFull; }; enum RGB16MASK { RGB16_RED_MASK = 0xF800, RGB16_GREEN_MASK = 0x07E0, RGB16_BLUE_MASK = 0x001F }; }; struct RGB32 { union u { unsigned int iFull; // all the color elements // together (8 bits per) unsigned char iElements[4]; // Separate color elements }; enum RGB32_ELEMENTS { R32EL_RED = 0, R32EL_GREEN, R32EL_BLUE, R32EL_ALPHA }; }; struct Screen320x240x32 { RGB32 *m_pScreen; // pointer to image data }; struct Screen320x240x8 { unsigned char *m_pScreen; // pointer to image data RGB16 m_aPalette[256]; // image’s palette }; regards pf

Share this post


Link to post
Share on other sites
Advertisement

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

Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!