this can be slightly less boilerplatey and error-checked if you fancy: 
    
    
    from macros import error
    type FileBits = (
      when BitDepth == 8: uint8
      elif BitDepth == 16: uint16
      elif BitDepth in {24,32}: uint32
      elif BitDepth == 64: uint64
      else: static: error("bitdepth of " & $BitDepth & "unsupported"); nil
      )
    
    
    Run

Reply via email to