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 structures */
00031 #pragma pack(1)
00032 
00033 typedef struct tagBITMAPFILEHEADER {
00034   WORD    bfType;               /* byte 0-1 */
00035   DWORD   bfSize;               /* 2-5 */
00036   WORD    bfReserved1;          /* 6-7 */
00037   WORD    bfReserved2;          /* 8-9 */
00038   DWORD   bfOffBits;            /* 10-13 */
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 /* resume normal packing... */
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


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