Changeset 461 for trunk/src/gl/gl_device.cc
- Timestamp:
- 08/19/15 19:01:16 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gl/gl_device.cc
r439 r461 51 51 } 52 52 // TODO: BGR vs RGB, single channel 53 assert( image->format->BytesPerPixel > 2 ); 54 image_format format(image->format->BytesPerPixel == 3 ? RGB : RGBA, UBYTE ); 53 pixel_format pformat = RGBA; 54 switch ( image->format->BytesPerPixel ) 55 { 56 case 4: pformat = RGBA; break; 57 case 3: pformat = RGB; break; 58 case 1: pformat = RED; break; 59 default: NV_ASSERT( false, "BytesPerPixel != 4,3 or 1!" ); 60 } 61 image_format format( pformat, UBYTE ); 55 62 image_data* data = new image_data( format, ivec2( image->w, image->h ), static_cast<nv::uint8*>( image->pixels ) ); 56 63 return data;
Note: See TracChangeset
for help on using the changeset viewer.