1/*
2
3Image Cache.
4
5Copyright (c) 2003 OpenBeOS.
6
7Author:
8	Michael Pfeiffer
9
10Permission is hereby granted, free of charge, to any person obtaining a copy of
11this software and associated documentation files (the "Software"), to deal in
12the Software without restriction, including without limitation the rights to
13use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
14of the Software, and to permit persons to whom the Software is furnished to do
15so, subject to the following conditions:
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26THE SOFTWARE.
27
28*/
29
30#ifndef _IMAGE_CACHE_H
31#define _IMAGE_CACHE_H
32
33#include <Bitmap.h>
34#include <InterfaceDefs.h>
35#include <String.h>
36
37#include "pdflib.h"
38#include "PrintUtils.h"
39#include "Cache.h"
40
41extern const char* kTemporaryPath;
42extern const char* kCachePath;
43extern const char* kImagePathPrefix;
44extern const char* kMaskPathPrefix;
45
46#define STORE_AS_BBITMAP 1
47
48class ImageCache {
49public:
50	ImageCache();
51	~ImageCache();
52	void Flush();
53
54	void NextPass();
55	int GetImage(PDF* pdf, BBitmap* bitmap, int mask);
56	int GetMask(PDF* pdf, const char* mask, int length, int width, int height, int bpc);
57
58private:
59	Cache fImageCache;
60	Cache fMaskCache;
61};
62
63#endif
64
65