1 /* 2 * Copyright 2006, Haiku. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Stephan Aßmus <superstippi@gmx.de> 7 */ 8 9 #ifndef WONDERBRUSH_TRANSLATOR_H 10 #define WONDERBRUSH_TRANSLATOR_H 11 12 #include <ByteOrder.h> 13 #include <DataIO.h> 14 #include <File.h> 15 #include <fs_attr.h> 16 #include <GraphicsDefs.h> 17 #include <InterfaceDefs.h> 18 #include <TranslationDefs.h> 19 #include <Translator.h> 20 #include <TranslatorFormats.h> 21 22 #include "BaseTranslator.h" 23 24 #define WBI_TRANSLATOR_VERSION B_TRANSLATION_MAKE_VERSION(1,0,0) 25 26 #define WBI_IN_QUALITY 1.0 27 #define WBI_IN_CAPABILITY 1.0 28 #define WBI_OUT_QUALITY 1.0 29 #define WBI_OUT_CAPABILITY 1.0 30 31 #define BBT_IN_QUALITY 0.4 32 #define BBT_IN_CAPABILITY 0.6 33 #define BBT_OUT_QUALITY 0.4 34 #define BBT_OUT_CAPABILITY 0.6 35 36 enum { 37 WBI_FORMAT = 'WBI ', 38 }; 39 40 class WonderBrushTranslator : public BaseTranslator { 41 public: 42 WonderBrushTranslator(); 43 44 virtual status_t DerivedIdentify(BPositionIO* inSource, 45 const translation_format* inFormat, 46 BMessage* ioExtension, 47 translator_info* outInfo, uint32 outType); 48 49 virtual status_t DerivedTranslate(BPositionIO* inSource, 50 const translator_info* inInfo, 51 BMessage* ioExtension, uint32 outType, 52 BPositionIO* outDestination, 53 int32 baseType); 54 55 virtual BView* NewConfigView(TranslatorSettings* settings); 56 57 protected: 58 virtual ~WonderBrushTranslator(); 59 // this is protected because the object is deleted by the 60 // Release() function instead of being deleted directly by 61 // the user 62 63 private: 64 status_t _TranslateFromWBI(BPositionIO* inSource, 65 uint32 outType, BPositionIO* outDestination); 66 }; 67 68 #endif // WONDERBRUSH_TRANSLATOR_H 69