This is an easy file format for the developer, but sometimes a nightmare for the user. :-)
Basically, It's a raw format. There is no predefined format, not even for Image width and height, nor palettes, etc. The raw format is basically a type of import/export format rather than a storage format. For some systems and\or applications it’s a direct dump of the memory section containing the graphics information. Which means that encoding may depend on the graphics card memory arrangement itself. When opening a raw graphic format, the width and height must be specified usually, as well as when the picture data starts. There's other properties that needs to be specified sometimes. A raw file could be as simple as a stream of RGB values or as complex as random numbers as a header file with planar CMYK settings appended afterwards.
There's no standard between image viewers\painters. Some can write 16-bit and indexed colour graphics, but only read 16-bits or indexed colours. Some probably support RLE encoding.
RGB is not always the colour information being recorded in the file, it can also be encoded as grayscale, monochrome bitmap, indexed colours, CMY, CMYK, HSV, HSB, or even L*a*b models.