271 } |
275 } |
272 } |
276 } |
273 |
277 |
274 TSDCColorDepth CSDCInput::ConvertToColorDepth( const wchar_t* aToken ) |
278 TSDCColorDepth CSDCInput::ConvertToColorDepth( const wchar_t* aToken ) |
275 { |
279 { |
276 if( _wcsicmp( aToken, L"1" ) == 0) return ESDCColorDepth1; |
280 if( sd_wcscasecmp( aToken, L"1" ) == 0) return ESDCColorDepth1; |
277 else if( _wcsicmp( aToken, L"2" ) == 0) return ESDCColorDepth2; |
281 else if( sd_wcscasecmp( aToken, L"2" ) == 0) return ESDCColorDepth2; |
278 else if( _wcsicmp( aToken, L"4" ) == 0) return ESDCColorDepth4; |
282 else if( sd_wcscasecmp( aToken, L"4" ) == 0) return ESDCColorDepth4; |
279 else if( _wcsicmp( aToken, L"8" ) == 0) return ESDCColorDepth8; |
283 else if( sd_wcscasecmp( aToken, L"8" ) == 0) return ESDCColorDepth8; |
280 else if( _wcsicmp( aToken, L"c4" ) == 0) return ESDCColorDepthC4; |
284 else if( sd_wcscasecmp( aToken, L"c4" ) == 0) return ESDCColorDepthC4; |
281 else if( _wcsicmp( aToken, L"c8" ) == 0) return ESDCColorDepthC8; |
285 else if( sd_wcscasecmp( aToken, L"c8" ) == 0) return ESDCColorDepthC8; |
282 else if( _wcsicmp( aToken, L"c12" ) == 0) return ESDCColorDepthC12; |
286 else if( sd_wcscasecmp( aToken, L"c12" ) == 0) return ESDCColorDepthC12; |
283 else if( _wcsicmp( aToken, L"c16" ) == 0) return ESDCColorDepthC16; |
287 else if( sd_wcscasecmp( aToken, L"c16" ) == 0) return ESDCColorDepthC16; |
284 else if( _wcsicmp( aToken, L"c24" ) == 0) return ESDCColorDepthC24; |
288 else if( sd_wcscasecmp( aToken, L"c24" ) == 0) return ESDCColorDepthC24; |
285 else if( _wcsicmp( aToken, L"c32" ) == 0) return ESDCColorDepthC32; |
289 else if( sd_wcscasecmp( aToken, L"c32" ) == 0) return ESDCColorDepthC32; |
286 throw CSDCException( ESDCParseError, "Unknown color depth parameter" ); |
290 throw CSDCException( ESDCParseError, "Unknown color depth parameter" ); |
287 } |
291 } |
288 |
292 |
289 int CSDCInput::ConvertToLayer( const wchar_t* aToken ) |
293 int CSDCInput::ConvertToLayer( const wchar_t* aToken ) |
290 { |
294 { |
291 if( _wcsicmp( aToken, L"none" ) == 0 ) return 0x0001; |
295 if( sd_wcscasecmp( aToken, L"none" ) == 0 ) return 0x0001; |
292 |
296 |
293 wchar_t buf[512]; |
297 wchar_t buf[512]; |
294 wcscpy( buf, aToken ); |
298 wcscpy( buf, aToken ); |
295 |
299 |
296 wchar_t* p = wcsstr( buf, L"/" ); |
300 wchar_t* p = wcsstr( buf, L"/" ); |
297 if( !p ) throw CSDCException( ESDCParseError, "Slash expected in layer parameter" ); |
301 if( !p ) throw CSDCException( ESDCParseError, "Slash expected in layer parameter" ); |
298 *p = 0; |
302 *p = 0; |
299 p = p+1; |
303 p = p+1; |
300 |
304 |
301 int layer = ConvertToNumber( buf ) << 8; |
305 int layer = ConvertToNumber( buf ) << 8; |
302 if( _wcsicmp( p, L"RGB" ) == 0 ) |
306 if( sd_wcscasecmp( p, L"RGB" ) == 0 ) |
303 { |
307 { |
304 layer |= 0x02; |
308 layer |= 0x02; |
305 } |
309 } |
306 else if( _wcsicmp( p, L"A" ) == 0 ) |
310 else if( sd_wcscasecmp( p, L"A" ) == 0 ) |
307 { |
311 { |
308 layer |= 0x04; |
312 layer |= 0x04; |
309 } |
313 } |
310 else if( _wcsicmp( p, L"RGBA" ) == 0 ) |
314 else if( sd_wcscasecmp( p, L"RGBA" ) == 0 ) |
311 { |
315 { |
312 layer |= 0x08; |
316 layer |= 0x08; |
313 } |
317 } |
314 else |
318 else |
315 { |
319 { |