⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jpeg.h

📁 s1d13716的源码 windiws ce 或8位单片机
💻 H
字号:
//===========================================================================
//	JPEG.H
//	This file contains JPEG library functions.
//---------------------------------------------------------------------------
//  Copyright (c) 2003 Epson Research and Development, Inc.
//  All Rights Reserved.
//===========================================================================

#ifndef __JPG_H__
#define __JPG_H__

//---------------------------------------------------------------------------
// Include Files
//---------------------------------------------------------------------------
#ifndef MV850E
#include <time.h>
#endif
#include "datatype.h"
//#include "paraminfo.h"

//---------------------------------------------------------------------------
// Type Defintitions
//---------------------------------------------------------------------------
typedef enum
{
	JPEG_ERR_NONE=0,
	JPEG_ERR_DIM_RESTRICT,
	JPEG_ERR_RESTART_INTERVAL,
	JPEG_ERR_IMAGE_SIZE,
	JPEG_ERR_LINEBUF_OVERFLOW,
	JPEG_ERR_ENCODE_OVERFLOW,
	JPEG_ERR_ENCSIZELIMIT,
	JPEG_ERR_NO_JPEG_DATA,
	JPEG_ERR_JPEG_FULL,
	JPEG_ERR_NULL_BUFFER,
	JPEG_ERR_ZERO_BUFFER_SIZE,
	JPEG_ERR_NO_STARTOFIMAGE,
	JPEG_ERR_NO_ENDOFIMAGE,
	JPEG_ERR_AGILENT_ERROR,
	JPEG_ERR_INVALID_JPEG_DATA,
	JPEG_ERR_TRUNCATED_JPEG_DATA,
	JPEG_ERR_INCOMPLETE,
	JPEG_ERR_TIME_OUT,
	JPEG_ERR_INVALID_PARAM,
	JPEG_ERR_UNKNOWN_ERROR			
} jpegError;


#ifdef __cplusplus
   extern "C" {
#endif

typedef enum
{
	YUVFmt444=0,
	YUVFmt422=1,
	YUVFmt420=2,
	YUVFmt411=3
} jpegYUVFmt;

typedef struct tagJPEGINFO
{
	UInt8*		m_pBuf;					//data buffer for encode jpeg data for decode
	UInt32		m_BufSize;				//the buffer size for encode
	UInt32		m_Delay;				//delay in multi frames 
	UInt32		m_EncSize;				//encode result size or jpegfile szie for decode				
	char*		m_pszFile; 				//if you use filesystem youcan use it save jpeg file
	Boolean		m_fFastCpu;				//if your cpu is paralle set TRUE.
	UInt32		m_FrameCount;			//the frame cout you want to encode.
	UInt16		m_Height;				//before scale encode height or result height for decode
	UInt16		m_DesiredWidth;				//the actual image's height after decode and scale  
	UInt8		m_HScaleRate;			//H scale rate
	Boolean		m_fIndScale;			//same the H scale rate and V scale rate?
	Boolean		m_fInfLoop;				//just save the last frame in multi frame encode? 
	Boolean		m_fMotionJPEG;			//is motion jpeg?if yes,multi frame capture format is Header--body--body.. else Hader--body--header--body
	Boolean		m_fMulFrm;				//just use in file system
	Boolean		m_fPause;				//debug use
	UInt16		m_RWidth;				//if>0,is resize width
	UInt16		m_RHeight;				//if>0,is resize height
	Boolean		m_fScale;				//scale?
	UInt8		m_ScaleMode;			//set scale mode
	Boolean		m_fSOE;					//scale overlay?
#ifndef MV850E
	clock_t		m_TimeOutTgt;
	Boolean		m_TimeOutMS;
#endif
	UInt8		m_VScaleRate;			//V scale rate
	UInt16		m_XStart;				//Resizer X start
	UInt16		m_XEnd;				//Resizer X end
	UInt16		m_Width;				//width before resizer for encoded or result width for decode
	UInt16		m_DesiredHeight;			//actual width for decoded
	Boolean		m_fWrAlways;			//always let camera write data to display? 
	UInt16		m_YStart;				//resizer Y start
	UInt16		m_YEnd;
	jpegYUVFmt	m_YUVFmt;
	Boolean		m_fAFAP;				//exam jpeg file format
	Boolean		m_IsYUVfile;
	Boolean		m_MemEnc;				//is display buffer encode?
} JPEGINFO;

//---------------------------------------------------------------------------
// Function Prototypes
//---------------------------------------------------------------------------
Boolean		jpegCamEncode( JPEGINFO* pJpegInfo );
Boolean		jpegDecode(JPEGINFO *pJpegInfo);
Boolean		jpegEncode( JPEGINFO* pJpegInfo );
jpegError	jpegGetLastError( void );
const char* jpegGetLastErrorText( void );
UInt32		jpegGetEncSizeResult( void );
Boolean		jpegHasEndOfImage( JPEGINFO* pJpegInfo );
Boolean		jpegHasImageMarkers( JPEGINFO* pJpegInfo );
Boolean		jpegHasStartOfImage( JPEGINFO* pJpegInfo );
Boolean		jpegInit( JPEGINFO* pJpegInfo );
Boolean		jpegInitVideo( JPEGINFO* pJpegInfo );
UInt32		jpegInterpretImage( const char* pszName, JPEGINFO* pJpegInfo );
void		jpegSetLastError( jpegError lastError );
/*Boolean		jpegStartUp
( 
	const char* pszProgram, 
	const char* pszDescription, 
	const char* pszVersion, 
	int			argc, 
	char*		argv[], 
	PARAMINFO*	paParamInfo, 
	int			sizePI,
	JPEGINFO*	pJpegInfo,
	int			startArg
);*/
Boolean		jpegValidateBuf( JPEGINFO* pJpegInfo );
Boolean		jpegWaitLCDNotBusy( JPEGINFO* pJpegInfo );
Boolean		jpegWarnWidth( void* pValue, const char* pszCommand );
Boolean		jpegWarnOdd( void* pValue, const char* pszCommand );
int			jpegYUVValue2Fmt( int value );
jpegYUVFmt	jpegGetYUVFmt( void );

#ifndef JPEGUSEFILESYS
void	jpegCreateFileName( JPEGINFO* pJpegInfo, const char* pszName );
Boolean jpegWriteFile( JPEGINFO* pJpegInfo );
Boolean jpegWriteImage( const char* pszName, JPEGINFO* pJpegInfo );
#endif //MV850E

#ifdef __cplusplus
   }
#endif


#endif //__JPEG_H__

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -