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
00032
00033 #pragma pack(1)
00034
00035 typedef struct tagBITMAPFILEHEADER {
00036 WORD bfType;
00037 DWORD bfSize;
00038 WORD bfReserved1;
00039 WORD bfReserved2;
00040 DWORD bfOffBits;
00041 } BITMAPFILEHEADER;
00042
00043 typedef struct tagBITMAPINFOHEADER {
00044 DWORD biSize;
00045 LONG biWidth;
00046 LONG biHeight;
00047 WORD biPlanes;
00048 WORD biBitCount;
00049 DWORD biCompression;
00050 DWORD biSizeImage;
00051 LONG biXPelsPerMeter;
00052 LONG biYPelsPerMeter;
00053 DWORD biClrUsed;
00054 DWORD biClrImportant;
00055 } BITMAPINFOHEADER;
00056
00057
00058 typedef struct tagRGBQUAD {
00059 BYTE rgbBlue;
00060 BYTE rgbGreen;
00061 BYTE rgbRed;
00062 BYTE rgbReserved;
00063 } RGBQUAD;
00064
00065
00066 #pragma pack()
00067
00068 #endif
00069
00070 int tl_write_bmp (tlPixel *src, int width, int height, tl_format format, char *filename);
00071 int tl_write_gif (tlPixel *src, int width, int height, char *filename);
00072 int tl_write_jpg (tlPixel *src, int width, int height, int pixel_width, int quality, char *filename);
00073 int tl_write_ppm (tlPixel *src, int width, int height, char *filename);
00074 int tl_write_tlb (tlImage *image, char *filename);
00075
00076 tlPixel *tl_read_bmp (char *filename, int *width, int *height, tl_format *format);
00077 tlPixel *tl_read_gif (char *filename, int *width, int *height, tl_format *format);
00078 tlPixel *tl_read_jpg (char *filename, int *width, int *height, tl_format *format);
00079 tlPixel *tl_read_ppm (char *filename, int *width, int *height, tl_format *format);
00080 void *tl_read_tlb (char *filename, int *width, int *height, int *pixel_width, tl_format *format);
00081
00082 #endif