def get_bits_per_pixel(data_format):
if data_format in component_8bit_formats:<EOL><INDENT>return <NUM_LIT:8><EOL><DEDENT>elif data_format in component_10bit_formats:<EOL><INDENT>return <NUM_LIT:10><EOL><DEDENT>elif data_format in component_12bit_formats:<EOL><INDENT>return <NUM_LIT:12><EOL><DEDENT>elif data_format in component_14bit_formats:<EOL><INDENT>return <NUM_LIT><EOL><DEDENT>elif data_format in component_16bit_formats:<EOL><INDENT>return <NUM_LIT:16><EOL><DEDENT>return None<EOL>
Returns the number of (used) bits per pixel.
So without padding.
Returns None if format is not known.