xref: /haiku/src/add-ons/translators/raw/RAWTranslator.h (revision 56eb8e78cc702792e3b032e3f5f45da9e5dbea9e)
1 /*
2  * Copyright 2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef RAW_TRANSLATOR_H
6 #define RAW_TRANSLATOR_H
7 
8 
9 #include "BaseTranslator.h"
10 
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>
19 
20 
21 #define RAW_TRANSLATOR_VERSION B_TRANSLATION_MAKE_VERSION(0, 5, 0)
22 #define RAW_IMAGE_FORMAT	'RAWI'
23 
24 #define RAW_IN_QUALITY		0.90
25 #define RAW_IN_CAPABILITY	0.90
26 #define BITS_IN_QUALITY		1
27 #define BITS_IN_CAPABILITY	1
28 
29 #define RAW_OUT_QUALITY		0.8
30 #define RAW_OUT_CAPABILITY	0.8
31 #define BITS_OUT_QUALITY	1
32 #define BITS_OUT_CAPABILITY	0.9
33 
34 
35 class RAWTranslator : public BaseTranslator {
36 	public:
37 		RAWTranslator();
38 		virtual ~RAWTranslator();
39 
40 		virtual status_t DerivedIdentify(BPositionIO *inSource,
41 			const translation_format *inFormat, BMessage *ioExtension,
42 			translator_info *outInfo, uint32 outType);
43 
44 		virtual status_t DerivedTranslate(BPositionIO *inSource,
45 			const translator_info *inInfo, BMessage *ioExtension,
46 			uint32 outType, BPositionIO *outDestination, int32 baseType);
47 
48 		virtual BView *NewConfigView(TranslatorSettings *settings);
49 
50 	private:
51 		static void _ProgressMonitor(const char* message, float percentage,
52 			void* data);
53 };
54 
55 #endif	// RAW_TRANSLATOR_H
56