TLIB documentation
 

tlFile.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This file is part of the TLIB computer vision library.
00004 //  Copyright (C) 2003-2008 Sebastien Grange
00005 //  Copyright (C) 2003-2007 VRAI Group, EPFL
00006 //  All rights reserved.
00007 // 
00008 //  This library is free software; you can redistribute it and/or modify
00009 //  it under the terms of the GNU General Public License("GPL") version 2
00010 //  as published by the Free Software Foundation.
00011 // 
00012 //  <http://www.tuyphon.com/tlib>
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; /* unsigned char */
00026 typedef u_int16_t WORD;         /* unsigned short */
00027 typedef u_int32_t DWORD;        /* unsigned long */
00028 typedef int32_t   LONG;         /* long */
00029 
00030 /* this pragma is intended to tell GCC to byte align (pad) the following
00031  * structures
00032  */
00033 #pragma pack(1)
00034 
00035 typedef struct tagBITMAPFILEHEADER {
00036   WORD    bfType;               /* byte 0-1 */
00037   DWORD   bfSize;               /* 2-5 */
00038   WORD    bfReserved1;          /* 6-7 */
00039   WORD    bfReserved2;          /* 8-9 */
00040   DWORD   bfOffBits;            /* 10-13 */
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 /* resume normal packing... */
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


TLIB documentation - generated on 7 May 2008
Please address any questions to seb@tuyphon.com
(C) 2001-2008 - S. Grange
(C) 2001-2007 - VRAI Group, EPFL
All Rights Reserved.