head 1.4; access; symbols; locks; strict; comment @# @; 1.4 date 2002.09.07.01.50.38; author curt; state Exp; branches; next 1.3; 1.3 date 2002.08.31.19.01.54; author curt; state Exp; branches; next 1.2; 1.2 date 2002.08.31.18.54.00; author curt; state Exp; branches; next 1.1; 1.1 date 2002.02.15.17.21.56; author curt; state Exp; branches; next ; desc @@ 1.4 log @Updated doxygen docs. @ text @
Main Page Class Hierarchy Compound List File List Compound Members File Members

# jpgfactory.hxx

    00001 // jpgfactory.hxx --  jpeg frontend for TR library
    00002 //
    00003 // Written by Norman Vine, started August 2001.
    00004 //
    00005 // Copyright (C) 2001  Norman Vine - nhv@@yahoo.com
    00006 //
    00007 // This program is free software; you can redistribute it and/or
    00008 // modify it under the terms of the GNU General Public License as
    00009 // published by the Free Software Foundation; either version 2 of the
    00010 // License, or (at your option) any later version.
    00011 //
    00012 // This program is distributed in the hope that it will be useful, but
    00013 // WITHOUT ANY WARRANTY; without even the implied warranty of
    00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00015 // General Public License for more details.
    00016 //
    00017 // You should have received a copy of the GNU General Public License
    00018 // along with this program; if not, write to the Free Software
    00019 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    00020 //
    00021 // $Id:
    00022
    00023 #ifndef _FG_JPGFACTORY_HXX
    00024 #define _FG_JPGFACTORY_HXX
    00025
    00026 #ifdef __cplusplus
    00027 extern "C" {
    00028 #endif
    00029
    00030 #include <jpeglib.h>
    00031 #include <jerror.h>
    00032
    00033 #ifdef __cplusplus
    00034 }
    00035 #endif
    00036
    00037 #include <simgear/screen/tr.h>
    00038
    00039 /* should look at how VNC does this */
    00040 class trJpgFactory {
    00041     private:
    00042         int imageWidth;
    00043         int imageHeight;
    00044         GLubyte *tile;
    00045         GLubyte *buffer;
    00046
    00047         TRcontext *tr;
    00048         unsigned char *IMAGE;
    00049         int IMAGESIZE;
    00050
    00051         struct jpeg_compress_struct cinfo;
    00052         struct jpeg_error_mgr jerr;
    00053
    00054         int jpeg_init();
    00055         int compress();
    00056
    00057         typedef enum {
    00058             DEFAULT_XS = 320,
    00059             DEFAULT_YS = 240
    00060         } JPG_FACTORY_ENUM;
    00061
    00062     public:
    00063         trJpgFactory();
    00064         ~trJpgFactory();
    00065
    00066         int init(int width = 0, int height = 0 );
    00067         void destroy(int error = 0);
    00068
    00069         int render();
    00070         unsigned char *data() { return IMAGE ; }
    00071
    00072         struct jpeg_compress_struct *JPGinfo() { return &cinfo ; }
    00073 };
    00074
    00075 #endif // #ifndef _FG_JPGFACTORY_HXX

@ 1.3 log @Oops, try again. @ text @d84 1 a84 1