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

📄 decodeimage.h

📁 barcode readers [ from Image]
💻 H
字号:
/*
	DecodeImage. Given an image, decode all the barcodes in it
	and show the first one found to the user.
	This code is a derivative work of the SnapShot example
	application distributed with the Symbian 6.0 SDK.
	Copyright (C) 2006  Jon A. Webb

	This program is free software; you can redistribute it and/or
	modify it under the terms of the GNU General Public License
	as published by the Free Software Foundation; either version 2
	of the License, or (at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program; if not, write to the Free Software
	Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

*/

#ifndef DecodeImage_h
#define DecodeImage_h

#include "Array.h"
#include "Bars2Sym.h"
#include "Image.h"
#include "MeasureComponents.h"

class CBars2SymFactory;
class CWindowGc;

class CDecodeImage : public CBase
{
public:
/*!
  @function CDecodeImage
  
  @discussion Perform the first phase of two phase construction 
  */
  CDecodeImage();	

/*!
  @function DecodeImage
  
  @discussion Create a CDecodeImage object.
  */
  static CDecodeImage* NewL();

private:
/*!
  @function ConstructL
  
  @discussion  Perform the second phase construction of a CDecodeImage object
  */
	void ConstructL();

public:
/*!
  @function ConstructL
  
  @discussion Destructor
  */
	~CDecodeImage();

	// Operations
public:
/*!
	@function DoItL
	@discussion Given an image, decode all barcode sequences in it and 
		show the user the first one. Save the others into a list so they 
		can be retrieved later. For each decodeder, save each new barcode sequence
		only the first time.
	@param gc: the graphics context for the window to so debugging results etc.
	@param drawRect: the rectangle for showing debugging results.
	@param aImage: the image to be processed.
	*/
	void DoItL(CWindowGc& gc, TRect drawRect, CFbsBitmap* aImage);

/*!
	@function ResetProcessed
	@discussion Reset the processed flag so DoItL will actuall process the next
		image it sees.
	*/
	void ResetProcessed();

	// Accessors
	TRect BarcodeRectangle() const;
	bool FoundBarcode() const;
private:
/*!
	@function ClearCodes
	@discussion Clear the code arrays.
	*/
	void ClearArrays();

private:
	/*! @var iBars: the array of bar widths */
	CArrayFix<char>* iBars;

	/*! @var iBars2SymFactory access to bar decoders */
	CBars2SymFactory* iBars2SymFactory;

	/*! @var iCodeList array of all unique bar codes */
	CArrayFixFlat<CBars2Sym::CodeType*>* iCodeList;

	/*! @var iCodes array of decoded bars organized by decoder */
	Core::CArray<CBars2Sym::CodeType*>* iCodes;

	/*! @var iFoundBarcode */
	bool iFoundBarcode;

	/*! @var iFsSession the file session */
	RFs iFsSession;

	/*! @var iGeometry array of geometry elements */
	CArrayFixFlat<Algorithm::ComponentGeometry>* ipGeometry;

    /*! @var iPosition: array of arrays of zero crossing positions */
	Core::CArray<CArrayFixFlat<TReal>*>* iPosition;

	/*! @var iProcessed: current image has been processed */
	bool iProcessed;

	/*! @var iRectangle: barcode bounding box */
	TRect iRectangle;

	/*! @var iRows: number of rows in the image */
	int iRows;

};

#endif // DecodeImage_h

⌨️ 快捷键说明

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