parameters: (self)
docstring: Open file, check magic number and read header
docstring_summary: Open file, check magic number and read header
docstring_tokens: Open file check magic number and read header
function: def _open(self):
          """ Open file, check magic number and read header """
          # read 14 bytes: magic number, filesize, reserved, header final offset
          head_data = self.fp.read(14)
          # choke if the file does not have the required magic bytes
          if head_data[0:2] != b"BM":
              raise SyntaxError("Not a BMP file")
          # read the start position of the BMP image data (u32)
          offset = i32(head_data[10:14])
          # load bitmap information (offset=raster info)
          self._bitmap(offset=offset)
function_tokens: def _open ( self ) : # read 14 bytes: magic number, filesize, reserved, header final offset head_data = self . fp . read ( 14 ) # choke if the file does not have the required magic bytes if head_data [ 0 : 2 ] != b"BM" : raise SyntaxError ( "Not a BMP file" ) # read the start position of the BMP image data (u32) offset = i32 ( head_data [ 10 : 14 ] ) # load bitmap information (offset=raster info) self . _bitmap ( offset = offset )