2 Large image displaying library.
4 Copyright (C) 2004,2005 Maks Orlovich (maksim@kde.org)
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:
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
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.
28 #include "pixmaptile.h"
29 #include "imageformat.h"
32 namespace khtmlImLoad
{
35 Image planes represent client-side image data, and are primarily an
36 abstraction for pushing data to the server, as needed.
38 class ImagePlane
: public Plane
43 ImagePlane(unsigned int _width
, unsigned int _height
):Plane(_width
, _height
)
46 virtual void flushCache() = 0;
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)
54 virtual bool isUpToDate(unsigned int tileX
, unsigned int tileY
,
55 PixmapTile
* tile
) = 0;
58 Ensures that the given pixmap tile is up-to-date.
60 virtual void ensureUpToDate(unsigned int tileX
, unsigned int tileY
,
61 PixmapTile
* tile
) = 0;
63 virtual ~ImagePlane();
65 //Helpers for subclasses.
68 Checks whether the tile is up-to-date for a given version array
70 bool checkUpToDate(const unsigned char* versions
, PixmapTile
* tile
);
73 Creates the pixmap in the tile
75 void setupTile(unsigned int tileX
, unsigned int tileY
, PixmapTile
* tile
);
78 Update the pixmap using the appropriate image, starting from
79 offset (offX, offY), and the matching version array
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
);
91 // kate: indent-width 4; replace-tabs on; tab-width 4; space-indent on;