00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __TLFILE_H__
00018 #define __TLFILE_H__
00019
00020 #include "tlVision.h"
00021
00022 #ifdef LINUX
00023 #include <sys/types.h>
00024
00025 typedef u_int8_t BYTE, *LPBYTE;
00026 typedef u_int16_t WORD;
00027 typedef u_int32_t DWORD;
00028 typedef int32_t LONG;
00029
00030
00031 #pragma pack(1)
00032
00033 typedef struct tagBITMAPFILEHEADER {
00034 WORD bfType;
00035 DWORD bfSize;
00036 WORD bfReserved1;
00037 WORD bfReserved2;
00038 DWORD bfOffBits;
00039 } BITMAPFILEHEADER;
00040
00041 typedef struct tagBITMAPINFOHEADER {
00042 DWORD biSize;
00043 LONG biWidth;
00044 LONG biHeight;
00045 WORD biPlanes;
00046 WORD biBitCount;
00047 DWORD biCompression;
00048 DWORD biSizeImage;
00049 LONG biXPelsPerMeter;
00050 LONG biYPelsPerMeter;
00051 DWORD biClrUsed;
00052 DWORD biClrImportant;
00053 } BITMAPINFOHEADER;
00054
00055
00056 typedef struct tagRGBQUAD {
00057 BYTE rgbBlue;
00058 BYTE rgbGreen;
00059 BYTE rgbRed;
00060 BYTE rgbReserved;
00061 } RGBQUAD;
00062
00063
00064 #pragma pack()
00065
00066 #endif
00067
00068 int tl_write_bmp (tlPixel *src, int width, int height, tl_format format, char *filename);
00069 int tl_write_gif (tlPixel *src, int width, int height, char *filename);
00070 int tl_write_jpg (tlPixel *src, int width, int height, int pixel_width, int quality, char *filename);
00071 int tl_write_ppm (tlPixel *src, int width, int height, char *filename);
00072 int tl_write_tlb (tlImage *image, char *filename);
00073
00074 tlPixel *tl_read_bmp (char *filename, int *width, int *height, tl_format *format);
00075 tlPixel *tl_read_gif (char *filename, int *width, int *height, tl_format *format);
00076 tlPixel *tl_read_jpg (char *filename, int *width, int *height, tl_format *format);
00077 tlPixel *tl_read_ppm (char *filename, int *width, int *height, tl_format *format);
00078 void *tl_read_tlb (char *filename, int *width, int *height, int *pixel_width, tl_format *format);
00079
00080 #endif