Library to control a Graphics TFT connected to 4-wire SPI - revised for the Raio RA8875 Display Controller.

Dependents:   FRDM_RA8875_mPaint RA8875_Demo RA8875_KeyPadDemo SignalGenerator ... more

Fork of SPI_TFT by Peter Drescher

See Components - RA8875 Based Display

Enhanced touch-screen support - where it previous supported both the Resistive Touch and Capacitive Touch based on the FT5206 Touch Controller, now it also has support for the GSL1680 Touch Controller.

Offline Help Manual (Windows chm)

/media/uploads/WiredHome/ra8875.zip.bin (download, rename to .zip and unzip)

Bitmap.h

Committer:
WiredHome
Date:
2014-01-20
Revision:
31:c72e12cd5c67
Child:
32:0e4f2ae512e2

File content as of revision 31:c72e12cd5c67:

//
// Windows BMP file definitions.
//
// Adapted from code written by Michael Sweet from Paul Bourke's
// web site: http://paulbourke.net/dataformats/bmp/
//

#ifndef _BITMAP_H_
#define _BITMAP_H_

#include <mbed.h>

// BITMAPFILEHEADER
// BITMAPINFOHEADER
// Optional Palette
// Raw Data

//
// Bitmap file data structures
//
#pragma push
#pragma pack(2)

typedef struct                 /**** BMP file header structure ****/
    {
    uint16_t    bfType;           /* Magic number for file */
    uint32_t    bfSize;           /* Size of file */
    uint16_t    bfReserved1;      /* Reserved */
    uint16_t    bfReserved2;      /* ... */
    uint32_t    bfOffBits;        /* Offset to bitmap data */
    } BITMAPFILEHEADER;

#define BF_TYPE 0x4D42            /* "MB" */

typedef struct                    /**** BMP file info structure ****/
    {
    uint32_t    biSize;           /* Size of info header */
    uint32_t    biWidth;          /* Width of image */
    uint32_t    biHeight;         /* Height of image */
    uint16_t    biPlanes;         /* Number of color planes */
    uint16_t    biBitCount;       /* Number of bits per pixel */
    uint32_t    biCompression;    /* Type of compression to use */
    uint32_t    biSizeImage;      /* Size of image data */
    int32_t     biXPelsPerMeter;  /* X pixels per meter */
    int32_t     biYPelsPerMeter;  /* Y pixels per meter */
    uint32_t    biClrUsed;        /* Number of colors used */
    uint32_t    biClrImportant;   /* Number of important colors */
    } BITMAPINFOHEADER;
#pragma pop

/*
 * Constants for the biCompression field...
 */

#  define BI_RGB       0             /* No compression - straight BGR data */
#  define BI_RLE8      1             /* 8-bit run-length compression */
#  define BI_RLE4      2             /* 4-bit run-length compression */
#  define BI_BITFIELDS 3             /* RGB bitmap with RGB masks */

typedef struct                       /**** Colormap entry structure ****/
    {
    uint8_t  rgbBlue;          /* Blue value */
    uint8_t  rgbGreen;         /* Green value */
    uint8_t  rgbRed;           /* Red value */
    uint8_t  rgbReserved;      /* Reserved */
    } RGBQUAD;

typedef struct                       /**** Bitmap information structure ****/
    {
    BITMAPINFOHEADER bmiHeader;      /* Image header */
    RGBQUAD          bmiColors[256]; /* Image colormap */
    } BITMAPINFO;


/*
 * Prototypes...
 */

//extern GLubyte *LoadDIBitmap(const char *filename, BITMAPINFO **info);
//extern int32_t    SaveDIBitmap(const char *filename, BITMAPINFO *info,
//                            GLubyte *bits);

#endif // _BITMAP_H_