vfs: check userland buffers before reading them.
[haiku.git] / src / add-ons / translators / ico / ICOTranslator.h
blob80e08890020001914818244e11b7c499358b12ef
1 /*
2 * Copyright 2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef ICO_TRANSLATOR_H
6 #define ICO_TRANSLATOR_H
9 #include "BaseTranslator.h"
11 #include <Translator.h>
12 #include <TranslatorFormats.h>
13 #include <TranslationDefs.h>
14 #include <GraphicsDefs.h>
15 #include <InterfaceDefs.h>
16 #include <DataIO.h>
17 #include <File.h>
18 #include <ByteOrder.h>
21 #define ICO_TRANSLATOR_VERSION B_TRANSLATION_MAKE_VERSION(0, 3, 0)
22 #define ICO_IMAGE_FORMAT 'ICO '
24 #define ICO_IN_QUALITY 0.5
25 #define ICO_IN_CAPABILITY 0.5
26 #define BITS_IN_QUALITY 1
27 #define BITS_IN_CAPABILITY 1
29 #define ICO_OUT_QUALITY 0.8
30 #define ICO_OUT_CAPABILITY 0.8
31 #define BITS_OUT_QUALITY 1
32 #define BITS_OUT_CAPABILITY 0.9
35 class ICOTranslator : public BaseTranslator {
36 public:
37 ICOTranslator();
39 virtual status_t DerivedIdentify(BPositionIO *inSource,
40 const translation_format *inFormat, BMessage *ioExtension,
41 translator_info *outInfo, uint32 outType);
43 virtual status_t DerivedTranslate(BPositionIO *inSource,
44 const translator_info *inInfo, BMessage *ioExtension,
45 uint32 outType, BPositionIO *outDestination, int32 baseType);
47 virtual status_t DerivedCanHandleImageSize(float width,
48 float height) const;
50 virtual BView *NewConfigView(TranslatorSettings *settings);
52 protected:
53 virtual ~ICOTranslator();
54 // this is protected because the object is deleted by the
55 // Release() function instead of being deleted directly by
56 // the user
58 private:
61 // Extensions that ShowImage supports
62 extern const char *kDocumentCount;
63 extern const char *kDocumentIndex;
65 #endif /* ICO_TRANSLATOR_H */