1*3459199eSGerasim Troeglazov /* 2*3459199eSGerasim Troeglazov * Copyright 2013, Gerasim Troeglazov, 3dEyes@gmail.com. All rights reserved. 3*3459199eSGerasim Troeglazov * Distributed under the terms of the MIT License. 4*3459199eSGerasim Troeglazov */ 5*3459199eSGerasim Troeglazov 6*3459199eSGerasim Troeglazov 7*3459199eSGerasim Troeglazov #ifndef PSD_WRITER_H 8*3459199eSGerasim Troeglazov #define PSD_WRITER_H 9*3459199eSGerasim Troeglazov 10*3459199eSGerasim Troeglazov #include <stdlib.h> 11*3459199eSGerasim Troeglazov #include <stdio.h> 12*3459199eSGerasim Troeglazov #include <string.h> 13*3459199eSGerasim Troeglazov 14*3459199eSGerasim Troeglazov #include <Translator.h> 15*3459199eSGerasim Troeglazov #include <TranslatorFormats.h> 16*3459199eSGerasim Troeglazov #include <TranslationDefs.h> 17*3459199eSGerasim Troeglazov #include <GraphicsDefs.h> 18*3459199eSGerasim Troeglazov #include <InterfaceDefs.h> 19*3459199eSGerasim Troeglazov #include <String.h> 20*3459199eSGerasim Troeglazov #include <DataIO.h> 21*3459199eSGerasim Troeglazov #include <File.h> 22*3459199eSGerasim Troeglazov #include <ByteOrder.h> 23*3459199eSGerasim Troeglazov #include <List.h> 24*3459199eSGerasim Troeglazov 25*3459199eSGerasim Troeglazov #include "PSDLoader.h" 26*3459199eSGerasim Troeglazov 27*3459199eSGerasim Troeglazov class PSDWriter { 28*3459199eSGerasim Troeglazov public: 29*3459199eSGerasim Troeglazov PSDWriter(BPositionIO *stream); 30*3459199eSGerasim Troeglazov ~PSDWriter(); 31*3459199eSGerasim Troeglazov 32*3459199eSGerasim Troeglazov status_t EncodeFromRGBA(BPositionIO *target, uint8 *buff, 33*3459199eSGerasim Troeglazov int32 layers, int32 width, int32 height); 34*3459199eSGerasim Troeglazov 35*3459199eSGerasim Troeglazov private: 36*3459199eSGerasim Troeglazov void _WriteInt32ToStream(BPositionIO *stream, int32); 37*3459199eSGerasim Troeglazov void _WriteUInt32ToStream(BPositionIO *stream, uint32); 38*3459199eSGerasim Troeglazov void _WriteInt16ToStream(BPositionIO *stream, int16); 39*3459199eSGerasim Troeglazov void _WriteUInt16ToStream(BPositionIO *stream, uint16); 40*3459199eSGerasim Troeglazov void _WriteInt8ToStream(BPositionIO *stream, int8); 41*3459199eSGerasim Troeglazov void _WriteUInt8ToStream(BPositionIO *stream, uint8); 42*3459199eSGerasim Troeglazov void _WriteFillBlockToStream(BPositionIO *stream, 43*3459199eSGerasim Troeglazov uint8 val, size_t count); 44*3459199eSGerasim Troeglazov void _WriteBlockToStream(BPositionIO *stream, 45*3459199eSGerasim Troeglazov uint8 *block, size_t count); 46*3459199eSGerasim Troeglazov 47*3459199eSGerasim Troeglazov BPositionIO *fStream; 48*3459199eSGerasim Troeglazov }; 49*3459199eSGerasim Troeglazov 50*3459199eSGerasim Troeglazov 51*3459199eSGerasim Troeglazov #endif /* PSD_WRITER_H */ 52