vfs: check userland buffers before reading them.
[haiku.git] / src / add-ons / translators / icns / ICNSTranslator.h
blob0b5982071a394a11611111c3ddde843b593150b5
1 /*
2 * Copyright 2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 * Copyright 2012, Gerasim Troeglazov, 3dEyes@gmail.com. All rights reserved.
4 * Distributed under the terms of the MIT License.
5 */
7 #ifndef ICNS_TRANSLATOR_H
8 #define ICNS_TRANSLATOR_H
11 #include "BaseTranslator.h"
13 #include <Translator.h>
14 #include <TranslatorFormats.h>
15 #include <TranslationDefs.h>
16 #include <GraphicsDefs.h>
17 #include <InterfaceDefs.h>
18 #include <DataIO.h>
19 #include <File.h>
20 #include <ByteOrder.h>
22 #define DOCUMENT_COUNT "/documentCount"
23 #define DOCUMENT_INDEX "/documentIndex"
25 #define ICNS_TRANSLATOR_VERSION B_TRANSLATION_MAKE_VERSION(1, 0, 0)
26 #define ICNS_IMAGE_FORMAT 'ICNS'
28 #define ICNS_IN_QUALITY 0.5
29 #define ICNS_IN_CAPABILITY 0.5
30 #define BITS_IN_QUALITY 1
31 #define BITS_IN_CAPABILITY 1
33 #define ICNS_OUT_QUALITY 0.8
34 #define ICNS_OUT_CAPABILITY 0.8
35 #define BITS_OUT_QUALITY 1
36 #define BITS_OUT_CAPABILITY 0.9
39 class ICNSTranslator : public BaseTranslator {
40 public:
41 ICNSTranslator();
43 virtual status_t DerivedIdentify(BPositionIO *inSource,
44 const translation_format *inFormat, BMessage *ioExtension,
45 translator_info *outInfo, uint32 outType);
47 virtual status_t DerivedTranslate(BPositionIO *inSource,
48 const translator_info *inInfo, BMessage *ioExtension,
49 uint32 outType, BPositionIO *outDestination, int32 baseType);
51 virtual status_t DerivedCanHandleImageSize(float width,
52 float height) const;
54 virtual BView *NewConfigView(TranslatorSettings *settings);
56 protected:
57 virtual ~ICNSTranslator();
60 // Extensions that ShowImage supports
61 extern const char *kDocumentCount;
62 extern const char *kDocumentIndex;
64 #endif /* ICNS_TRANSLATOR_H */