VR-Forces 4.2 Class Documentation
largeImageReader.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2008 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: largeImageReader.h,v $ $Revision: 1.4 $ $State: Exp $
7 *******************************************************************************/
8 
11 
12 #ifndef LARGEIMAGEREADER_H_
13 #define LARGEIMAGEREADER_H_
14 
16 #include <QtGui/QImageReader>
17 #include <QtCore/QSize>
18 #include <QtCore/QRect>
19 
35 
36 class jpegClippedReader;
37 
39 {
40 public:
42  {
43  DtKeepSize = 1,
44  DtAutoFitLargeImage = 2
45  };
46 
47  DtLargeImageReader(QIODevice *device, DtLargeImageFlags fl = DtAutoFitLargeImage,
48  int stepSize = 2, const QByteArray &format = QByteArray());
49  DtLargeImageReader(const QString &fileName, DtLargeImageFlags fl = DtAutoFitLargeImage,
50  int stepSize = 2, const QByteArray &format = QByteArray());
52 
53  static bool canCreateImageOfSize(const QSize&, int imageDepth = 32);
54 
55  void setImageSize(const QSize&);
56  const QSize& imageSize() const;
57 
58  void setStepSize(int);
59  int stepSize() const;
60 
63  virtual QImage read();
64 
69  virtual QSize imageSizeToUse(const QSize& expectedSize) const;
70 
73  virtual QSize minimumImageSize(const QSize& basedOn, int stepSize = 2) const;
74 
77  virtual QImage loadImage(const QSize& imageSize);
78 
81  virtual QSize determineSize() const;
82 
85  virtual QSize size() const;
86 
88  virtual bool supportsOption(QImageIOHandler::ImageOption option) const;
89  virtual QRect clipRect() const;
90  virtual void setClipRect(const QRect&);
91 
92  virtual bool isJpeg() const;
93 
96  virtual QImage loadClippedImage(const QRect& clipRect, const QSize& outputSize);
97 
99  virtual bool canImportImage() const;
100 
101 protected:
102  virtual QImage loadClippedJpeg(const QRect& clipRect, const QSize& outputSize);
103 
104 protected:
106  QSize myImageSize;
107  QRect myClipRect;
110  jpegClippedReader* myScaler;
111 };
112 
114 {
115  myStepSize = i;
116 }
117 
119 {
120  return myStepSize;
121 }
122 
123 inline void DtLargeImageReader::setImageSize(const QSize& sz)
124 {
125  myImageSize = sz;
126 }
127 
128 inline const QSize& DtLargeImageReader::imageSize() const
129 {
130  return myImageSize;
131 }
132 
133 #endif

Document ID: Generated on Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)