| 53 | |
| 54 | template<typename T> |
| 55 | gl::TextureRef TextureUploadApp::genTexUpdate( bool color, bool alpha ) |
| 56 | { |
| 57 | if( color && alpha ) { |
| 58 | SurfaceT<T> s0( mImgAlpha ); |
| 59 | gl::TextureRef result = gl::Texture::create( s0 ); |
| 60 | result->update( SurfaceT<T>( mImg2Alpha ) ); |
| 61 | return result; |
| 62 | } |
| 63 | else if( color ) { |
| 64 | SurfaceT<T> s0( mImg ); |
| 65 | gl::TextureRef result = gl::Texture::create( s0 ); |
| 66 | result->update( SurfaceT<T>( mImg2 ) ); |
| 67 | return result; |
| 68 | } |
| 69 | else { // grayscale |
| 70 | ChannelT<T> s0( mImg ); |
| 71 | gl::TextureRef result = gl::Texture::create( s0 ); |
| 72 | result->update( ChannelT<T>( mImg2 ) ); |
| 73 | return result; |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | template<typename T> |
| 78 | void TextureUploadApp::setupTexConstructor() |