KHtml

imageplane.h
1 /*
2  Large image displaying library.
3 
4  Copyright (C) 2004,2005 Maks Orlovich ([email protected])
5 
6  Permission is hereby granted, free of charge, to any person obtaining a copy
7  of this software and associated documentation files (the "Software"), to deal
8  in the Software without restriction, including without limitation the rights
9  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  copies of the Software, and to permit persons to whom the Software is
11  furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20  AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 
23 */
24 #ifndef IMAGE_PLANE_H
25 #define IMAGE_PLANE_H
26 
27 #include "plane.h"
28 #include "pixmaptile.h"
29 #include "imageformat.h"
30 
31 namespace khtmlImLoad
32 {
33 
34 /**
35  Image planes represent client-side image data, and are primarily an
36  abstraction for pushing data to the server, as needed.
37 */
38 class ImagePlane: public Plane
39 {
40 public:
41  ImageFormat format;
42 
43  ImagePlane(unsigned int _width, unsigned int _height): Plane(_width, _height)
44  {}
45 
46  virtual void flushCache() = 0;
47 
48  /**
49  Returns true if the given pixmap tile is up-to-date.
50  Note that this should compare the information in the pixmap with ideal the
51  up-to-date image using the decoding information thus far, and not
52  with the state of the image proper. (Which might not even be in memory)
53  */
54  virtual bool isUpToDate(unsigned int tileX, unsigned int tileY,
55  PixmapTile *tile) = 0;
56 
57  /**
58  Ensures that the given pixmap tile is up-to-date.
59  */
60  virtual void ensureUpToDate(unsigned int tileX, unsigned int tileY,
61  PixmapTile *tile) = 0;
62 
63  virtual ~ImagePlane();
64 protected:
65  //Helpers for subclasses.
66 
67  /**
68  Checks whether the tile is up-to-date for a given version array
69  */
70  bool checkUpToDate(const unsigned char *versions, PixmapTile *tile);
71 
72  /**
73  Creates the pixmap in the tile
74  */
75  void setupTile(unsigned int tileX, unsigned int tileY, PixmapTile *tile);
76 
77  /**
78  Update the pixmap using the appropriate image, starting from
79  offset (offX, offY), and the matching version array
80  */
81  void updatePixmap(PixmapTile *tile, const QImage &image,
82  unsigned int tileX, unsigned int tileY,
83  unsigned int offX, unsigned int offY,
84  unsigned char *versions);
85 
86 };
87 
88 }
89 
90 #endif
All picture data, whether image or pixmap-related, logically denotes a plane: logically, some collection of tiles, which has some geometry.
Definition: plane.h:38
virtual bool isUpToDate(unsigned int tileX, unsigned int tileY, PixmapTile *tile)=0
Returns true if the given pixmap tile is up-to-date.
void updatePixmap(PixmapTile *tile, const QImage &image, unsigned int tileX, unsigned int tileY, unsigned int offX, unsigned int offY, unsigned char *versions)
Update the pixmap using the appropriate image, starting from offset (offX, offY), and the matching ve...
Definition: imageplane.cpp:52
Image planes represent client-side image data, and are primarily an abstraction for pushing data to t...
Definition: imageplane.h:38
void setupTile(unsigned int tileX, unsigned int tileY, PixmapTile *tile)
Creates the pixmap in the tile.
Definition: imageplane.cpp:46
bool checkUpToDate(const unsigned char *versions, PixmapTile *tile)
Checks whether the tile is up-to-date for a given version array.
Definition: imageplane.cpp:33
virtual void ensureUpToDate(unsigned int tileX, unsigned int tileY, PixmapTile *tile)=0
Ensures that the given pixmap tile is up-to-date.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Oct 16 2021 22:47:55 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.