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

kimgio

  • kimgio
g3r.cpp
1 // This library is distributed under the conditions of the GNU LGPL.
2 
3 #include "config.h"
4 
5 #ifdef HAVE_LIBTIFF
6 
7 #include <tiffio.h>
8 
9 #include <tqimage.h>
10 #include <tqfile.h>
11 
12 #include "g3r.h"
13 
14 KDE_EXPORT void kimgio_g3_read( TQImageIO *io )
15 {
16  // This won't work if io is not a TQFile !
17  TIFF *tiff = TIFFOpen(TQFile::encodeName(io->fileName()), "r");
18  if (!tiff)
19  return;
20 
21  uint32 width, height;
22  tsize_t scanlength;
23 
24  if( TIFFGetField( tiff, TIFFTAG_IMAGEWIDTH, &width ) != 1
25  || TIFFGetField( tiff, TIFFTAG_IMAGELENGTH, &height ) != 1 )
26  return;
27  scanlength = TIFFScanlineSize(tiff);
28 
29  TQImage image(width, height, 1, 0, TQImage::BigEndian);
30 
31  if (image.isNull() || scanlength != image.bytesPerLine())
32  {
33  TIFFClose(tiff);
34  return;
35  }
36 
37  for (uint32 y=0; y < height; y++)
38  TIFFReadScanline(tiff, image.scanLine(y), y);
39 
40  TIFFClose(tiff);
41 
42  io->setImage(image);
43  io->setStatus(0);
44 }
45 
46 
47 KDE_EXPORT void kimgio_g3_write(TQImageIO *)
48 {
49  // TODO: stub
50 }
51 
52 
53 #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.8.13
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |