• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kimgio
 

kimgio

g3r.cpp
00001 // This library is distributed under the conditions of the GNU LGPL.
00002 
00003 #include "config.h"
00004 
00005 #ifdef HAVE_LIBTIFF
00006 
00007 #include <tiffio.h>
00008 
00009 #include <tqimage.h>
00010 #include <tqfile.h>
00011 
00012 #include "g3r.h"
00013 
00014 KDE_EXPORT void kimgio_g3_read( TQImageIO *io )
00015 {
00016     // This won't work if io is not a TQFile !
00017   TIFF *tiff = TIFFOpen(TQFile::encodeName(io->fileName()), "r");  
00018   if (!tiff)
00019     return;
00020  
00021   uint32 width, height;
00022   tsize_t scanlength;
00023 
00024   if( TIFFGetField( tiff, TIFFTAG_IMAGEWIDTH, &width ) != 1
00025       || TIFFGetField( tiff, TIFFTAG_IMAGELENGTH, &height ) != 1 )
00026       return;
00027   scanlength = TIFFScanlineSize(tiff);
00028 
00029   TQImage image(width, height, 1, 0, TQImage::BigEndian);
00030   
00031   if (image.isNull() || scanlength != image.bytesPerLine())
00032     {
00033       TIFFClose(tiff);
00034       return;
00035     }
00036 
00037   for (uint32 y=0; y < height; y++)
00038     TIFFReadScanline(tiff, image.scanLine(y), y);
00039 
00040   TIFFClose(tiff);
00041   
00042   io->setImage(image);
00043   io->setStatus(0);
00044 }
00045 
00046 
00047 KDE_EXPORT void kimgio_g3_write(TQImageIO *)
00048 {
00049     // TODO: stub
00050 }
00051 
00052 
00053 #endif

kimgio

Skip menu "kimgio"
  • Main Page
  • File List
  • Related Pages

kimgio

Skip menu "kimgio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kimgio by doxygen 1.7.6.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |