• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KImgIO

  • kimgio
g3r.cpp
Go to the documentation of this file.
1
8#include "g3r.h"
9
10#include <config.h>
11
12#include <tiffio.h>
13
14#include <qimage.h>
15#include <qfile.h>
16
17KDE_EXPORT void kimgio_g3_read( QImageIO *io )
18{
19 // This won't work if io is not a QFile !
20 TIFF *tiff = TIFFOpen(QFile::encodeName(io->fileName()), "r");
21 if (!tiff)
22 return;
23
24 uint32 width, height;
25 tsize_t scanlength;
26
27 if( TIFFGetField( tiff, TIFFTAG_IMAGEWIDTH, &width ) != 1
28 || TIFFGetField( tiff, TIFFTAG_IMAGELENGTH, &height ) != 1 )
29 return;
30 scanlength = TIFFScanlineSize(tiff);
31
32 QImage image(width, height, 1, 0, QImage::BigEndian);
33
34 if (image.isNull() || scanlength != image.bytesPerLine())
35 {
36 TIFFClose(tiff);
37 return;
38 }
39
40 for (uint32 y=0; y < height; y++)
41 TIFFReadScanline(tiff, image.scanLine(y), y);
42
43 TIFFClose(tiff);
44
45 io->setImage(image);
46 io->setStatus(0);
47}
48
49
50KDE_EXPORT void kimgio_g3_write(QImageIO *)
51{
52 // TODO: stub
53}
54
kimgio_g3_write
void kimgio_g3_write(QImageIO *)
Definition: g3r.cpp:50
kimgio_g3_read
void kimgio_g3_read(QImageIO *io)
QImageIO Routines to read/write g3 (fax) images.
Definition: g3r.cpp:17
g3r.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KImgIO

Skip menu "KImgIO"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal