xref: /haiku/src/add-ons/translators/psd/PSDTranslator.h (revision e81a954787e50e56a7f06f72705b7859b6ab06d1)
1 /*
2  * Copyright 2013, Gerasim Troeglazov, 3dEyes@gmail.com. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 
7 #ifndef PSD_TRANSLATOR_H
8 #define PSD_TRANSLATOR_H
9 
10 #include "BaseTranslator.h"
11 
12 #include <Translator.h>
13 #include <TranslatorFormats.h>
14 #include <TranslationDefs.h>
15 #include <GraphicsDefs.h>
16 #include <InterfaceDefs.h>
17 #include <DataIO.h>
18 #include <File.h>
19 #include <ByteOrder.h>
20 
21 #define DOCUMENT_COUNT "/documentCount"
22 #define DOCUMENT_INDEX "/documentIndex"
23 
24 #define PSD_SETTING_COMPRESSION "psd /compression"
25 #define PSD_SETTING_VERSION 	"psd /psdversion"
26 
27 #define PSD_TRANSLATOR_VERSION B_TRANSLATION_MAKE_VERSION(1, 3, 0)
28 #define PSD_IMAGE_FORMAT	'PSD '
29 
30 #define PSD_IN_QUALITY		0.7
31 #define PSD_IN_CAPABILITY	0.6
32 #define PSD_OUT_QUALITY		0.5
33 #define PSD_OUT_CAPABILITY	0.6
34 
35 #define BITS_IN_QUALITY		0.7
36 #define BITS_IN_CAPABILITY	0.6
37 #define BITS_OUT_QUALITY	0.7
38 #define BITS_OUT_CAPABILITY	0.6
39 
40 class PSDTranslator : public BaseTranslator {
41 	public:
42 		PSDTranslator();
43 
44 		virtual status_t DerivedIdentify(BPositionIO *inSource,
45 			const translation_format *inFormat, BMessage *ioExtension,
46 			translator_info *outInfo, uint32 outType);
47 
48 		virtual status_t DerivedTranslate(BPositionIO *inSource,
49 			const translator_info *inInfo, BMessage *ioExtension,
50 			uint32 outType, BPositionIO *outDestination, int32 baseType);
51 
52 		virtual status_t DerivedCanHandleImageSize(float width,
53 			float height) const;
54 
55 		virtual BView *NewConfigView(TranslatorSettings *settings);
56 
57 	protected:
58 		virtual ~PSDTranslator();
59 };
60 
61 extern const char *kDocumentCount;
62 extern const char *kDocumentIndex;
63 
64 #endif	/* PSD_TRANSLATOR_H */
65