1 /* 2 OpenCV for Android NDK 3 Copyright (c) 2006-2009 SIProp Project http://www.siprop.org/ 4 5 This software is provided 'as-is', without any express or implied warranty. 6 In no event will the authors be held liable for any damages arising from the use of this software. 7 Permission is granted to anyone to use this software for any purpose, 8 including commercial applications, and to alter it and redistribute it freely, 9 subject to the following restrictions: 10 11 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 3. This notice may not be removed or altered from any source distribution. 14 */ 15 #ifndef _WLNonFileByteStream_H_ 16 #define _WLNonFileByteStream_H_ 17 18 #include <stdio.h> 19 #include "cv.h" 20 #include "cxcore.h" 21 #include "cvaux.h" 22 #include "highgui.h" 23 #include "ml.h" 24 #include "utils.h" 25 26 class WLNonFileByteStream { 27 public: 28 WLNonFileByteStream(); 29 ~WLNonFileByteStream(); 30 31 bool Open(int data_size); 32 void Close(); 33 void PutByte( int val ); 34 void PutBytes( const void* buffer, int count ); 35 void PutWord( int val ); 36 void PutDWord( int val ); 37 uchar* GetByte(); 38 int GetSize(); 39 40 protected: 41 void Allocate(int data_size); 42 void Deallocate(); 43 int _size; 44 uchar* m_start; 45 uchar* m_end; 46 uchar* m_current; 47 bool m_is_opened; 48 49 }; 50 51 #endif/*_WLNonFileByteStream_H_*/ 52