Download List

Sponsored link

System Requirements

System requirement is not defined

Released at 2009-11-02 00:55
NyARToolkit for C++ 2.4.0 (1 files Hide)

Release Notes

Update for NyARToolkit/2.4.0

Update Alchemymaster and Alchemy-bind module.

処理系をNyARToolkit/2.4.0系に更新しました。

forAlchemyのAlchemyMasterを更新しました。

Changelog

Index: D:/project.sorceforge/NyARToolkitCPP/trunk/LICENCE.txt
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/LICENCE.txt (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/LICENCE.txt (revision 335)
@@ -1,10 +1,10 @@
-ARToolkit Java class library NyARToolkitCS.
+ARToolkit C++ class library NyARToolkitCPP.
Copyright (C)2008 R.Iizuka

-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 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 3 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
@@ -12,24 +12,21 @@
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+along with this program. If not, see <http://www.gnu.org/licenses/>.



-C#版 NyARToolkit クラスライブラリ NyARToolkitCS
-Copyright (C)2008 R.Iizuka
+C++ NyARToolkit クラスライブラリ NyARToolkitCS
+Copyright (C)2008-2009 Ryo Iizuka

-このプログラムはフリーソフトウェアです。あなたはこれを、フリーソフトウェ
-ア財団によって発行された GNU 一般公衆利用許諾契約書(バージョン2か、希
-望によってはそれ以降のバージョンのうちどれか)の定める条件の下で再頒布
-または改変することができます。
+このプログラムはフリーソフトウェアです。あなたはこれを、フリーソフトウェア
+財団によって発行されたGNU 一般公衆利用許諾書(バージョン3か、それ以降のバー
+ジョンのうちどれか)が定める条件の下で再頒布または改変 することができます。

-このプログラムは有用であることを願って頒布されますが、*全くの無保証*
-です。商業可能性の保証や特定の目的への適合性は、言外に示されたものも含
-め全く存在しません。詳しくはGNU 一般公衆利用許諾契約書をご覧ください。
-
-あなたはこのプログラムと共に、GNU 一般公衆利用許諾契約書の複製物を一部
-受け取ったはずです。もし受け取っていなければ、フリーソフトウェア財団ま
-で請求してください(宛先は the Free Software Foundation, Inc., 59
-Temple Place, Suite 330, Boston, MA 02111-1307 USA)。
\ No newline at end of file
+このプログラムは有用であることを願って頒布されますが、*全くの無保証 *です。
+商業可能性の保証や特定目的への適合性は、言外に示されたものも 含め、全く存
+在しません。詳しくはGNU 一般公衆利用許諾書をご覧ください。
+
+あなたはこのプログラムと共に、GNU 一般公衆利用許諾書のコピーを一部受け取って
+いるはずです。もし受け取っていなければ、<http://www.gnu.org/licenses/>
+ご覧ください。
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forWindows/NyARToolkitCPP/NyARToolkitCPP.vcproj
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forWindows/NyARToolkitCPP/NyARToolkitCPP.vcproj (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forWindows/NyARToolkitCPP/NyARToolkitCPP.vcproj (revision 335)
@@ -163,14 +163,6 @@
Name="nyartoolkit"
>
<File
- RelativePath="..\..\src\core\NyARColorPatt_Perspective.cpp"
- >
- </File>
- <File
- RelativePath="..\..\inc\core\NyARColorPatt_Perspective.h"
- >
- </File>
- <File
RelativePath="..\..\src\core\NyARColorPatt_PseudoAffine.cpp"
>
</File>
@@ -206,14 +198,6 @@
Name="core"
>
<File
- RelativePath="..\..\src\core\INyARSquareDetector.cpp"
- >
- </File>
- <File
- RelativePath="..\..\inc\core\INyARSquareDetector.h"
- >
- </File>
- <File
RelativePath="..\..\src\core\NyARCode.cpp"
>
</File>
@@ -242,30 +226,6 @@
>
</File>
<File
- RelativePath="..\..\src\core\NyARSquare.cpp"
- >
- </File>
- <File
- RelativePath="..\..\inc\core\NyARSquare.h"
- >
- </File>
- <File
- RelativePath="..\..\src\core\NyARSquareDetector.cpp"
- >
- </File>
- <File
- RelativePath="..\..\inc\core\NyARSquareDetector.h"
- >
- </File>
- <File
- RelativePath="..\..\src\core\NyARSquareStack.cpp"
- >
- </File>
- <File
- RelativePath="..\..\inc\core\NyARSquareStack.h"
- >
- </File>
- <File
RelativePath="..\..\src\core\NyARVec.cpp"
>
</File>
@@ -273,14 +233,6 @@
RelativePath="..\..\inc\core\NyARVec.h"
>
</File>
- <File
- RelativePath="..\..\src\core\NyARVertexCounter.cpp"
- >
- </File>
- <File
- RelativePath="..\..\inc\core\NyARVertexCounter.h"
- >
- </File>
<Filter
Name="types"
>
@@ -521,53 +473,85 @@
Name="labeling"
>
<File
- RelativePath="..\..\src\core\INyARLabeling.cpp"
+ RelativePath="..\..\src\core\LabelOverlapChecker.cpp"
>
</File>
<File
- RelativePath="..\..\inc\core\INyARLabeling.h"
+ RelativePath="..\..\inc\core\LabelOverlapChecker.h"
>
</File>
<File
- RelativePath="..\..\src\core\INyARLabelingImage.cpp"
+ RelativePath="..\..\src\core\NyARLabelInfo.cpp"
>
</File>
<File
- RelativePath="..\..\inc\core\INyARLabelingImage.h"
+ RelativePath="..\..\inc\core\NyARLabelInfo.h"
>
</File>
<File
- RelativePath="..\..\src\core\NyARLabeling_ARToolKit.cpp"
+ RelativePath="..\..\src\core\NyARLabelInfoStack.cpp"
>
</File>
<File
- RelativePath="..\..\inc\core\NyARLabeling_ARToolKit.h"
+ RelativePath="..\..\inc\core\NyARLabelInfoStack.h"
>
</File>
- <File
- RelativePath="..\..\src\core\NyARLabelingImage.cpp"
+ <Filter
+ Name="rlelabeling"
>
- </File>
- <File
- RelativePath="..\..\inc\core\NyARLabelingImage.h"
+ <File
+ RelativePath="..\..\src\core\NyARLabeling_Rle.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\inc\core\NyARLabeling_Rle.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\core\RleLabelFragmentInfoStack.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\inc\core\RleLabelFragmentInfoStack.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="artoolkit"
>
- </File>
- <File
- RelativePath="..\..\src\core\NyARLabelingLabel.cpp"
- >
- </File>
- <File
- RelativePath="..\..\inc\core\NyARLabelingLabel.h"
- >
- </File>
- <File
- RelativePath="..\..\src\core\NyARLabelingLabelStack.cpp"
- >
- </File>
- <File
- RelativePath="..\..\inc\core\NyARLabelingLabelStack.h"
- >
- </File>
+ <File
+ RelativePath="..\..\src\core\NyARLabeling_ARToolKit.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\inc\core\NyARLabeling_ARToolKit.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\core\NyARLabelingImage.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\inc\core\NyARLabelingImage.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\core\NyARLabelingLabel.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\inc\core\NyARLabelingLabel.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\core\NyARLabelingLabelStack.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\inc\core\NyARLabelingLabelStack.h"
+ >
+ </File>
+ </Filter>
</Filter>
<Filter
Name="param"
@@ -669,18 +653,6 @@
>
</File>
<Filter
- Name="fitveccalc"
- >
- <File
- RelativePath="..\..\src\core\NyARFitVecCalculator.cpp"
- >
- </File>
- <File
- RelativePath="..\..\inc\core\NyARFitVecCalculator.h"
- >
- </File>
- </Filter>
- <Filter
Name="rotmatrix"
>
<File
@@ -700,11 +672,11 @@
>
</File>
<File
- RelativePath="..\..\src\core\NyARRotMatrix_NyARToolKit.cpp"
+ RelativePath="..\..\src\core\NyARRotMatrix_ARToolKit_O2.cpp"
>
</File>
<File
- RelativePath="..\..\inc\core\NyARRotMatrix_NyARToolKit.h"
+ RelativePath="..\..\inc\core\NyARRotMatrix_ARToolKit_O2.h"
>
</File>
<File
@@ -720,21 +692,53 @@
Name="optimize"
>
<File
- RelativePath="..\..\src\core\INyARRotTransOptimize.cpp"
+ RelativePath="..\..\src\core\NyARPartialDifferentiationOptimize.cpp"
>
</File>
<File
- RelativePath="..\..\inc\core\INyARRotTransOptimize.h"
+ RelativePath="..\..\inc\core\NyARPartialDifferentiationOptimize.h"
>
</File>
+ <Filter
+ Name="artoolkit"
+ >
+ <File
+ RelativePath="..\..\src\core\INyARRotTransOptimize.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\inc\core\INyARRotTransOptimize.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\core\NyARRotTransOptimize_O2.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\inc\core\NyARRotTransOptimize_O2.h"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="solver"
+ >
<File
- RelativePath="..\..\src\core\NyARRotTransOptimize_O2.cpp"
+ RelativePath="..\..\src\core\INyARTransportVectorSolver.cpp"
>
</File>
<File
- RelativePath="..\..\inc\core\NyARRotTransOptimize_O2.h"
+ RelativePath="..\..\inc\core\INyARTransportVectorSolver.h"
>
</File>
+ <File
+ RelativePath="..\..\src\core\NyARTransportVectorSolver.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\inc\core\NyARTransportVectorSolver.h"
+ >
+ </File>
</Filter>
</Filter>
<Filter
@@ -792,11 +796,35 @@
RelativePath="..\..\inc\core\NyARColorPatt_O3.h"
>
</File>
+ <File
+ RelativePath="..\..\src\core\NyARColorPatt_Perspective.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\inc\core\NyARColorPatt_Perspective.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\core\NyARColorPatt_Perspective_O2.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\inc\core\NyARColorPatt_Perspective_O2.h"
+ >
+ </File>
</Filter>
<Filter
Name="utils"
>
<File
+ RelativePath="..\..\src\core\NyAREquationSolver.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\inc\core\NyAREquationSolver.h"
+ >
+ </File>
+ <File
RelativePath="..\..\src\core\NyARPerspectiveParamGenerator.cpp"
>
</File>
@@ -813,6 +841,74 @@
>
</File>
</Filter>
+ <Filter
+ Name="squaredetector"
+ >
+ <File
+ RelativePath="..\..\src\core\ContourPickup.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\inc\core\ContourPickup.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\core\INyARSquareDetector.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\inc\core\INyARSquareDetector.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\core\NyARSquare.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\inc\core\NyARSquare.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\core\NyARSquareDetector_ARToolKit.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\inc\core\NyARSquareDetector_ARToolKit.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\core\NyARSquareDetector_Rle.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\inc\core\NyARSquareDetector_Rle.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\core\NyARSquareStack.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\inc\core\NyARSquareStack.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\core\NyARVertexCounter.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\inc\core\NyARVertexCounter.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\core\SquareContourDetector.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\inc\core\SquareContourDetector.h"
+ >
+ </File>
+ </Filter>
</Filter>
<Filter
Name="core2"
@@ -951,6 +1047,14 @@
Name="processor"
>
<File
+ RelativePath="..\..\src\processor\SingleARMarkerProcessor.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\inc\processor\SingleARMarkerProcessor.h"
+ >
+ </File>
+ <File
RelativePath="..\..\src\processor\SingleNyIdMarkerProcessor.cpp"
>
</File>
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forWindows/NyARToolKitCPP-SingleARMarker/main.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forWindows/NyARToolKitCPP-SingleARMarker/main.cpp (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forWindows/NyARToolKitCPP-SingleARMarker/main.cpp (revision 335)
@@ -0,0 +1,110 @@
+#include "NyAR_core.h"
+#include "SingleARMarkerProcessor.h"
+
+
+#define CODE_FILE "../../data/patt.hiro"
+#define DATA_FILE "../../data/320x240ABGR.raw"
+#define CAMERA_FILE "../../data/camera_para.dat"
+#include <cstdio>
+#include <iostream>
+#include <fstream>
+#include <windows.h>
+using namespace NyARToolkitCPP;
+using namespace std;
+
+unsigned char* load_file_image(const char* i_filename)
+{
+ ifstream inf;
+ unsigned char* result=NULL;
+ try {
+ inf.open(i_filename,ios::binary+ios::in);
+ int size=320*240*4;
+ result=new unsigned char[size];
+ inf.read((char*)result,size);
+ if(size!=inf.gcount()){
+ throw exception();
+ }
+ inf.close();
+ } catch(exception e){
+ if(result!=NULL){
+ delete result;
+ }
+ throw;
+ }
+ return result;
+}
+
+
+class MarkerProcessor :public SingleARMarkerProcesser
+ {
+ public:
+ const NyARTransMatResult* transmat;
+ int current_code;
+
+ public:
+ MarkerProcessor(const NyARParam* i_cparam,int i_raster_format)
+ {
+ //āĶÊЛĖÇÓĴ̛ÀϛĎÌω˺ɻ
+ initInstance(i_cparam,i_raster_format);
+ current_code=-1;
+ return;
+ }
+ protected:
+ void onEnterHandler(int i_code)
+ {
+ current_code=i_code;
+ }
+ void onLeaveHandler()
+ {
+ current_code=-1;
+ this->transmat=NULL;
+ return;
+ }
+ void onUpdateHandler(const NyARSquare& i_square, const NyARTransMatResult& result)
+ {
+ this->transmat=&result;
+ }
+ };
+
+
+
+
+
+
+int main(int argc,char* argv[])
+{
+ {
+ // ARذĊÁÉİÉÁĞĴĀăËð͛Ĩ
+ NyARParam ap;
+ //CPUÌćÓĦĂāÓðϷӨµÄɺ³¢‚
+ ap.setEndian(TNyAREndian_LITTLE);
+ ap.loadARParamFromFile(CAMERA_FILE);
+ ap.changeScreenSize(320, 240);
+
+
+ // ARذÌİĞ›ÓĒ›ĨðԇÝЯµ
+ unsigned char* buf;
+ NyARRgbRaster_BGRA* ra;
+
+
+ NyARCode code(16, 16);
+ code.loadARPattFromFile(CODE_FILE);
+ buf=load_file_image(DATA_FILE);
+ ra = new NyARRgbRaster_BGRA(buf,320, 240);
+ //ÉĢĶ·éįĢĴĀðĚĢħ·é‚
+
+ MarkerProcessor* pr = new MarkerProcessor(&ap, ra->getBufferReader().getBufferType());
+ NyARCode* codes[1];
+ codes[0]=new NyARCode(16,16);
+ codes[0]->loadARPattFromFile(CODE_FILE);
+ pr->setARCodeTable(codes,1,16,80.0);
+ pr->detectMarker(*ra);
+ delete codes[0];
+ delete ra;
+ delete pr;
+ delete buf;
+ }
+
+ _CrtDumpMemoryLeaks();
+ return 0;
+}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forWindows/NyARToolKitCPP-SingleARMarker/NyARToolKitCPP-SingleARMarker.vcproj
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forWindows/NyARToolKitCPP-SingleARMarker/NyARToolKitCPP-SingleARMarker.vcproj (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forWindows/NyARToolKitCPP-SingleARMarker/NyARToolKitCPP-SingleARMarker.vcproj (revision 335)
@@ -0,0 +1,195 @@
+<?xml version="1.0" encoding="shift_jis"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="NyARToolKitCPP-SingleARMarker"
+ ProjectGUID="{48345895-F493-4D1F-A4A6-2A8622D3B657}"
+ RootNamespace="NyARToolKitCPPSingleARMarker"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../inc;../../inc/nyidmarker;../../inc/processor;../../inc/core;../../inc/core2"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ EnableIntrinsicFunctions="true"
+ AdditionalIncludeDirectories="../../inc;../../inc/nyidmarker;../../inc/processor;../../inc/core;../../inc/core2"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Ĝ›Ę ĴĀăË"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\main.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="ķĢğ› ĴĀăË"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ </Filter>
+ <Filter
+ Name="ÊĜ›Ę ĴĀăË"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forWindows/NyARToolkitCPP-RawTest/main.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forWindows/NyARToolkitCPP-RawTest/main.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forWindows/NyARToolkitCPP-RawTest/main.cpp (revision 335)
@@ -32,7 +32,7 @@
return result;
}

-void main(int argc,char* argv[])
+int main(int argc,char* argv[])
{
{
// ARذĊÁÉİÉÁĞĴĀăËð͛Ĩ
@@ -52,12 +52,10 @@
NyARCode code(16, 16);
code.loadARPattFromFile(CODE_FILE);
buf=load_file_image(DATA_FILE);
- ra = new NyARRgbRaster_BGRA(320, 240);
- //ÉĢĶ·éįĢĴĀðĚĢħ·é‚
- ra->setBuffer(buf);
+ ra = new NyARRgbRaster_BGRA(buf,320, 240);

// ÐİĞ›ÓÌÝðӇѕ·éĎÉĘðάЬ
- ar = new NyARSingleDetectMarker(&ap,&code, 80.0,ra->getBufferReader().getBufferType());
+ ar = new NyARSingleDetectMarker(&ap,&code, 80.0,ra->getBufferReader().getBufferType(),NyARSingleDetectMarker::PF_NYARTOOLKIT);

ar->setContinueMode(false);

@@ -103,11 +101,14 @@
}
printf("done.\ntotal=%u[ms]\n",GetTickCount()-st);

+ TNyARDoublePoint3d ang;
+ result_mat.getZXYAngle(ang);
+
delete ra;
delete ar;
delete buf;

}
_CrtDumpMemoryLeaks();
- return;
+ return 0;
}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forWindows/NyARToolkitCPP.sln
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forWindows/NyARToolkitCPP.sln (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forWindows/NyARToolkitCPP.sln (revision 335)
@@ -13,6 +13,13 @@
{D41825F6-E7FA-4823-A465-F87E3FB4D12D} = {D41825F6-E7FA-4823-A465-F87E3FB4D12D}
EndProjectSection
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NyARToolKitCPP-SingleARMarker", "NyARToolKitCPP-SingleARMarker\NyARToolKitCPP-SingleARMarker.vcproj", "{48345895-F493-4D1F-A4A6-2A8622D3B657}"
+ ProjectSection(ProjectDependencies) = postProject
+ {D41825F6-E7FA-4823-A465-F87E3FB4D12D} = {D41825F6-E7FA-4823-A465-F87E3FB4D12D}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NyARToolKitCPP-sandbox", "NyARToolKitCPP-sandbox\NyARToolKitCPP-sandbox.vcproj", "{E6F6BDD9-7FA3-4161-93F4-35FB02583F5D}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Mixed Platforms = Debug|Mixed Platforms
@@ -53,6 +60,26 @@
{1E833C12-B3FF-448B-9B71-693D9867F006}.Release|Win32.ActiveCfg = Release|Win32
{1E833C12-B3FF-448B-9B71-693D9867F006}.Release|Win32.Build.0 = Release|Win32
{1E833C12-B3FF-448B-9B71-693D9867F006}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Win32
+ {48345895-F493-4D1F-A4A6-2A8622D3B657}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
+ {48345895-F493-4D1F-A4A6-2A8622D3B657}.Debug|Mixed Platforms.Build.0 = Debug|Win32
+ {48345895-F493-4D1F-A4A6-2A8622D3B657}.Debug|Win32.ActiveCfg = Debug|Win32
+ {48345895-F493-4D1F-A4A6-2A8622D3B657}.Debug|Win32.Build.0 = Debug|Win32
+ {48345895-F493-4D1F-A4A6-2A8622D3B657}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Win32
+ {48345895-F493-4D1F-A4A6-2A8622D3B657}.Release|Mixed Platforms.ActiveCfg = Release|Win32
+ {48345895-F493-4D1F-A4A6-2A8622D3B657}.Release|Mixed Platforms.Build.0 = Release|Win32
+ {48345895-F493-4D1F-A4A6-2A8622D3B657}.Release|Win32.ActiveCfg = Release|Win32
+ {48345895-F493-4D1F-A4A6-2A8622D3B657}.Release|Win32.Build.0 = Release|Win32
+ {48345895-F493-4D1F-A4A6-2A8622D3B657}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Win32
+ {E6F6BDD9-7FA3-4161-93F4-35FB02583F5D}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
+ {E6F6BDD9-7FA3-4161-93F4-35FB02583F5D}.Debug|Mixed Platforms.Build.0 = Debug|Win32
+ {E6F6BDD9-7FA3-4161-93F4-35FB02583F5D}.Debug|Win32.ActiveCfg = Debug|Win32
+ {E6F6BDD9-7FA3-4161-93F4-35FB02583F5D}.Debug|Win32.Build.0 = Debug|Win32
+ {E6F6BDD9-7FA3-4161-93F4-35FB02583F5D}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Win32
+ {E6F6BDD9-7FA3-4161-93F4-35FB02583F5D}.Release|Mixed Platforms.ActiveCfg = Release|Win32
+ {E6F6BDD9-7FA3-4161-93F4-35FB02583F5D}.Release|Mixed Platforms.Build.0 = Release|Win32
+ {E6F6BDD9-7FA3-4161-93F4-35FB02583F5D}.Release|Win32.ActiveCfg = Release|Win32
+ {E6F6BDD9-7FA3-4161-93F4-35FB02583F5D}.Release|Win32.Build.0 = Release|Win32
+ {E6F6BDD9-7FA3-4161-93F4-35FB02583F5D}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forWindows/NyARToolkitCPP-IdMarker/main.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forWindows/NyARToolkitCPP-IdMarker/main.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forWindows/NyARToolkitCPP-IdMarker/main.cpp (revision 335)
@@ -111,7 +111,7 @@
// Ύ̱ăÁ›ėÌԇÝЯµ(320x240 BGRAÌRAWĦ›Ğ)
unsigned char* img=load_file_image(data_file);

- NyARRgbRaster_BGRA* ra = NyARRgbRaster_BGRA::wrap(img, 320, 240);
+ NyARRgbRaster_BGRA* ra = new NyARRgbRaster_BGRA(img, 320, 240);
MarkerProcessor pr(&ap, ra->getBufferReader().getBufferType());
pr.detectMarker(*ra);
delete ra;
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/readme.ja.txt
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/readme.ja.txt (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/readme.ja.txt (revision 335)
@@ -1,7 +1,7 @@
ARToolkit C++ class library NyARToolkitCPP.
Copyright (C)2008-2009 R.Iizuka

-version 0.10.0
+version 2.4.0

http://nyatla.jp/
airmail(at)ebony.plala.or.jp
@@ -10,16 +10,14 @@

・NyARToolkitCPP

-NyARToolkitCPPは、NyARToolkit for Java 2.3系をベースにした、C++
+NyARToolkitCPPは、NyARToolkit for Java 2.4系をベースにした、C++
によるNyARToolkit互換のクラスライブラリです。

-処理性能は、オリジナルARToolKit比で、約30%~40%程度高速です。
+処理性能は、オリジナルARToolKit比で、約400%程度高速です。
NyARToolkitと同様に、検出数が多くなるほど高速になります。


-****現在β版につき、いくつか機能不足な点があります。****
-
-※現在は計算用のコアクラスのみの実装となっています。
+※現在は計算用クラスのみの実装となっています。
 カメラ入力・3D出力部のコードはまだ実装されていません。

※マーカ検出クラスは、SingleMarkerDetectorのみ(単一マーカ検出クラス)
@@ -52,6 +50,7 @@

forAlchemy
Adobe alchemy用のswcを作成するmakefileがあります。
+ コンパイル方法は、NyARToolkitAS3以下にあるhow_to_compile.txtを見てください。


・ディレクトリ構成
@@ -98,23 +97,26 @@


・ライセンス
-extlib以下のものは、各モジュールのライセンスに従ってください。
-NyARToolkitCSは、GPLv2、または商用ライセンスでご利用になれます。
+後述するモジュールを除いたNyARToolkitCPP主要コンポーネントは、商用ライセンス
+とGPLv3以降のデュアルライセンスを採用しています。
+(Version/2.4.0より、GPLv3ライセンスになりました。)

-GPL
- GPLは、商用目的/非商用目的のどちらでも利用できますが、
- ソフトウェアのバイナリを第三者に公開するのであれば、
- そのソフトウェアを構成するすべてのソースファイルを、
- GPLライセンスで公開しなければならない制約があります。
- 詳しくはLICENCE.txtをみてください。

-商用ライセンス
+以下のディレクトリ配下にあるものについては、各モジュールのライセンスに従ってください。
+forAlchemy/AlchemyMaster
+forAlchemy/NyARToolkitAS3

- クローズ開発等が可能なライセンスです。ARToolWorksから
- 購入することができます。価格等のお問い合わせは、
- info@artoolworks.comからどうぞ。

+ -GPL
+ GPLについては、LICENCE.txtをお読みください。

+ -商用ライセンス
+ 商用ライセンスについては、ARToolWorks社に管理を委託しております。
+ http://www.artoolworks.com/Home.html

+ 日本国内での販売については、下記にお問い合わせ下さい。
+ http://www.msoft.co.jp/pressrelease/press090928-1.html


+
+
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forLinux/RawTest/main.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forLinux/RawTest/main.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forLinux/RawTest/main.cpp (revision 335)
@@ -50,12 +50,10 @@
NyARCode code(16, 16);
code.loadARPattFromFile(CODE_FILE);
buf=load_file_image(DATA_FILE);
- ra = new NyARRgbRaster_BGRA(320, 240);
- //ÉĢĶ·éįĢĴĀðĚĢħ·é‚
- ra->setBuffer(buf);
+ ra = new NyARRgbRaster_BGRA(buf,320, 240);

// ÐİĞ›ÓÌÝðӇѕ·éĎÉĘðάЬ
- ar = new NyARSingleDetectMarker(&ap,&code, 80.0,ra->getBufferReader()->getBufferType());
+ ar = new NyARSingleDetectMarker(&ap,&code, 80.0,ra->getBufferReader().getBufferType());
ar->setContinueMode(false);

NyARTransMatResult result_mat;
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/processor/SingleARMarkerProcessor.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/processor/SingleARMarkerProcessor.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/processor/SingleARMarkerProcessor.cpp (revision 335)
@@ -1,33 +1,331 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
-
-
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
+#include "SingleARMarkerProcessor.h"
+#include "nyarcore.h"
namespace NyARToolkitCPP
{
+ /**
+ * ±ÌĎÉĘ́ӯΞÉÐ͂ÌĽ›Ċðψם·é±ÆÌÅ«éāĶÊЛĖÇÓĶÍĚĢĔÅ·‚
+ * Ľ›ĊÌЯ̻…ɚӮ…ЁׅðăĸÓħÅӊӭ·é±ÆªÅ«Ü·‚
+ * ĎÉĘÉÍաДÌĽ›ĊðԯٞÅ«Ü·‚ɪÂÌĽ›Ċª̩©éƁĶÍĚĢĔÍͰѱµÄӯ¶Ľ›Ċð
+ * о¯Նίµѱ¯̩θ¤ÜÅÌ˔ÍѼÌĽ›ĊðՆίµÜ¹ñ‚
+ *
+ * ăĸÓħ́ OnEnterhOnUpdate[n]hOnLeaveÌχÅԭжµÜ·‚
+ * Ľ›Ċª̩©éÆܸOnEnterªÐԸԭжµÄɽՔÌĽ›Ċªԭ̩³ê½©ªí©èÜ·‚
+ * ΟÉOnUpdateÉæè̻ΝÌ֏ʷγرªفѱµÄԮ³êÜ·‚΅ͣÉĽ›Ċð̩θ¤ÆOnLeave
+ * ăĸÓħªԭжµÜ·‚
+ *
+ */
+ SingleARMarkerProcesser::SingleARMarkerProcesser()
+ {
+ this->_cf_threshold_new = 0.30;
+ this->_cf_threshold_exist = 0.15;
+ this->_threshold = 110;
+ this->_current_arcode_index = -1;
+ this->_lost_delay_count = 0;
+ this->_lost_delay = 5;
+ this->_square_list = new NyARSquareStack(100);
+ this->_initialized=false;
+ return;
+ }
+ SingleARMarkerProcesser::~SingleARMarkerProcesser()
+ {
+ //setARCodeTableÅʄèӖÄçê½ĉĵėĆĎħðˊֺ
+ freeARCodeTable();
+ NyAR_SAFE_DELETE(this->_square_list);
+ if(this->_initialized==true){
+ //initInstanceÅʄèӖĽĉĵėĆĎħðˊֺ
+ NyAR_SAFE_DELETE(this->_square_detect);
+ NyAR_SAFE_DELETE(this->_transmat);
+ NyAR_SAFE_DELETE(this->_bin_raster);
+ NyAR_SAFE_DELETE(this->_tobin_filter);
+ NyAR_SAFE_DELETE(this->_threshold_detect);
+ }
+ return;
+ }
+ void SingleARMarkerProcesser::initInstance(const NyARParam* i_param,int i_raster_type)
+ {
+ const TNyARIntSize& scr_size = i_param->getScreenSize();
+ // ʰэĉĵėĆĎħðάé
+ this->_square_detect = new NyARSquareDetector_Rle(i_param->getDistortionFactor(), scr_size);
+ this->_transmat = new NyARTransMat(i_param);
+ this->_tobin_filter=new NyARRasterFilter_ARToolkitThreshold(110,i_raster_type);

+ // ÑӬʦќįĢĴĀðάé
+ this->_bin_raster = new NyARBinRaster(scr_size.w, scr_size.h);
+ this->_threshold_detect=new NyARRasterThresholdAnalyzer_SlidePTile(15,i_raster_type,4);
+ //ω˺ɻ
+ this->_patt=NULL;
+ this->_deviation_data=NULL;
+ this->_match_patt=NULL;
+ this->_initialized=true;
+ return;
+ }
+
+ void SingleARMarkerProcesser::freeARCodeTable()
+ {
+ //ʄӖΏÌĉĵėĆĎħðέϜ
+ NyAR_SAFE_DELETE(this->_patt);
+ NyAR_SAFE_DELETE(this->_deviation_data);
+ if(this->_match_patt!=NULL){
+ for(int i=0;i<this->_match_patt->length;i++){
+ NyAR_SAFE_DELETE(this->_match_patt->item[i]);
+ }
+ NyAR_SAFE_DELETE(this->_match_patt);
+ }
+ return;
+ }
+
+ /*ΩӮ…ϨӮÌѝӨªЯ׈È¢ÌŁĒÁÓħāąħ
+ public void setThreshold(int i_threshold)
+ {
+ this._threshold = i_threshold;
+ return;
+ }*/
+
+ /**̟Я·éĽ›ĊĒ›ĨÌպرðϷӨµÜ·‚ ̟ЯгҔűÌ˖Дðπγ·éƁ
+ * ĉĵėĆĎħгҔÉ˭ЧÊĚĢħª©©èÜ·‚
+ */
+
+ void SingleARMarkerProcesser::setARCodeTable(NyARCode* const i_ref_code_table[],int i_number_of_code, int i_code_resolution, double i_marker_width)
+ {
+ if (this->_current_arcode_index != -1) {
+ // ˭ЧÊĚĢħ
+ reset(true);
+ }
+ //ʄӖΏÌĉĵėĆĎħðέϜ
+ freeARCodeTable();
+
+ //̟Я·éĽ›ĊĚĢħЮֱ̟Я˭ðάèҼ·‚(1ijĎĚË4ļăÓħĔÓĶÊÓď,Ľ›ĊÌİĞ›Ó،ɦÍ50%)
+ this->_patt = new NyARColorPatt_Perspective_O2(i_code_resolution, i_code_resolution,4,25);
+ this->_deviation_data=new NyARMatchPattDeviationColorData(i_code_resolution, i_code_resolution);
+ this->_marker_width = i_marker_width;
+
+ this->_match_patt = new NyArray<NyARMatchPatt_Color_WITHOUT_PCA*>(i_number_of_code);
+ for(int i=0;i<i_number_of_code;i++){
+ this->_match_patt->item[i]=new NyARMatchPatt_Color_WITHOUT_PCA(i_ref_code_table[i]);
+ }
+ return;
+ }
+
+ void SingleARMarkerProcesser::reset(bool i_is_force)
+ {
+ if (this->_current_arcode_index != -1 && i_is_force == false) {
+ // ˭Чϑ«ʷ¦ÅȯêÎăĸÓħĒ›Ë
+ this->onLeaveHandler();
+ }
+ // ĊÌÓħĽ›ĊðÊĚĢħ
+ this->_current_arcode_index = -1;
+ return;
+ }
+
+ void SingleARMarkerProcesser::detectMarker(const INyARRgbRaster& i_raster)
+ {
+ // ĔăęĠĆĢĎ
+ NyAR_ASSERT(this->_bin_raster->getSize().isEqualSize(i_raster.getSize().w, i_raster.getSize().h));
+
+ // Ē›Ĩĥ›ĵ˪ֳ¯êα±ÅЉíè
+ if (this->_match_patt== NULL) {
+ return;
+ }
+
+ // ÉĘĞð(1/4ÌʦќÌ)ÑӬăÁ›ėÉ֏ʷ·é.
+ this->_tobin_filter->setThreshold(this->_threshold);
+ this->_tobin_filter->doFilter(i_raster, *this->_bin_raster);
+
+ NyARSquareStack& square_stack = *this->_square_list;
+ // ĘĎćāĒ›ĨðӔ·
+ this->_square_detect->detectMarker(*this->_bin_raster, square_stack);
+ // Նίψם
+ if (this->_current_arcode_index == -1) { // Ľ›Ċ֢Նί
+ detectNewMarker(i_raster, square_stack);
+ } else { // Ľ›ĊՆί҆
+ detectExistMarker(i_raster, square_stack, this->_current_arcode_index);
+ }
+ return;
+ }
+
+
+ /**ARCodeÌÊĘħ©ç΅àɪӶ·éĒ›ĨՔ͆ð̟εµÜ·‚
+ */
+ bool SingleARMarkerProcesser::selectARCodeIndexFromList(const INyARRgbRaster& i_raster,const NyARSquare& i_square, TResult_selectARCodeIndex& o_result)
+ {
+ // ̻ΝĒ›Ĩĥ›ĵËÍāĎĥĂĵˆ
+ if (this->_match_patt==NULL) {
+ return false;
+ }
+ // ֝ɿˮπÉÈéİĞ›ÓðăÁ›ė©çјèЯ·
+ if (!this->_patt->pickFromRaster(i_raster, i_square)) {
+ return false;
+ }
+ //֝ɿĦ›ĞðάЬµÄ֝ɿ˭ÉĚĢħ
+ this->_deviation_data->setRaster(*this->_patt);
+ TNyARMatchPattResult mr;
+ int code_index = 0;
+ int dir = 0;
+ double c1 = 0;
+ // Ē›ĨÆդ˲·é
+ for (int i = 0; i < this->_match_patt->length; i++) {
+ this->_match_patt->item[i]->evaluate(*this->_deviation_data,mr);
+ double c2 = mr.confidence;
+ if (c1 < c2) {
+ code_index = i;
+ c1 = c2;
+ dir = mr.direction;
+ }
+ }
+ o_result.code_index = code_index;
+ o_result.direction = dir;
+ o_result.confidence = c1;
+ return true;
+ }
+
+ /**і̋Ľ›Ċ̟ε ̻ΝՆί҆ÌĽ›ĊªÈ¢àÌƵā΅àՆίµâ·¢Ľ›ĊðÐ͂ՆίµÜ·‚
+ */
+ void SingleARMarkerProcesser::detectNewMarker(const INyARRgbRaster& i_raster,NyARSquareStack& i_stack)
+ {
+ int number_of_square = i_stack.getLength();
+ double cf = 0;
+ int dir = 0;
+ int code_index = -1;
+ int square_index = 0;
+ TResult_selectARCodeIndex detect_result;
+ for (int i = 0; i < number_of_square; i++) {
+ if (!selectARCodeIndexFromList(i_raster,*i_stack.getItem(i), detect_result)) {
+ // ̩©çÈ¢‚
+ return;
+ }
+ if (detect_result.confidence < this->_cf_threshold_new) {
+ continue;
+ }
+ if (detect_result.confidence < cf) {
+ // ɪӶԸªӡ¢‚
+ continue;
+ }
+ cf = detect_result.confidence;
+ code_index = detect_result.code_index;
+ square_index = i;
+ dir = detect_result.direction;
+ }
+ // ՆίгҔðΘі
+ const bool is_id_found=updateStatus(*this->_square_list->getItem(square_index), code_index, cf, dir);
+ //臒lĴÛĨįĢĎ(detectExistMarkerÉà éæ)
+ if(!is_id_found){
+ //Ľ›ĊªÈ¯ê΁Ӕε+DualPTailÅˮπ̐Ը̟ε
+ this->_threshold_detect->analyzeRaster(i_raster);
+ this->_threshold=(this->_threshold+this->_threshold_detect->getThreshold())/2;
+ }
+ }
+
+ /**Ľ›ĊÌͰѱՆί ̻ΝՆί҆ÌĽ›Ċð؄ѦµÄՆίµÜ·‚
+ * ©ҍª±Ì̀՜ͽÔñͣ͡¢ë¢ëԭԗ·é©çNewÆͬºÈ¢±Æ‚
+ */
+ void SingleARMarkerProcesser::detectExistMarker(const INyARRgbRaster& i_raster,const NyARSquareStack& i_stack, int i_current_id)
+ {
+ int number_of_square = i_stack.getLength();
+ double cf = 0;
+ int dir = 0;
+ int code_index = -1;
+ int square_index = 0;
+ TResult_selectARCodeIndex detect_result;
+ for (int i = 0; i < number_of_square; i++) {
+ if (!selectARCodeIndexFromList(i_raster,*i_stack.getItem(i), detect_result)) {
+ // ̩©çÈ¢‚
+ return;
+ }
+ // ̻ΝÌĽ›ĊðՆίµ½©ˆ
+ if (detect_result.code_index != i_current_id) {
+ // Նί҆ÌĽ›ĊÅÍÈ¢ÌÅֳ΋
+ continue;
+ }
+ if (detect_result.confidence < this->_cf_threshold_exist) {
+ continue;
+ }
+ if (detect_result.confidence < cf) {
+ // ɪӶԸª͂¢ֻð҉Ô
+ continue;
+ }
+ cf = detect_result.confidence;
+ code_index = detect_result.code_index;
+ dir = detect_result.direction;
+ square_index = i;
+ }
+ // ՆίгҔðΘі
+ const bool is_id_found=updateStatus(*this->_square_list->getItem(square_index), code_index, cf, dir);
+ //臒lĴÛĨįĢĎ(detectExistMarkerÉà éæ)
+ if(!is_id_found){
+ //Ľ›ĊªÈ¯ê΁Ӕε+DualPTailÅˮπ̐Ը̟ε
+ this->_threshold_detect->analyzeRaster(i_raster);
+ this->_threshold=(this->_threshold+this->_threshold_detect->getThreshold())/2;
+ }
+
+ }
+
+ /** ĉĵėĆĎħÌĘĥ›ĞĘðΘіµ֋ضÉɞ¶ÄĮÓĨË˖Дð̬ӮµÜ·‚
+ * ןèӬ́µπΛÉĽ›Ċðԭ̩·éΖªÅ«½©¶Å·‚ĎÉĘÌгҔÆÍəÈèÜ·‚
+ */
+ bool SingleARMarkerProcesser::updateStatus(const NyARSquare& i_square, int i_code_index, double i_cf, int i_dir)
+ {
+ NyARTransMatResult& result = this->__NyARSquare_result;
+ if (this->_current_arcode_index < 0) {// ֢Նί҆
+ if (i_code_index < 0) {// ֢Նί©ç֢ՆίÌҊɚ
+ // ÈÉàµÈ¢æ›ñ‚
+ return false;
+ } else {// ֢Նί©çՆίÌҊɚ
+ this->_current_arcode_index = i_code_index;
+ // ăĸÓħжЬ
+ // OnEnter
+ this->onEnterHandler(i_code_index);
+ // ֏ʷγرðάЬ
+ this->_transmat->transMat(i_square, i_dir, this->_marker_width, result);
+ // OnUpdate
+ this->onUpdateHandler(i_square, result);
+ this->_lost_delay_count = 0;
+ return true;
+ }
+ } else {// Նί҆
+ if (i_code_index < 0) {// Նί©ç֢ՆίÌҊɚ
+ this->_lost_delay_count++;
+ if (this->_lost_delay < this->_lost_delay_count) {
+ // OnLeave
+ this->_current_arcode_index = -1;
+ this->onLeaveHandler();
+ }
+ return false;
+ } else if (i_code_index == this->_current_arcode_index) {// ӯ¶ARCodeÌ΄Նί
+ // ăĸÓħжЬ
+ // ֏ʷγرðάЬ
+ this->_transmat->transMat(i_square, i_dir, this->_marker_width, result);
+ // OnUpdate
+ this->onUpdateHandler(i_square, result);
+ this->_lost_delay_count = 0;
+ return true;
+ } else {// əÈéĒ›ĨÌՆίh͡ÍĔļ›ħµÈ¢‚
+ throw NyARException();
+ }
+ }
+ }
}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/processor/SingleNyIdMarkerProcessor.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/processor/SingleNyIdMarkerProcessor.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/processor/SingleNyIdMarkerProcessor.cpp (revision 335)
@@ -2,32 +2,28 @@
* PROJECT: NyARToolkitCPP
* --------------------------------------------------------------------------------
*
-* The NyARToolkitCS is C++ version NyARToolkit class library.
-*
-* Copyright (C)2008 R.Iizuka
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
*
-* 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 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 3 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 framework; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For further information please contact.
* http://nyatla.jp/nyatoolkit/
-* <airmail(at)ebony.plala.or.jp>
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
*
*/

-
-
#include "SingleNyIdMarkerProcessor.h"
namespace NyARToolkitCPP
{
@@ -35,28 +31,33 @@
//filterÍΩժÅ̈ßé
SingleNyIdMarkerProcesser::SingleNyIdMarkerProcesser()
{
+ this->_initialized=false;
}
SingleNyIdMarkerProcesser::~SingleNyIdMarkerProcesser()
{
- // ÑӬʦќįĢĴĀðάé
- NyAR_SAFE_DELETE(this->_threshold_detect);
- NyAR_SAFE_DELETE(this->_tobin_filter);
- NyAR_SAFE_DELETE(this->_data_current);
- NyAR_SAFE_DELETE(this->_data_temp);
- NyAR_SAFE_DELETE(this->_bin_raster);
- NyAR_SAFE_DELETE(this->_transmat);
- NyAR_SAFE_DELETE(this->_square_detect);
NyAR_SAFE_DELETE(this->_id_pickup);
NyAR_SAFE_DELETE(this->_square_list);
+
+ if(this->_initialized==true){
+ NyAR_SAFE_DELETE(this->_threshold_detect);
+ NyAR_SAFE_DELETE(this->_tobin_filter);
+ NyAR_SAFE_DELETE(this->_data_current);
+ NyAR_SAFE_DELETE(this->_data_temp);
+ NyAR_SAFE_DELETE(this->_bin_raster);
+ NyAR_SAFE_DELETE(this->_transmat);
+ NyAR_SAFE_DELETE(this->_square_detect);
+ this->_initialized=false;
+ }
return;
}

void SingleNyIdMarkerProcesser::initInstance(const NyARParam* i_param,const INyIdMarkerDataEncoder* i_encoder,int i_raster_format)
{
+ NyAR_ASSERT(this->_initialized==false);
const TNyARIntSize &scr_size = i_param->getScreenSize();
this->_id_pickup=new NyIdMarkerPickup();
// ʰэĉĵėĆĎħðάé
- this->_square_detect = new NyARSquareDetector(i_param->getDistortionFactor(), scr_size);
+ this->_square_detect = new NyARSquareDetector_Rle(i_param->getDistortionFactor(), scr_size);
this->_transmat = new NyARTransMat(i_param);
this->_encoder=i_encoder;

@@ -73,7 +74,7 @@
this->_current_threshold=110;
this->_lost_delay_count=0;
this->_lost_delay = 5;
-
+ this->_initialized=true;
return;
}

Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/utils/NyStdLib.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/utils/NyStdLib.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/utils/NyStdLib.cpp (revision 335)
@@ -1,3 +1,28 @@
+/*
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyStdLib.h"

namespace NyARToolkitCPP
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/nyidmarker/NyIdMarkerPickup.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/nyidmarker/NyIdMarkerPickup.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/nyidmarker/NyIdMarkerPickup.cpp (revision 335)
@@ -2,27 +2,25 @@
* PROJECT: NyARToolkitCPP
* --------------------------------------------------------------------------------
*
-* The NyARToolkitCS is C++ version NyARToolkit class library.
-*
-* Copyright (C)2008 R.Iizuka
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
*
-* 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 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 3 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 framework; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For further information please contact.
* http://nyatla.jp/nyatoolkit/
-* <airmail(at)ebony.plala.or.jp>
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
*
*/
#include "NyIdMarkerPickup.h"
@@ -314,9 +312,8 @@
double _cparam[8];

private:
- const INyARRgbRaster* _raster;
- const TNyARIntSize* _raster_size;

+
public:
PerspectivePixelReader()
{
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/nyidmarker/NyIdMarkerPattern.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/nyidmarker/NyIdMarkerPattern.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/nyidmarker/NyIdMarkerPattern.cpp (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/


namespace NyARToolkitCPP
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/nyidmarker/NyIdMarkerParam.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/nyidmarker/NyIdMarkerParam.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/nyidmarker/NyIdMarkerParam.cpp (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/


namespace NyARToolkitCPP
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/nyidmarker/NyIdMarkerDataEncoder_RawBit.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/nyidmarker/NyIdMarkerDataEncoder_RawBit.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/nyidmarker/NyIdMarkerDataEncoder_RawBit.cpp (revision 335)
@@ -2,27 +2,25 @@
* PROJECT: NyARToolkitCPP
* --------------------------------------------------------------------------------
*
-* The NyARToolkitCS is C++ version NyARToolkit class library.
-*
-* Copyright (C)2008 R.Iizuka
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
*
-* 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 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 3 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 framework; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For further information please contact.
* http://nyatla.jp/nyatoolkit/
-* <airmail(at)ebony.plala.or.jp>
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
*
*/

Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/nyidmarker/NyIdMarkerData_RawBit.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/nyidmarker/NyIdMarkerData_RawBit.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/nyidmarker/NyIdMarkerData_RawBit.cpp (revision 335)
@@ -2,27 +2,25 @@
* PROJECT: NyARToolkitCPP
* --------------------------------------------------------------------------------
*
-* The NyARToolkitCS is C++ version NyARToolkit class library.
-*
-* Copyright (C)2008 R.Iizuka
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
*
-* 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 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 3 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 framework; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For further information please contact.
* http://nyatla.jp/nyatoolkit/
-* <airmail(at)ebony.plala.or.jp>
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
*
*/
#include "NyIdMarkerData_RawBit.h"
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/nyidmarker/INyIdMarkerData.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/nyidmarker/INyIdMarkerData.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/nyidmarker/INyIdMarkerData.cpp (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "INyIdMarkerData.h"

namespace NyARToolkitCPP
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/nyidmarker/INyIdMarkerDataEncoder.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/nyidmarker/INyIdMarkerDataEncoder.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/nyidmarker/INyIdMarkerDataEncoder.cpp (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/


namespace NyARToolkitCPP
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARSquareDetector.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARSquareDetector.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARSquareDetector.cpp (revision 335)
@@ -1,419 +0,0 @@
-/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
-#include "NyARSquareDetector.h"
-#include "NyARLabeling_ARToolKit.h"
-#include "NyARLabelingImage.h"
-#include "NyARObserv2IdealMap.h"
-#include "INyARSquareDetector.h"
-#include "NyARVertexCounter.h"
-#include "INyARPca2d.h"
-#include "NyARPca2d_MatrixPCA_O2.h"
-#include "../utils/NyArray.h"
-#include "nyarcore.h"
-#include <cstring>
-#include <cstdio>
-namespace NyARToolkitCPP
-{
-
- /**
- * ÉĸËӯϭÌФÈè©Ԡ֯˖͗ªðҲ×éĎÉĘÅ·‚
- * ÉĸËÊĘħÉԠ֯·éÉĸËðӾяµ»êÉĞ›đĢħÌÉĸ˪Ԡ֯³êÄ¢é© ð˭ՆµÜ·‚
- */
- class OverlapChecker
- {
- private:
- NyArray<const NyARLabelingLabel*> _labels;
- int _length;
-
- /**
- * ΅ҥi_max_label͂ÌÉĸËðӾяÅ«éæ¤ÉĉĵėĆĎħðÊĚĢħ·é
- *
- * @param i_max_label
- */
- public:
- OverlapChecker()
- {
- return;
- }
- ~OverlapChecker()
- {
- return;
- }
- void reset(int i_max_label)
- {
- if (i_max_label > this->_labels.length){
- this->_labels.renew(i_max_label);
- }
- this->_length = 0;
- }
-
- /**
- * ĠĆĢĎҎЛÌÉĸËðӇʁ·é‚
- *
- * @param i_label_ref
- */
- void push(const NyARLabelingLabel* i_label_ref)
- {
- this->_labels.item[this->_length] = i_label_ref;
- this->_length++;
- }
-
- /**
- * ̻ΝÊĘħÉ éÉĸËÆФÈÁÄ¢é©ð֔·‚
- *
- * @param i_label
- * @return ɽê©ÌÉĸËÌԠѤÉ éÈçÎfalse,Ԇקµ½ÉĸËÅ éʂ՜Ыª͂¯êÎtrueÅ·„
- */
- bool check(const NyARLabelingLabel& i_label)
- {
- // ФÈèψם©Èˆ
- const NyARLabelingLabel** label_pt = this->_labels.item;
- const int px1 = (int) i_label.pos_x;
- const int py1 = (int) i_label.pos_y;
- for (int i = this->_length - 1; i >= 0; i--) {
- const int px2 = (int) label_pt[i]->pos_x;
- const int py2 = (int) label_pt[i]->pos_y;
- const int d = (px1 - px2) * (px1 - px2) + (py1 - py2) * (py1 - py2);
- if (d < label_pt[i]->area / 4) {
- // ҎЛˏ
- return false;
- }
- }
- // ҎЛ
- return true;
- }
- };
-
-
-
-#define VERTEX_FACTOR 1.0// Ѽ̟ЯÌĴĀĎĞ
-#define AR_AREA_MAX 100000// #define AR_AREA_MAX 100000
-#define AR_AREA_MIN 70// #define AR_AREA_MIN 70
-
-
- NyARSquareDetector::NyARSquareDetector(const NyARCameraDistortionFactor& i_dist_factor_ref,const TNyARIntSize& i_size)
- {
- this->_width = i_size.w;
- this->_height = i_size.h;
- //٣ÝͶϚĥ›ĵËðάéƁ8*width/height*2Ì،ɦðЁկµÜ·‚
- //،ɦðϦè½­È¢Ъ͇́i_dist_factor_refÌӬð»ÌÜÜϧÁÄ­¾³¢‚
- this->_dist_factor = new NyARObserv2IdealMap(i_dist_factor_ref,i_size);
- this->_limage = new NyARLabelingImage(this->_width, this->_height);
- this->_labeling = new NyARLabeling_ARToolKit();
- this->_labeling->attachDestination(this->_limage);
- this->_pca=new NyARPca2d_MatrixPCA_O2();
-
- // ؖ˳Ì΅ҥҷÍʦ׊Éʦè¤é΅ҥÌҷֻ͠Ĕăę‚
- int number_of_coord = (this->_width + this->_height) * 2;
- // ؖ˳įĢĴĀÍҸԟ֏ʷð·éÌŁؖ˳įĢĴĀÌÑջϦé‚
- this->_max_coord = number_of_coord;
- this->_xcoord = new int[number_of_coord * 2];
- this->_ycoord = new int[number_of_coord * 2];
- this->_xpos=new double[this->_width+this->_height];//΅ҥ֓ҷÍthis._width+this._height
- this->_ypos=new double[this->_width+this->_height];//΅ҥ֓ҷÍthis._width+this._height
- this->_overlap_checker=new OverlapChecker();
- return;
- }
- NyARSquareDetector::~NyARSquareDetector()
- {
- NyAR_SAFE_DELETE(this->_overlap_checker);
- NyAR_SAFE_DELETE(this->_labeling);
- NyAR_SAFE_DELETE(this->_limage);
- NyAR_SAFE_DELETE(this->_dist_factor);
- NyAR_SAFE_DELETE(this->_pca);
- NyAR_SAFE_DELETE(this->_xcoord);
- NyAR_SAFE_DELETE(this->_ycoord);
- NyAR_SAFE_DELETE(this->_xpos);
- NyAR_SAFE_DELETE(this->_ypos);
- return;
- }
- void NyARSquareDetector::normalizeCoord(int i_coord_x[], int i_coord_y[], int i_index, int i_coord_num)
- {
- // vertex1ð˫˅ɵāֻͣÉպرðف̋
- memcpy(i_coord_x+i_coord_num,i_coord_x+1,i_index*sizeof(int));
- memcpy(i_coord_y+i_coord_num,i_coord_y+1,i_index*sizeof(int));
- return;
- }
- void NyARSquareDetector::detectMarker(const NyARBinRaster& i_raster, NyARSquareStack& o_square_stack)
- {
- NyARLabelingImage& limage = *this->_limage;
-
- // ω˺ɻ
-
- // Ľ›Ċ›ĺËğðÊĚĢħ
- o_square_stack.clear();
-
- // ÉĸÊÓď
- this->_labeling->labeling(i_raster);
-
- // ÉĸËДª0Èç±±ÜÅ
- int label_num = limage.getLabelStack().getLength();
- if (label_num < 1) {
- return;
- }
-
- NyARLabelingLabelStack& stack = limage.getLabelStack();
- const NyArray<NyARLabelingLabel*>& labels = stack.getArray();
-
-
- // ÉĸËðҥ«¢χÉЮر
- stack.sortByArea();
-
- // ĦĊ¢ÉĸËðԇÝղε
- int i;
- for (i = 0; i < label_num; i++) {
- // ̟͸ҎЛԠÌÉĸËĔăęÉÈéÜÅֳ΋
- if (labels.item[i]->area <= AR_AREA_MAX) {
- break;
- }
- }
-
- const int xsize = this->_width;
- const int ysize = this->_height;
- int* xcoord = this->_xcoord;
- int* ycoord = this->_ycoord;
- const int coord_max = this->_max_coord;
- int mkvertex[5];
- OverlapChecker* overlap = this->_overlap_checker;
- int coord_num;
- int label_area;
- const NyARLabelingLabel* label_pt;
-
- //ФÈèĠĆĢĊÌ΅ҥДðѝӨ
- overlap->reset(label_num);
-
- for (; i < label_num; i++) {
- label_pt = labels.item[i];
- label_area = label_pt->area;
- // ̟͸ҎЛĔăęæèàϬ³­ÈÁ½çЉ׹
- if (label_area < AR_AREA_MIN) {
- break;
- }
- // ĎÊĢĶ،ɦªʦ׊Ì٧ÉњµÄ¢êÎϜˏ
- if (label_pt->clip_l == 1 || label_pt->clip_r == xsize - 2) {// if(wclip[i*4+0] == 1 || wclip[i*4+1] ==xsize-2){
- continue;
- }
- if (label_pt->clip_t == 1 || label_pt->clip_b == ysize - 2) {// if( wclip[i*4+2] == 1 || wclip[i*4+3] ==ysize-2){
- continue;
- }
- // ˹É̟Я³ê½̩͠ÆÌФÈèð˭Ն
- if (!overlap->check(*label_pt)) {
- // ФÈÁÄ¢é椾‚
- continue;
- }
-
- // ؖ˳ðϦӾ
- coord_num = limage.getContour(i, coord_max, xcoord, ycoord);
- if (coord_num == coord_max) {
- // ؖ˳ªҥ«·¬é‚
- continue;
- }
- //Ҹԟͳ֢ÌăÓĦĎĘðϦӾ
- const int vertex1 = scanVertex(xcoord, ycoord, coord_num);
-
- // Ҹԟͳ֢(vertex1)ðѦӪÉր×Ȩµ½պرðάЬ·é‚
- normalizeCoord(xcoord, ycoord, vertex1, coord_num);
-
- // ،ɦðπյ·é‚
- NyARSquare* square_ptr = o_square_stack.prePush();
-
- // ҸԟЮֱðϦӾ
- if (!getSquareVertex(xcoord, ycoord, vertex1, coord_num, label_area, mkvertex)) {
- o_square_stack.pop();// ҸԟÌϦӾªЯ׈È©Á½ÌÅժ˼
- continue;
- }
- // Ľ›Ċ›ð̟Я
- if (!getSquareLine(mkvertex, xcoord, ycoord,*square_ptr)) {
- // ̩͠ªЬקµÈ©Á½‚
- o_square_stack.pop();
- continue;
- }
- // ̟ЯΏÌ̩͠ÌѮµ½ÉĸËðФÈèĠĆĢĎÉӇʁ·é‚
- overlap->push(label_pt);
- }
- return;
- }
-
- int NyARSquareDetector::scanVertex(const int i_xcoord[], const int i_ycoord[], int i_coord_num)
- {
- const int sx = i_xcoord[0];
- const int sy = i_ycoord[0];
- int d = 0;
- int w, x, y;
- int ret = 0;
- for (int i = 1; i < i_coord_num; i++) {
- x = i_xcoord[i] - sx;
- y = i_ycoord[i] - sy;
- w = x * x + y * y;
- if (w > d) {
- d = w;
- ret = i;
- }
- // ±±Å¤Ü­Љ׹а̏ԼêçêÈ¢©È‚
- }
- return ret;
- }
- NyARVertexCounter __getSquareVertex_wv1;
- NyARVertexCounter __getSquareVertex_wv2;
-
- /**
- * static int arDetectMarker2_check_square( int area, ARMarkerInfo2 *marker_info2, double factor ) ˖ДÌңҖ˖Д OPTIMIZED STEP [450->415] o_squareÉҸԟЮֱðĚĢħµÜ·‚
- *
- * @param i_x_coord
- * @param i_y_coord
- * @param i_vertex1_index
- * @param i_coord_num
- * @param i_area
- * @param o_vertex
- * ضҦДÍint[4]Å éΖ
- * @return
- */
- bool NyARSquareDetector::getSquareVertex(const int i_x_coord[], const int i_y_coord[], int i_vertex1_index, int i_coord_num, int i_area, int o_vertex[])
- {
- NyARVertexCounter& wv1 = this->__getSquareVertex_wv1;
- NyARVertexCounter& wv2 = this->__getSquareVertex_wv2;
- const int end_of_coord = i_vertex1_index + i_coord_num - 1;
- const int sx = i_x_coord[i_vertex1_index];// sx = marker_info2->x_coord[0];
- const int sy = i_y_coord[i_vertex1_index];// sy = marker_info2->y_coord[0];
- int dmax = 0;
- int v1 = i_vertex1_index;
- for (int i = 1 + i_vertex1_index; i < end_of_coord; i++) {// for(i=1;i<marker_info2->coord_num-1;i++)
- // {
- const int d = (i_x_coord[i] - sx) * (i_x_coord[i] - sx) + (i_y_coord[i] - sy) * (i_y_coord[i] - sy);
- if (d > dmax) {
- dmax = d;
- v1 = i;
- }
- }
- const double thresh = (i_area / 0.75) * 0.01 * VERTEX_FACTOR;
-
- o_vertex[0] = i_vertex1_index;
-
- if (!wv1.getVertex(i_x_coord, i_y_coord, i_vertex1_index, v1, thresh)) { // if(get_vertex(marker_info2->x_coord,marker_info2->y_coord,0,v1,thresh,wv1,&wvnum1)<
- // 0 ) {
- return false;
- }
- if (!wv2.getVertex(i_x_coord, i_y_coord, v1, end_of_coord, thresh)) {// if(get_vertex(marker_info2->x_coord,marker_info2->y_coord,v1,marker_info2->coord_num-1,thresh,wv2,&wvnum2)
- // < 0) {
- return false;
- }
-
- int v2;
- if (wv1.number_of_vertex == 1 && wv2.number_of_vertex == 1) {// if(wvnum1 == 1 && wvnum2== 1) {
- o_vertex[1] = wv1.vertex[0];
- o_vertex[2] = v1;
- o_vertex[3] = wv2.vertex[0];
- } else if (wv1.number_of_vertex > 1 && wv2.number_of_vertex == 0) {// }else if( wvnum1 > 1 && wvnum2== 0) {
- //ҸԟɊӵð̎ԟ©çҎ˰ԟÌ˔Ì1/2É éÆ؜ҺµÄ̟ε·é‚
- v2 = (v1-i_vertex1_index)/2+i_vertex1_index;
- if (!wv1.getVertex(i_x_coord, i_y_coord, i_vertex1_index, v2, thresh)) {
- return false;
- }
- if (!wv2.getVertex(i_x_coord, i_y_coord, v2, v1, thresh)) {
- return false;
- }
- if (wv1.number_of_vertex == 1 && wv2.number_of_vertex == 1) {
- o_vertex[1] = wv1.vertex[0];
- o_vertex[2] = wv2.vertex[0];
- o_vertex[3] = v1;
- } else {
- return false;
- }
- } else if (wv1.number_of_vertex == 0 && wv2.number_of_vertex > 1) {
- //v2 = (v1-i_vertex1_index+ end_of_coord-i_vertex1_index) / 2+i_vertex1_index;
- v2 = (v1+ end_of_coord)/2;
-
- if (!wv1.getVertex(i_x_coord, i_y_coord, v1, v2, thresh)) {
- return false;
- }
- if (!wv2.getVertex(i_x_coord, i_y_coord, v2, end_of_coord, thresh)) {
- return false;
- }
- if (wv1.number_of_vertex == 1 && wv2.number_of_vertex == 1) {
- o_vertex[1] = v1;
- o_vertex[2] = wv1.vertex[0];
- o_vertex[3] = wv2.vertex[0];
- } else {
- return false;
- }
- } else {
- return false;
- }
- o_vertex[4] = end_of_coord;
- return true;
- }
-
- bool NyARSquareDetector::getSquareLine(const int i_mkvertex[], const int i_xcoord[],const int i_ycoord[], NyARSquare& o_square)
- {
- NyARDoubleMatrix22& evec=this->__getSquareLine_evec;
- TNyARDoublePoint2d mean;
- TNyARDoublePoint2d ev;
-
-
- for (int i = 0; i < 4; i++) {
- const double w1 = (double) (i_mkvertex[i + 1] - i_mkvertex[i] + 1) * 0.05 + 0.5;
- const int st = (int) (i_mkvertex[i] + w1);
- const int ed = (int) (i_mkvertex[i + 1] - w1);
- const int n = ed - st + 1;
- if (n < 2) {
- // nª2ɈɺÅmatrix.PCAðͶϚ·é±ÆÍÅ«È¢ÌŁćɛ
- return false;
- }
- //պرάЬ
- this->_dist_factor->observ2IdealBatch(i_xcoord, i_ycoord, st, n,this->_xpos,this->_ypos);
-
- //ϥЬժժэ·é‚
- this->_pca->pca(this->_xpos,this->_ypos,n,evec, ev,mean);
- TNyARLinear& l_line_i = o_square.line[i];
- l_line_i.run = evec.m01;// line[i][0] = evec->m[1];
- l_line_i.rise = -evec.m00;// line[i][1] = -evec->m[0];
- l_line_i.intercept = -(l_line_i.run * mean.x + l_line_i.rise * mean.y);// line[i][2] = -(line[i][0]*mean->v[0] + line[i][1]*mean->v[1]);
- }
-
- TNyARDoublePoint2d* l_sqvertex = o_square.sqvertex;
- TNyARIntPoint2d* l_imvertex = o_square.imvertex;
- for (int i = 0; i < 4; i++) {
- const TNyARLinear& l_line_i = o_square.line[i];
- const TNyARLinear& l_line_2 = o_square.line[(i + 3) % 4];
- const double w1 = l_line_2.run * l_line_i.rise - l_line_i.run * l_line_2.rise;
- if (w1 == 0.0) {
- return false;
- }
- l_sqvertex[i].x = (l_line_2.rise * l_line_i.intercept - l_line_i.rise * l_line_2.intercept) / w1;
- l_sqvertex[i].y = (l_line_i.run * l_line_2.intercept - l_line_2.run * l_line_i.intercept) / w1;
- // ҸԟăÓĦĎĘ©çҸԟ΀֗ðӾÄ֛Ѷ
- l_imvertex[i].x = i_xcoord[i_mkvertex[i]];
- l_imvertex[i].y = i_ycoord[i_mkvertex[i]];
- }
- return true;
- }
-
-
-
-
-}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARLabeling.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARLabeling.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARLabeling.cpp (revision 335)
@@ -1,28 +0,0 @@
-/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
-#include "INyARLabeling.h"
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARLabelingImage.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARLabelingImage.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARLabelingImage.cpp (revision 335)
@@ -1,29 +0,0 @@
-/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
-#include "INyARLabelingImage.h"
-
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARFitVecCalculator.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARFitVecCalculator.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARFitVecCalculator.cpp (revision 335)
@@ -1,152 +0,0 @@
-/*
-* PROJECT: NyARToolkitCPP
-* --------------------------------------------------------------------------------
-*
-* The NyARToolkitCS is C++ version NyARToolkit class library.
-*
-* Copyright (C)2008 R.Iizuka
-*
-* 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 framework; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*
-* For further information please contact.
-* http://nyatla.jp/nyatoolkit/
-* <airmail(at)ebony.plala.or.jp>
-*
-*/
-#include "NyARFitVecCalculator.h"
-#include "nyarcore.h"
-#include <cstdlib>
-
-namespace NyARToolkitCPP
-{
- NyARFitVecCalculator::NyARFitVecCalculator(const NyARPerspectiveProjectionMatrix* i_projection_mat_ref,const NyARCameraDistortionFactor* i_distortion_ref)
- {
- this->_mat_a=new NyARMat(8,3);
- this->_mat_b=new NyARMat(3,8);
- this->_mat_d=new NyARMat(3,3);
-
- this->_mat_e = new NyARMat(3, 1);
- this->_mat_f = new NyARMat(3, 1);
- this->__calculateTransferVec_mat_c = new NyARMat(8, 1);//NUMBER_OF_VERTEX * 2, 1
-
- // ֏ʷĽħÊĎĘdÆbÌπյ(arGetTransMatSubÌɪՔ)
- double* a_array = this->_mat_a->getArray();
- double* b_array = this->_mat_b->getArray();
-
- //֏ʷذγرÌcparaͅӨӬÌՔժðѦÉω˺ɻµÄµÜ¤‚
- for (int i = 0; i < 4; i++){
- const int x2 = i * 2;
- a_array[x2*3+0] = b_array[0*8+x2] = i_projection_mat_ref->m00;// mat_a->m[j*6+0]=mat_b->m[num*0+j*2] =cpara[0][0];
- a_array[x2*3+1] = b_array[1*8+x2] = i_projection_mat_ref->m01;// mat_a->m[j*6+1]=mat_b->m[num*2+j*2]=cpara[0][1];
- a_array[(x2 + 1)*3+0] = b_array[0*8+x2 + 1] = 0.0;// mat_a->m[j*6+3] =mat_b->m[num*0+j*2+1]= 0.0;
- a_array[(x2 + 1)*3+1] = b_array[1*8+x2 + 1] = i_projection_mat_ref->m11;// mat_a->m[j*6+4] =mat_b->m[num*2+j*2+1]= cpara[1][1];
- //a_array[x2 + 1][2] = b_array[2][x2 + 1] = cpara[1 * 4 + 2] - o_marker_vertex_2d[i].y;// mat_a->m[j*6+5]=mat_b->m[num*4+j*2+1]=cpara[1][2]-pos2d[j][1];
- }
- this->_projection_mat=i_projection_mat_ref;
- this->_distortionfactor=i_distortion_ref;
- this->_offset_square=NULL;
- return;
- }
- NyARFitVecCalculator::~NyARFitVecCalculator()
- {
- NyAR_SAFE_DELETE(this->_mat_a);
- NyAR_SAFE_DELETE(this->_mat_b);
- NyAR_SAFE_DELETE(this->_mat_d);
- NyAR_SAFE_DELETE(this->_mat_e);
- NyAR_SAFE_DELETE(this->_mat_f);
- NyAR_SAFE_DELETE(this->__calculateTransferVec_mat_c);//NUMBER_OF_VERTEX * 2, 1
- return;
- }
- void NyARFitVecCalculator::setOffsetSquare(const NyARTransOffset* i_offset)
- {
- this->_offset_square=i_offset;
- return;
- }
- const TNyARDoublePoint2d* NyARFitVecCalculator::getFitSquare()const
- {
- return this->_fitsquare_vertex;
- }
- const NyARTransOffset* NyARFitVecCalculator::getOffsetVertex()const
- {
- return this->_offset_square;
- }
-
- void NyARFitVecCalculator::setFittedSquare(const TNyARDoublePoint2d* i_square_vertex[])
- {
- TNyARDoublePoint2d* vertex=this->_fitsquare_vertex;
- this->_distortionfactor->ideal2ObservBatch(i_square_vertex, vertex,4);
- // } else {
- // for (i = 0; i < NUMBER_OF_VERTEX; i++) {
- // o_marker_vertex_2d[i].x = i_square_vertex[i].x;
- // o_marker_vertex_2d[i].y = i_square_vertex[i].y;
- // }
- // }
-
-
- const double cpara02=this->_projection_mat->m02;
- const double cpara12=this->_projection_mat->m12;
- NyARMat& mat_d=*this->_mat_d;
- NyARMat& mat_a=*this->_mat_a;
- NyARMat& mat_b=*this->_mat_b;
- double* a_array = mat_a.getArray();
- double* b_array = mat_b.getArray();
- for (int i = 0; i < 4; i++) {
- const int x2 = i * 2;
- a_array[x2*3+2] = b_array[2*8+x2] = cpara02 - vertex[i].x;// mat_a->m[j*6+2]=mat_b->m[num*4+j*2]=cpara[0][2]-pos2d[j][0];
- a_array[(x2 + 1)*3+2] = b_array[2*8+x2 + 1] = cpara12 - vertex[i].y;// mat_a->m[j*6+5]=mat_b->m[num*4+j*2+1]=cpara[1][2]-pos2d[j][1];
- }
- // mat_d
- mat_d.matrixMul(mat_b, mat_a);
- mat_d.matrixSelfInv();
- return;
- }
-
- void NyARFitVecCalculator::calculateTransfer(const NyARRotMatrix& i_rotation,TNyARDoublePoint3d& o_transfer)const
- {
- NyAR_ASSERT(this->_offset_square!=NULL);
- TNyARDoublePoint3d point3d[4];
- const double cpara00=this->_projection_mat->m00;
- const double cpara01=this->_projection_mat->m01;
- const double cpara02=this->_projection_mat->m02;
- const double cpara11=this->_projection_mat->m11;
- const double cpara12=this->_projection_mat->m12;
- const TNyARDoublePoint3d* vertex3d=this->_offset_square->vertex;
- const TNyARDoublePoint2d* vertex2d=this->_fitsquare_vertex;
- NyARMat& mat_c = *this->__calculateTransferVec_mat_c;// ΟψםÅӬðàç¤ÌŁω˺ɻÌ֋ضÍֳ¢‚
-
- double* f_array = this->_mat_f->getArray();
- double* c_array = mat_c.getArray();
-
-
- //©3D΀֗ˆªðɪʇпˁ
- i_rotation.getPoint3dBatch(vertex3d,point3d,4);
- for (int i = 0; i < 4; i++) {
- const int x2 = i+i;
- const TNyARDoublePoint3d& point3d_ptr=point3d[i];
- // i_rotation.getPoint3d(vertex3d[i],point3d);
- //ӧ΋֏ʷˆ
- c_array[x2*1+0] = point3d_ptr.z * vertex2d[i].x - cpara00 * point3d_ptr.x - cpara01 * point3d_ptr.y - cpara02 * point3d_ptr.z;// mat_c->m[j*2+0] = wz*pos2d[j][0]-cpara[0][0]*wx-cpara[0][1]*wy-cpara[0][2]*wz;
- c_array[(x2 + 1)*1+0] = point3d_ptr.z * vertex2d[i].y - cpara11 * point3d_ptr.y - cpara12 * point3d_ptr.z;// mat_c->m[j*2+1]= wz*pos2d[j][1]-cpara[1][1]*wy-cpara[1][2]*wz;
- }
- this->_mat_e->matrixMul(*this->_mat_b, mat_c);
- this->_mat_f->matrixMul(*this->_mat_d, *this->_mat_e);
-
- // double[] trans=wk_arGetTransMatSub_trans;//double trans[3];
- o_transfer.x= f_array[0*1+0];// trans[0] = mat_f->m[0];
- o_transfer.y= f_array[1*1+0];
- o_transfer.z= f_array[2*1+0];// trans[2] = mat_f->m[2];
- return;
- }
-}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRotMatrix_NyARToolKit.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRotMatrix_NyARToolKit.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRotMatrix_NyARToolKit.cpp (revision 335)
@@ -1,71 +0,0 @@
-/*
-* PROJECT: NyARToolkitCPP
-* --------------------------------------------------------------------------------
-*
-* The NyARToolkitCS is C++ version NyARToolkit class library.
-*
-* Copyright (C)2008 R.Iizuka
-*
-* 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 framework; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*
-* For further information please contact.
-* http://nyatla.jp/nyatoolkit/
-* <airmail(at)ebony.plala.or.jp>
-*
-*/
-
-#include "NyARRotMatrix_NyARToolKit.h"
-#include <math.h>
-namespace NyARToolkitCPP
-{
- NyARRotMatrix_NyARToolKit::NyARRotMatrix_NyARToolKit(const NyARPerspectiveProjectionMatrix* i_matrix):NyARRotMatrix_ARToolKit(i_matrix)
- {
- return;
- }
- /* ˖ДͷµҖ¦
- */
- void NyARRotMatrix_NyARToolKit::setAngle(double i_x,double i_y,double i_z)
- {
- const double sina = sin(i_x);
- const double cosa = cos(i_x);
- const double sinb = sin(i_y);
- const double cosb = cos(i_y);
- const double sinc = sin(i_z);
- const double cosc = cos(i_z);
- // Optimize
- const double CACA = cosa * cosa;
- const double SASA = sina * sina;
- const double SACA = sina * cosa;
- const double SASB = sina * sinb;
- const double CASB = cosa * sinb;
- const double SACACB = SACA * cosb;
-
- this->m00 = CACA * cosb * cosc + SASA * cosc + SACACB * sinc - SACA * sinc;
- this->m01 = -CACA * cosb * sinc - SASA * sinc + SACACB * cosc - SACA * cosc;
- this->m02 = CASB;
- this->m10 = SACACB * cosc - SACA * cosc + SASA * cosb * sinc + CACA * sinc;
- this->m11 = -SACACB * sinc + SACA * sinc + SASA * cosb * cosc + CACA * cosc;
- this->m12 = SASB;
- this->m20 = -CASB * cosc - SASB * sinc;
- this->m21 = CASB * sinc - SASB * cosc;
- this->m22 = cosb;
- //angleð̴ͶϚ¹¸ÉҼњңԼ
- this->_angle.x=i_x;
- this->_angle.y=i_y;
- this->_angle.z=i_z;
- return;
- }
-
-}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARRotTransOptimize.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARRotTransOptimize.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARRotTransOptimize.cpp (revision 335)
@@ -1,29 +1,27 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "INyARRotTransOptimize.h"

Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARDoubleMatrix44.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARDoubleMatrix44.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARDoubleMatrix44.cpp (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARDoubleMatrix44.h"

namespace NyARToolkitCPP
@@ -80,5 +78,90 @@
o_value[15]=this->m33;
return;
}
+ bool NyARDoubleMatrix44::inverse(const NyARDoubleMatrix44& i_src)
+ {
+ double a11,a12,a13,a14,a21,a22,a23,a24,a31,a32,a33,a34,a41,a42,a43,a44;
+ double b11,b12,b13,b14,b21,b22,b23,b24,b31,b32,b33,b34,b41,b42,b43,b44;
+ double t1,t2,t3,t4,t5,t6;
+ a11=i_src.m00;a12=i_src.m01;a13=i_src.m02;a14=i_src.m03;
+ a21=i_src.m10;a22=i_src.m11;a23=i_src.m12;a24=i_src.m13;
+ a31=i_src.m20;a32=i_src.m21;a33=i_src.m22;a34=i_src.m23;
+ a41=i_src.m30;a42=i_src.m31;a43=i_src.m32;a44=i_src.m33;
+
+ t1=a33*a44-a34*a43;
+ t2=a34*a42-a32*a44;
+ t3=a32*a43-a33*a42;
+ t4=a34*a41-a31*a44;
+ t5=a31*a43-a33*a41;
+ t6=a31*a42-a32*a41;
+
+ b11=a22*t1+a23*t2+a24*t3;
+ b21=-(a23*t4+a24*t5+a21*t1);
+ b31=a24*t6-a21*t2+a22*t4;
+ b41=-(a21*t3-a22*t5+a23*t6);
+
+ t1=a43*a14-a44*a13;
+ t2=a44*a12-a42*a14;
+ t3=a42*a13-a43*a12;
+ t4=a44*a11-a41*a14;
+ t5=a41*a13-a43*a11;
+ t6=a41*a12-a42*a11;

+ b12=-(a32*t1+a33*t2+a34*t3);
+ b22=a33*t4+a34*t5+a31*t1;
+ b32=-(a34*t6-a31*t2+a32*t4);
+ b42=a31*t3-a32*t5+a33*t6;
+
+ t1=a13*a24-a14*a23;
+ t2=a14*a22-a12*a24;
+ t3=a12*a23-a13*a22;
+ t4=a14*a21-a11*a24;
+ t5=a11*a23-a13*a21;
+ t6=a11*a22-a12*a21;
+
+ b13=a42*t1+a43*t2+a44*t3;
+ b23=-(a43*t4+a44*t5+a41*t1);
+ b33=a44*t6-a41*t2+a42*t4;
+ b43=-(a41*t3-a42*t5+a43*t6);
+
+ t1=a23*a34-a24*a33;
+ t2=a24*a32-a22*a34;
+ t3=a22*a33-a23*a32;
+ t4=a24*a31-a21*a34;
+ t5=a21*a33-a23*a31;
+ t6=a21*a32-a22*a31;
+
+ b14=-(a12*t1+a13*t2+a14*t3);
+ b24=a13*t4+a14*t5+a11*t1;
+ b34=-(a14*t6-a11*t2+a12*t4);
+ b44=a11*t3-a12*t5+a13*t6;
+
+ double det_1=(a11*b11+a21*b12+a31*b13+a41*b14);
+ if(det_1==0){
+ return false;
+ }
+ det_1=1/det_1;
+
+ this->m00=b11*det_1;
+ this->m01=b12*det_1;
+ this->m02=b13*det_1;
+ this->m03=b14*det_1;
+
+ this->m10=b21*det_1;
+ this->m11=b22*det_1;
+ this->m12=b23*det_1;
+ this->m13=b24*det_1;
+
+ this->m20=b31*det_1;
+ this->m21=b32*det_1;
+ this->m22=b33*det_1;
+ this->m23=b34*det_1;
+
+ this->m30=b41*det_1;
+ this->m31=b42*det_1;
+ this->m32=b43*det_1;
+ this->m33=b44*det_1;
+
+ return true;
+ }
}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARPerspectiveProjectionMatrix.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARPerspectiveProjectionMatrix.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARPerspectiveProjectionMatrix.cpp (revision 335)
@@ -2,27 +2,25 @@
* PROJECT: NyARToolkitCPP
* --------------------------------------------------------------------------------
*
-* The NyARToolkitCS is C++ version NyARToolkit class library.
-*
-* Copyright (C)2008 R.Iizuka
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
*
-* 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 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 3 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 framework; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For further information please contact.
* http://nyatla.jp/nyatoolkit/
-* <airmail(at)ebony.plala.or.jp>
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
*
*/
#include "NyARPerspectiveProjectionMatrix.h"
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRasterFilter_ARToolkitThreshold.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRasterFilter_ARToolkitThreshold.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRasterFilter_ARToolkitThreshold.cpp (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARRasterFilter_ARToolkitThreshold.h"
#include "INyARRgbRaster.h"
#include "NyARBinRaster.h"
@@ -263,8 +261,65 @@
}
};

+ class doThFilterImpl_BUFFERFORMAT_WORD1D_R5G6B5_16LE :public IdoThFilterImpl
+ {
+ void doThFilter(const INyARBufferReader& i_input,const INyARBufferReader& i_output,const TNyARIntSize& i_size,int i_threshold)const
+ {
+ int* out_buf = (int*) i_output.getBuffer();
+ unsigned short* in_buf = (unsigned short*) i_input.getBuffer();
+
+ const int th=i_threshold*3;
+ unsigned short w;
+ int xy;
+ const int pix_count =i_size.h*i_size.w;
+ const int pix_mod_part=pix_count-(pix_count%8);

+ for(xy=pix_count-1;xy>=pix_mod_part;xy--){
+ w =in_buf[xy];
+ w = ((w & 0xf800) >> 8) + ((w & 0x07e0) >> 3) + ((w & 0x001f) << 3);
+ out_buf[xy] = w <= th ? 0 : 1;
+ }
+ //ĞăÊÓď
+ for (;xy>=0;) {
+ w =in_buf[xy];
+ w = ((w & 0xf800) >> 8) + ((w & 0x07e0) >> 3) + ((w & 0x001f) << 3);
+ out_buf[xy] = w <= th ? 0 : 1;
+ xy--;
+ w =in_buf[xy];
+ w = ((w & 0xf800) >> 8) + ((w & 0x07e0) >> 3) + ((w & 0x001f) << 3);
+ out_buf[xy] = w <= th ? 0 : 1;
+ xy--;
+ w =in_buf[xy];
+ w = ((w & 0xf800) >> 8) + ((w & 0x07e0) >> 3) + ((w & 0x001f) << 3);
+ out_buf[xy] = w <= th ? 0 : 1;
+ xy--;
+ w =in_buf[xy];
+ w = ((w & 0xf800) >> 8) + ((w & 0x07e0) >> 3) + ((w & 0x001f) << 3);
+ out_buf[xy] = w <= th ? 0 : 1;
+ xy--;
+ w =in_buf[xy];
+ w = ((w & 0xf800) >> 8) + ((w & 0x07e0) >> 3) + ((w & 0x001f) << 3);
+ out_buf[xy] = w <= th ? 0 : 1;
+ xy--;
+ w =in_buf[xy];
+ w = ((w & 0xf800) >> 8) + ((w & 0x07e0) >> 3) + ((w & 0x001f) << 3);
+ out_buf[xy] = w <= th ? 0 : 1;
+ xy--;
+ w =in_buf[xy];
+ w = ((w & 0xf800) >> 8) + ((w & 0x07e0) >> 3) + ((w & 0x001f) << 3);
+ out_buf[xy] = w <= th ? 0 : 1;
+ xy--;
+ w =in_buf[xy];
+ w = ((w & 0xf800) >> 8) + ((w & 0x07e0) >> 3) + ((w & 0x001f) << 3);
+ out_buf[xy] = w <= th ? 0 : 1;
+ xy--;
+ }
+ }
+ };

+
+
+
NyARRasterFilter_ARToolkitThreshold:: NyARRasterFilter_ARToolkitThreshold(int i_threshold,int i_input_raster_type)
{
this->_threshold = i_threshold;
@@ -282,6 +337,9 @@
case INyARBufferReader::BUFFERFORMAT_INT1D_X8R8G8B8_32:
this->_do_threshold_impl=new doThFilterImpl_BUFFERFORMAT_INT1D_X8R8G8B8_32();
break;
+ case INyARBufferReader::BUFFERFORMAT_WORD1D_R5G6B5_16LE:
+ this->_do_threshold_impl=new doThFilterImpl_BUFFERFORMAT_WORD1D_R5G6B5_16LE();
+ break;
default:
throw NyARException();
}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARSingleDetectMarker.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARSingleDetectMarker.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARSingleDetectMarker.cpp (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARSingleDetectMarker.h"
#include "NyARParam.h"
#include "NyARMatchPatt_Color_WITHOUT_PCA.h"
@@ -34,24 +32,55 @@
#include "NyARRasterFilter_ARToolkitThreshold.h"
#include "NyARTransMatResult.h"
#include "NyARColorPatt_O3.h"
-#include "NyARSquareDetector.h"
+#include "NyARSquareDetector_ARToolKit.h"
+#include "NyARSquareDetector_Rle.h"
+#include "NyARColorPatt_Perspective_O2.h"
#include "NyARSquareStack.h"
#include "NyAR_types.h"
#define AR_SQUARE_MAX 100
namespace NyARToolkitCPP
{
- NyARSingleDetectMarker::NyARSingleDetectMarker(const NyARParam* i_param,const NyARCode* i_code, double i_marker_width,int i_input_raster_type)
+ NyARSingleDetectMarker::NyARSingleDetectMarker(const NyARParam* i_param,const NyARCode* i_code, double i_marker_width,int i_input_raster_type,int i_profile_id)
{
- this->_threshold=new NyARRasterFilter_ARToolkitThreshold(100,i_input_raster_type);
- this->initInstance(i_param,i_code,i_marker_width,this->_threshold);
+ initInstance(i_param,i_code,i_marker_width,i_input_raster_type,i_profile_id);
return;
}
+
NyARSingleDetectMarker::~NyARSingleDetectMarker()
{
NyAR_SAFE_DELETE(this->_threshold);
return;
}
+ void NyARSingleDetectMarker::initInstance(
+ const NyARParam* i_ref_param,
+ const NyARCode* i_ref_code,
+ double i_marker_width,
+ int i_input_raster_type,
+ int i_profile_id)
+ {
+ //±Ì3ăÓĘĞÓĘ́CustomѤÅˊֺ·é‚
+ INyARColorPatt* patt_inst;
+ INyARSquareDetector* sqdetect_inst;
+ INyARTransMat* transmat_inst;

+ this->_threshold=new NyARRasterFilter_ARToolkitThreshold(100,i_input_raster_type);
+ switch(i_profile_id){
+ case PF_NYARTOOLKIT_ARTOOLKIT_FITTING:
+ case PF_ARTOOLKIT_COMPATIBLE:
+ //not supprted!
+ throw NyARException();
+ break;
+ case PF_NYARTOOLKIT:
+ patt_inst=new NyARColorPatt_Perspective_O2(i_ref_code->getWidth(), i_ref_code->getHeight(),4,25);
+ sqdetect_inst=new NyARSquareDetector_Rle(i_ref_param->getDistortionFactor(),i_ref_param->getScreenSize());
+ transmat_inst=new NyARTransMat(i_ref_param);
+ break;
+ default:
+ throw NyARException();
+ }
+ NyARCustomSingleDetectMarker::initInstance(patt_inst,sqdetect_inst,transmat_inst,this->_threshold,i_ref_param,i_ref_code,i_marker_width);
+ return;
+ }

bool NyARSingleDetectMarker::detectMarkerLite(const INyARRgbRaster &i_raster,int i_threshold)
{
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyAREquationSolver.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyAREquationSolver.cpp (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyAREquationSolver.cpp (revision 335)
@@ -0,0 +1,316 @@
+/*
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
+#include "NyAREquationSolver.h"
+
+
+
+#include "NyARBaseClass.h"
+#include "NyAR_types.h"
+#include "nyarcore.h"
+#include <cmath>
+#include <stdio.h>
+using namespace std;
+namespace NyARToolkitCPP
+{
+
+
+ //o_resultÍضҦД2ɈУÅ é±Æ‚
+ int NyAREquationSolver::solve2Equation(double i_a, double i_b, double i_c,double* o_result)
+ {
+ NyAR_ASSERT(i_a!=0);
+ return solve2Equation(i_b/i_a,i_c/i_a,o_result,0);
+ }
+
+ //o_resultÍضҦД2ɈУÅ é±Æ‚
+ int NyAREquationSolver::solve2Equation(double i_b, double i_c,double* o_result)
+ {
+ return solve2Equation(i_b,i_c,o_result,0);
+ }
+
+ //
+ int NyAREquationSolver::solve2Equation(double i_b, double i_c,double* o_result,int i_result_st)
+ {
+ double t=i_b*i_b-4*i_c;
+ if(t<0){
+ //˕Дͪ
+ return 0;
+ }
+ if(t==0){
+ //Фͪ
+ o_result[i_result_st+0]=-i_b/(2);
+ return 1;
+ }
+ //πͪÑ͂
+ t=sqrt(t);
+ o_result[i_result_st+0]=(-i_b+t)/(2);
+ o_result[i_result_st+1]=(-i_b-t)/(2);
+ return 2;
+ }
+
+ /**
+ * ÒΟֻӶή a*x^3+b*x^2+c*x+d=0Ìπͪðˁßé‚
+ * http://aoki2.si.gunma-u.ac.jp/JavaScript/src/3jisiki.html
+ * ÌĒ›ĨðˮɵÄÜ·‚
+ * @param i_a
+ * X^3Ì͗Д
+ * @param i_b
+ * X^2Ì͗Д
+ * @param i_c
+ * X^1Ì͗Д
+ * @param i_d
+ * X^0Ì͗Д
+ * @param o_result
+ * πͪ‚double[3]ðϷӨ·é±Æ‚
+ * @return
+ */
+ int NyAREquationSolver::solve3Equation(double i_a, double i_b, double i_c, double i_d,double* o_result)
+ {
+ NyAR_ASSERT(i_a != 0);
+ return solve3Equation(i_b/i_a,i_c/i_a,i_d/i_a,o_result);
+ }
+
+ /**
+ * ÒΟֻӶή x^3+b*x^2+c*x+d=0Ìπͪðˁßé‚
+ * ¾¯ðˁßé‚
+ * http://aoki2.si.gunma-u.ac.jp/JavaScript/src/3jisiki.html
+ * ÌĒ›ĨðˮɵÄÜ·‚
+ * @param i_b
+ * X^2Ì͗Д
+ * @param i_c
+ * X^1Ì͗Д
+ * @param i_d
+ * X^0Ì͗Д
+ * @param o_result
+ * πͪ‚double[1]ɈУðϷӨ·é±Æ‚
+ * @return
+ */
+ int NyAREquationSolver::solve3Equation(double i_b, double i_c, double i_d,double* o_result)
+ {
+ double tmp,b, p, q;
+ b = i_b/(3);
+ p = b * b - i_c / 3;
+ q = (b * (i_c - 2 * b * b) - i_d) / 2;
+ if ((tmp = q * q - p * p * p) == 0) {
+ // Фͪ
+ q = cuberoot(q);
+ o_result[0] = 2 * q - b;
+ o_result[1] = -q - b;
+ return 2;
+ } else if (tmp > 0) {
+ // πͪ1,˕ͪ2
+ double a3 = cuberoot(q + ((q > 0) ? 1 : -1) * sqrt(tmp));
+ double b3 = p / a3;
+ o_result[0] = a3 + b3 - b;
+ // ˕ͪ:-0.5*(a3+b3)-b,Math.abs(a3-b3)*Math.sqrt(3.0)/2
+ return 1;
+ } else {
+ // πͪ3
+ tmp = 2 * sqrt(p);
+ double t = acos(q / (p * tmp / 2));
+ o_result[0] = tmp * cos(t / 3) - b;
+ o_result[1] = tmp * cos((t + 2 * NyAR_PI) / 3) - b;
+ o_result[2] = tmp * cos((t + 4 * NyAR_PI) / 3) - b;
+ return 3;
+ }
+ }
+
+
+
+ /**
+ * ÓΟֻӶήÌπͪ¾¯ðˁßé‚
+ * @param i_a
+ * X^3Ì͗Д
+ * @param i_b
+ * X^2Ì͗Д
+ * @param i_c
+ * X^1Ì͗Д
+ * @param i_d
+ * X^0Ì͗Д
+ * @param o_result
+ * πͪ‚double[3]ðϷӨ·é±Æ‚
+ * @return
+ */
+ int NyAREquationSolver::solve4Equation(double i_a, double i_b, double i_c, double i_d,double i_e,double* o_result)
+ {
+ NyAR_ASSERT(i_a != 0);
+ double A3,A2,A1,A0,B3;
+ A3=i_b/i_a;
+ A2=i_c/i_a;
+ A1=i_d/i_a;
+ A0=i_e/i_a;
+ B3=A3/4;
+ double p,q,r;
+ double B3_2=B3*B3;
+ p=A2-6*B3_2;//A2-6*B3*B3;
+ q=A1+B3*(-2*A2+8*B3_2);//A1-2*A2*B3+8*B3*B3*B3;
+ r=A0+B3*(-A1+A2*B3)-3*B3_2*B3_2;//A0-A1*B3+A2*B3*B3-3*B3*B3*B3*B3;
+ int number_of_result=0;
+ if(q==0){
+ double result_0,result_1;
+ //աԱΟή
+ int res=solve2Equation(p,r,o_result,0);
+ switch(res){
+ case 0:
+ //ғÄ˕Дʰ
+ return 0;
+ case 1:
+ //Фͪ
+ //ʰÍ0,1,2Ìɽꩂ
+ result_0=o_result[0];
+ if(result_0<0){
+ //ғÄ˕Дʰ
+ return 0;
+ }
+ //πͪ1͂
+ if(result_0==0){
+ //NC
+ o_result[0]=0-B3;
+ return 1;
+ }
+ //πͪ2͂
+ result_0=sqrt(result_0);
+ o_result[0]=result_0-B3;
+ o_result[1]=-result_0-B3;
+ return 2;
+ case 2:
+ //πͪÑ͂¾©çt==t2==0Í è¦È¢‚(case1)
+ //ʰ́0,2,4Ìɽꩂ
+ result_0=o_result[0];
+ result_1=o_result[1];
+ if(result_0>0){
+ //NC
+ result_0=sqrt(result_0);
+ o_result[0]= result_0-B3;
+ o_result[1]=-result_0-B3;
+ number_of_result+=2;
+ }
+ if(result_1>0)
+ {
+ //NC
+ result_1=sqrt(result_1);
+ o_result[number_of_result+0]= result_1-B3;
+ o_result[number_of_result+1]=-result_1-B3;
+ number_of_result+=2;
+ }
+ return number_of_result;
+ default:
+ throw NyARException();
+ }
+ }else{
+ //»êɈˏ
+ //΅ԋɻļăÓħ:
+ //u^3 + (2*p)*u^2 +((- 4*r)+(p^2))*u -q^2= 0
+ double u=solve3Equation_1((2*p),(- 4*r)+(p*p),-q*q);
+ if(u<0){
+ //ғÄ˕Дʰ
+ return 0;
+ }
+ double ru=sqrt(u);
+ //2ΟֻӶήðʰ¢ÄyðͶϚ(΅ԋɻļăÓħ)
+ int result_1st,result_2nd;
+ result_1st=solve2Equation(-ru,(p+u)/2+ru*q/(2*u),o_result,0);
+ //պرϧ¢ʱµÌ½ßɁ֏ДÉҞհ
+ switch(result_1st){
+ case 0:
+ break;
+ case 1:
+ o_result[0]=o_result[0]-B3;
+ break;
+ case 2:
+ o_result[0]=o_result[0]-B3;
+ o_result[1]=o_result[1]-B3;
+ break;
+ default:
+ throw NyARException();
+ }
+ result_2nd=solve2Equation(ru,(p+u)/2-ru*q/(2*u),o_result,result_1st);
+ //0,1ՔךÉ˩՛
+ switch(result_2nd){
+ case 0:
+ break;
+ case 1:
+ o_result[result_1st+0]=o_result[result_1st+0]-B3;
+ break;
+ case 2:
+ o_result[result_1st+0]=o_result[result_1st+0]-B3;
+ o_result[result_1st+1]=o_result[result_1st+1]-B3;
+ break;
+ default:
+ throw NyARException();
+ }
+ return result_1st+result_2nd;
+ }
+ }
+ /**
+ * 3ЦͪðˁßçêÈ¢ĖĘĥÀŁÒЦͪðˁßÜ·‚
+ * http://aoki2.si.gunma-u.ac.jp/JavaScript/src/3jisiki.html
+ * @param i_in
+ * @return
+ */
+ double NyAREquationSolver::cuberoot(double i_in)
+ {
+ double res = pow(abs(i_in), 1.0 / 3.0);
+ return (i_in >= 0) ? res : -res;
+ }
+ /**
+ * 3ΟֻӶήÌπͪðÐ͂¾¯ˁßé‚
+ * 4ΚֻӶήÅϧ¤‚
+ * @param i_b
+ * @param i_c
+ * @param i_d
+ * @param o_result
+ * @return
+ */
+ double NyAREquationSolver::solve3Equation_1(double i_b, double i_c, double i_d)
+ {
+ double tmp,b, p, q;
+ b = i_b/(3);
+ p = b * b - i_c / 3;
+ q = (b * (i_c - 2 * b * b) - i_d) / 2;
+ if ((tmp = q * q - p * p * p) == 0) {
+ // Фͪ
+ q = cuberoot(q);
+ return 2 * q - b;
+ } else if (tmp > 0) {
+ // πͪ1,˕ͪ2
+ double a3 = cuberoot(q + ((q > 0) ? 1 : -1) * sqrt(tmp));
+ double b3 = p / a3;
+ return a3 + b3 - b;
+ } else {
+ // πͪ3
+ tmp = 2 * sqrt(p);
+ double t = acos(q / (p * tmp / 2));
+ return tmp * cos(t / 3) - b;
+ }
+ }
+
+
+}
+
+
+
+
+
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARColorPatt_Perspective_O2.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARColorPatt_Perspective_O2.cpp (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARColorPatt_Perspective_O2.cpp (revision 335)
@@ -0,0 +1,738 @@
+/*
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
+
+#include "NyARColorPatt_Perspective_O2.h"
+
+#include "nyarcore.h"
+
+namespace NyARToolkitCPP
+{
+
+ class IpickFromRaster_Impl:public NyARBaseClass
+ {
+ public:
+ virtual void pickFromRaster(const double* i_cpara,const INyARRgbRaster& image,int* o_patt)=0;
+ };
+
+ /**
+ * ՄذijĢĎāĢĶ˖Д
+ *
+ */
+ class pickFromRaster_N :public IpickFromRaster_Impl
+ {
+ protected:
+ int _resolution;
+ const TNyARIntSize* _size_ref;
+ const TNyARIntPoint2d* _lt_ref;
+ public:
+ pickFromRaster_N(const TNyARIntPoint2d* i_lt,int i_resolution,const TNyARIntSize* i_source_size)
+ {
+ this->_lt_ref=i_lt;
+ this->_resolution=i_resolution;
+ this->_size_ref=i_source_size;
+
+ this->_rgb_temp=new int[i_resolution*i_resolution*3];
+ this->_rgb_px=new int[i_resolution*i_resolution];
+ this->_rgb_py=new int[i_resolution*i_resolution];
+
+ this->_cp1cy_cp2=new double[i_resolution];
+ this->_cp4cy_cp5=new double[i_resolution];
+ this->_cp7cy_1=new double[i_resolution];
+ return;
+ }
+ ~pickFromRaster_N()
+ {
+ NyAR_SAFE_DELETE(this->_rgb_temp);
+ NyAR_SAFE_DELETE(this->_rgb_px);
+ NyAR_SAFE_DELETE(this->_rgb_py);
+
+ NyAR_SAFE_DELETE(this->_cp1cy_cp2);
+ NyAR_SAFE_DELETE(this->_cp4cy_cp5);
+ NyAR_SAFE_DELETE(this->_cp7cy_1);
+ return;
+ }
+
+ private:
+ int* _rgb_temp;
+ int* _rgb_px;
+ int* _rgb_py;
+ double* _cp1cy_cp2;
+ double* _cp4cy_cp5;
+ double* _cp7cy_1;
+
+ public:
+ void pickFromRaster(const double* i_cpara,const INyARRgbRaster& image,int* o_patt)
+ {
+ int i2x,i2y;//ĶÉăÀ֏Д
+ int x,y;
+ int w;
+ int r,g,b;
+
+ const int resolution=this->_resolution;
+ const int res_pix=resolution*resolution;
+ const int img_x = image.getWidth();
+ const int img_y = image.getHeight();
+
+ int* rgb_tmp = this->_rgb_temp;
+ int* rgb_px=this->_rgb_px;
+ int* rgb_py=this->_rgb_py;
+
+ double* cp1cy_cp2=this->_cp1cy_cp2;
+ double* cp4cy_cp5=this->_cp4cy_cp5;
+ double* cp7cy_1=this->_cp7cy_1;
+
+ const double cp0=i_cpara[0];
+ const double cp3=i_cpara[3];
+ const double cp6=i_cpara[6];
+ const double cp1=i_cpara[1];
+ const double cp2=i_cpara[2];
+ const double cp4=i_cpara[4];
+ const double cp5=i_cpara[5];
+ const double cp7=i_cpara[7];
+
+
+ const int pick_y=this->_lt_ref->y;
+ const int pick_x=this->_lt_ref->x;
+ //ijĎĚËʛğ›ðϦӾ
+ const INyARRgbPixelReader& reader=image.getRgbPixelReader();
+ int p=0;
+
+
+ for(int iy=0;iy<this->_size_ref->h*resolution;iy+=resolution){
+ w=pick_y+iy;
+ cp1cy_cp2[0]=cp1*w+cp2;
+ cp4cy_cp5[0]=cp4*w+cp5;
+ cp7cy_1[0]=cp7*w+1.0;
+ for(i2y=1;i2y<resolution;i2y++){
+ cp1cy_cp2[i2y]=cp1cy_cp2[i2y-1]+cp1;
+ cp4cy_cp5[i2y]=cp4cy_cp5[i2y-1]+cp4;
+ cp7cy_1[i2y]=cp7cy_1[i2y-1]+cp7;
+ }
+ //ʰќԸժÌԟðϦé‚
+
+ for(int ix=0;ix<this->_size_ref->w*resolution;ix+=resolution){
+ int n=0;
+ w=pick_x+ix;
+ for(i2y=resolution-1;i2y>=0;i2y--){
+ double cp0cx=cp0*w+cp1cy_cp2[i2y];
+ double cp6cx=cp6*w+cp7cy_1[i2y];
+ double cp3cx=cp3*w+cp4cy_cp5[i2y];
+
+ const double m=1/(cp6cx);
+ const double d=-cp6/(cp6cx*(cp6cx+cp6));
+
+ double m2=cp0cx*m;
+ double m3=cp3cx*m;
+ double d2=cp0cx*d+cp0*(m+d);
+ double d3=cp3cx*d+cp3*(m+d);
+ for(i2x=resolution-1;i2x>=0;i2x--){
+ //1ijĎĚËðάЬ
+ x=rgb_px[n]=(int)(m2);
+ y=rgb_py[n]=(int)(m3);
+ if(x<0||x>=img_x||y<0||y>=img_y){
+ if(x<0){rgb_px[n]=0;}else if(x>=img_x){rgb_px[n]=img_x-1;}
+ if(y<0){rgb_py[n]=0;}else if(y>=img_y){rgb_py[n]=img_y-1;}
+ }
+ n++;
+ m2+=d2;
+ m3+=d3;
+ }
+ }
+ reader.getPixelSet(rgb_px, rgb_py,res_pix, rgb_tmp);
+ r=g=b=0;
+ for(int i=res_pix*3-1;i>0;){
+ b+=rgb_tmp[i--];
+ g+=rgb_tmp[i--];
+ r+=rgb_tmp[i--];
+ }
+ r/=res_pix;
+ g/=res_pix;
+ b/=res_pix;
+ o_patt[p]=((r&0xff)<<16)|((g&0xff)<<8)|((b&0xff));
+ p++;
+ }
+ }
+ return;
+ }
+ };
+ /**
+ * ĠĆĢĎĦėĢħ:4127936236942444153655776299710081208144715171590159116971715177917901890204024192573274828522936312731813388371037714083
+ *
+ */
+ class pickFromRaster_1 : public IpickFromRaster_Impl
+ {
+ protected:
+ const TNyARIntSize* _size_ref;
+ const TNyARIntPoint2d* _lt_ref;
+ public:
+ pickFromRaster_1(const TNyARIntPoint2d* i_lt,const TNyARIntSize* i_source_size)
+ {
+ this->_lt_ref=i_lt;
+ this->_size_ref=i_source_size;
+
+ this->_rgb_temp=new int[i_source_size->w*3];
+ this->_rgb_px=new int[i_source_size->w];
+ this->_rgb_py=new int[i_source_size->w];
+
+ return;
+ }
+ ~pickFromRaster_1()
+ {
+ NyAR_SAFE_DELETE(this->_rgb_temp);
+ NyAR_SAFE_DELETE(this->_rgb_px);
+ NyAR_SAFE_DELETE(this->_rgb_py);
+ return;
+ }
+ private:
+ int* _rgb_temp;
+ int* _rgb_px;
+ int* _rgb_py;
+
+
+ public:
+ void pickFromRaster(const double* i_cpara,const INyARRgbRaster& image,int* o_patt)
+ {
+ double d0,m0;
+ int x,y;
+
+ const int img_x = image.getWidth();
+ const int img_y = image.getHeight();
+ const int patt_w=this->_size_ref->w;
+
+ int* rgb_tmp = this->_rgb_temp;
+ int* rgb_px=this->_rgb_px;
+ int* rgb_py=this->_rgb_py;
+
+
+
+ const double cp0=i_cpara[0];
+ const double cp3=i_cpara[3];
+ const double cp6=i_cpara[6];
+ const double cp1=i_cpara[1];
+ const double cp4=i_cpara[4];
+ const double cp7=i_cpara[7];
+
+
+ const int pick_y=this->_lt_ref->y;
+ const int pick_x=this->_lt_ref->x;
+ //ijĎĚËʛğ›ðϦӾ
+ const INyARRgbPixelReader& reader=image.getRgbPixelReader();
+ int p=0;
+
+
+ double cp0cx0,cp3cx0;
+ double cp1cy_cp20=cp1*pick_y+i_cpara[2]+cp0*pick_x;
+ double cp4cy_cp50=cp4*pick_y+i_cpara[5]+cp3*pick_x;
+ double cp7cy_10=cp7*pick_y+1.0+cp6*pick_x;
+
+
+ for(int iy=this->_size_ref->h-1;iy>=0;iy--){
+ m0=1/(cp7cy_10);
+ d0=-cp6/(cp7cy_10*(cp7cy_10+cp6));
+
+ cp0cx0=cp1cy_cp20;
+ cp3cx0=cp4cy_cp50;
+
+ //ijĢĎāĢĶĖ›ĐÓĘ
+
+ //0ՔךÌijĎĚË(̟͸ҎЛ)ðijĢĎāĢĶ
+
+
+ for(int ix=patt_w-1;ix>=0;ix--){
+ //1ijĎĚËðάЬ
+ x=rgb_px[ix]=(int)(cp0cx0*m0);
+ y=rgb_py[ix]=(int)(cp3cx0*m0);
+ if(x<0||x>=img_x||y<0||y>=img_y){
+ if(x<0){rgb_px[ix]=0;}else if(x>=img_x){rgb_px[ix]=img_x-1;}
+ if(y<0){rgb_py[ix]=0;}else if(y>=img_y){rgb_py[ix]=img_y-1;}
+ }
+ cp0cx0+=cp0;
+ cp3cx0+=cp3;
+ m0+=d0;
+ }
+
+ cp1cy_cp20+=cp1;
+ cp4cy_cp50+=cp4;
+ cp7cy_10+=cp7;
+
+ reader.getPixelSet(rgb_px, rgb_py,patt_w, rgb_tmp);
+ for(int ix=patt_w-1;ix>=0;ix--){
+ const int idx=ix*3;
+ o_patt[p]=(rgb_tmp[idx]<<16)|(rgb_tmp[idx+1]<<8)|((rgb_tmp[idx+2]&0xff));
+ p++;
+ }
+ }
+
+ return;
+ }
+ };
+
+ /**
+ * 2x2
+ * ĠĆĢĎĦėĢħ:207585881161241401501892422483163713744114324414474655086016467027227327958629279571017
+ *
+ */
+ class pickFromRaster_2x :public IpickFromRaster_Impl
+ {
+ protected:
+ const TNyARIntSize* _size_ref;
+ const TNyARIntPoint2d* _lt_ref;
+ public:
+ pickFromRaster_2x(const TNyARIntPoint2d* i_lt,const TNyARIntSize* i_source_size)
+ {
+ this->_lt_ref=i_lt;
+ this->_size_ref=i_source_size;
+
+ this->_rgb_temp=new int[i_source_size->w*4*3];
+ this->_rgb_px=new int[i_source_size->w*4];
+ this->_rgb_py=new int[i_source_size->w*4];
+
+ return;
+ }
+ ~pickFromRaster_2x()
+ {
+ NyAR_SAFE_DELETE(this->_rgb_temp);
+ NyAR_SAFE_DELETE(this->_rgb_px);
+ NyAR_SAFE_DELETE(this->_rgb_py);
+ return;
+ }
+ private:
+ int* _rgb_temp;
+ int* _rgb_px;
+ int* _rgb_py;
+
+
+ public:
+ void pickFromRaster(const double* i_cpara,const INyARRgbRaster& image,int* o_patt)
+ {
+ double d0,m0,d1,m1;
+ int x,y;
+
+ const int img_x = image.getWidth();
+ const int img_y = image.getHeight();
+ const int patt_w=this->_size_ref->w;
+
+ int* rgb_tmp = this->_rgb_temp;
+ int* rgb_px=this->_rgb_px;
+ int* rgb_py=this->_rgb_py;
+
+
+
+ const double cp0=i_cpara[0];
+ const double cp3=i_cpara[3];
+ const double cp6=i_cpara[6];
+ const double cp1=i_cpara[1];
+ const double cp4=i_cpara[4];
+ const double cp7=i_cpara[7];
+
+
+ const int pick_y=this->_lt_ref->y;
+ const int pick_x=this->_lt_ref->x;
+ //ijĎĚËʛğ›ðϦӾ
+ const INyARRgbPixelReader& reader=image.getRgbPixelReader();
+ int p=0;
+
+
+ double cp0cx0,cp3cx0;
+ double cp1cy_cp20=cp1*pick_y+i_cpara[2]+cp0*pick_x;
+ double cp4cy_cp50=cp4*pick_y+i_cpara[5]+cp3*pick_x;
+ double cp7cy_10=cp7*pick_y+1.0+cp6*pick_x;
+
+
+ double cp0cx1,cp3cx1;
+ double cp1cy_cp21=cp1cy_cp20+cp1;
+ double cp4cy_cp51=cp4cy_cp50+cp4;
+ double cp7cy_11=cp7cy_10+cp7;
+
+ double cw0=cp1+cp1;
+ double cw7=cp7+cp7;
+ double cw4=cp4+cp4;
+
+ for(int iy=this->_size_ref->h-1;iy>=0;iy--){
+ cp0cx0=cp1cy_cp20;
+ cp3cx0=cp4cy_cp50;
+ cp0cx1=cp1cy_cp21;
+ cp3cx1=cp4cy_cp51;
+
+ m0=1/(cp7cy_10);
+ d0=-cp6/(cp7cy_10*(cp7cy_10+cp6));
+ m1=1/(cp7cy_11);
+ d1=-cp6/(cp7cy_11*(cp7cy_11+cp6));
+
+ int n=patt_w*2*2-1;
+
+ for(int ix=patt_w*2-1;ix>=0;ix--){
+ //[n,0]
+ x=rgb_px[n]=(int)(cp0cx0*m0);
+ y=rgb_py[n]=(int)(cp3cx0*m0);
+ if(x<0||x>=img_x||y<0||y>=img_y){
+ if(x<0){rgb_px[n]=0;}else if(x>=img_x){rgb_px[n]=img_x-1;}
+ if(y<0){rgb_py[n]=0;}else if(y>=img_y){rgb_py[n]=img_y-1;}
+ }
+ cp0cx0+=cp0;
+ cp3cx0+=cp3;
+ m0+=d0;
+ n--;
+ //[n,1]
+ x=rgb_px[n]=(int)(cp0cx1*m1);
+ y=rgb_py[n]=(int)(cp3cx1*m1);
+ if(x<0||x>=img_x||y<0||y>=img_y){
+ if(x<0){rgb_px[n]=0;}else if(x>=img_x){rgb_px[n]=img_x-1;}
+ if(y<0){rgb_py[n]=0;}else if(y>=img_y){rgb_py[n]=img_y-1;}
+ }
+ cp0cx1+=cp0;
+ cp3cx1+=cp3;
+ m1+=d1;
+ n--;
+ }
+ cp7cy_10+=cw7;
+ cp7cy_11+=cw7;
+
+ cp1cy_cp20+=cw0;
+ cp4cy_cp50+=cw4;
+ cp1cy_cp21+=cw0;
+ cp4cy_cp51+=cw4;
+
+
+
+ reader.getPixelSet(rgb_px, rgb_py,patt_w*4, rgb_tmp);
+ for(int ix=patt_w-1;ix>=0;ix--){
+ const int idx=ix*12;//3*2*2
+ const int r=(rgb_tmp[idx+0]+rgb_tmp[idx+3]+rgb_tmp[idx+6]+rgb_tmp[idx+ 9])/4;
+ const int g=(rgb_tmp[idx+1]+rgb_tmp[idx+4]+rgb_tmp[idx+7]+rgb_tmp[idx+10])/4;
+ const int b=(rgb_tmp[idx+2]+rgb_tmp[idx+5]+rgb_tmp[idx+8]+rgb_tmp[idx+11])/4;
+ o_patt[p]=(r<<16)|(g<<8)|((b&0xff));
+ p++;
+ }
+ }
+
+ return;
+ }
+ };
+
+ /**
+ * 4x4
+ *
+ */
+ class pickFromRaster_4x :public IpickFromRaster_Impl
+ {
+ protected:
+ const TNyARIntSize* _size_ref;
+ const TNyARIntPoint2d* _lt_ref;
+ public:
+ pickFromRaster_4x(const TNyARIntPoint2d* i_lt,const TNyARIntSize* i_source_size)
+ {
+ this->_lt_ref=i_lt;
+ this->_size_ref=i_source_size;
+
+ this->_rgb_temp=new int[4*4*3];
+ this->_rgb_px=new int[4*4];
+ this->_rgb_py=new int[4*4];
+ return;
+ }
+ ~pickFromRaster_4x()
+ {
+ NyAR_SAFE_DELETE(this->_rgb_temp);
+ NyAR_SAFE_DELETE(this->_rgb_px);
+ NyAR_SAFE_DELETE(this->_rgb_py);
+ return;
+ }
+
+ private:
+ int* _rgb_temp;
+ int* _rgb_px;
+ int* _rgb_py;
+
+ public:
+ void pickFromRaster(const double* i_cpara,const INyARRgbRaster& image,int* o_patt)
+ {
+ int x,y;
+ double d,m;
+ double cp6cx,cp0cx,cp3cx;
+ int* rgb_px=this->_rgb_px;
+ int* rgb_py=this->_rgb_py;
+
+ int r,g,b;
+ //ɓ̟׀ÌİÉÁ›ĞðͶϚ
+
+ const int img_x = image.getWidth();
+ const int img_y = image.getHeight();
+ int* rgb_tmp = this->_rgb_temp;
+ const double cp0=i_cpara[0];
+ const double cp3=i_cpara[3];
+ const double cp6=i_cpara[6];
+ const double cp1=i_cpara[1];
+ const double cp2=i_cpara[2];
+ const double cp4=i_cpara[4];
+ const double cp5=i_cpara[5];
+ const double cp7=i_cpara[7];
+
+
+ int pick_lt_x=this->_lt_ref->x;
+ //ijĎĚËʛğ›ðϦӾ
+ const INyARRgbPixelReader& reader=image.getRgbPixelReader();
+
+
+ int p=0;
+ int py=this->_lt_ref->y;
+ for(int iy=this->_size_ref->h-1;iy>=0;iy--,py+=4){
+ const double cp1cy_cp2_0=cp1*py+cp2;
+ const double cp4cy_cp5_0=cp4*py+cp5;
+ const double cp7cy_1_0 =cp7*py+1.0;
+
+ const double cp1cy_cp2_1=cp1cy_cp2_0+cp1;
+ const double cp1cy_cp2_2=cp1cy_cp2_1+cp1;
+ const double cp1cy_cp2_3=cp1cy_cp2_2+cp1;
+
+ const double cp4cy_cp5_1=cp4cy_cp5_0+cp4;
+ const double cp4cy_cp5_2=cp4cy_cp5_1+cp4;
+ const double cp4cy_cp5_3=cp4cy_cp5_2+cp4;
+
+ int px=pick_lt_x;
+ //ʰќԸժÌԟðϦé‚
+ for(int ix=this->_size_ref->w-1;ix>=0;ix--,px+=4){
+
+ cp6cx=cp6*px;
+ cp0cx=cp0*px;
+ cp3cx=cp3*px;
+
+ cp6cx+=cp7cy_1_0;
+ m=1/cp6cx;
+ d=-cp7/((cp6cx+cp7)*cp6cx);
+
+ //1ijĎĚËðάЬ[0,0]
+ x=rgb_px[0]=(int)((cp0cx+cp1cy_cp2_0)*m);
+ y=rgb_py[0]=(int)((cp3cx+cp4cy_cp5_0)*m);
+ if(x<0||x>=img_x||y<0||y>=img_y){
+ if(x<0){rgb_px[0]=0;}else if(x>=img_x){rgb_px[0]=img_x-1;}
+ if(y<0){rgb_py[0]=0;}else if(y>=img_y){rgb_py[0]=img_y-1;}
+ }
+
+ //1ijĎĚËðάЬ[0,1]
+ m+=d;
+ x=rgb_px[4]=(int)((cp0cx+cp1cy_cp2_1)*m);
+ y=rgb_py[4]=(int)((cp3cx+cp4cy_cp5_1)*m);
+ if(x<0||x>=img_x||y<0||y>=img_y){
+ if(x<0){rgb_px[4]=0;}else if(x>=img_x){rgb_px[4]=img_x-1;}
+ if(y<0){rgb_py[4]=0;}else if(y>=img_y){rgb_py[4]=img_y-1;}
+ }
+ //1ijĎĚËðάЬ[0,2]
+ m+=d;
+ x=rgb_px[8]=(int)((cp0cx+cp1cy_cp2_2)*m);
+ y=rgb_py[8]=(int)((cp3cx+cp4cy_cp5_2)*m);
+ if(x<0||x>=img_x||y<0||y>=img_y){
+ if(x<0){rgb_px[8]=0;}else if(x>=img_x){rgb_px[8]=img_x-1;}
+ if(y<0){rgb_py[8]=0;}else if(y>=img_y){rgb_py[8]=img_y-1;}
+ }
+
+ //1ijĎĚËðάЬ[0,3]
+ m+=d;
+ x=rgb_px[12]=(int)((cp0cx+cp1cy_cp2_3)*m);
+ y=rgb_py[12]=(int)((cp3cx+cp4cy_cp5_3)*m);
+ if(x<0||x>=img_x||y<0||y>=img_y){
+ if(x<0){rgb_px[12]=0;}else if(x>=img_x){rgb_px[12]=img_x-1;}
+ if(y<0){rgb_py[12]=0;}else if(y>=img_y){rgb_py[12]=img_y-1;}
+ }
+
+ cp6cx+=cp6;
+ cp0cx+=cp0;
+ cp3cx+=cp3;
+
+ m=1/cp6cx;
+ d=-cp7/((cp6cx+cp7)*cp6cx);
+
+ //1ijĎĚËðάЬ[1,0]
+ x=rgb_px[1]=(int)((cp0cx+cp1cy_cp2_0)*m);
+ y=rgb_py[1]=(int)((cp3cx+cp4cy_cp5_0)*m);
+ if(x<0||x>=img_x||y<0||y>=img_y){
+ if(x<0){rgb_px[1]=0;}else if(x>=img_x){rgb_px[1]=img_x-1;}
+ if(y<0){rgb_py[1]=0;}else if(y>=img_y){rgb_py[1]=img_y-1;}
+ }
+ //1ijĎĚËðάЬ[1,1]
+ m+=d;
+ x=rgb_px[5]=(int)((cp0cx+cp1cy_cp2_1)*m);
+ y=rgb_py[5]=(int)((cp3cx+cp4cy_cp5_1)*m);
+ if(x<0||x>=img_x||y<0||y>=img_y){
+ if(x<0){rgb_px[5]=0;}else if(x>=img_x){rgb_px[5]=img_x-1;}
+ if(y<0){rgb_py[5]=0;}else if(y>=img_y){rgb_py[5]=img_y-1;}
+ }
+ //1ijĎĚËðάЬ[1,2]
+ m+=d;
+ x=rgb_px[9]=(int)((cp0cx+cp1cy_cp2_2)*m);
+ y=rgb_py[9]=(int)((cp3cx+cp4cy_cp5_2)*m);
+ if(x<0||x>=img_x||y<0||y>=img_y){
+ if(x<0){rgb_px[9]=0;}else if(x>=img_x){rgb_px[9]=img_x-1;}
+ if(y<0){rgb_py[9]=0;}else if(y>=img_y){rgb_py[9]=img_y-1;}
+ }
+ //1ijĎĚËðάЬ[1,3]
+ m+=d;
+ x=rgb_px[13]=(int)((cp0cx+cp1cy_cp2_3)*m);
+ y=rgb_py[13]=(int)((cp3cx+cp4cy_cp5_3)*m);
+ if(x<0||x>=img_x||y<0||y>=img_y){
+ if(x<0){rgb_px[13]=0;}else if(x>=img_x){rgb_px[13]=img_x-1;}
+ if(y<0){rgb_py[13]=0;}else if(y>=img_y){rgb_py[13]=img_y-1;}
+ }
+
+ cp6cx+=cp6;
+ cp0cx+=cp0;
+ cp3cx+=cp3;
+
+ m=1/cp6cx;
+ d=-cp7/((cp6cx+cp7)*cp6cx);
+
+ //1ijĎĚËðάЬ[2,0]
+ x=rgb_px[2]=(int)((cp0cx+cp1cy_cp2_0)*m);
+ y=rgb_py[2]=(int)((cp3cx+cp4cy_cp5_0)*m);
+ if(x<0||x>=img_x||y<0||y>=img_y){
+ if(x<0){rgb_px[2]=0;}else if(x>=img_x){rgb_px[2]=img_x-1;}
+ if(y<0){rgb_py[2]=0;}else if(y>=img_y){rgb_py[2]=img_y-1;}
+ }
+ //1ijĎĚËðάЬ[2,1]
+ m+=d;
+ x=rgb_px[6]=(int)((cp0cx+cp1cy_cp2_1)*m);
+ y=rgb_py[6]=(int)((cp3cx+cp4cy_cp5_1)*m);
+ if(x<0||x>=img_x||y<0||y>=img_y){
+ if(x<0){rgb_px[6]=0;}else if(x>=img_x){rgb_px[6]=img_x-1;}
+ if(y<0){rgb_py[6]=0;}else if(y>=img_y){rgb_py[6]=img_y-1;}
+ }
+ //1ijĎĚËðάЬ[2,2]
+ m+=d;
+ x=rgb_px[10]=(int)((cp0cx+cp1cy_cp2_2)*m);
+ y=rgb_py[10]=(int)((cp3cx+cp4cy_cp5_2)*m);
+ if(x<0||x>=img_x||y<0||y>=img_y){
+ if(x<0){rgb_px[10]=0;}else if(x>=img_x){rgb_px[10]=img_x-1;}
+ if(y<0){rgb_py[10]=0;}else if(y>=img_y){rgb_py[10]=img_y-1;}
+ }
+ //1ijĎĚËðάЬ[2,3](±±ͶϚ¸êµÜ·‚)
+ m+=d;
+ x=rgb_px[14]=(int)((cp0cx+cp1cy_cp2_3)*m);
+ y=rgb_py[14]=(int)((cp3cx+cp4cy_cp5_3)*m);
+ if(x<0||x>=img_x||y<0||y>=img_y){
+ if(x<0){rgb_px[14]=0;}else if(x>=img_x){rgb_px[14]=img_x-1;}
+ if(y<0){rgb_py[14]=0;}else if(y>=img_y){rgb_py[14]=img_y-1;}
+ }
+ cp6cx+=cp6;
+ cp0cx+=cp0;
+ cp3cx+=cp3;
+
+ m=1/cp6cx;
+ d=-cp7/((cp6cx+cp7)*cp6cx);
+
+ //1ijĎĚËðάЬ[3,0]
+ x=rgb_px[3]=(int)((cp0cx+cp1cy_cp2_0)*m);
+ y=rgb_py[3]=(int)((cp3cx+cp4cy_cp5_0)*m);
+ if(x<0||x>=img_x||y<0||y>=img_y){
+ if(x<0){rgb_px[3]=0;}else if(x>=img_x){rgb_px[3]=img_x-1;}
+ if(y<0){rgb_py[3]=0;}else if(y>=img_y){rgb_py[3]=img_y-1;}
+ }
+ //1ijĎĚËðάЬ[3,1]
+ m+=d;
+ x=rgb_px[7]=(int)((cp0cx+cp1cy_cp2_1)*m);
+ y=rgb_py[7]=(int)((cp3cx+cp4cy_cp5_1)*m);
+ if(x<0||x>=img_x||y<0||y>=img_y){
+ if(x<0){rgb_px[7]=0;}else if(x>=img_x){rgb_px[7]=img_x-1;}
+ if(y<0){rgb_py[7]=0;}else if(y>=img_y){rgb_py[7]=img_y-1;}
+ }
+ //1ijĎĚËðάЬ[3,2]
+ m+=d;
+ x=rgb_px[11]=(int)((cp0cx+cp1cy_cp2_2)*m);
+ y=rgb_py[11]=(int)((cp3cx+cp4cy_cp5_2)*m);
+ if(x<0||x>=img_x||y<0||y>=img_y){
+ if(x<0){rgb_px[11]=0;}else if(x>=img_x){rgb_px[11]=img_x-1;}
+ if(y<0){rgb_py[11]=0;}else if(y>=img_y){rgb_py[11]=img_y-1;}
+ }
+ //1ijĎĚËðάЬ[3,3]
+ m+=d;
+ x=rgb_px[15]=(int)((cp0cx+cp1cy_cp2_3)*m);
+ y=rgb_py[15]=(int)((cp3cx+cp4cy_cp5_3)*m);
+ if(x<0||x>=img_x||y<0||y>=img_y){
+ if(x<0){rgb_px[15]=0;}else if(x>=img_x){rgb_px[15]=img_x-1;}
+ if(y<0){rgb_py[15]=0;}else if(y>=img_y){rgb_py[15]=img_y-1;}
+ }
+
+ reader.getPixelSet(rgb_px, rgb_py,4*4, rgb_tmp);
+
+ r=(rgb_tmp[ 0]+rgb_tmp[ 3]+rgb_tmp[ 6]+rgb_tmp[ 9]+rgb_tmp[12]+rgb_tmp[15]+rgb_tmp[18]+rgb_tmp[21]+rgb_tmp[24]+rgb_tmp[27]+rgb_tmp[30]+rgb_tmp[33]+rgb_tmp[36]+rgb_tmp[39]+rgb_tmp[42]+rgb_tmp[45])/16;
+ g=(rgb_tmp[ 1]+rgb_tmp[ 4]+rgb_tmp[ 7]+rgb_tmp[10]+rgb_tmp[13]+rgb_tmp[16]+rgb_tmp[19]+rgb_tmp[22]+rgb_tmp[25]+rgb_tmp[28]+rgb_tmp[31]+rgb_tmp[34]+rgb_tmp[37]+rgb_tmp[40]+rgb_tmp[43]+rgb_tmp[46])/16;
+ b=(rgb_tmp[ 2]+rgb_tmp[ 5]+rgb_tmp[ 8]+rgb_tmp[11]+rgb_tmp[14]+rgb_tmp[17]+rgb_tmp[20]+rgb_tmp[23]+rgb_tmp[26]+rgb_tmp[29]+rgb_tmp[32]+rgb_tmp[35]+rgb_tmp[38]+rgb_tmp[41]+rgb_tmp[44]+rgb_tmp[47])/16;
+ o_patt[p]=((r&0xff)<<16)|((g&0xff)<<8)|((b&0xff));
+ p++;
+
+ }
+ }
+ return;
+ }
+ };
+
+
+
+
+
+
+
+
+
+ /**
+ * ɓ̟׀ðϧÁ½İ›ĘĹĎĥĂĵ֢гð©¯ÄÉĘĞУÌϬ˰͠©ç
+ * ՃɓʰќԸÌ̩͠İĞ›ÓðάЬµÜ·‚
+ *
+ */
+ NyARColorPatt_Perspective_O2::NyARColorPatt_Perspective_O2(int i_width, int i_height,int i_resolution,int i_edge_percentage):NyARColorPatt_Perspective(i_width,i_height,i_resolution,i_edge_percentage)
+ {
+ switch(i_resolution){
+ case 1:
+ this->_pickup=new pickFromRaster_1(&this->_pickup_lt,&this->_size);
+ break;
+ case 2:
+ this->_pickup=new pickFromRaster_2x(&this->_pickup_lt,&this->_size);
+ break;
+ case 4:
+ this->_pickup=new pickFromRaster_4x(&this->_pickup_lt,&this->_size);
+ break;
+ default:
+ this->_pickup=new pickFromRaster_N(&this->_pickup_lt,i_resolution,&this->_size);
+ }
+ return;
+ }
+ NyARColorPatt_Perspective_O2::~NyARColorPatt_Perspective_O2()
+ {
+ NyAR_SAFE_DELETE(this->_pickup);
+ return;
+ }
+ bool NyARColorPatt_Perspective_O2::pickFromRaster(const INyARRgbRaster& image,const NyARSquare& i_square)
+ {
+ //ɓ̟׀ÌİÉÁ›ĞðͶϚ
+ double cpara[8];
+ if (!this->_perspective_gen->getParam(i_square.imvertex, cpara)) {
+ return false;
+ }
+ this->_pickup->pickFromRaster(cpara, image, this->_patdata);
+ return true;
+ }
+
+
+}
+
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARPerspectiveParamGenerator_O1.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARPerspectiveParamGenerator_O1.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARPerspectiveParamGenerator_O1.cpp (revision 335)
@@ -2,27 +2,25 @@
* PROJECT: NyARToolkitCPP
* --------------------------------------------------------------------------------
*
-* The NyARToolkitCS is C++ version NyARToolkit class library.
-*
-* Copyright (C)2008 R.Iizuka
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
*
-* 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 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 3 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 framework; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For further information please contact.
* http://nyatla.jp/nyatoolkit/
-* <airmail(at)ebony.plala.or.jp>
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
*
*/
#include "NyARPerspectiveParamGenerator_O1.h"
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARLabelInfoStack.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARLabelInfoStack.cpp (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARLabelInfoStack.cpp (revision 335)
@@ -0,0 +1,29 @@
+/*
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
+#include "NyARLabelInfoStack.h"
+namespace NyARToolkitCPP
+{
+}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARMatchPattDeviationColorData.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARMatchPattDeviationColorData.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARMatchPattDeviationColorData.cpp (revision 335)
@@ -2,27 +2,25 @@
* PROJECT: NyARToolkitCPP
* --------------------------------------------------------------------------------
*
-* The NyARToolkitCS is C++ version NyARToolkit class library.
-*
-* Copyright (C)2008 R.Iizuka
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
*
-* 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 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 3 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 framework; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For further information please contact.
* http://nyatla.jp/nyatoolkit/
-* <airmail(at)ebony.plala.or.jp>
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
*
*/

Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARPerspectiveParamGenerator.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARPerspectiveParamGenerator.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARPerspectiveParamGenerator.cpp (revision 335)
@@ -1,40 +1,38 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARPerspectiveParamGenerator.h"

namespace NyARToolkitCPP
{


-/**
- * ɓ̟׀ðذ¢½PerspectiveİÉÁ›ĞðͶϚ·éĎÉĘÅ·‚
- *
- */
+ /**
+ * ɓ̟׀ðذ¢½PerspectiveİÉÁ›ĞðͶϚ·éĎÉĘÅ·‚
+ *
+ */
NyARPerspectiveParamGenerator::NyARPerspectiveParamGenerator(int i_local_x,int i_local_y,int i_width, int i_height)
{
this->_height=i_height;
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARTransportVectorSolver.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARTransportVectorSolver.cpp (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARTransportVectorSolver.cpp (revision 335)
@@ -0,0 +1,29 @@
+/*
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
+#include "INyARTransportVectorSolver.h"
+namespace NyARToolkitCPP
+{
+}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRgbRaster_RGB.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRgbRaster_RGB.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRgbRaster_RGB.cpp (revision 335)
@@ -1,49 +1,36 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2009 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
+
#include "NyARRgbRaster_RGB.h"
#include "nyarcore.h"
namespace NyARToolkitCPP
{
- NyARRgbRaster_RGB* NyARRgbRaster_RGB::wrap(const NyAR_BYTE_t* i_buffer, int i_width, int i_height)
+ NyARRgbRaster_RGB::NyARRgbRaster_RGB(const NyAR_BYTE_t* i_ref_buffer,int i_width, int i_height):NyARRgbRaster_BasicClass(i_width,i_height)
{
- return new NyARRgbRaster_RGB(i_buffer, i_width, i_height);
- }
-
- NyARRgbRaster_RGB::NyARRgbRaster_RGB(const NyAR_BYTE_t* i_buffer, int i_width, int i_height):NyARRgbRaster_BasicClass(i_width,i_height)
- {
- this->_ref_buf = i_buffer;
- this->_rgb_reader = new NyARRgbPixelReader_RGB24(&this->_size,i_buffer);
- this->_buffer_reader=new NyARBufferReader(i_buffer,INyARBufferReader::BUFFERFORMAT_BYTE1D_R8G8B8_24);
- return;
- }
- NyARRgbRaster_RGB::NyARRgbRaster_RGB(int i_width, int i_height):NyARRgbRaster_BasicClass(i_width,i_height)
- {
- this->_ref_buf =NULL;
+ this->_ref_buf =i_ref_buffer;
this->_rgb_reader = new NyARRgbPixelReader_RGB24(&this->_size,NULL);
this->_buffer_reader=new NyARBufferReader(NULL,INyARBufferReader::BUFFERFORMAT_BYTE1D_R8G8B8_24);
return;
@@ -64,12 +51,5 @@
{
return *(this->_buffer_reader);
}
- void NyARRgbRaster_RGB::setBuffer(const NyAR_BYTE_t* i_buffer)
- {
- NyAR_ASSERT(i_buffer!=NULL);
- this->_ref_buf=i_buffer;
- this->_buffer_reader->setBuffer(i_buffer);
- }
-
}

Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARSquareStack.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARSquareStack.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARSquareStack.cpp (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARSquareStack.h"
namespace NyARToolkitCPP
{
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRaster_BasicClass.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRaster_BasicClass.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRaster_BasicClass.cpp (revision 335)
@@ -1,3 +1,28 @@
+/*
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "nyarcore.h"
#include "NyARRaster_BasicClass.h"
namespace NyARToolkitCPP
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARMatchPatt_Color_WITHOUT_PCA.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARMatchPatt_Color_WITHOUT_PCA.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARMatchPatt_Color_WITHOUT_PCA.cpp (revision 335)
@@ -2,27 +2,25 @@
* PROJECT: NyARToolkitCPP
* --------------------------------------------------------------------------------
*
-* The NyARToolkitCS is C++ version NyARToolkit class library.
-*
-* Copyright (C)2008 R.Iizuka
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
*
-* 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 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 3 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 framework; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For further information please contact.
* http://nyatla.jp/nyatoolkit/
-* <airmail(at)ebony.plala.or.jp>
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
*
*/
#include "NyARMatchPatt_Color_WITHOUT_PCA.h"
@@ -114,4 +112,4 @@



-}
\ No newline at end of file
+}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARBinRaster.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARBinRaster.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARBinRaster.cpp (revision 335)
@@ -1,30 +1,29 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
+
#include "NyARBinRaster.h"
#include "NyARBufferReader.h"
#include "nyarcore.h"
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARMatchPatt.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARMatchPatt.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARMatchPatt.cpp (revision 335)
@@ -1,29 +1,27 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "INyARMatchPatt.h"

Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARParam.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARParam.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARParam.cpp (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARParam.h"
#include "../utils/NyStdLib.h"
#include "nyarcore.h"
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARSquare.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARSquare.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARSquare.cpp (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARSquare.h"

namespace NyARToolkitCPP
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARSquareDetector.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARSquareDetector.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARSquareDetector.cpp (revision 335)
@@ -1,28 +1,26 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "INyARSquareDetector.h"
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARLabeling_ARToolKit.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARLabeling_ARToolKit.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARLabeling_ARToolKit.cpp (revision 335)
@@ -1,3 +1,28 @@
+/*
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARLabeling_ARToolKit.h"
#include "nyarcore.h"
#include <cstdlib>
@@ -31,7 +56,7 @@
return;
}

- void reserv(int i_index)
+ void reserv(int i_index)
{
// āÍЛħΏÝÈçѦÊĞ›Ó
if (this->_allocate_size > i_index) {
@@ -67,34 +92,7 @@
return;
}

- void NyARLabeling_ARToolKit::attachDestination(INyARLabelingImage* i_destination_image)
- {
- // ĔăęĠĆĢĎ
- const TNyARIntSize& size = i_destination_image->getSize();
- this->_out_image = i_destination_image;

- // NyLabelingImageÌăÁ›ėω˺ɻ(٧ϑ«)
- int* img = (int*) i_destination_image->getBufferReader().getBuffer();
- int bottom_ptr = (size.h - 1) * size.w;
- for (int i = 0; i < size.w; i++) {
- img[i] = 0;
- img[bottom_ptr + i] = 0;
- }
- for (int i = 0; i < size.h; i++) {
- img[i * size.w] = 0;
- img[(i + 1) * size.w - 1] = 0;
- }
-
- // Ĕăę(ϑІӬ)ð֛Ѷ
-// this->_dest_size = size;
- return;
- }
-
- const INyARLabelingImage* NyARLabeling_ARToolKit::getAttachedDestination()const
- {
- return this->_out_image;
- }
-
/**
* static ARInt16 *labeling2( ARUint8 *image, int thresh,int *label_num, int **area, double **pos, int **clip,int **label_ref, int LorR ) ˖ДÌңҖ֩
* ÉĘĞimageðÉĸÊÓďµÄ̋ʊð֛ѶµÜ·‚ Optimize:STEP[1514->1493]
@@ -102,7 +100,7 @@
* @param i_raster
* @throws NyARException
*/
- void NyARLabeling_ARToolKit::labeling(const NyARBinRaster& i_raster)
+ int NyARLabeling_ARToolKit::labeling(const NyARBinRaster& i_raster,NyARLabelingImage& o_destination_image)const
{
int label_img_ptr1, label_pixel;
int i, j;
@@ -110,18 +108,18 @@

// ĔăęĠĆĢĎ
const TNyARIntSize& in_size = i_raster.getSize();
- NyAR_ASSERT(this->_out_image->getSize().isEqualSize(in_size));
+ NyAR_ASSERT(o_destination_image.getSize().isEqualSize(in_size));

const int lxsize = in_size.w;// lxsize = arUtil_c.arImXsize;
const int lysize = in_size.h;// lysize = arUtil_c.arImYsize;
- int *label_img = (int*) this->_out_image->getBufferReader().getBuffer();
+ int *label_img = (int*)o_destination_image.getBufferReader().getBuffer();

// ٧άЬÍăÓĘĞÓĘðάÁ½ҼͣÉâÁĵܤ‚

// ÉĸÊÓďЮֱÌÊĚĢħ©ÉĸÊÓďăÓĦĢĎĘðϧذª
- this->_out_image->reset(true);
+ o_destination_image.reset(true);

- int *label_idxtbl = this->_out_image->getIndexArray()->item;
+ int *label_idxtbl = o_destination_image.getIndexArray()->item;
const int *raster_buf = (const int*) i_raster.getBufferReader().getBuffer();

int *work2_pt;
@@ -261,11 +259,11 @@
wlabel_num -= 1;// *label_num = *wlabel_num = j - 1;
if (wlabel_num == 0) {// if( *label_num == 0 ) {
// ԭ̩Д0
- this->_out_image->getLabelStack().clear();
- return;
+ o_destination_image.getLabelStack().clear();
+ return 0;
}
// ÉĸËЮֱÌ֛Ѷә
- NyARLabelingLabelStack& label_list = this->_out_image->getLabelStack();
+ NyARLabelingLabelStack& label_list = o_destination_image.getLabelStack();

// ÉĸËįĢĴĀð؜ױ
label_list.reserv(wlabel_num);
@@ -308,6 +306,6 @@
label_pt->pos_x /= label_pt->area;
label_pt->pos_y /= label_pt->area;
}
- return;
+ return wlabel_num;
}
}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARCameraDistortionFactor.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARCameraDistortionFactor.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARCameraDistortionFactor.cpp (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARCameraDistortionFactor.h"
#include <cmath>

Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARCustomSingleDetectMarker.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARCustomSingleDetectMarker.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARCustomSingleDetectMarker.cpp (revision 335)
@@ -2,27 +2,25 @@
* PROJECT: NyARToolkitCPP
* --------------------------------------------------------------------------------
*
-* The NyARToolkitCS is C++ version NyARToolkit class library.
-*
-* Copyright (C)2008 R.Iizuka
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
*
-* 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 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 3 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 framework; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For further information please contact.
* http://nyatla.jp/nyatoolkit/
-* <airmail(at)ebony.plala.or.jp>
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
*
*/
#include "NyARCustomSingleDetectMarker.h"
@@ -33,11 +31,6 @@
{
#define AR_SQUARE_MAX 100

- NyARCustomSingleDetectMarker::NyARCustomSingleDetectMarker(const NyARParam* i_param,const NyARCode* i_code, double i_marker_width,const INyARRasterFilter_RgbToBin* i_filter)
- {
- initInstance(i_param,i_code,i_marker_width,i_filter);
- return;
- }
NyARCustomSingleDetectMarker::NyARCustomSingleDetectMarker()
{
//ΩժÅinitInstanceðπγµÄɺ³¢‚
@@ -46,32 +39,36 @@
NyARCustomSingleDetectMarker::~NyARCustomSingleDetectMarker()
{
NyAR_SAFE_DELETE(this->_square_list);
- NyAR_SAFE_DELETE(this->_square_detect);
+ NyAR_SAFE_DELETE(this->_bin_raster);
+ NyAR_SAFE_DELETE(this->_match_patt);
+ NyAR_SAFE_DELETE(this->_deviation_data);
NyAR_SAFE_DELETE(this->_transmat);
+ //У©çàçÁ½Ì
NyAR_SAFE_DELETE(this->_patt);
- NyAR_SAFE_DELETE(this->_deviation_data);
- NyAR_SAFE_DELETE(this->_match_patt);
- NyAR_SAFE_DELETE(this->_bin_raster);
+ NyAR_SAFE_DELETE(this->_square_detect);
return;
}
- void NyARCustomSingleDetectMarker::initInstance(const NyARParam* i_param,const NyARCode* i_code, double i_marker_width,const INyARRasterFilter_RgbToBin* i_filter)
+ void NyARCustomSingleDetectMarker::initInstance(
+ INyARColorPatt* i_patt_inst,
+ INyARSquareDetector* i_sqdetect_inst,
+ INyARTransMat* i_transmat_inst,
+ const INyARRasterFilter_RgbToBin* i_filter,
+ const NyARParam* i_ref_param,
+ const NyARCode* i_ref_code,
+ double i_marker_width)
{
- const TNyARIntSize& scr_size=i_param->getScreenSize();
+ const TNyARIntSize& scr_size=i_ref_param->getScreenSize();
// ʰэĉĵėĆĎħðάé
- this->_square_list=new NyARSquareStack(AR_SQUARE_MAX);
- this->_square_detect = new NyARSquareDetector(i_param->getDistortionFactor(),scr_size);
- this->_transmat = new NyARTransMat(i_param);
- //İĞ›ÓijĢĎāĢĶðάЬ
- this->_patt = new NyARColorPatt_O3(i_code->getWidth(), i_code->getHeight());
- //ϦӾİĞ›ÓÌͷժĦ›Ğ˭ðάЬ
- this->_deviation_data=new NyARMatchPattDeviationColorData(i_code->getWidth(),i_code->getHeight());
- //i_codeذÌ֝ɿ˭ðάЬ
- this->_match_patt = new NyARMatchPatt_Color_WITHOUT_PCA(i_code);
- this->_bin_raster=new NyARBinRaster(scr_size.w,scr_size.h);
- //ÑӬʦќįĢĴĀðάé
+ this->_square_detect=i_sqdetect_inst;
+ this->_transmat=i_transmat_inst;
this->_tobin_filter=i_filter;
- this->_is_continue = false;
this->_marker_width = i_marker_width;
+ this->_patt = i_patt_inst;
+ this->_deviation_data=new NyARMatchPattDeviationColorData(i_ref_code->getWidth(),i_ref_code->getHeight());
+ this->_match_patt = new NyARMatchPatt_Color_WITHOUT_PCA(i_ref_code);
+ this->_bin_raster=new NyARBinRaster(scr_size.w,scr_size.h);
+ this->_square_list=new NyARSquareStack(AR_SQUARE_MAX);
+ this->_is_continue = false;
return;
}

Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARRgbPixelReader.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARRgbPixelReader.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARRgbPixelReader.cpp (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "INyARRgbPixelReader.h"
namespace NyARToolkitCPP
{
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/TNyARMatchPattResult.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/TNyARMatchPattResult.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/TNyARMatchPattResult.cpp (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/

#include "TNyARMatchPattResult.h"
namespace NyARToolkitCPP
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARSystemofLinearEquationProcessor.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARSystemofLinearEquationProcessor.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARSystemofLinearEquationProcessor.cpp (revision 335)
@@ -1,31 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
-
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "nyarcore.h"

namespace NyARToolkitCPP
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARTransportVectorSolver.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARTransportVectorSolver.cpp (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARTransportVectorSolver.cpp (revision 335)
@@ -0,0 +1,130 @@
+/*
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
+#include "NyARTransportVectorSolver.h"
+#include "nyarcore.h"
+namespace NyARToolkitCPP
+{
+ NyARTransportVectorSolver::NyARTransportVectorSolver(const NyARPerspectiveProjectionMatrix* i_projection_mat_ref,int i_max_vertex)
+ {
+ this->_projection_mat=i_projection_mat_ref;
+ this->_cx=new double[i_max_vertex];
+ this->_cy=new double[i_max_vertex];
+ return;
+ }
+ NyARTransportVectorSolver::~NyARTransportVectorSolver()
+ {
+ NyAR_SAFE_DELETE(this->_cx);
+ NyAR_SAFE_DELETE(this->_cy);
+ return;
+ }
+
+ void NyARTransportVectorSolver::set2dVertex(const TNyARDoublePoint2d* i_ref_vertex_2d,int i_number_of_vertex)
+ {
+ //3x2nÆ2n*3Ìγر©ç΅ϬԱЦ׀ͶϚ·é½ßÉ3x3ĽħÊĎĘðάé‚
+ //[A]*[A]T
+ //γر[A]Ì3رךÌČÃĢĖÅ
+ double* cx=this->_cx;
+ double* cy=this->_cy;
+
+ double m22;
+ double p00=this->_projection_mat->m00;
+ double p01=this->_projection_mat->m01;
+ double p11=this->_projection_mat->m11;
+ double p12=this->_projection_mat->m12;
+ double p02=this->_projection_mat->m02;
+ double w1,w2,w3,w4;
+ this->_a00=i_number_of_vertex*p00*p00;
+ this->_a01_10=i_number_of_vertex*p00*p01;
+ this->_a11=i_number_of_vertex*(p01*p01+p11*p11);
+
+ //[A]T*[A]ÌͶϚ
+ m22=0;
+ w1=w2=0;
+ for(int i=0;i<i_number_of_vertex;i++){
+ //΀֗ð֛ѶµÄ¨­‚
+ w3=p02-(cx[i]=i_ref_vertex_2d[i].x);
+ w4=p12-(cy[i]=i_ref_vertex_2d[i].y);
+ w1+=w3;
+ w2+=w4;
+ m22+=w3*w3+w4*w4;
+ }
+ this->_a02_20=w1*p00;
+ this->_a12_21=p01*w1+p11*w2;
+ this->_a22=m22;
+
+ this->_nmber_of_vertex=i_number_of_vertex;
+ return;
+ }
+ void NyARTransportVectorSolver::solveTransportVector(const TNyARDoublePoint3d i_vertex3d[],TNyARDoublePoint3d& o_transfer)const
+ {
+ int number_of_vertex=this->_nmber_of_vertex;
+ double p00=this->_projection_mat->m00;
+ double p01=this->_projection_mat->m01;
+ double p02=this->_projection_mat->m02;
+ double p11=this->_projection_mat->m11;
+ double p12=this->_projection_mat->m12;
+ //γر[A]Ì3رךÌČÃĢĖÅ
+ double* cx=this->_cx;
+ double* cy=this->_cy;
+
+ //ʱԝγرð̳΀֗ÌҸԟ͑Éԋɞ
+ //[A]T*[b]ðͶϚ
+ double b1=0,b2=0,b3=0;
+ for(int i=0;i<number_of_vertex;i++)
+ {
+ double w1=i_vertex3d[i].z*cx[i]-p00*i_vertex3d[i].x-p01*i_vertex3d[i].y-p02*i_vertex3d[i].z;
+ double w2=i_vertex3d[i].z*cy[i]-p11*i_vertex3d[i].y-p12*i_vertex3d[i].z;
+ b1+=w1;
+ b2+=w2;
+ b3+=cx[i]*w1+cy[i]*w2;
+ }
+ //[A]T*[b]ðͶϚ
+ b3=p02*b1+p12*b2-b3;//χՔ֏¦½çğÁæ
+ b2=p01*b1+p11*b2;
+ b1=p00*b1;
+ //([A]T*[A])*[T]=[A]T*[b]ðֻӶήÅʰ­‚
+ //a01Æa10ð0ÆɼӨµÄà؇¢ñ¶áÈ¢©Èˆ
+ double a00=this->_a00;
+ double a01=this->_a01_10;
+ double a02=this->_a02_20;
+ double a11=this->_a11;
+ double a12=this->_a12_21;
+ double a22=this->_a22;
+
+ double t1=a22*b2-a12*b3;
+ double t2=a12*b2-a11*b3;
+ double t3=a01*b3-a02*b2;
+ double t4=a12*a12-a11*a22;
+ double t5=a02*a12-a01*a22;
+ double t6=a02*a11-a01*a12;
+ double det=a00*t4-a01*t5 + a02*t6;
+ o_transfer.x= (a01*t1 - a02*t2 +b1*t4)/det;
+ o_transfer.y=-(a00*t1 + a02*t3 +b1*t5)/det;
+ o_transfer.z= (a00*t2 + a01*t3 +b1*t6)/det;
+
+ return;
+ }
+}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARLabeling_Rle.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARLabeling_Rle.cpp (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARLabeling_Rle.cpp (revision 335)
@@ -0,0 +1,357 @@
+/*
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
+#include "NyARLabeling_Rle.h"
+#include "nyarcore.h"
+
+
+
+#define AR_AREA_MAX 100000// #define AR_AREA_MAX 100000
+#define AR_AREA_MIN 70// #define AR_AREA_MIN 70
+
+
+
+namespace NyARToolkitCPP
+{
+ typedef struct TRleInfo_t
+ {
+ //ͰϳÁÓį
+ int entry_x; // ĴÉďÁÓħÉĸËÌɊӵ
+ int area;
+ int clip_r;
+ int clip_l;
+ int clip_b;
+ int clip_t;
+ NyAR_INT64_t pos_x;
+ NyAR_INT64_t pos_y;
+ }TRleInfo;
+
+ class RleInfoStack : public NyObjectStack<TRleInfo>
+ {
+ public:
+
+ public:
+ RleInfoStack(int i_length):NyObjectStack<TRleInfo>(i_length)
+ {
+ return;
+ }
+ };
+ /**
+ * [strage class]
+ */
+
+ struct TRleElement_t
+ {
+ int l;
+ int r;
+ int fid;
+ };
+
+ NyARLabeling_Rle::NyARLabeling_Rle(int i_width,int i_height)
+ {
+ this->_rlestack=new RleInfoStack(i_width*i_height*2048/(320*240)+32);
+ this->_rle1 = new TRleElement[i_width/2+1];
+ this->_rle2 = new TRleElement[i_width/2+1];
+ setAreaRange(AR_AREA_MAX,AR_AREA_MIN);
+ return;
+ }
+ NyARLabeling_Rle::~NyARLabeling_Rle()
+ {
+ NyAR_SAFE_DELETE(this->_rlestack);
+ NyAR_SAFE_DELETE(this->_rle1);
+ NyAR_SAFE_DELETE(this->_rle2);
+ return;
+ }
+
+
+ void NyARLabeling_Rle::setAreaRange(int i_max,int i_min)
+ {
+ this->_max_area=i_max;
+ this->_min_area=i_min;
+ return;
+ }
+
+
+ int NyARLabeling_Rle::toRel(int* i_bin_buf, int i_st, int i_len, TRleElement* i_out)
+ {
+ int current = 0;
+ int r = -1;
+ // γ˭ӨˊϮ
+ int x = i_st;
+ const int right_edge = i_st + i_len - 1;
+ while (x < right_edge) {
+ // Ƀԟ(0)ĘČÃÓ
+ if (i_bin_buf[x] != 0) {
+ x++;
+ continue;
+ }
+ // Ƀԟԭ̩hɃԟҷðҲ×é
+ r = (x - i_st);
+ i_out[current].l = r;
+ r++;// Ƀԟ+1
+ x++;
+ while (x < right_edge) {
+ if (i_bin_buf[x] != 0) {
+ // ־ԟ(1)hɃԟ(0)պرЉ׹>ԯٞ
+ i_out[current].r = r;
+ current++;
+ x++;// ΟԟÌ˭Ն‚
+ r = -1;// ʅӛÌɊӵð0ɂ
+ break;
+ } else {
+ // Ƀԟ(0)ҷӇʁ
+ r++;
+ x++;
+ }
+ }
+ }
+ // ΅ͣÌ1ԟ¾¯ԻӨֻ׀ªϭµɡ¤Ì‚
+ if (i_bin_buf[x] != 0) {
+ // ־ԟhrĊąÓħ҆ÈçɃԟպرЉ׹>ԯٞ
+ if (r >= 0) {
+ i_out[current].r = r;
+ current++;
+ }
+ } else {
+ // ɃԟhĊąÓħ҆ÅȯêÎl1ÅӇʁ
+ if (r >= 0) {
+ i_out[current].r = (r + 1);
+ } else {
+ // ΅ͣÌ1ԟÌЪ͇
+ i_out[current].l = (i_len - 1);
+ i_out[current].r = (i_len);
+ }
+ current++;
+ }
+ // γ˭Ө
+ return current;
+ }
+
+ void NyARLabeling_Rle::addFragment(TRleElement& i_rel_img, int i_nof, int i_row_index,RleInfoStack& o_stack)
+ {
+ int l=i_rel_img.l;
+ const int len=i_rel_img.r - l;
+ i_rel_img.fid = i_nof;// RELֈÌͅ،ID
+ TRleInfo* v = o_stack.prePush();
+ v->entry_x = l;
+ v->area =len;
+ v->clip_l=l;
+ v->clip_r=i_rel_img.r-1;
+ v->clip_t=i_row_index;
+ v->clip_b=i_row_index;
+ v->pos_x=(len*(2*l+(len-1)))/2;
+ v->pos_y=i_row_index*len;
+
+ return;
+ }
+
+ //
+ int NyARLabeling_Rle::labeling(const NyARBinRaster& i_bin_raster, int i_top, int i_bottom,RleLabelFragmentInfoStack& o_stack)
+ {
+ // ÊĚĢħψם
+ RleInfoStack& rlestack=*this->_rlestack;
+ rlestack.clear();
+
+ //
+ TRleElement* rle_prev = this->_rle1;
+ TRleElement* rle_current = this->_rle2;
+ int len_prev = 0;
+ int len_current = 0;
+ const int width = i_bin_raster.getWidth();
+ int* in_buf = (int*) i_bin_raster.getBufferReader().getBuffer();
+
+ int id_max = 0;
+ int label_count=0;
+ // ωөԯٞ
+
+ len_prev = toRel(in_buf, i_top, width, rle_prev);
+ for (int i = 0; i < len_prev; i++) {
+ // ĴÉďÁÓħID=ĴÉďÁÓħω˺ӬPOS=YӬRELăÓĦĎĘ=γ
+ addFragment(rle_prev[i], id_max, i_top, rlestack);
+ id_max++;
+ // nofÌ΅ҥӬĠĆĢĎ
+ label_count++;
+ }
+ TRleInfo** const f_array = rlestack.getArray().item;
+ // Οө͇̋
+ for (int y = i_top + 1; y < i_bottom; y++) {
+ // ĊÌÓħγÌԇ͞
+ len_current = toRel(in_buf, y * width, width, rle_current);
+ int index_prev = 0;
+
+ for (int i = 0; i < len_current; i++) {
+ // index_prev,len_prevÌɊӵðҲЮ·é
+ int id = -1;
+ // ĠĆĢϷ׫prevª êÎ˭Ն
+ while (index_prev < len_prev) {
+ if (rle_current[i].l - rle_prev[index_prev].r > 0) {// 0Èç8ֻɊÉĸÊÓď
+ // prevªcurÌͶֻÉ éhΟÌĴÉďÁÓħðӔε
+ index_prev++;
+ continue;
+ } else if (rle_prev[index_prev].l - rle_current[i].r > 0) {// 0Èç8ֻɊÉĸÊÓďÉÈé
+ // prevªcurʅֻÉ éhԆקĴÉďÁÓħ
+ addFragment(rle_current[i], id_max, y,rlestack);
+ id_max++;
+ label_count++;
+ // ΟÌindexðµç×é
+ goto SCAN_CUR;
+ }
+ id=rle_prev[index_prev].fid;//˛ħĴÉďÁÓħid
+ TRleInfo& id_ptr = *f_array[id];
+ //͇̋ҎЛ(ωʱ)->prevÌIDðĒij›µÄË›ħĴÉďÁÓħÌЮֱðΘі
+ rle_current[i].fid = id;//ĴÉďÁÓħIDð֛Ѷ
+ //
+ const int l= rle_current[i].l;
+ const int r= rle_current[i].r;
+ const int len=r-l;
+ //͇̋ѦĴÉďÁÓħÌЮֱðΘі·é‚
+ id_ptr.area += len;
+ //tÆentry_x͇́̋ѦÌðϧ¤ÌÅΘіµÈ¢‚
+ id_ptr.clip_l=l<id_ptr.clip_l?l:id_ptr.clip_l;
+ id_ptr.clip_r=r>id_ptr.clip_r?r-1:id_ptr.clip_r;
+ id_ptr.clip_b=y;
+ id_ptr.pos_x+=(len*(2*l+(len-1)))/2;
+ id_ptr.pos_y+=y*len;
+ //ѽФ͇̋Ì˭Ն©Ñ͂ךɈξª
+ index_prev++;
+ while (index_prev < len_prev) {
+ if (rle_current[i].l - rle_prev[index_prev].r > 0) {// 0Èç8ֻɊÉĸÊÓď
+ // prevªcurÌͶֻÉ éhprevÍcurÉف̋µÄ¢È¢‚
+ goto SCAN_PREV;
+ } else if (rle_prev[index_prev].l - rle_current[i].r > 0) {// 0Èç8ֻɊÉĸÊÓďÉÈé
+ // prevªcurÌʅֻÉ éhprevÍcurÉف̋µÄ¢È¢‚
+ index_prev--;
+ goto SCAN_CUR;
+ }
+ // prevÆcurÍف̋µÄ¢éh˛ħĴÉďÁÓħÌӝ͇
+
+ //͇̋·é˛ħĴÉďÁÓħðϦӾ
+ const int prev_id =rle_prev[index_prev].fid;
+ TRleInfo& prev_ptr = *f_array[prev_id];
+ if (id != prev_id){
+ label_count--;
+ //prevÆcurrentÌĴÉďÁÓħidðϑ«ʷ¦é‚
+ for(int i2=index_prev;i2<len_prev;i2++){
+ //prevÍ̻ΝÌid©ç΅ͣÜÅ
+ if(rle_prev[i2].fid==prev_id){
+ rle_prev[i2].fid=id;
+ }
+ }
+ for(int i2=0;i2<i;i2++){
+ //currentÍ0©ç̻Ν-1ÜÅ
+ if(rle_current[i2].fid==prev_id){
+ rle_current[i2].fid=id;
+ }
+ }
+
+ //̻ΝÌ˛ħĴÉďÁÓħÉЮֱðЗױ
+ id_ptr.area +=prev_ptr.area;
+ id_ptr.pos_x+=prev_ptr.pos_x;
+ id_ptr.pos_y+=prev_ptr.pos_y;
+ //tÆentry_xÌ̈Ө
+ if (id_ptr.clip_t > prev_ptr.clip_t) {
+ // ̻ΝÌֻªɺÉ é‚
+ id_ptr.clip_t = prev_ptr.clip_t;
+ id_ptr.entry_x = prev_ptr.entry_x;
+ }else if (id_ptr.clip_t < prev_ptr.clip_t) {
+ // ̻ΝÌֻªУÉ é‚prevÉĴÛĨįĢĎ
+ } else {
+ // ЅսֻͼÅϬ³¢ֻªćÓħÊļăÓħ‚
+ if (id_ptr.entry_x > prev_ptr.entry_x) {
+ id_ptr.entry_x = prev_ptr.entry_x;
+ }else{
+ }
+ }
+ //lÌ̈Ө
+ if (id_ptr.clip_l > prev_ptr.clip_l) {
+ id_ptr.clip_l=prev_ptr.clip_l;
+ }else{
+ }
+ //rÌ̈Ө
+ if (id_ptr.clip_r < prev_ptr.clip_r) {
+ id_ptr.clip_r=prev_ptr.clip_r;
+ }else{
+ }
+ //bÌ̈Ө
+
+ //͇̋ΏÌ˛ħĴÉďÁÓħðֳ͸ɻ·é‚
+ prev_ptr.area=0;
+ }
+
+
+ index_prev++;
+ }
+ index_prev--;
+ break;
+ SCAN_PREV:;
+ }
+ // curÉidªʄèӖÄç꽩ð˭Ն
+ // ʅӛԆקĴÉďÁÓħðӇʁ
+ if (id < 0){
+ addFragment(rle_current[i], id_max, y,rlestack);
+ id_max++;
+ label_count++;
+ }
+ SCAN_CUR:;
+ }
+ // prevÆrelÌͰʷ
+ TRleElement* tmp = rle_prev;
+ rle_prev = rle_current;
+ len_prev = len_current;
+ rle_current = tmp;
+ }
+ //ҎЛÌÉĸ˾¯ԝϊ
+ o_stack.reserv(label_count);
+ RleLabelFragmentInfo** o_dest_array=o_stack.getArray().item;
+ const int max=this->_max_area;
+ const int min=this->_min_area;
+ int active_labels=0;
+ for(int i=id_max-1;i>=0;i--){
+ const int area=f_array[i]->area;
+ if(area<min || area>max){//ҎЛˏÌćÊā0ÌàminÅͶ­
+ continue;
+ }
+ //
+ const TRleInfo src_info=*f_array[i];
+ RleLabelFragmentInfo& dest_info=*o_dest_array[active_labels];
+ dest_info.area=area;
+ dest_info.clip_b=src_info.clip_b;
+ dest_info.clip_r=src_info.clip_r;
+ dest_info.clip_t=src_info.clip_t;
+ dest_info.clip_l=src_info.clip_l;
+ dest_info.entry_x=src_info.entry_x;
+ dest_info.pos_x=(double)(src_info.pos_x/src_info.area);
+ dest_info.pos_y=(double)(src_info.pos_y/src_info.area);
+ active_labels++;
+ }
+ //ÉĸËДð΄ѝӨ
+ o_stack.pops(label_count-active_labels);
+ //ÉĸËДð̰֔
+ return active_labels;
+ }
+
+
+}
+
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARCameraDistortionFactor.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARCameraDistortionFactor.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARCameraDistortionFactor.cpp (revision 335)
@@ -1,28 +1,26 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "INyARCameraDistortionFactor.h"
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARMat.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARMat.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARMat.cpp (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARMat.h"
#include "nyarcore.h"
#include <cstddef>
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRgbRaster_BasicClass.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRgbRaster_BasicClass.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRgbRaster_BasicClass.cpp (revision 335)
@@ -2,29 +2,28 @@
* PROJECT: NyARToolkitCPP
* --------------------------------------------------------------------------------
*
-* The NyARToolkitCS is C++ version NyARToolkit class library.
-*
-* Copyright (C)2008 R.Iizuka
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
*
-* 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 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 3 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 framework; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For further information please contact.
* http://nyatla.jp/nyatoolkit/
-* <airmail(at)ebony.plala.or.jp>
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
*
*/
+
#include "nyarcore.h"
#include "NyARRgbRaster_BasicClass.h"
namespace NyARToolkitCPP
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRotVector.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRotVector.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRotVector.cpp (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARRotVector.h"
#include "nyarcore.h"
#include <cmath>
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARTransMat.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARTransMat.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARTransMat.cpp (revision 335)
@@ -1,41 +1,42 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARTransMat.h"
#include "NyARRotTransOptimize_O2.h"
-#include "NyARRotMatrix_ARToolKit.h"
-#include "NyARRotMatrix_NyARToolKit.h"
+#include "NyARTransportVectorSolver.h"
+#include "NyARPartialDifferentiationOptimize.h"
#include "nyarcore.h"
#include <cstdlib>
+#include <stdio.h>
namespace NyARToolkitCPP
{
-#define AR_GET_TRANS_CONT_MAT_MAX_FIT_ERROR 1.0
+#define FIT_DIFF_THRESHOLD 1.0
+#define FIT_DIFF_THRESHOLD_CONT 1.0


+
NyARTransMat::NyARTransMat()
{
this->_center.x=0;
@@ -48,19 +49,19 @@
{
this->_center.x=0;
this->_center.y=0;
- const NyARCameraDistortionFactor& dist=i_param->getDistortionFactor();
- const NyARPerspectiveProjectionMatrix& pmat=i_param->getPerspectiveProjectionMatrix();
- this->_calculator=new NyARFitVecCalculator(&pmat,&dist);
- this->_mat_optimize=new NyARRotTransOptimize_O2(&pmat);
+ const NyARCameraDistortionFactor* dist=&i_param->getDistortionFactor();
+ const NyARPerspectiveProjectionMatrix* pmat=&i_param->getPerspectiveProjectionMatrix();
+ this->_transsolver=new NyARTransportVectorSolver(pmat,4);
//͝ʷЫªФضÈΞ́NyARRotMatrix_ARToolKitðϧ¤±Æ‚
//ם̼ÍNyARRotMatrix_NyARToolKitàNyARRotMatrix_ARToolKitàӯ¶¾¯Çϭµ¾¯Ӭª¸êé‚
- this->_rotmatrix = new NyARRotMatrix_NyARToolKit(&pmat);
-// this->_rotmatrix = new NyARRotMatrix_ARToolKit(pmat);
-
+ this->_rotmatrix = new NyARRotMatrix(pmat);
+ this->_mat_optimize=new NyARPartialDifferentiationOptimize(pmat);
+ this->_ref_dist_factor=dist;
+ this->_projection_mat_ref=pmat;
}
NyARTransMat::~NyARTransMat()
{
- NyAR_SAFE_DELETE(this->_calculator);
+ NyAR_SAFE_DELETE(this->_transsolver);
NyAR_SAFE_DELETE(this->_rotmatrix);
NyAR_SAFE_DELETE(this->_mat_optimize);
return;
@@ -94,30 +95,32 @@
const TNyARDoublePoint2d* sqvertex_ref[4];
const TNyARLinear* linear_ref[4];
TNyARDoublePoint3d trans;
-
+
//ͶϚذÉҸԟЮֱðω˺ɻ©χՔҲЮª
initVertexOrder(i_square, i_direction, sqvertex_ref,linear_ref);
+
+ TNyARDoublePoint2d vertex_2d[4];
+ TNyARDoublePoint3d vertex_3d[4];

- //ˮπ̩͠ðѝӨ
+ //սγɚӮ؊ͶϚ̀Ɂ2D΀֗ͮðĚĢħ
+ this->_ref_dist_factor->ideal2ObservBatch(sqvertex_ref, vertex_2d,4);
+ this->_transsolver->set2dVertex(vertex_2d,4);
+
+ //ˮπ̩͠Ì3D΀֗ͮðάЬ
this->_offset.setSquare(i_width,this->_center);

- // rotationð̩͠Юֱ©çͶϚ
+ //ʱԝγرðͶϚ
this->_rotmatrix->initRotBySquare(linear_ref,sqvertex_ref);
-
- //սγɚӮ؊ͶϚ̀ÉĉĴĚĢħҸԟðĚĢħ
- this->_calculator->setOffsetSquare(&this->_offset);
-
- //սγɚӮ؊ͶϚ̀ÉԋɞѦ̩͠ÌЮֱðĚĢħ
- this->_calculator->setFittedSquare(sqvertex_ref);
-
- //ʱԝγرÌսγɚӮ؊ÌͶϚ
- this->_calculator->calculateTransfer(*this->_rotmatrix,trans);
-
- //ͶϚ̋ʊÌ΅ԋɻ(this._rotmatrix,trans)
- this->_mat_optimize->optimize(*this->_rotmatrix,trans,*this->_calculator);
-
+
+ //ʱԝͣÌ3D΀֗ͮ©çսγɚӮ؊ðͶϚ
+ this->_rotmatrix->getPoint3dBatch(this->_offset.vertex,vertex_3d,4);
+ this->_transsolver->solveTransportVector(vertex_3d,trans);
+
+ //ͶϚ̋ʊÌ΅ԋɻ(սγɚӮ؊ÆʱԝγرÌ΅ԋɻ)
+ this->optimize(*this->_rotmatrix, trans,*this->_transsolver,this->_offset.vertex, vertex_2d);
+
// ĽħÊĎĘÌ֛Ѷ
- this->updateMatrixValue(*this->_rotmatrix,this->_offset.point,trans,o_result);
+ this->updateMatrixValue(*this->_rotmatrix, this->_offset.point, trans,o_result);
return;
}

@@ -133,48 +136,124 @@
this->transMat(i_square, i_direction, i_width, io_result_conv);
return;
}
+
//ͶϚذÉҸԟЮֱðω˺ɻ©χՔҲЮª
initVertexOrder(i_square, i_direction, sqvertex_ref,linear_ref);

-
- //ˮπ̩͠ðѝӨ
+
+ //սγɚӮ؊ͶϚ̀Ɂ2D΀֗ͮðĚĢħ
+ TNyARDoublePoint2d vertex_2d[4];
+ TNyARDoublePoint3d vertex_3d[4];
+ this->_ref_dist_factor->ideal2ObservBatch(sqvertex_ref, vertex_2d,4);
+ this->_transsolver->set2dVertex(vertex_2d,4);
+
+ //ˮπ̩͠Ì3D΀֗ͮðάЬ
this->_offset.setSquare(i_width,this->_center);

- // rotationð̩͠ЮֱðɪÂҏÌ֏ʷγرÅω˺ɻ
+ //ʱԝγرðͶϚ
this->_rotmatrix->initRotByPrevResult(io_result_conv);
+
+ //ʱԝͣÌ3D΀֗ͮ©çսγɚӮ؊ðͶϚ
+ this->_rotmatrix->getPoint3dBatch(this->_offset.vertex,vertex_3d,4);
+ this->_transsolver->solveTransportVector(vertex_3d,trans);

- //սγɚӮ؊ͶϚ̀ɁĉĴĚĢħҸԟðĚĢħ
- this->_calculator->setOffsetSquare(&this->_offset);
-
- //սγɚӮ؊ͶϚ̀ɁԋɞѦ̩͠ÌЮֱðĚĢħ
- this->_calculator->setFittedSquare(sqvertex_ref);
-
- //ʱԝγرÌսγɚӮ؊ÌͶϚ
- this->_calculator->calculateTransfer(*this->_rotmatrix,trans);
-
- //ͶϚ̋ʊÌ΅ԋɻ(this._rotmatrix,trans)
- const double err=this->_mat_optimize->optimize(*this->_rotmatrix,trans,*this->_calculator);
-
- //ͶϚ̋ʊð֛Ѷ
- this->updateMatrixValue(*this->_rotmatrix,this->_offset.point, trans,io_result_conv);
-
- // ćɛӬª˖إՍɍÅȯêÎTransMatðâèҼµ
- if (err > AR_GET_TRANS_CONT_MAT_MAX_FIT_ERROR) {
- // rotationð̩͠ЮֱÅω˺ɻ
+ //̻ΝÌćɛ̛ħðͶϚµÄ¨­
+ double min_err=errRate(*this->_rotmatrix,trans, this->_offset.vertex, vertex_2d,4,vertex_3d);
+ NyARDoubleMatrix33& rot=this->__rot;
+ //ćɛ̛ħª臒lҴ¦Ä½çāđăÓ
+ if(min_err<FIT_DIFF_THRESHOLD_CONT){
+ rot.setValue(*this->_rotmatrix);
+ //΅ԋɻµÄÝé‚
+ for (int i = 0;i<5; i++) {
+ //֏ʷγرÌ΅ԋɻ
+ this->_mat_optimize->modifyMatrix(rot, trans, this->_offset.vertex, vertex_2d, 4);
+ double err=errRate(rot,trans,this->_offset.vertex, vertex_2d,4,vertex_3d);
+ //System.out.println("E:"+err);
+ if(min_err-err<FIT_DIFF_THRESHOLD){
+ //System.out.println("BREAK");
+ break;
+ }
+ this->_transsolver->solveTransportVector(vertex_3d, trans);
+ this->_rotmatrix->setValue(rot);
+ min_err=err;
+ }
+ this->updateMatrixValue(*this->_rotmatrix, this->_offset.point, trans,io_result_conv);
+ }else{
+ //ʱԝγرðͶϚ
this->_rotmatrix->initRotBySquare(linear_ref,sqvertex_ref);
- //ʱԝγرÌսγɚӮ؊ÌͶϚ
- this->_calculator->calculateTransfer(*this->_rotmatrix,trans);
- //ͶϚ̋ʊÌ΅ԋɻ(this._rotmatrix,trans)
- const double err2=this->_mat_optimize->optimize(*this->_rotmatrix,trans,*this->_calculator);
- //ćɛӬªӡ©Á½çӬðͷʷ¦
- if (err2 < err) {
- // ؇¢ӬªϦê½çͷʷ¦
- this->updateMatrixValue(*this->_rotmatrix,this->_offset.point, trans,io_result_conv);
- }
+
+ //ʱԝͣÌ3D΀֗ͮ©çսγɚӮ؊ðͶϚ
+ this->_rotmatrix->getPoint3dBatch(this->_offset.vertex,vertex_3d,4);
+ this->_transsolver->solveTransportVector(vertex_3d,trans);
+
+ //ͶϚ̋ʊÌ΅ԋɻ(սγɚӮ؊ÆʱԝγرÌ΅ԋɻ)
+ this->optimize(*this->_rotmatrix, trans,*this->_transsolver,this->_offset.vertex, vertex_2d);
+ this->updateMatrixValue(*this->_rotmatrix, this->_offset.point, trans,io_result_conv);
}
return;
}
+ double NyARTransMat::optimize(NyARRotMatrix& io_rotmat,TNyARDoublePoint3d& io_transvec,const INyARTransportVectorSolver& i_solver,TNyARDoublePoint3d i_offset_3d[],TNyARDoublePoint2d i_2d_vertex[])
+ {
+ //System.out.println("START");
+ //printf("[ST]\n");
+ TNyARDoublePoint3d vertex_3d[4];
+ //ω˺ÌćɛӬðͶϚ
+ double min_err=errRate(io_rotmat, io_transvec, i_offset_3d, i_2d_vertex,4,vertex_3d);
+ NyARDoubleMatrix33& rot=this->__rot;
+ rot.setValue(io_rotmat);
+ for (int i = 0;i<5; i++) {
+ //֏ʷγرÌ΅ԋɻ
+ this->_mat_optimize->modifyMatrix(rot, io_transvec, i_offset_3d, i_2d_vertex, 4);
+ double err=errRate(rot,io_transvec, i_offset_3d, i_2d_vertex,4,vertex_3d);
+ //System.out.println("E:"+err);
+ //printf("[E:]%f\n",err);
+ if(min_err-err<FIT_DIFF_THRESHOLD){
+ //printf("[BK]\n");
+ //System.out.println("BREAK");
+ break;
+ }
+ i_solver.solveTransportVector(vertex_3d, io_transvec);
+ io_rotmat.setValue(rot);
+ min_err=err;
+ }
+ //System.out.println("END");
+ //printf("[ED]\n");
+ return min_err;
+ }
+
+ //ćɛ̛ħͶϚ̀
+ double NyARTransMat::errRate(const NyARDoubleMatrix33& io_rot,const TNyARDoublePoint3d& i_trans, TNyARDoublePoint3d i_vertex3d[], TNyARDoublePoint2d i_vertex2d[],int i_number_of_vertex,TNyARDoublePoint3d o_rot_vertex[])
+ {
+ const NyARPerspectiveProjectionMatrix& cp = *this->_projection_mat_ref;
+ double cp00=cp.m00;
+ double cp01=cp.m01;
+ double cp02=cp.m02;
+ double cp11=cp.m11;
+ double cp12=cp.m12;

+ double err=0;
+ for(int i=0;i<i_number_of_vertex;i++){
+ double x3d,y3d,z3d;
+ o_rot_vertex[i].x=x3d=io_rot.m00*i_vertex3d[i].x+io_rot.m01*i_vertex3d[i].y+io_rot.m02*i_vertex3d[i].z;
+ o_rot_vertex[i].y=y3d=io_rot.m10*i_vertex3d[i].x+io_rot.m11*i_vertex3d[i].y+io_rot.m12*i_vertex3d[i].z;
+ o_rot_vertex[i].z=z3d=io_rot.m20*i_vertex3d[i].x+io_rot.m21*i_vertex3d[i].y+io_rot.m22*i_vertex3d[i].z;
+ x3d+=i_trans.x;
+ y3d+=i_trans.y;
+ z3d+=i_trans.z;
+
+ //ϋʥ֏ʷ
+ double x2d=x3d*cp00+y3d*cp01+z3d*cp02;
+ double y2d=y3d*cp11+z3d*cp12;
+ double h2d=z3d;
+
+ //ćɛ̛ħͶϚ
+ double t1=i_vertex2d[i].x-x2d/h2d;
+ double t2=i_vertex2d[i].y-y2d/h2d;
+ err+=t1*t1+t2*t2;
+
+ }
+ return err/i_number_of_vertex;
+ }
void NyARTransMat::updateMatrixValue(const NyARRotMatrix& i_rot,const TNyARDoublePoint3d& i_off, const TNyARDoublePoint3d& i_trans,NyARTransMatResult& o_result)
{
o_result.m00=i_rot.m00;
@@ -191,7 +270,6 @@
o_result.m21 = i_rot.m21;
o_result.m22 = i_rot.m22;
o_result.m23 = i_rot.m20 * i_off.x + i_rot.m21 * i_off.y + i_rot.m22 * i_off.z + i_trans.z;
- o_result.angle.setValue(i_rot.refAngle());
o_result.has_value = true;
return;
}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRotMatrix.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRotMatrix.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRotMatrix.cpp (revision 335)
@@ -1,29 +1,121 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARRotMatrix.h"
+#include "nyarcore.h"
+namespace NyARToolkitCPP
+{
+ NyARRotMatrix::NyARRotMatrix(const NyARPerspectiveProjectionMatrix* i_matrix)
+ {
+ this->__initRot_vec1=new NyARRotVector(i_matrix);
+ this->__initRot_vec2=new NyARRotVector(i_matrix);
+ return;
+ }
+ NyARRotMatrix::~NyARRotMatrix()
+ {
+ NyAR_SAFE_DELETE(this->__initRot_vec1);
+ NyAR_SAFE_DELETE(this->__initRot_vec2);
+ }
+ void NyARRotMatrix::initRotByPrevResult(const NyARTransMatResult& i_prev_result)
+ {
+ this->m00=i_prev_result.m00;
+ this->m01=i_prev_result.m01;
+ this->m02=i_prev_result.m02;

+ this->m10=i_prev_result.m10;
+ this->m11=i_prev_result.m11;
+ this->m12=i_prev_result.m12;
+
+ this->m20=i_prev_result.m20;
+ this->m21=i_prev_result.m21;
+ this->m22=i_prev_result.m22;
+ return;
+ }
+ void NyARRotMatrix::initRotBySquare(const TNyARLinear* i_linear[],const TNyARDoublePoint2d* i_sqvertex[])
+ {
+ NyARRotVector& vec1=*this->__initRot_vec1;
+ NyARRotVector& vec2=*this->__initRot_vec2;
+
+ //ͼ©¢͇Á½֓©çÑ׻ÌĸĎħËðͶϚ
+
+ //βÐ
+ vec1.exteriorProductFromLinear(*i_linear[0], *i_linear[2]);
+ vec1.checkVectorByVertex(*i_sqvertex[0], *i_sqvertex[1]);
+
+ //βÑ
+ vec2.exteriorProductFromLinear(*i_linear[1], *i_linear[3]);
+ vec2.checkVectorByVertex(*i_sqvertex[3], *i_sqvertex[0]);
+
+ //ʱԝÌ΅ԋɻˆ
+ NyARRotVector::checkRotation(vec1,vec2);
+
+ this->m00 =vec1.v1;
+ this->m10 =vec1.v2;
+ this->m20 =vec1.v3;
+ this->m01 =vec2.v1;
+ this->m11 =vec2.v2;
+ this->m21 =vec2.v3;
+
+ //΅ͣÌβðͶϚ
+ double w02 = vec1.v2 * vec2.v3 - vec1.v3 * vec2.v2;
+ double w12 = vec1.v3 * vec2.v1 - vec1.v1 * vec2.v3;
+ double w22 = vec1.v1 * vec2.v2 - vec1.v2 * vec2.v1;
+ double w = sqrt(w02 * w02 + w12 * w12 + w22 * w22);
+ this->m02 = w02/w;
+ this->m12 = w12/w;
+ this->m22 = w22/w;
+ return;
+ }
+ void NyARRotMatrix::getPoint3d(const TNyARDoublePoint3d& i_in_point,TNyARDoublePoint3d& i_out_point)const
+ {
+ double x=i_in_point.x;
+ double y=i_in_point.y;
+ double z=i_in_point.z;
+ i_out_point.x=this->m00 * x + this->m01 * y + this->m02 * z;
+ i_out_point.y=this->m10 * x + this->m11 * y + this->m12 * z;
+ i_out_point.z=this->m20 * x + this->m21 * y + this->m22 * z;
+ return;
+ }
+ /**
+ * աДÌҸԟðɪʇµÄ֏ʷ·é
+ * @param i_in_point
+ * @param i_out_point
+ * @param i_number_of_vertex
+ */
+ void NyARRotMatrix::getPoint3dBatch(const TNyARDoublePoint3d i_in_point[],TNyARDoublePoint3d i_out_point[],int i_number_of_vertex)const
+ {
+ for(int i=i_number_of_vertex-1;i>=0;i--){
+ TNyARDoublePoint3d& out_ptr=i_out_point[i];
+ const TNyARDoublePoint3d& in_ptr=i_in_point[i];
+ double x=in_ptr.x;
+ double y=in_ptr.y;
+ double z=in_ptr.z;
+ out_ptr.x=this->m00 * x + this->m01 * y + this->m02 * z;
+ out_ptr.y=this->m10 * x + this->m11 * y + this->m12 * z;
+ out_ptr.z=this->m20 * x + this->m21 * y + this->m22 * z;
+ }
+ return;
+ }
+}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARLabelInfo.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARLabelInfo.cpp (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARLabelInfo.cpp (revision 335)
@@ -0,0 +1,29 @@
+/*
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
+#include "NyARLabelInfo.h"
+namespace NyARToolkitCPP
+{
+}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARSquareDetector_Rle.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARSquareDetector_Rle.cpp (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARSquareDetector_Rle.cpp (revision 335)
@@ -0,0 +1,143 @@
+/*
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
+
+
+
+#include "NyARSquareDetector_Rle.h"
+#include "NyARLabelingImage.h"
+
+#include "INyARPca2d.h"
+#include "NyARLabelingLabelStack.h"
+#include "../utils/NyArray.h"
+#include "nyarcore.h"
+#include <cstring>
+#include <cstdio>
+namespace NyARToolkitCPP
+{
+
+#define VERTEX_FACTOR 1.0// Ѽ̟ЯÌĴĀĎĞ
+#define AR_AREA_MAX 100000// #define AR_AREA_MAX 100000
+#define AR_AREA_MIN 70// #define AR_AREA_MIN 70
+
+
+ NyARSquareDetector_Rle::NyARSquareDetector_Rle(const NyARCameraDistortionFactor& i_dist_factor_ref,const TNyARIntSize& i_size)
+ {
+ this->_width = i_size.w;
+ this->_height = i_size.h;
+ this->_labeling = new NyARLabeling_Rle(this->_width,this->_height);
+ this->_labeling->setAreaRange(AR_AREA_MAX, AR_AREA_MIN);
+ this->_sqconvertor=new SquareContourDetector(i_size,i_dist_factor_ref);
+ this->_stack=new RleLabelFragmentInfoStack(i_size.w*i_size.h*2048/(320*240)+32);//̟Яʂ՜È΅ҥÉĸËД
+ this->_overlap_checker = new LabelOverlapChecker<RleLabelFragmentInfo>(32);
+
+ // ؖ˳Ì΅ҥҷÍʦ׊Éʦè¤é΅ҥÌҷֻ͠Ĕăę‚
+ int number_of_coord = (this->_width + this->_height) * 2;
+ // ؖ˳įĢĴĀÍҸԟ֏ʷð·éÌŁؖ˳įĢĴĀÌÑջϦé‚
+ this->_max_coord = number_of_coord;
+ this->_xcoord = new int[number_of_coord * 2];
+ this->_ycoord = new int[number_of_coord * 2];
+ return;
+ }
+ NyARSquareDetector_Rle::~NyARSquareDetector_Rle()
+ {
+ NyAR_SAFE_DELETE(this->_overlap_checker);
+ NyAR_SAFE_DELETE(this->_labeling);
+ NyAR_SAFE_DELETE(this->_sqconvertor);
+ NyAR_SAFE_DELETE(this->_stack);
+ NyAR_SAFE_DELETE(this->_xcoord);
+ NyAR_SAFE_DELETE(this->_ycoord);
+ return;
+ }
+ void NyARSquareDetector_Rle::detectMarker(const NyARBinRaster& i_raster, NyARSquareStack& o_square_stack)
+ {
+ RleLabelFragmentInfoStack& flagment=*this->_stack;
+ LabelOverlapChecker<RleLabelFragmentInfo>* overlap = this->_overlap_checker;
+
+ // Ľ›Ċ›ĺËğðÊĚĢħ
+ o_square_stack.clear();
+
+ // ÉĸËДª0Èç±±ÜÅ
+ const int label_num=this->_labeling->labeling(i_raster, 0, i_raster.getHeight(), flagment);
+ if (label_num < 1) {
+ return;
+ }
+ //ÉĸËðĜ›ħµÄ¨­
+ flagment.sortByArea();
+ //ÉĸËÊĘħðϦӾ
+ RleLabelFragmentInfo** labels=flagment.getArray().item;
+
+ const int xsize = this->_width;
+ const int ysize = this->_height;
+ int* xcoord = this->_xcoord;
+ int* ycoord = this->_ycoord;
+ const int coord_max = this->_max_coord;
+
+
+ //ФÈèĠĆĢĊÌ΅ҥДðѝӨ
+ overlap->setMaxLabels(label_num);
+
+ for (int i=0; i < label_num; i++) {
+ const RleLabelFragmentInfo& label_pt=*labels[i];
+ const int label_area = label_pt.area;
+
+ // ĎÊĢĶ،ɦªʦ׊Ì٧ÉњµÄ¢êÎϜˏ
+ if (label_pt.clip_l == 0 || label_pt.clip_r == xsize-1){
+ continue;
+ }
+ if (label_pt.clip_t == 0 || label_pt.clip_b == ysize-1){
+ continue;
+ }
+ // ˹É̟Я³ê½̩͠ÆÌФÈèð˭Ն
+ if (!overlap->check(label_pt)) {
+ // ФÈÁÄ¢é椾‚
+ continue;
+ }
+
+ // ؖ˳ðϦӾ
+ const int coord_num = _cpickup->getContour(i_raster,label_pt.entry_x,label_pt.clip_t, coord_max, xcoord, ycoord);
+ if (coord_num == coord_max) {
+ // ؖ˳ªҥ«·¬é‚
+ continue;
+ }
+ //ؖ˳ժэذÉг̋ɻ·é‚
+ const int vertex1 = SquareContourDetector::normalizeCoord(xcoord, ycoord, coord_num);
+
+ //±±©çѦªؖ˳ժэ
+ NyARSquare* square_ptr = o_square_stack.prePush();
+ if(!this->_sqconvertor->coordToSquare(xcoord,ycoord,vertex1,coord_num,label_area,*square_ptr)){
+ o_square_stack.pop();// ҸԟÌϦӾªЯ׈È©Á½ÌÅժ˼
+ continue;
+ }
+ // ̟ЯΏÌ̩͠ÌѮµ½ÉĸËðФÈèĠĆĢĎÉӇʁ·é‚
+ overlap->push(&label_pt);
+ }
+ return;
+ }
+
+
+
+
+}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRotTransOptimize_O2.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRotTransOptimize_O2.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRotTransOptimize_O2.cpp (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARRotTransOptimize_O2.h"
#include <cmath>
#define AR_GET_TRANS_MAT_MAX_LOOP_COUNT 5
@@ -38,28 +36,8 @@
this->_projection_mat_ref=i_projection_mat_ref;
return;
}
- double NyARRotTransOptimize_O2::optimize(NyARRotMatrix& io_rotmat,TNyARDoublePoint3d& io_transvec,const NyARFitVecCalculator& i_calculator)const
+ double NyARRotTransOptimize_O2::modifyMatrix(NyARRotMatrix_ARToolKit& io_rot,TNyARDoublePoint3d& trans,const TNyARDoublePoint3d i_vertex3d[], const TNyARDoublePoint2d i_vertex2d[])const
{
- const TNyARDoublePoint2d* fit_vertex=i_calculator.getFitSquare();
- const TNyARDoublePoint3d* offset_square=i_calculator.getOffsetVertex()->vertex;
-
- double err = -1;
- /*˛ĶðԲ¯éĞăľÓďðARToolKitÆ͇í¹é½ßÉ֏ȱƵÄÜ·‚*/
- for (int i = 0;; i++) {
- // <arGetTransMat3>
- err = modifyMatrix(io_rotmat,io_transvec,offset_square,fit_vertex);
- i_calculator.calculateTransfer(io_rotmat, io_transvec);
- err = modifyMatrix(io_rotmat,io_transvec,offset_square,fit_vertex);
- // //</arGetTransMat3>
- if (err < AR_GET_TRANS_MAT_MAX_FIT_ERROR || i == AR_GET_TRANS_MAT_MAX_LOOP_COUNT-1) {
- break;
- }
- i_calculator.calculateTransfer(io_rotmat, io_transvec);
- }
- return err;
- }
- double NyARRotTransOptimize_O2::modifyMatrix(NyARRotMatrix& io_rot,TNyARDoublePoint3d& trans,const TNyARDoublePoint3d i_vertex3d[], const TNyARDoublePoint2d i_vertex2d[])const
- {
double factor;
double a2, b2, c2;
double h, x, y;
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARIntRectStack.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARIntRectStack.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARIntRectStack.cpp (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARIntRectStack.h"
namespace NyARToolkitCPP
{
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARDoubleMatrixProcessor.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARDoubleMatrixProcessor.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARDoubleMatrixProcessor.cpp (revision 335)
@@ -1,32 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
-
-
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
namespace NyARToolkitCPP
{

Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARDoubleMatrix22.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARDoubleMatrix22.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARDoubleMatrix22.cpp (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARDoubleMatrix22.h"
namespace NyARToolkitCPP
{
@@ -44,4 +42,22 @@
o_value[4]=this->m11;
return;
}
+ bool NyARDoubleMatrix22::inverse(const NyARDoubleMatrix22& i_src)
+ {
+ double a11,a12,a21,a22;
+ a11=i_src.m00;
+ a12=i_src.m01;
+ a21=i_src.m10;
+ a22=i_src.m11;
+ double det=a11*a22-a12*a21;
+ if(det==0){
+ return false;
+ }
+ det=1/det;
+ this->m00=a22*det;
+ this->m01=-a12*det;
+ this->m10=a21*det;
+ this->m11=-a11*det;
+ return true;
+ }
}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARRgbRaster.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARRgbRaster.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARRgbRaster.cpp (revision 335)
@@ -1,2 +1,27 @@
+/*
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "nyarcore.h"
#include "INyARRgbRaster.h"
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARBufferReader.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARBufferReader.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARBufferReader.cpp (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "INyARBufferReader.h"
namespace NyARToolkitCPP
{
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARRasterFilter_RgbToBin.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARRasterFilter_RgbToBin.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARRasterFilter_RgbToBin.cpp (revision 335)
@@ -1,3 +1,28 @@
+/*
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "INyARRasterFilter_RgbToBin.h"

namespace NyARToolkitCPP
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRgbPixelReader_INT1D_GRAY_8.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRgbPixelReader_INT1D_GRAY_8.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRgbPixelReader_INT1D_GRAY_8.cpp (revision 335)
@@ -2,31 +2,30 @@
* PROJECT: NyARToolkitCPP
* --------------------------------------------------------------------------------
*
-* The NyARToolkitCS is C++ version NyARToolkit class library.
-*
-* Copyright (C)2008 R.Iizuka
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
*
-* 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 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 3 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 framework; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For further information please contact.
* http://nyatla.jp/nyatoolkit/
-* <airmail(at)ebony.plala.or.jp>
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
*
*/

#include "NyARRgbPixelReader_INT1D_GRAY_8.h"
+#include "NyARException.h"
namespace NyARToolkitCPP
{

@@ -52,6 +51,13 @@
}
return;
}
+ void NyARRgbPixelReader_INT1D_GRAY_8::setPixel(int i_x, int i_y, const int* i_rgb)
+ {
+ NyARException::notImplement();
+ }
+ void NyARRgbPixelReader_INT1D_GRAY_8::setPixels(const int* i_x, const int* i_y, int i_num, const int* i_intrgb)
+ {
+ NyARException::notImplement();
+ }

-
}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARColorPatt_O3.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARColorPatt_O3.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARColorPatt_O3.cpp (revision 335)
@@ -1,3 +1,28 @@
+/*
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARColorPatt_O3.h"
#include "nyarcore.h"
#include <cstring>
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARDetectMarker.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARDetectMarker.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARDetectMarker.cpp (revision 335)
@@ -2,34 +2,31 @@
* PROJECT: NyARToolkitCPP
* --------------------------------------------------------------------------------
*
-* The NyARToolkitCS is C++ version NyARToolkit class library.
-*
-* Copyright (C)2008 R.Iizuka
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
*
-* 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 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 3 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 framework; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For further information please contact.
* http://nyatla.jp/nyatoolkit/
-* <airmail(at)ebony.plala.or.jp>
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
*
*/
#include "NyARDetectMarker.h"
+#include "nyarcore.h"
namespace NyARToolkitCPP
{
- NyARDetectMarker::NyARDetectMarker(void)
- {
- }

-}
\ No newline at end of file
+
+}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARCode.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARCode.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARCode.cpp (revision 335)
@@ -2,27 +2,25 @@
* PROJECT: NyARToolkitCPP
* --------------------------------------------------------------------------------
*
-* The NyARToolkitCS is C++ version NyARToolkit class library.
-*
-* Copyright (C)2008 R.Iizuka
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
*
-* 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 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 3 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 framework; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For further information please contact.
* http://nyatla.jp/nyatoolkit/
-* <airmail(at)ebony.plala.or.jp>
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
*
*/
#include <cstdio>
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/ContourPickup.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/ContourPickup.cpp (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/ContourPickup.cpp (revision 335)
@@ -0,0 +1,251 @@
+/*
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
+#include "nyarcore.h"
+#include "ContourPickup.h"
+#include "NyARVertexCounter.h"
+#include "NyAR_types.h"
+#include "INyARPca2d.h"
+#include "NyARLabelingImage.h"
+#include "NyARBinRaster.h"
+
+namespace NyARToolkitCPP
+{
+ //τʱϑІÅ«éæ¤Éĥ›ĵËðԱФɻ
+ // 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6
+ const static int _getContour_xdir[15] = { 0, 1, 1, 1, 0,-1,-1,-1 , 0, 1, 1, 1, 0,-1,-1};
+ const static int _getContour_ydir[15] = {-1,-1, 0, 1, 1, 1, 0,-1 ,-1,-1, 0, 1, 1, 1, 0};
+
+
+ int ContourPickup::getContour(const NyARBinRaster& i_raster,int i_entry_x,int i_entry_y,int i_array_size,int* o_coord_x,int* o_coord_y)
+ {
+ const int* xdir = _getContour_xdir;// static int xdir[8] = { 0, 1, 1, 1, 0,-1,-1,-1};
+ const int* ydir = _getContour_ydir;// static int ydir[8] = {-1,-1, 0, 1, 1, 1, 0,-1};
+
+ int* i_buf=(int*)i_raster.getBufferReader().getBuffer();
+ int width=i_raster.getWidth();
+ int height=i_raster.getHeight();
+ //ĎÊĢĶ،ɦÌУӛÉњµÄ¢éļăÓħðӾé‚
+
+
+ int coord_num = 1;
+ o_coord_x[0] = i_entry_x;
+ o_coord_y[0] = i_entry_y;
+ int dir = 5;
+
+ int c = i_entry_x;
+ int r = i_entry_y;
+ for (;;) {
+ dir = (dir + 5) % 8;//dirÌг̋ɻ
+ //±±Í˦ңêÎàÁÆ΅ԋɻÅ«éÆ϶¤æ‚
+ //4̷ɈˏÌ˫˅њӮÌЪ͇Ɂ˫˅ĠĆĢĎðЈת·éƩ˂
+ if(c>=1 && c<width-1 && r>=1 && r<height-1){
+ for(;;){//gotoÌćľÅ̛ħذÌforն
+ //˫˅ÉњµÄ¢È¢Æ«
+ if (i_buf[(r + ydir[dir])*width+(c + xdir[dir])] == 0) {
+ break;
+ }
+ dir++;
+ if (i_buf[(r + ydir[dir])*width+(c + xdir[dir])] == 0) {
+ break;
+ }
+ dir++;
+ if (i_buf[(r + ydir[dir])*width+(c + xdir[dir])] == 0) {
+ break;
+ }
+ dir++;
+ if (i_buf[(r + ydir[dir])*width+(c + xdir[dir])] == 0) {
+ break;
+ }
+ dir++;
+ if (i_buf[(r + ydir[dir])*width+(c + xdir[dir])] == 0) {
+ break;
+ }
+ dir++;
+ if (i_buf[(r + ydir[dir])*width+(c + xdir[dir])] == 0) {
+ break;
+ }
+ dir++;
+ if (i_buf[(r + ydir[dir])*width+(c + xdir[dir])] == 0) {
+ break;
+ }
+ dir++;
+ if (i_buf[(r + ydir[dir])*width+(c + xdir[dir])] == 0) {
+ break;
+ }
+ /*
+ try{
+ BufferedImage b=new BufferedImage(width,height,ColorSpace.TYPE_RGB);
+ NyARRasterImageIO.copy(i_raster, b);
+ ImageIO.write(b,"png",new File("bug.png"));
+ }catch(Exception e){
+
+ }*/
+ //8ֻͼғÄҲ×½¯ÇÉĸ˪ֳ¢æˆ
+ throw NyARException();
+ }
+ }else{
+ //˫˅ÉњµÄ¢éÆ«
+ int i;
+ for (i = 0; i < 8; i++){
+ const int x=c + xdir[dir];
+ const int y=r + ydir[dir];
+ //˫˅ĠĆĢĎ
+ if(x>=0 && x<width && y>=0 && y<height){
+ if (i_buf[(y)*width+(x)] == 0) {
+ break;
+ }
+ }
+ dir++;//ջҷĥ›ĵËðϑІ·éÌÅעҨȵ
+ }
+ if (i == 8) {
+ //8ֻͼғÄҲ×½¯ÇÉĸ˪ֳ¢æˆ
+ throw NyARException();// return(-1);
+ }
+ }
+
+ dir=dir% 8;//dirÌг̋ɻ
+
+ // xcoordÆycoordðc,rÉà֛Ѷ
+ c = c + xdir[dir];
+ r = r + ydir[dir];
+ o_coord_x[coord_num] = c;
+ o_coord_y[coord_num] = r;
+ // Љ׹а̏ԻӨ
+ if (c == i_entry_x && r == i_entry_y){
+ coord_num++;
+ break;
+ }
+ coord_num++;
+ if (coord_num == i_array_size) {
+ //ؖ˳ª֖ӛÉӂµ½
+ return coord_num;
+ }
+ }
+ return coord_num;
+ }
+ int ContourPickup::getContour(const NyARLabelingImage& i_raster,int i_entry_x,int i_entry_y,int i_array_size,int* o_coord_x,int* o_coord_y)
+ {
+ const int* xdir = _getContour_xdir;// static int xdir[8] = { 0, 1, 1, 1, 0,-1,-1,-1};
+ const int* ydir = _getContour_ydir;// static int ydir[8] = {-1,-1, 0, 1, 1, 1, 0,-1};
+
+ const int* i_buf=(int*)i_raster.getBufferReader().getBuffer();
+ const int width=i_raster.getWidth();
+ const int height=i_raster.getHeight();
+ //ĎÊĢĶ،ɦÌУӛÉњµÄ¢éļăÓħðӾé‚
+ int sx=i_entry_x;
+ int sy=i_entry_y;
+
+ int coord_num = 1;
+ o_coord_x[0] = sx;
+ o_coord_y[0] = sy;
+ int dir = 5;
+
+ int c = o_coord_x[0];
+ int r = o_coord_y[0];
+ for (;;) {
+ dir = (dir + 5) % 8;//dirÌг̋ɻ
+ //±±Í˦ңêÎàÁÆ΅ԋɻÅ«éÆ϶¤æ‚
+ //4̷ɈˏÌ˫˅њӮÌЪ͇Ɂ˫˅ĠĆĢĎðЈת·éƩ˂
+ if(c>=1 && c<width-1 && r>=1 && r<height-1){
+ for(;;){//gotoÌćľÅ̛ħذÌforն
+ //˫˅ÉњµÄ¢È¢Æ«
+ if (i_buf[(r + ydir[dir])*width+(c + xdir[dir])] > 0) {
+ break;
+ }
+ dir++;
+ if (i_buf[(r + ydir[dir])*width+(c + xdir[dir])] > 0) {
+ break;
+ }
+ dir++;
+ if (i_buf[(r + ydir[dir])*width+(c + xdir[dir])] > 0) {
+ break;
+ }
+ dir++;
+ if (i_buf[(r + ydir[dir])*width+(c + xdir[dir])] > 0) {
+ break;
+ }
+ dir++;
+ if (i_buf[(r + ydir[dir])*width+(c + xdir[dir])] > 0) {
+ break;
+ }
+ dir++;
+ if (i_buf[(r + ydir[dir])*width+(c + xdir[dir])] > 0) {
+ break;
+ }
+ dir++;
+ if (i_buf[(r + ydir[dir])*width+(c + xdir[dir])] > 0) {
+ break;
+ }
+ dir++;
+ if (i_buf[(r + ydir[dir])*width+(c + xdir[dir])] > 0) {
+ break;
+ }
+ //8ֻͼғÄҲ×½¯ÇÉĸ˪ֳ¢æˆ
+ throw NyARException();
+ }
+ }else{
+ //˫˅ÉњµÄ¢éÆ«
+ int i;
+ for (i = 0; i < 8; i++){
+ const int x=c + xdir[dir];
+ const int y=r + ydir[dir];
+ //˫˅ĠĆĢĎ
+ if(x>=0 && x<width && y>=0 && y<height){
+ if (i_buf[(y)*width+(x)] > 0) {
+ break;
+ }
+ }
+ dir++;//ջҷĥ›ĵËðϑІ·éÌÅעҨȵ
+ }
+ if (i == 8) {
+ //8ֻͼғÄҲ×½¯ÇÉĸ˪ֳ¢æˆ
+ throw NyARException();// return(-1);
+ }
+ }
+
+ dir=dir% 8;//dirÌг̋ɻ
+
+ // xcoordÆycoordðc,rÉà֛Ѷ
+ c = c + xdir[dir];
+ r = r + ydir[dir];
+ o_coord_x[coord_num] = c;
+ o_coord_y[coord_num] = r;
+ // Љ׹а̏ԻӨ
+ if (c == sx && r == sy){
+ coord_num++;
+ break;
+ }
+ coord_num++;
+ if (coord_num == i_array_size) {
+ //ؖ˳ª֖ӛÉӂµ½
+ return coord_num;
+ }
+ }
+ return coord_num;
+ }
+
+}
+
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARObserv2IdealMap.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARObserv2IdealMap.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARObserv2IdealMap.cpp (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARObserv2IdealMap.h"
#include "nyarcore.h"
#include <cmath>
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARMatchPattDeviationBlackWhiteData.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARMatchPattDeviationBlackWhiteData.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARMatchPattDeviationBlackWhiteData.cpp (revision 335)
@@ -1,32 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
-
-
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
namespace NyARToolkitCPP
{

Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRotMatrix_ARToolKit_O2.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRotMatrix_ARToolKit_O2.cpp (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRotMatrix_ARToolKit_O2.cpp (revision 335)
@@ -0,0 +1,68 @@
+/*
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
+#include "NyARRotMatrix_ARToolKit_O2.h"
+#include <cmath>
+namespace NyARToolkitCPP
+{
+ NyARRotMatrix_ARToolKit_O2::NyARRotMatrix_ARToolKit_O2(const NyARPerspectiveProjectionMatrix* i_matrix):NyARRotMatrix_ARToolKit(i_matrix)
+ {
+ return;
+ }
+ /* ˖ДͷµҖ¦
+ */
+ void NyARRotMatrix_ARToolKit_O2::setAngle(double i_x,double i_y,double i_z)
+ {
+ const double sina = sin(i_x);
+ const double cosa = cos(i_x);
+ const double sinb = sin(i_y);
+ const double cosb = cos(i_y);
+ const double sinc = sin(i_z);
+ const double cosc = cos(i_z);
+ // Optimize
+ const double CACA = cosa * cosa;
+ const double SASA = sina * sina;
+ const double SACA = sina * cosa;
+ const double SASB = sina * sinb;
+ const double CASB = cosa * sinb;
+ const double SACACB = SACA * cosb;
+
+ this->m00 = CACA * cosb * cosc + SASA * cosc + SACACB * sinc - SACA * sinc;
+ this->m01 = -CACA * cosb * sinc - SASA * sinc + SACACB * cosc - SACA * cosc;
+ this->m02 = CASB;
+ this->m10 = SACACB * cosc - SACA * cosc + SASA * cosb * sinc + CACA * sinc;
+ this->m11 = -SACACB * sinc + SACA * sinc + SASA * cosb * cosc + CACA * cosc;
+ this->m12 = SASB;
+ this->m20 = -CASB * cosc - SASB * sinc;
+ this->m21 = CASB * sinc - SASB * cosc;
+ this->m22 = cosb;
+ //angleð̴ͶϚ¹¸ÉҼњңԼ
+ this->_angle.x=i_x;
+ this->_angle.y=i_y;
+ this->_angle.z=i_z;
+ return;
+ }
+
+}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRotMatrix_ARToolKit.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRotMatrix_ARToolKit.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRotMatrix_ARToolKit.cpp (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008-2009 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARRotMatrix_ARToolKit.h"
#include "NyARRotMatrix.h"
#include "NyARRotVector.h"
@@ -33,20 +31,15 @@
#include <cstdlib>
namespace NyARToolkitCPP
{
- NyARRotMatrix_ARToolKit::NyARRotMatrix_ARToolKit(const NyARPerspectiveProjectionMatrix* i_matrix)
+ NyARRotMatrix_ARToolKit::NyARRotMatrix_ARToolKit(const NyARPerspectiveProjectionMatrix* i_matrix):NyARRotMatrix(i_matrix)
{
- this->__initRot_vec1=new NyARRotVector(i_matrix);
- this->__initRot_vec2=new NyARRotVector(i_matrix);
return;
}
NyARRotMatrix_ARToolKit::~NyARRotMatrix_ARToolKit()
{
- NyAR_SAFE_DELETE(this->__initRot_vec1);
- NyAR_SAFE_DELETE(this->__initRot_vec2);
}
void NyARRotMatrix_ARToolKit::initRotByPrevResult(const NyARTransMatResult& i_prev_result)
{
-
this->m00=i_prev_result.m00;
this->m01=i_prev_result.m01;
this->m02=i_prev_result.m02;
@@ -62,38 +55,9 @@
}
void NyARRotMatrix_ARToolKit::initRotBySquare(const TNyARLinear* i_linear[],const TNyARDoublePoint2d* i_sqvertex[])
{
- NyARRotVector& vec1=*this->__initRot_vec1;
- NyARRotVector& vec2=*this->__initRot_vec2;
-
- //ͼ©¢͇Á½֓©çÑ׻ÌĸĎħËðͶϚ
-
- //βÐ
- vec1.exteriorProductFromLinear(*i_linear[0],*i_linear[2]);
- vec1.checkVectorByVertex(*i_sqvertex[0],*i_sqvertex[1]);
-
- //βÑ
- vec2.exteriorProductFromLinear(*i_linear[1],*i_linear[3]);
- vec2.checkVectorByVertex(*i_sqvertex[3],*i_sqvertex[0]);
-
- //ʱԝÌ΅ԋɻˆ
- NyARRotVector::checkRotation(vec1,vec2);
-
- this->m00 =vec1.v1;
- this->m10 =vec1.v2;
- this->m20 =vec1.v3;
- this->m01 =vec2.v1;
- this->m11 =vec2.v2;
- this->m21 =vec2.v3;
-
- //΅ͣÌβðͶϚ
- const double w02 = vec1.v2 * vec2.v3 - vec1.v3 * vec2.v2;
- const double w12 = vec1.v3 * vec2.v1 - vec1.v1 * vec2.v3;
- const double w22 = vec1.v1 * vec2.v2 - vec1.v2 * vec2.v1;
- const double w = sqrt(w02 * w02 + w12 * w12 + w22 * w22);
- this->m02 = w02/w;
- this->m12 = w12/w;
- this->m22 = w22/w;
- updateAngleFromMatrix();
+ NyARRotMatrix::initRotBySquare(i_linear,i_sqvertex);
+ //Matrix©çangleð͛Ĩ
+ this->updateAngleFromMatrix();
return;
}
const TNyARDoublePoint3d& NyARRotMatrix_ARToolKit::refAngle()const
@@ -137,40 +101,7 @@
updateAngleFromMatrix();
return;
}
- /**
- * i_in_pointð֏ʷγرÅ΀֗֏ʷ·é‚
- * @param i_in_point
- * @param i_out_point
- */
- void NyARRotMatrix_ARToolKit::getPoint3d(const TNyARDoublePoint3d& i_in_point,TNyARDoublePoint3d& i_out_point)const
- {
- const double x=i_in_point.x;
- const double y=i_in_point.y;
- const double z=i_in_point.z;
- i_out_point.x=this->m00 * x + this->m01 * y + this->m02 * z;
- i_out_point.y=this->m10 * x + this->m11 * y + this->m12 * z;
- i_out_point.z=this->m20 * x + this->m21 * y + this->m22 * z;
- return;
- }
- /**
- * աДÌҸԟðɪʇµÄ֏ʷ·é
- * @param i_in_point
- * @param i_out_point
- * @param i_number_of_vertex
- */
- void NyARRotMatrix_ARToolKit::getPoint3dBatch(const TNyARDoublePoint3d i_in_point[],TNyARDoublePoint3d i_out_point[],int i_number_of_vertex)const
- {
- for(int i=i_number_of_vertex-1;i>=0;i--){
- TNyARDoublePoint3d& out_ptr=i_out_point[i];
- const TNyARDoublePoint3d& in_ptr=i_in_point[i];
- out_ptr.x=this->m00 * in_ptr.x + this->m01 * in_ptr.y + this->m02 * in_ptr.z;
- out_ptr.y=this->m10 * in_ptr.x + this->m11 * in_ptr.y + this->m12 * in_ptr.z;
- out_ptr.z=this->m20 * in_ptr.x + this->m21 * in_ptr.y + this->m22 * in_ptr.z;
- }
- return;
- }

-
/* įď†m22ÍĚĢħΞÉ˭ӨÅ«éñ¶áȢ̈

*/
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRgbPixelReader_INT1D_X8R8G8B8_32.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRgbPixelReader_INT1D_X8R8G8B8_32.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRgbPixelReader_INT1D_X8R8G8B8_32.cpp (revision 335)
@@ -1,6 +1,31 @@
+/*
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARRgbPixelReader_INT1D_X8R8G8B8_32.h"
+#include "NyARException.h"

-
namespace NyARToolkitCPP
{
NyARRgbPixelReader_INT1D_X8R8G8B8_32::NyARRgbPixelReader_INT1D_X8R8G8B8_32(const TNyARIntSize* i_size,const int* i_buf)
@@ -29,5 +54,13 @@
}
return;
}
+ void NyARRgbPixelReader_INT1D_X8R8G8B8_32::setPixel(int i_x, int i_y, const int* i_rgb)
+ {
+ NyARException::notImplement();
+ }
+ void NyARRgbPixelReader_INT1D_X8R8G8B8_32::setPixels(const int* i_x, const int* i_y, int i_num, const int* i_intrgb)
+ {
+ NyARException::notImplement();
+ }
}

Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRgbRaster_BGRA.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRgbRaster_BGRA.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRgbRaster_BGRA.cpp (revision 335)
@@ -1,3 +1,28 @@
+/*
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "nyarcore.h"
#include "NyARRgbRaster_BGRA.h"
#include "NyARBufferReader.h"
@@ -6,11 +31,6 @@
{


- NyARRgbRaster_BGRA* NyARRgbRaster_BGRA::wrap(const NyAR_BYTE_t* i_buffer, int i_width, int i_height)
- {
- return new NyARRgbRaster_BGRA(i_buffer, i_width, i_height);
- }
-
NyARRgbRaster_BGRA::NyARRgbRaster_BGRA(const NyAR_BYTE_t* i_buffer, int i_width, int i_height):NyARRgbRaster_BasicClass(i_width,i_height)
{
this->_ref_buf = i_buffer;
@@ -18,13 +38,6 @@
this->_buffer_reader=new NyARBufferReader(i_buffer,INyARBufferReader::BUFFERFORMAT_BYTE1D_B8G8R8X8_32);
return;
}
- NyARRgbRaster_BGRA::NyARRgbRaster_BGRA(int i_width, int i_height):NyARRgbRaster_BasicClass(i_width,i_height)
- {
- this->_ref_buf =NULL;
- this->_rgb_reader = new PixelReader(this);
- this->_buffer_reader=new NyARBufferReader(NULL,INyARBufferReader::BUFFERFORMAT_BYTE1D_B8G8R8X8_32);
- return;
- }

NyARRgbRaster_BGRA::~NyARRgbRaster_BGRA(void)
{
@@ -41,11 +54,5 @@
{
return *(this->_buffer_reader);
}
- void NyARRgbRaster_BGRA::setBuffer(const NyAR_BYTE_t* i_buffer)
- {
- NyAR_ASSERT(i_buffer!=NULL);
- this->_ref_buf=i_buffer;
- this->_buffer_reader->setBuffer(i_buffer);
- }

}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARTransMatResult.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARTransMatResult.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARTransMatResult.cpp (revision 335)
@@ -1,31 +1,30 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARTransMatResult.h"
+#include <cmath>
namespace NyARToolkitCPP
{
NyARTransMatResult::NyARTransMatResult()
@@ -33,5 +32,31 @@
this->has_value=false;
return;
}
+ /**
+ * ±Ì˖Д́0-PIÌ˔ÅӬð֔µÜ·‚
+ * @param o_out
+ */
+ void NyARTransMatResult::getZXYAngle(TNyARDoublePoint3d& o_out)
+ {
+ double sina = this->m21;
+ if (sina >= 1.0)
+ {
+ o_out.x = NyAR_PI / 2;
+ o_out.y = 0;
+ o_out.z = atan2(-this->m10, this->m00);
+ }
+ else if (sina <= -1.0)
+ {
+ o_out.x = -NyAR_PI / 2;
+ o_out.y = 0;
+ o_out.z = atan2(-this->m10, this->m00);
+ }
+ else
+ {
+ o_out.x = asin(sina);
+ o_out.z = atan2(-this->m01, this->m11);
+ o_out.y = atan2(-this->m20, this->m22);
+ }
+ }

}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARTransOffset.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARTransOffset.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARTransOffset.cpp (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARTransOffset.h"

namespace NyARToolkitCPP
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARColorPatt_PseudoAffine.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARColorPatt_PseudoAffine.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARColorPatt_PseudoAffine.cpp (revision 335)
@@ -1,32 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
-
-
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
namespace NyARToolkitCPP
{

Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRaster.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRaster.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRaster.cpp (revision 335)
@@ -2,27 +2,25 @@
* PROJECT: NyARToolkitCPP
* --------------------------------------------------------------------------------
*
-* The NyARToolkitCS is C++ version NyARToolkit class library.
-*
-* Copyright (C)2008 R.Iizuka
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
*
-* 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 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 3 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 framework; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For further information please contact.
* http://nyatla.jp/nyatoolkit/
-* <airmail(at)ebony.plala.or.jp>
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
*
*/
#include "NyARRaster.h"
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARPca2d.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARPca2d.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARPca2d.cpp (revision 335)
@@ -1,29 +1,27 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "INyARPca2d.h"

Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/LabelOverlapChecker.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/LabelOverlapChecker.cpp (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/LabelOverlapChecker.cpp (revision 335)
@@ -0,0 +1,30 @@
+/*
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
+#include <LabelOverlapChecker.h>
+namespace NyARToolkitCPP
+{
+}
+
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARDoubleMatrix33.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARDoubleMatrix33.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARDoubleMatrix33.cpp (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARDoubleMatrix33.h"

namespace NyARToolkitCPP
@@ -46,7 +44,7 @@
this->m22=i_value[8];
return;
}
- void NyARDoubleMatrix33::getValue(double o_value[])const
+ void NyARDoubleMatrix33::getValue(double o_value[])const
{
o_value[0]=this->m00;
o_value[1]=this->m01;
@@ -59,4 +57,96 @@
o_value[8]=this->m22;
return;
}
+ void NyARDoubleMatrix33::setValue(const NyARDoubleMatrix33& i_value)
+ {
+ this->m00=i_value.m00;
+ this->m01=i_value.m01;
+ this->m02=i_value.m02;
+ this->m10=i_value.m10;
+ this->m11=i_value.m11;
+ this->m12=i_value.m12;
+ this->m20=i_value.m20;
+ this->m21=i_value.m21;
+ this->m22=i_value.m22;
+ return;
+ }
+ bool NyARDoubleMatrix33::inverse(const NyARDoubleMatrix33& i_src)
+ {
+ double a11,a12,a13,a21,a22,a23,a31,a32,a33;
+ double b11,b12,b13,b21,b22,b23,b31,b32,b33;
+ a11=i_src.m00;a12=i_src.m01;a13=i_src.m02;
+ a21=i_src.m10;a22=i_src.m11;a23=i_src.m12;
+ a31=i_src.m20;a32=i_src.m21;a33=i_src.m22;
+
+ b11=a22*a33-a23*a32;
+ b12=a32*a13-a33*a12;
+ b13=a12*a23-a13*a22;
+
+ b21=a23*a31-a21*a33;
+ b22=a33*a11-a31*a13;
+ b23=a13*a21-a11*a23;
+
+ b31=a21*a32-a22*a31;
+ b32=a31*a12-a32*a11;
+ b33=a11*a22-a12*a21;
+
+ double det_1=a11*b11+a21*b12+a31*b13;
+ if(det_1==0){
+ return false;
+ }
+ det_1=1/det_1;
+
+ this->m00=b11*det_1;
+ this->m01=b12*det_1;
+ this->m02=b13*det_1;
+
+ this->m10=b21*det_1;
+ this->m11=b22*det_1;
+ this->m12=b23*det_1;
+
+ this->m20=b31*det_1;
+ this->m21=b32*det_1;
+ this->m22=b33*det_1;
+
+ return true;
+ }
+ /**
+ * ±Ì˖Д́0-PIÌ˔ÅӬð֔µÜ·‚
+ * @param o_out
+ */
+ void NyARDoubleMatrix33::getZXYAngle(TNyARDoublePoint3d& o_out)const
+ {
+ double sina = this->m21;
+ if (sina >= 1.0) {
+ o_out.x = NyAR_PI / 2;
+ o_out.y = 0;
+ o_out.z = atan2(-this->m10, this->m00);
+ } else if (sina <= -1.0) {
+ o_out.x = -NyAR_PI / 2;
+ o_out.y = 0;
+ o_out.z = atan2(-this->m10, this->m00);
+ } else {
+ o_out.x = asin(sina);
+ o_out.z = atan2(-this->m01, this->m11);
+ o_out.y = atan2(-this->m20, this->m22);
+ }
+ }
+ void NyARDoubleMatrix33::setZXYAngle(double i_x, double i_y, double i_z)
+ {
+ double sina = sin(i_x);
+ double cosa = cos(i_x);
+ double sinb = sin(i_y);
+ double cosb = cos(i_y);
+ double sinc = sin(i_z);
+ double cosc = cos(i_z);
+ this->m00 = cosc * cosb - sinc * sina * sinb;
+ this->m01 = -sinc * cosa;
+ this->m02 = cosc * sinb + sinc * sina * cosb;
+ this->m10 = sinc * cosb + cosc * sina * sinb;
+ this->m11 = cosc * cosa;
+ this->m12 = sinc * sinb - cosc * sina * cosb;
+ this->m20 = -cosa * sinb;
+ this->m21 = sina;
+ this->m22 = cosb * cosa;
+ }
}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARDoubleMatrix34.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARDoubleMatrix34.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARDoubleMatrix34.cpp (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARDoubleMatrix34.h"

namespace NyARToolkitCPP
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARPartialDifferentiationOptimize.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARPartialDifferentiationOptimize.cpp (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARPartialDifferentiationOptimize.cpp (revision 335)
@@ -0,0 +1,358 @@
+/*
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
+#include "NyARPartialDifferentiationOptimize.h"
+#include <float.h>
+#include <cmath>
+#include <stdio.h>
+using namespace std;
+namespace NyARToolkitCPP
+{
+ NyARPartialDifferentiationOptimize::NyARPartialDifferentiationOptimize(const NyARPerspectiveProjectionMatrix* i_projection_mat_ref)
+ {
+ this->_projection_mat_ref = i_projection_mat_ref;
+ return;
+ }
+
+ void NyARPartialDifferentiationOptimize::sincos2Rotation_ZXY(const TSinCosValue (&i_sincos)[3],NyARDoubleMatrix33& i_rot_matrix)
+ {
+ double sina = i_sincos[0].sin_val;
+ double cosa = i_sincos[0].cos_val;
+ double sinb = i_sincos[1].sin_val;
+ double cosb = i_sincos[1].cos_val;
+ double sinc = i_sincos[2].sin_val;
+ double cosc = i_sincos[2].cos_val;
+ i_rot_matrix.m00 = cosc * cosb - sinc * sina * sinb;
+ i_rot_matrix.m01 = -sinc * cosa;
+ i_rot_matrix.m02 = cosc * sinb + sinc * sina * cosb;
+ i_rot_matrix.m10 = sinc * cosb + cosc * sina * sinb;
+ i_rot_matrix.m11 = cosc * cosa;
+ i_rot_matrix.m12 = sinc * sinb - cosc * sina * cosb;
+ i_rot_matrix.m20 = -cosa * sinb;
+ i_rot_matrix.m21 = sina;
+ i_rot_matrix.m22 = cosb * cosa;
+ }
+
+ void NyARPartialDifferentiationOptimize::rotation2Sincos_ZXY(const NyARDoubleMatrix33& i_rot_matrix, TSinCosValue (&o_out)[3],TNyARDoublePoint3d& o_ang)
+ {
+ double x, y, z;
+ double sina = i_rot_matrix.m21;
+ if (sina >= 1.0) {
+ x = NyAR_PI / 2;
+ y = 0;
+ z = atan2(-i_rot_matrix.m10, i_rot_matrix.m00);
+ } else if (sina <= -1.0) {
+ x = -NyAR_PI / 2;
+ y = 0;
+ z = atan2(-i_rot_matrix.m10, i_rot_matrix.m00);
+ } else {
+ x = asin(sina);
+ y = atan2(-i_rot_matrix.m20, i_rot_matrix.m22);
+ z = atan2(-i_rot_matrix.m01, i_rot_matrix.m11);
+ }
+ o_ang.x=x;
+ o_ang.y=y;
+ o_ang.z=z;
+ o_out[0].sin_val = sin(x);
+ o_out[0].cos_val = cos(x);
+ o_out[1].sin_val = sin(y);
+ o_out[1].cos_val = cos(y);
+ o_out[2].sin_val = sin(z);
+ o_out[2].cos_val = cos(z);
+ return;
+ }
+
+ /*
+ * ϋʥ֏ʷή ˮ׻ή ox=(cosc * cosb - sinc * sina * sinb)*ix+(-sinc * cosa)*iy+(cosc * sinb + sinc * sina * cosb)*iz+i_trans.x; oy=(sinc * cosb + cosc * sina *
+ * sinb)*ix+(cosc * cosa)*iy+(sinc * sinb - cosc * sina * cosb)*iz+i_trans.y; oz=(-cosa * sinb)*ix+(sina)*iy+(cosb * cosa)*iz+i_trans.z;
+ *
+ * double ox=(cosc * cosb)*ix+(-sinc * sina * sinb)*ix+(-sinc * cosa)*iy+(cosc * sinb)*iz + (sinc * sina * cosb)*iz+i_trans.x; double oy=(sinc * cosb)*ix
+ * +(cosc * sina * sinb)*ix+(cosc * cosa)*iy+(sinc * sinb)*iz+(- cosc * sina * cosb)*iz+i_trans.y; double oz=(-cosa * sinb)*ix+(sina)*iy+(cosb *
+ * cosa)*iz+i_trans.z;
+ *
+ * sina,cosaÉ¢Äʰ­ cx=(cp00*(-sinc*sinb*ix+sinc*cosb*iz)+cp01*(cosc*sinb*ix-cosc*cosb*iz)+cp02*(iy))*sina
+ * +(cp00*(-sinc*iy)+cp01*((cosc*iy))+cp02*(-sinb*ix+cosb*iz))*cosa
+ * +(cp00*(i_trans.x+cosc*cosb*ix+cosc*sinb*iz)+cp01*((i_trans.y+sinc*cosb*ix+sinc*sinb*iz))+cp02*(i_trans.z));
+ * cy=(cp11*(cosc*sinb*ix-cosc*cosb*iz)+cp12*(iy))*sina +(cp11*((cosc*iy))+cp12*(-sinb*ix+cosb*iz))*cosa
+ * +(cp11*((i_trans.y+sinc*cosb*ix+sinc*sinb*iz))+cp12*(i_trans.z)); ch=(iy)*sina +(-sinb*ix+cosb*iz)*cosa +i_trans.z; sinb,cosb hx=(cp00*(-sinc *
+ * sina*ix+cosc*iz)+cp01*(cosc * sina*ix+sinc*iz)+cp02*(-cosa*ix))*sinb +(cp01*(sinc*ix-cosc * sina*iz)+cp00*(cosc*ix+sinc * sina*iz)+cp02*(cosa*iz))*cosb
+ * +(cp00*(i_trans.x+(-sinc*cosa)*iy)+cp01*(i_trans.y+(cosc * cosa)*iy)+cp02*(i_trans.z+(sina)*iy)); double hy=(cp11*(cosc *
+ * sina*ix+sinc*iz)+cp12*(-cosa*ix))*sinb +(cp11*(sinc*ix-cosc * sina*iz)+cp12*(cosa*iz))*cosb +(cp11*(i_trans.y+(cosc *
+ * cosa)*iy)+cp12*(i_trans.z+(sina)*iy)); double h =((-cosa*ix)*sinb +(cosa*iz)*cosb +i_trans.z+(sina)*iy); İÉÁ›Ğ֔˒ή L=2*ð(d[n]*e[n]+a[n]*b[n])
+ * J=2*ð(d[n]*f[n]+a[n]*c[n])/L K=2*ð(-e[n]*f[n]+b[n]*c[n])/L M=ð(-e[n]^2+d[n]^2-b[n]^2+a[n]^2)/L ֎շժή +J*cos(x) +K*sin(x) -sin(x)^2 +cos(x)^2
+ * +2*M*cos(x)*sin(x)
+ */
+ double NyARPartialDifferentiationOptimize::optimizeParamX(const TSinCosValue& i_angle_y, const TSinCosValue& i_angle_z, const TNyARDoublePoint3d& i_trans, const TNyARDoublePoint3d i_vertex3d[],const TNyARDoublePoint2d i_vertex2d[], int i_number_of_vertex, double i_hint_angle)
+ {
+ const NyARPerspectiveProjectionMatrix& cp = *this->_projection_mat_ref;
+ const double sinb = i_angle_y.sin_val;
+ const double cosb = i_angle_y.cos_val;
+ const double sinc = i_angle_z.sin_val;
+ const double cosc = i_angle_z.cos_val;
+ double L, J, K, M, N, O;
+ L = J = K = M = N = O = 0;
+ for (int i = 0; i < i_number_of_vertex; i++) {
+ double ix, iy, iz;
+ ix = i_vertex3d[i].x;
+ iy = i_vertex3d[i].y;
+ iz = i_vertex3d[i].z;
+
+ const double cp00 = cp.m00;
+ const double cp01 = cp.m01;
+ const double cp02 = cp.m02;
+ const double cp11 = cp.m11;
+ const double cp12 = cp.m12;
+
+ double X0 = (cp00 * (-sinc * sinb * ix + sinc * cosb * iz) + cp01 * (cosc * sinb * ix - cosc * cosb * iz) + cp02 * (iy));
+ double X1 = (cp00 * (-sinc * iy) + cp01 * ((cosc * iy)) + cp02 * (-sinb * ix + cosb * iz));
+ double X2 = (cp00 * (i_trans.x + cosc * cosb * ix + cosc * sinb * iz) + cp01 * ((i_trans.y + sinc * cosb * ix + sinc * sinb * iz)) + cp02 * (i_trans.z));
+ double Y0 = (cp11 * (cosc * sinb * ix - cosc * cosb * iz) + cp12 * (iy));
+ double Y1 = (cp11 * ((cosc * iy)) + cp12 * (-sinb * ix + cosb * iz));
+ double Y2 = (cp11 * ((i_trans.y + sinc * cosb * ix + sinc * sinb * iz)) + cp12 * (i_trans.z));
+ double H0 = (iy);
+ double H1 = (-sinb * ix + cosb * iz);
+ double H2 = i_trans.z;
+
+ double VX = i_vertex2d[i].x;
+ double VY = i_vertex2d[i].y;
+
+ double a, b, c, d, e, f;
+ a = (VX * H0 - X0);
+ b = (VX * H1 - X1);
+ c = (VX * H2 - X2);
+ d = (VY * H0 - Y0);
+ e = (VY * H1 - Y1);
+ f = (VY * H2 - Y2);
+
+ L += d * e + a * b;
+ N += d * d + a * a;
+ J += d * f + a * c;
+ M += e * e + b * b;
+ K += e * f + b * c;
+ O += f * f + c * c;
+
+ }
+ L *=2;
+ J *=2;
+ K *=2;
+
+ return getMinimumErrorAngleFromParam(L,J, K, M, N, O, i_hint_angle);
+
+
+ }
+
+ double NyARPartialDifferentiationOptimize::optimizeParamY(const TSinCosValue& i_angle_x, const TSinCosValue& i_angle_z,const TNyARDoublePoint3d& i_trans,const TNyARDoublePoint3d i_vertex3d[],const TNyARDoublePoint2d i_vertex2d[], int i_number_of_vertex, double i_hint_angle)
+ {
+ const NyARPerspectiveProjectionMatrix& cp = *this->_projection_mat_ref;
+ const double sina = i_angle_x.sin_val;
+ const double cosa = i_angle_x.cos_val;
+ const double sinc = i_angle_z.sin_val;
+ const double cosc = i_angle_z.cos_val;
+ double L, J, K, M, N, O;
+ L = J = K = M = N = O = 0;
+ for (int i = 0; i < i_number_of_vertex; i++) {
+ double ix, iy, iz;
+ ix = i_vertex3d[i].x;
+ iy = i_vertex3d[i].y;
+ iz = i_vertex3d[i].z;
+
+ const double cp00 = cp.m00;
+ const double cp01 = cp.m01;
+ const double cp02 = cp.m02;
+ const double cp11 = cp.m11;
+ const double cp12 = cp.m12;
+
+ double X0 = (cp00 * (-sinc * sina * ix + cosc * iz) + cp01 * (cosc * sina * ix + sinc * iz) + cp02 * (-cosa * ix));
+ double X1 = (cp01 * (sinc * ix - cosc * sina * iz) + cp00 * (cosc * ix + sinc * sina * iz) + cp02 * (cosa * iz));
+ double X2 = (cp00 * (i_trans.x + (-sinc * cosa) * iy) + cp01 * (i_trans.y + (cosc * cosa) * iy) + cp02 * (i_trans.z + (sina) * iy));
+ double Y0 = (cp11 * (cosc * sina * ix + sinc * iz) + cp12 * (-cosa * ix));
+ double Y1 = (cp11 * (sinc * ix - cosc * sina * iz) + cp12 * (cosa * iz));
+ double Y2 = (cp11 * (i_trans.y + (cosc * cosa) * iy) + cp12 * (i_trans.z + (sina) * iy));
+ double H0 = (-cosa * ix);
+ double H1 = (cosa * iz);
+ double H2 = i_trans.z + (sina) * iy;
+
+ double VX = i_vertex2d[i].x;
+ double VY = i_vertex2d[i].y;
+
+ double a, b, c, d, e, f;
+ a = (VX * H0 - X0);
+ b = (VX * H1 - X1);
+ c = (VX * H2 - X2);
+ d = (VY * H0 - Y0);
+ e = (VY * H1 - Y1);
+ f = (VY * H2 - Y2);
+
+ L += d * e + a * b;
+ N += d * d + a * a;
+ J += d * f + a * c;
+ M += e * e + b * b;
+ K += e * f + b * c;
+ O += f * f + c * c;
+
+ }
+ L *= 2;
+ J *= 2;
+ K *= 2;
+ return getMinimumErrorAngleFromParam(L,J, K, M, N, O, i_hint_angle);
+
+ }
+
+ double NyARPartialDifferentiationOptimize::optimizeParamZ(const TSinCosValue& i_angle_x, const TSinCosValue& i_angle_y,const TNyARDoublePoint3d& i_trans,const TNyARDoublePoint3d i_vertex3d[],const TNyARDoublePoint2d i_vertex2d[], int i_number_of_vertex, double i_hint_angle)
+ {
+ const NyARPerspectiveProjectionMatrix& cp = *this->_projection_mat_ref;
+ const double sina = i_angle_x.sin_val;
+ const double cosa = i_angle_x.cos_val;
+ const double sinb = i_angle_y.sin_val;
+ const double cosb = i_angle_y.cos_val;
+ double L, J, K, M, N, O;
+ L = J = K = M = N = O = 0;
+ for (int i = 0; i < i_number_of_vertex; i++) {
+ double ix, iy, iz;
+ ix = i_vertex3d[i].x;
+ iy = i_vertex3d[i].y;
+ iz = i_vertex3d[i].z;
+
+ const double cp00 = cp.m00;
+ const double cp01 = cp.m01;
+ const double cp02 = cp.m02;
+ const double cp11 = cp.m11;
+ const double cp12 = cp.m12;
+
+ double X0 = (cp00 * (-sina * sinb * ix - cosa * iy + sina * cosb * iz) + cp01 * (ix * cosb + sinb * iz));
+ double X1 = (cp01 * (sina * ix * sinb + cosa * iy - sina * iz * cosb) + cp00 * (cosb * ix + sinb * iz));
+ double X2 = cp00 * i_trans.x + cp01 * (i_trans.y) + cp02 * (-cosa * sinb) * ix + cp02 * (sina) * iy + cp02 * ((cosb * cosa) * iz + i_trans.z);
+ double Y0 = cp11 * (ix * cosb + sinb * iz);
+ double Y1 = cp11 * (sina * ix * sinb + cosa * iy - sina * iz * cosb);
+ double Y2 = (cp11 * i_trans.y + cp12 * (-cosa * sinb) * ix + cp12 * ((sina) * iy + (cosb * cosa) * iz + i_trans.z));
+ double H0 = 0;
+ double H1 = 0;
+ double H2 = ((-cosa * sinb) * ix + (sina) * iy + (cosb * cosa) * iz + i_trans.z);
+
+ double VX = i_vertex2d[i].x;
+ double VY = i_vertex2d[i].y;
+
+ double a, b, c, d, e, f;
+ a = (VX * H0 - X0);
+ b = (VX * H1 - X1);
+ c = (VX * H2 - X2);
+ d = (VY * H0 - Y0);
+ e = (VY * H1 - Y1);
+ f = (VY * H2 - Y2);
+
+ L += d * e + a * b;
+ N += d * d + a * a;
+ J += d * f + a * c;
+ M += e * e + b * b;
+ K += e * f + b * c;
+ O += f * f + c * c;
+
+ }
+ L *=2;
+ J *=2;
+ K *=2;
+
+ return getMinimumErrorAngleFromParam(L,J, K, M, N, O, i_hint_angle);
+ }
+ void NyARPartialDifferentiationOptimize::modifyMatrix(NyARDoubleMatrix33& io_rot,const TNyARDoublePoint3d& i_trans,const TNyARDoublePoint3d i_vertex3d[],const TNyARDoublePoint2d i_vertex2d[], int i_number_of_vertex)
+ {
+ TSinCosValue angles_in[3];
+ TNyARDoublePoint3d ang;
+
+ // ZXYͮÌsin/cosӬðҊЯ
+ rotation2Sincos_ZXY(io_rot, angles_in,ang);
+ ang.x += optimizeParamX(angles_in[1], angles_in[2], i_trans, i_vertex3d, i_vertex2d, i_number_of_vertex, ang.x);
+ ang.y += optimizeParamY(angles_in[0], angles_in[2], i_trans, i_vertex3d, i_vertex2d, i_number_of_vertex, ang.y);
+ ang.z += optimizeParamZ(angles_in[0], angles_in[1], i_trans, i_vertex3d, i_vertex2d, i_number_of_vertex, ang.z);
+ io_rot.setZXYAngle(ang.x, ang.y, ang.z);
+ return;
+ }
+ /**
+ * ćɛ̛ħª΅ϬÉÈéԟðӾé‚
+ */
+ double NyARPartialDifferentiationOptimize::getMinimumErrorAngleFromParam(double iL,double iJ, double iK, double iM, double iN, double iO, double i_hint_angle)
+ {
+ double sin_table[4];
+
+ double M = (iN - iM)/iL;
+ double J = iJ/iL;
+ double K = -iK/iL;
+
+ // İÉÁ›Ğ©çsinĥ›ĵËðάЬ
+ // (- 4*M^2-4)*x^4 + (4*K- 4*J*M)*x^3 + (4*M^2 -(K^2- 4)- J^2)*x^2 +(4*J*M- 2*K)*x + J^2-1 = 0
+ int number_of_sin = NyAREquationSolver::solve4Equation(-4 * M * M - 4, 4 * K - 4 * J * M, 4 * M * M - (K * K - 4) - J * J, 4 * J * M - 2 * K, J * J - 1, sin_table);
+
+
+ // ΅ϬӬÑ͂ðӾĨ­‚
+ double min_ang_0 = DBL_MAX;
+ double min_ang_1 = DBL_MAX;
+ double min_err_0 = DBL_MAX;
+ double min_err_1 = DBL_MAX;
+ for (int i = 0; i < number_of_sin; i++) {
+ // +-cos_v[i]ªҸԟͳ֢
+ double sin_rt = sin_table[i];
+ double cos_rt = sqrt(1 - (sin_rt * sin_rt));
+ // cosðЃ՜‚շժήÅ0É̟¢ֻªгʰ
+ // 0 = 2*cos(x)*sin(x)*M - sin(x)^2 + cos(x)^2 + sin(x)*K + cos(x)*J
+ double a1 = 2 * cos_rt * sin_rt * M + sin_rt * (K - sin_rt) + cos_rt * (cos_rt + J);
+ double a2 = 2 * (-cos_rt) * sin_rt * M + sin_rt * (K - sin_rt) + (-cos_rt) * ((-cos_rt) + J);
+ // ѢҎӬÉȨµÄўÌcosӬðӾĨ­‚
+ a1 = a1 < 0 ? -a1 : a1;
+ a2 = a2 < 0 ? -a2 : a2;
+ cos_rt = (a1 < a2) ? cos_rt : -cos_rt;
+ double ang = atan2(sin_rt, cos_rt);
+ // ćɛӬðͶϚ
+ double err = iN * sin_rt * sin_rt + (iL*cos_rt + iJ) * sin_rt + iM * cos_rt * cos_rt + iK * cos_rt + iO;
+ // ΅ϬÌÑ͂ðˬӾ·é‚
+ if (min_err_0 > err) {
+ min_err_1 = min_err_0;
+ min_ang_1 = min_ang_0;
+ min_err_0 = err;
+ min_ang_0 = ang;
+ } else if (min_err_1 > err) {
+ min_err_1 = err;
+ min_ang_1 = ang;
+ }
+ }
+ // [0]ðĥĘħ
+ double gap_0;
+ gap_0 = min_ang_0 - i_hint_angle;
+ if (gap_0 > NyAR_PI) {
+ gap_0 = (min_ang_0 - NyAR_PI * 2) - i_hint_angle;
+ } else if (gap_0 < -NyAR_PI) {
+ gap_0 = (min_ang_0 + NyAR_PI * 2) - i_hint_angle;
+ }
+ // [1]ðĥĘħ
+ double gap_1;
+ gap_1 = min_ang_1 - i_hint_angle;
+ if (gap_1 > NyAR_PI) {
+ gap_1 = (min_ang_1 - NyAR_PI * 2) - i_hint_angle;
+ } else if (gap_1 < -NyAR_PI) {
+ gap_1 = (min_ang_1 + NyAR_PI * 2) - i_hint_angle;
+ }
+ return abs(gap_1) < abs(gap_0) ? gap_1 : gap_0;
+ }
+
+}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARDoubleMatrix.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARDoubleMatrix.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARDoubleMatrix.cpp (revision 335)
@@ -1,28 +1,26 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "INyARDoubleMatrix.h"
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARRaster.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARRaster.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARRaster.cpp (revision 335)
@@ -1,29 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
+
#include "nyarcore.h"

Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/SquareContourDetector.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/SquareContourDetector.cpp (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/SquareContourDetector.cpp (revision 335)
@@ -0,0 +1,231 @@
+/*
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
+#include "SquareContourDetector.h"
+
+
+#include "NyARObserv2IdealMap.h"
+#include "NyARPca2d_MatrixPCA_O2.h"
+
+namespace NyARToolkitCPP
+{
+#define VERTEX_FACTOR 1.0// Ѽ̟ЯÌĴĀĎĞ
+
+ SquareContourDetector::SquareContourDetector(const TNyARIntSize& i_size,const NyARCameraDistortionFactor& i_distfactor_ref)
+ {
+ //٣ÝͶϚĥ›ĵËðάéƁ8*width/height*2Ì،ɦðЁկµÜ·‚
+ //،ɦðϦè½­È¢Ъ͇́i_dist_factor_refÌӬð»ÌÜÜϧÁÄ­¾³¢‚
+ this->_dist_factor = new NyARObserv2IdealMap(i_distfactor_ref,i_size);
+
+
+ // ؖ˳įĢĴĀÍҸԟ֏ʷð·éÌŁؖ˳įĢĴĀÌÑջϦé‚
+ this->_pca=new NyARPca2d_MatrixPCA_O2();
+ this->_xpos=new double[i_size.w+i_size.h];//΅ҥ֓ҷÍthis._width+this._height
+ this->_ypos=new double[i_size.w+i_size.h];//΅ҥ֓ҷÍthis._width+this._height
+ return;
+ }
+ SquareContourDetector::~SquareContourDetector()
+ {
+ NyAR_SAFE_DELETE(this->_dist_factor);
+ NyAR_SAFE_DELETE(this->_pca);
+ NyAR_SAFE_DELETE(this->_xpos);
+ NyAR_SAFE_DELETE(this->_ypos);
+ return;
+ }
+
+
+ bool SquareContourDetector::coordToSquare(const int* i_xcoord,const int* i_ycoord,int i_st_index,int i_coord_num,int i_label_area,NyARSquare& o_square)
+ {
+
+ int (&mkvertex)[5] = this->__detectMarker_mkvertex;
+
+ // ҸԟЮֱðϦӾ
+ if (!getSquareVertex(i_xcoord, i_ycoord, i_st_index, i_coord_num, i_label_area, mkvertex)) {
+ // ҸԟÌϦӾªЯ׈È©Á½ÌÅժ˼
+ return false;
+ }
+ // Ľ›Ċ›ð̟Я
+ if (!getSquareLine(mkvertex, i_xcoord, i_ycoord, o_square)){
+ // ̩͠ªЬקµÈ©Á½‚
+ return false;
+ }
+ return true;
+ }
+
+
+ bool SquareContourDetector::getSquareLine(const int* i_mkvertex,const int* i_xcoord,const int* i_ycoord, NyARSquare& o_square)
+ {
+ TNyARLinear* l_line = o_square.line;
+ NyARDoubleMatrix22& evec=this->__getSquareLine_evec;
+ TNyARDoublePoint2d mean;
+ TNyARDoublePoint2d ev;
+
+
+ for (int i = 0; i < 4; i++) {
+ const double w1 = (double) (i_mkvertex[i + 1] - i_mkvertex[i] + 1) * 0.05 + 0.5;
+ const int st = (int) (i_mkvertex[i] + w1);
+ const int ed = (int) (i_mkvertex[i + 1] - w1);
+ const int n = ed - st + 1;
+ if (n < 2) {
+ // nª2ɈɺÅmatrix.PCAðͶϚ·é±ÆÍÅ«È¢ÌŁćɛ
+ return false;
+ }
+ //պرάЬ
+ this->_dist_factor->observ2IdealBatch(i_xcoord, i_ycoord, st, n,this->_xpos,this->_ypos);
+
+ //ϥЬժժэ·é‚
+ this->_pca->pca(this->_xpos,this->_ypos,n,evec, ev,mean);
+ TNyARLinear& l_line_i = l_line[i];
+ l_line_i.run = evec.m01;// line[i][0] = evec->m[1];
+ l_line_i.rise = -evec.m00;// line[i][1] = -evec->m[0];
+ l_line_i.intercept = -(l_line_i.run * mean.x + l_line_i.rise * mean.y);// line[i][2] = -(line[i][0]*mean->v[0] + line[i][1]*mean->v[1]);
+ }
+
+ TNyARDoublePoint2d* l_sqvertex = o_square.sqvertex;
+ TNyARIntPoint2d* l_imvertex = o_square.imvertex;
+ for (int i = 0; i < 4; i++) {
+ const TNyARLinear& l_line_i = l_line[i];
+ const TNyARLinear& l_line_2 = l_line[(i + 3) % 4];
+ const double w1 = l_line_2.run * l_line_i.rise - l_line_i.run * l_line_2.rise;
+ if (w1 == 0.0) {
+ return false;
+ }
+ l_sqvertex[i].x = (l_line_2.rise * l_line_i.intercept - l_line_i.rise * l_line_2.intercept) / w1;
+ l_sqvertex[i].y = (l_line_i.run * l_line_2.intercept - l_line_2.run * l_line_i.intercept) / w1;
+ // ҸԟăÓĦĎĘ©çҸԟ΀֗ðӾÄ֛Ѷ
+ l_imvertex[i].x = i_xcoord[i_mkvertex[i]];
+ l_imvertex[i].y = i_ycoord[i_mkvertex[i]];
+ }
+ return true;
+ }
+ bool SquareContourDetector::getSquareVertex(const int* i_x_coord,const int* i_y_coord, int i_vertex1_index, int i_coord_num, int i_area, int* o_vertex)
+ {
+ NyARVertexCounter& wv1 = this->__getSquareVertex_wv1;
+ NyARVertexCounter& wv2 = this->__getSquareVertex_wv2;
+ int end_of_coord = i_vertex1_index + i_coord_num - 1;
+ int sx = i_x_coord[i_vertex1_index];// sx = marker_info2->x_coord[0];
+ int sy = i_y_coord[i_vertex1_index];// sy = marker_info2->y_coord[0];
+ int dmax = 0;
+ int v1 = i_vertex1_index;
+ for (int i = 1 + i_vertex1_index; i < end_of_coord; i++) {// for(i=1;i<marker_info2->coord_num-1;i++)
+ // {
+ const int d = (i_x_coord[i] - sx) * (i_x_coord[i] - sx) + (i_y_coord[i] - sy) * (i_y_coord[i] - sy);
+ if (d > dmax) {
+ dmax = d;
+ v1 = i;
+ }
+ }
+ const double thresh = (i_area / 0.75) * 0.01 * VERTEX_FACTOR;
+
+ o_vertex[0] = i_vertex1_index;
+
+ if (!wv1.getVertex(i_x_coord, i_y_coord, i_vertex1_index, v1, thresh)) { // if(get_vertex(marker_info2->x_coord,marker_info2->y_coord,0,v1,thresh,wv1,&wvnum1)<
+ // 0 ) {
+ return false;
+ }
+ if (!wv2.getVertex(i_x_coord, i_y_coord, v1, end_of_coord, thresh)) {// if(get_vertex(marker_info2->x_coord,marker_info2->y_coord,v1,marker_info2->coord_num-1,thresh,wv2,&wvnum2)
+ // < 0) {
+ return false;
+ }
+
+ int v2;
+ if (wv1.number_of_vertex == 1 && wv2.number_of_vertex == 1) {// if(wvnum1 == 1 && wvnum2== 1) {
+ o_vertex[1] = wv1.vertex[0];
+ o_vertex[2] = v1;
+ o_vertex[3] = wv2.vertex[0];
+ } else if (wv1.number_of_vertex > 1 && wv2.number_of_vertex == 0) {// }else if( wvnum1 > 1 && wvnum2== 0) {
+ //ҸԟɊӵð̎ԟ©çҎ˰ԟÌ˔Ì1/2É éÆ؜ҺµÄ̟ε·é‚
+ v2 = (v1-i_vertex1_index)/2+i_vertex1_index;
+ if (!wv1.getVertex(i_x_coord, i_y_coord, i_vertex1_index, v2, thresh)) {
+ return false;
+ }
+ if (!wv2.getVertex(i_x_coord, i_y_coord, v2, v1, thresh)) {
+ return false;
+ }
+ if (wv1.number_of_vertex == 1 && wv2.number_of_vertex == 1) {
+ o_vertex[1] = wv1.vertex[0];
+ o_vertex[2] = wv2.vertex[0];
+ o_vertex[3] = v1;
+ } else {
+ return false;
+ }
+ } else if (wv1.number_of_vertex == 0 && wv2.number_of_vertex > 1) {
+ //v2 = (v1-i_vertex1_index+ end_of_coord-i_vertex1_index) / 2+i_vertex1_index;
+ v2 = (v1+ end_of_coord)/2;
+
+ if (!wv1.getVertex(i_x_coord, i_y_coord, v1, v2, thresh)) {
+ return false;
+ }
+ if (!wv2.getVertex(i_x_coord, i_y_coord, v2, end_of_coord, thresh)) {
+ return false;
+ }
+ if (wv1.number_of_vertex == 1 && wv2.number_of_vertex == 1) {
+ o_vertex[1] = v1;
+ o_vertex[2] = wv1.vertex[0];
+ o_vertex[3] = wv2.vertex[0];
+ } else {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ o_vertex[4] = end_of_coord;
+ return true;
+ }
+
+ /**
+ * ؖ˳ѼÌ̩̟͠ЯˊϮļăÓħðԁӨµÄ΀֗ðր×Җ¦Ü·‚
+ * ؖ˳ѼÌѦӪ©çҎ˰Ѽª΅ҷÉÈéԟðÐԟ̟嵁»êæèҏÌ̦˔ðįĢĴĀÌֻͣÉњѱµÜ·‚
+ * ןèӬÍҎ˰Ѽª΅ҷÉÈÁ½ԟÅ·‚˖ДЉ׹ͣ̰֔Ӭ+i_coord_numÌضҦª،͸ÉÈèÜ·‚
+ * @param i_xcoord
+ * @param i_ycoord
+ * @param i_coord_num
+ * @return
+ */
+
+ int SquareContourDetector::normalizeCoord(int* i_coord_x, int* i_coord_y,int i_coord_num)
+ {
+ //
+ const int sx = i_coord_x[0];
+ const int sy = i_coord_y[0];
+ int d = 0;
+ int w, x, y;
+ int ret = 0;
+ for (int i = 1; i < i_coord_num; i++) {
+ x = i_coord_x[i] - sx;
+ y = i_coord_y[i] - sy;
+ w = x * x + y * y;
+ if (w > d) {
+ d = w;
+ ret = i;
+ }
+ // ±±Å¤Ü­Љ׹а̏ԼêçêÈ¢©È‚
+ }
+ // vertex1ð˫˅ɵāֻͣÉպرðف̋
+ memcpy(i_coord_x+i_coord_num,i_coord_x+1,ret*sizeof(int));
+ memcpy(i_coord_y+i_coord_num,i_coord_y+1,ret*sizeof(int));
+ return ret;
+ }
+}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARLabelingLabel.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARLabelingLabel.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARLabelingLabel.cpp (revision 335)
@@ -1,28 +1,26 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARLabelingLabel.h"
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARVec.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARVec.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARVec.cpp (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARVec.h"
#include "nyarcore.h"
#include <cstring>
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARVertexCounter.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARVertexCounter.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARVertexCounter.cpp (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARVertexCounter.h"
namespace NyARToolkitCPP
{
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/RleLabelFragmentInfoStack.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/RleLabelFragmentInfoStack.cpp (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/RleLabelFragmentInfoStack.cpp (revision 335)
@@ -0,0 +1,34 @@
+/*
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
+#include "nyarcore.h"
+#include "NyARLabelInfo.h"
+#include "NyARLabelInfoStack.h"
+
+namespace NyARToolkitCPP
+{
+}
+
+
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARLabelingImage.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARLabelingImage.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARLabelingImage.cpp (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "nyarcore.h"
#include "NyARLabelingImage.h"
#include <cstdlib>
@@ -32,38 +30,18 @@

namespace NyARToolkitCPP
{
- void f(){
- NyARLabelingImage a(1,2);
- }
- int NyARLabelingImage::getWidth()const
- {
- return this->_size.w;
- }
-
- int NyARLabelingImage::getHeight()const
- {
- return this->_size.h;
- }
-
- const TNyARIntSize& NyARLabelingImage::getSize()const
- {
- return this->_size;
- }
-
-
int NyARLabelingImage::_getContour_xdir[]={ 0, 1, 1, 1, 0,-1,-1,-1};
int NyARLabelingImage::_getContour_ydir[]={-1,-1, 0, 1, 1, 1, 0,-1};

- NyARLabelingImage::NyARLabelingImage(int i_width, int i_height)
+ NyARLabelingImage::NyARLabelingImage(int i_width, int i_height):NyARRaster_BasicClass(i_width,i_height)
{
- this->_size.w=i_width;
- this->_size.h=i_height;
- //
this->_ref_buf =new int[i_height*i_width];
this->_label_list = new NyARLabelingLabelStack(MAX_LABELS);
this->_index_table=new NyArray<int>(MAX_LABELS);
this->_is_index_table_enable=false;
this->_buffer_reader=new NyARBufferReader(this->_ref_buf,INyARBufferReader::BUFFERFORMAT_INT1D);
+ //жЬΞÉ٧ðϑ«Ü·‚
+ drawFrameEdge();
return;
}
NyARLabelingImage::~NyARLabelingImage()
@@ -74,22 +52,41 @@
NyAR_SAFE_DELETE(this->_ref_buf);
return;
}
-
- const INyARBufferReader& NyARLabelingImage::getBufferReader()const
+ /**
+ * ćĢėðϑ«Ü·‚
+ */
+ void NyARLabelingImage::drawFrameEdge()
{
+ int w=this->_size.w;
+ int h=this->_size.h;
+ // NyLabelingImageÌăÁ›ėω˺ɻ(٧ϑ«)
+ int* img = (int*) this->_ref_buf;
+ int bottom_ptr = (h - 1) * w;
+ for (int i = 0; i < w; i++) {
+ img[i] = 0;
+ img[bottom_ptr + i] = 0;
+ }
+ for (int i = 0; i < h; i++) {
+ img[i * w] = 0;
+ img[(i + 1) * w - 1] = 0;
+ }
+ return;
+ }
+ const INyARBufferReader& NyARLabelingImage::getBufferReader()const
+ {
return *(this->_buffer_reader);
}

- const NyArray<int>* NyARLabelingImage::getIndexArray()const
+ const NyArray<int>* NyARLabelingImage::getIndexArray()const
{
return this->_is_index_table_enable?this->_index_table:NULL;
}

- NyARLabelingLabelStack& NyARLabelingImage::getLabelStack()const
+ NyARLabelingLabelStack& NyARLabelingImage::getLabelStack()const
{
return *(this->_label_list);
}
- void NyARLabelingImage::reset(bool i_label_index_enable)
+ void NyARLabelingImage::reset(bool i_label_index_enable)
{
NyAR_ASSERT(i_label_index_enable==true);//ձÉĸË›ĨÍ֢πѕ
this->_label_list->clear();
@@ -114,55 +111,4 @@
// êˆ̩©çÈ¢æˆ
throw NyARException();
}
-
- int NyARLabelingImage::getContour(int i_index,int i_array_size,int o_coord_x[],int o_coord_y[])const
- {
- const int width=this->_size.w;
- const int* xdir = this->_getContour_xdir;// static int xdir[8] = { 0,1, 1, 1, 0,-1,-1,-1};
- const int* ydir = this->_getContour_ydir;// static int ydir[8] = {-1,-1,0, 1, 1, 1, 0,-1};
- const NyARLabelingLabel* label=this->_label_list->getItem(i_index);
- int i;
- //ĎÊĢĶ،ɦÌУӛÉњµÄ¢éļăÓħðӾé‚
- int sx=getTopClipTangentX(*label);
- int sy=label->clip_t;
-
- int coord_num = 1;
- o_coord_x[0] = sx;
- o_coord_y[0] = sy;
- int dir = 5;
-
- const int* limage=this->_ref_buf;
- int c = o_coord_x[0];
- int r = o_coord_y[0];
- for (;;) {
- dir = (dir + 5) % 8;
- for (i = 0; i < 8; i++) {
- if (limage[(r + ydir[dir])*width+(c + xdir[dir])] > 0) {
- break;
- }
- dir = (dir + 1) % 8;
- }
- if (i == 8) {
- //8ֻͼғÄҲ×½¯ÇÉĸ˪ֳ¢æˆ
- throw NyARException();// return(-1);
- }
- // xcoordÆycoordðc,rÉà֛Ѷ
- c = c + xdir[dir];
- r = r + ydir[dir];
- o_coord_x[coord_num] = c;
- o_coord_y[coord_num] = r;
- // Љ׹а̏ԻӨ
- if (c == sx && r == sy){
- coord_num++;
- break;
- }
- coord_num++;
- if (coord_num == i_array_size) {
- //ؖ˳ª֖ӛÉӂµ½
- return coord_num;
- }
- }
- return coord_num;
-
- }
}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARIntPoint2dStack.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARIntPoint2dStack.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARIntPoint2dStack.cpp (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARIntPoint2dStack.h"
namespace NyARToolkitCPP
{
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARColorPatt.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARColorPatt.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARColorPatt.cpp (revision 335)
@@ -1 +1,26 @@
+/*
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "INyARColorPatt.h"
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARColorPatt_Perspective.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARColorPatt_Perspective.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARColorPatt_Perspective.cpp (revision 335)
@@ -1,33 +1,185 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
+#include "INyARColorPatt.h"
+#include "NyAR_types.h"
+#include "NyARBufferReader.h"
+#include "NyARPerspectiveParamGenerator_O1.h"
+#include "NyARRgbPixelReader_INT1D_X8R8G8B8_32.h"

+#include "NyARColorPatt_Perspective.h"
+#include "nyarcore.h"

+
namespace NyARToolkitCPP
{
+ /**
+ * ɓ̟׀ðϧÁ½İ›ĘĹĎĥĂĵ֢гð©¯ÄÉĘĞУÌϬ˰͠©ç
+ * ՃɓʰќԸÌ̩͠İĞ›ÓðάЬµÜ·‚
+ *
+ */

+#define LOCAL_LT 1
+
+ void NyARColorPatt_Perspective::initializeInstance(int i_width, int i_height,int i_point_per_pix)
+ {
+ NyAR_ASSERT( i_width>2 && i_height>2);
+ this->_resolution=i_point_per_pix;
+ this->_size.w=i_width;
+ this->_size.h=i_height;
+ this->_patdata = new int[i_height*i_width];
+ this->_buf_reader=new NyARBufferReader(this->_patdata,NyARBufferReader::BUFFERFORMAT_INT1D_X8R8G8B8_32);
+ this->_pixelreader=new NyARRgbPixelReader_INT1D_X8R8G8B8_32(&(this->_size),this->_patdata);
+ this->_perspective_gen=NULL;
+ return;
+ }
+
+ NyARColorPatt_Perspective::NyARColorPatt_Perspective(int i_width, int i_height,int i_point_per_pix)
+ {
+ initializeInstance(i_width,i_height,i_point_per_pix);
+ setEdgeSize(0,0,i_point_per_pix);
+ return;
+ }
+ NyARColorPatt_Perspective::~NyARColorPatt_Perspective()
+ {
+ NyAR_SAFE_DELETE(this->_patdata);
+ NyAR_SAFE_DELETE(this->_buf_reader);
+ NyAR_SAFE_DELETE(this->_pixelreader);
+ if(this->_perspective_gen!=NULL){
+ NyAR_SAFE_DELETE(this->_perspective_gen);
+ }
+ return;
+ }
+
+ NyARColorPatt_Perspective::NyARColorPatt_Perspective(int i_width, int i_height,int i_resolution,int i_edge_percentage)
+ {
+ //Լ؍Ч̀
+ initializeInstance(i_width,i_height,i_resolution);
+ setEdgeSizeByPercent(i_edge_percentage,i_edge_percentage,i_resolution);
+ return;
+ }
+
+
+ void NyARColorPatt_Perspective::setEdgeSize(int i_x_edge,int i_y_edge,int i_resolution)
+ {
+ NyAR_ASSERT(i_x_edge>=0);
+ NyAR_ASSERT(i_y_edge>=0);
+ //PerspectiveİÉÁĞͶϚ˭ðάЬ
+ if(this->_perspective_gen!=NULL){
+ NyAR_SAFE_DELETE(this->_perspective_gen);
+ }
+ this->_perspective_gen=new NyARPerspectiveParamGenerator_O1(
+ LOCAL_LT,LOCAL_LT,
+ (i_x_edge*2+this->_size.w)*i_resolution,
+ (i_y_edge*2+this->_size.h)*i_resolution);
+ //ijĢĎāĢĶˊϮɊӵðͶϚ
+ this->_pickup_lt.x=i_x_edge*i_resolution+LOCAL_LT;
+ this->_pickup_lt.y=i_y_edge*i_resolution+LOCAL_LT;
+ return;
+ }
+ void NyARColorPatt_Perspective::setEdgeSizeByPercent(int i_x_percent,int i_y_percent,int i_resolution)
+ {
+ NyAR_ASSERT(i_x_percent>=0);
+ NyAR_ASSERT(i_y_percent>=0);
+ setEdgeSize(this->_size.w*i_x_percent/50,this->_size.h*i_y_percent/50,i_resolution);
+ return;
+ }
+
+
+ int NyARColorPatt_Perspective::getWidth()const
+ {
+ return this->_size.w;
+ }
+ int NyARColorPatt_Perspective::getHeight()const
+ {
+ return this->_size.h;
+ }
+ const TNyARIntSize& NyARColorPatt_Perspective::getSize()const
+ {
+ return this->_size;
+ }
+ const INyARBufferReader& NyARColorPatt_Perspective::getBufferReader()const
+ {
+ return *(this->_buf_reader);
+ }
+ const INyARRgbPixelReader& NyARColorPatt_Perspective::getRgbPixelReader()const
+ {
+ return *(this->_pixelreader);
+ }
+
+ bool NyARColorPatt_Perspective::pickFromRaster(const INyARRgbRaster& image,const NyARSquare& i_square)
+ {
+ //ɓ̟׀ÌİÉÁ›ĞðͶϚ
+ double cpara[8];
+ if (!this->_perspective_gen->getParam(i_square.imvertex, cpara)) {
+ return false;
+ }
+
+ int resolution=this->_resolution;
+ int img_x = image.getWidth();
+ int img_y = image.getHeight();
+ int res_pix=resolution*resolution;
+
+ int rgb_tmp[3];
+
+ //ijĎĚËʛğ›ðϦӾ
+ const INyARRgbPixelReader& reader=image.getRgbPixelReader();
+ int p=0;
+ for(int iy=0;iy<this->_size.h*resolution;iy+=resolution){
+ //ʰќԸժÌԟðϦé‚
+ for(int ix=0;ix<this->_size.w*resolution;ix+=resolution){
+ int r,g,b;
+ r=g=b=0;
+ for(int i2y=iy;i2y<iy+resolution;i2y++){
+ int cy=this->_pickup_lt.y+i2y;
+ for(int i2x=ix;i2x<ix+resolution;i2x++){
+ //1ijĎĚËðάЬ
+ int cx=this->_pickup_lt.x+i2x;
+ const double d=cpara[6]*cx+cpara[7]*cy+1.0;
+ int x=(int)((cpara[0]*cx+cpara[1]*cy+cpara[2])/d);
+ int y=(int)((cpara[3]*cx+cpara[4]*cy+cpara[5])/d);
+ if(x<0){x=0;}
+ if(x>=img_x){x=img_x-1;}
+ if(y<0){y=0;}
+ if(y>=img_y){y=img_y-1;}
+
+ reader.getPixel(x, y, rgb_tmp);
+ r+=rgb_tmp[0];
+ g+=rgb_tmp[1];
+ b+=rgb_tmp[2];
+ }
+ }
+ r/=res_pix;
+ g/=res_pix;
+ b/=res_pix;
+ this->_patdata[p]=((r&0xff)<<16)|((g&0xff)<<8)|((b&0xff));
+ p++;
+ }
+ }
+ //ijĎĚËע¢͇í¹
+ //ijĎĚËĚĢħ
+ return true;
+ }
}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARSquareDetector_ARToolKit.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARSquareDetector_ARToolKit.cpp (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARSquareDetector_ARToolKit.cpp (revision 335)
@@ -0,0 +1,163 @@
+/*
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
+#include "NyARSquareDetector_ARToolKit.h"
+#include "NyARLabeling_ARToolKit.h"
+#include "NyARLabelingImage.h"
+#include "NyARObserv2IdealMap.h"
+#include "INyARSquareDetector.h"
+#include "NyARVertexCounter.h"
+#include "INyARPca2d.h"
+#include "NyARPca2d_MatrixPCA_O2.h"
+#include "../utils/NyArray.h"
+#include "nyarcore.h"
+#include <cstring>
+#include <cstdio>
+namespace NyARToolkitCPP
+{
+#define AR_AREA_MAX 100000// #define AR_AREA_MAX 100000
+#define AR_AREA_MIN 70// #define AR_AREA_MIN 70
+
+
+
+#define VERTEX_FACTOR 1.0// Ѽ̟ЯÌĴĀĎĞ
+#define AR_AREA_MAX 100000// #define AR_AREA_MAX 100000
+#define AR_AREA_MIN 70// #define AR_AREA_MIN 70
+
+
+ NyARSquareDetector_ARToolKit::NyARSquareDetector_ARToolKit(const NyARCameraDistortionFactor& i_dist_factor_ref,const TNyARIntSize& i_size)
+ {
+ this->_width = i_size.w;
+ this->_height = i_size.h;
+
+ this->_labeling = new NyARLabeling_ARToolKit();
+ this->_sqconvertor=new SquareContourDetector(i_size,i_dist_factor_ref);
+ this->_limage = new NyARLabelingImage(this->_width, this->_height);
+ this->_overlap_checker = new LabelOverlapChecker<NyARLabelingLabel>(32);
+
+
+ // ؖ˳Ì΅ҥҷÍʦ׊Éʦè¤é΅ҥÌҷֻ͠Ĕăę‚
+ int number_of_coord = (this->_width + this->_height) * 2;
+ // ؖ˳įĢĴĀÍҸԟ֏ʷð·éÌŁؖ˳įĢĴĀÌÑջϦé‚
+ this->_max_coord = number_of_coord;
+ this->_xcoord = new int[number_of_coord * 2];
+ this->_ycoord = new int[number_of_coord * 2];
+ return;
+ }
+ NyARSquareDetector_ARToolKit::~NyARSquareDetector_ARToolKit()
+ {
+ NyAR_SAFE_DELETE(this->_overlap_checker);
+ NyAR_SAFE_DELETE(this->_labeling);
+ NyAR_SAFE_DELETE(this->_limage);
+ NyAR_SAFE_DELETE(this->_sqconvertor);
+ NyAR_SAFE_DELETE(this->_xcoord);
+ NyAR_SAFE_DELETE(this->_ycoord);
+ return;
+ }
+ void NyARSquareDetector_ARToolKit::detectMarker(const NyARBinRaster& i_raster, NyARSquareStack& o_square_stack)
+ {
+ NyARLabelingImage& limage = *this->_limage;
+
+
+ // Ľ›Ċ›ĺËğðÊĚĢħ
+ o_square_stack.clear();
+
+ // ÉĸÊÓď
+ int label_num =this->_labeling->labeling(i_raster,limage);
+
+ // ÉĸËДª0Èç±±ÜÅ
+ if (label_num < 1){
+ return;
+ }
+
+ NyARLabelingLabelStack& stack = limage.getLabelStack();
+ // ÉĸËðҥ«¢χÉЮر
+ stack.sortByArea();
+
+ const NyArray<NyARLabelingLabel*>& labels = stack.getArray();
+
+
+
+ // ĦĊ¢ÉĸËðԇÝղε
+ int i;
+ for (i = 0; i < label_num; i++) {
+ // ̟͸ҎЛԠÌÉĸËĔăęÉÈéÜÅֳ΋
+ if (labels.item[i]->area <= AR_AREA_MAX) {
+ break;
+ }
+ }
+
+ const int xsize = this->_width;
+ const int ysize = this->_height;
+ int* xcoord = this->_xcoord;
+ int* ycoord = this->_ycoord;
+ const int coord_max = this->_max_coord;
+ LabelOverlapChecker<NyARLabelingLabel>* overlap = this->_overlap_checker;
+
+ //ФÈèĠĆĢĊÌ΅ҥДðѝӨ
+ overlap->setMaxLabels(label_num);
+
+ for (; i < label_num; i++) {
+ const NyARLabelingLabel& label_pt = *labels.item[i];
+ const int label_area = label_pt.area;
+ // ̟͸ҎЛĔăęæèàϬ³­ÈÁ½çЉ׹
+ if (label_area < AR_AREA_MIN) {
+ break;
+ }
+ // ĎÊĢĶ،ɦªʦ׊Ì٧ÉњµÄ¢êÎϜˏ
+ if (label_pt.clip_l == 1 || label_pt.clip_r == xsize - 2) {// if(wclip[i*4+0] == 1 || wclip[i*4+1] ==xsize-2){
+ continue;
+ }
+ if (label_pt.clip_t == 1 || label_pt.clip_b == ysize - 2) {// if( wclip[i*4+2] == 1 || wclip[i*4+3] ==ysize-2){
+ continue;
+ }
+ // ˹É̟Я³ê½̩͠ÆÌФÈèð˭Ն
+ if (!overlap->check(label_pt)) {
+ // ФÈÁÄ¢é椾‚
+ continue;
+ }
+
+ // ؖ˳ðϦӾ
+ const int coord_num = _cpickup->getContour(limage,limage.getTopClipTangentX(label_pt),label_pt.clip_t, coord_max, xcoord, ycoord);
+ if (coord_num == coord_max) {
+ // ؖ˳ªҥ«·¬é‚
+ continue;
+ }
+ //Ҹԟͳ֢ÌăÓĦĎĘðϦӾ
+ const int vertex1 = SquareContourDetector::normalizeCoord(xcoord, ycoord, coord_num);
+
+ //±±©çѦªؖ˳ժэ
+ NyARSquare* square_ptr = o_square_stack.prePush();
+ if(!this->_sqconvertor->coordToSquare(xcoord,ycoord,vertex1,coord_num,label_area,*square_ptr)){
+ o_square_stack.pop();// ҸԟÌϦӾªЯ׈È©Á½ÌÅժ˼
+ continue;
+ }
+ // ̟ЯΏÌ̩͠ÌѮµ½ÉĸËðФÈèĠĆĢĎÉӇʁ·é‚
+ overlap->push(&label_pt);
+
+ }
+ return;
+ }
+}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARGrayscaleRaster.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARGrayscaleRaster.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARGrayscaleRaster.cpp (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "nyarcore.h"
#include "NyARGrayscaleRaster.h"
#include <cstdlib>
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARBufferReader.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARBufferReader.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARBufferReader.cpp (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARBufferReader.h"
#include "nyarcore.h"
#include <cstdlib>
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRgbPixelReader_BYTE1D_X8R8G8B8_32.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRgbPixelReader_BYTE1D_X8R8G8B8_32.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRgbPixelReader_BYTE1D_X8R8G8B8_32.cpp (revision 335)
@@ -1,6 +1,31 @@
+/*
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARRgbPixelReader_BYTE1D_X8R8G8B8_32.h"

-
+#include "NyARException.h"
namespace NyARToolkitCPP
{
NyARRgbPixelReader_BYTE1D_X8R8G8B8_32::NyARRgbPixelReader_BYTE1D_X8R8G8B8_32(const TNyARIntSize* i_size,const NyAR_BYTE_t* i_buf)
@@ -29,5 +54,14 @@
}
return;
}
+ void NyARRgbPixelReader_BYTE1D_X8R8G8B8_32::setPixel(int i_x, int i_y, const int* i_rgb)
+ {
+ NyARException::notImplement();
+ }
+ void NyARRgbPixelReader_BYTE1D_X8R8G8B8_32::setPixels(const int* i_x, const int* i_y, int i_num, const int* i_intrgb)
+ {
+ NyARException::notImplement();
+ }
+
}

Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRgbPixelReader_RGB24.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRgbPixelReader_RGB24.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARRgbPixelReader_RGB24.cpp (revision 335)
@@ -1,4 +1,30 @@
+/*
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARRgbPixelReader_RGB24.h"
+#include "NyARException.h"


namespace NyARToolkitCPP
@@ -29,5 +55,13 @@
}
return;
}
+ void NyARRgbPixelReader_RGB24::setPixel(int i_x, int i_y, const int* i_rgb)
+ {
+ NyARException::notImplement();
+ }
+ void NyARRgbPixelReader_RGB24::setPixels(const int* i_x, const int* i_y, int i_num, const int* i_intrgb)
+ {
+ NyARException::notImplement();
+ }
}

Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARPca2d_MatrixPCA_O2.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARPca2d_MatrixPCA_O2.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARPca2d_MatrixPCA_O2.cpp (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARPca2d_MatrixPCA_O2.h"
#include <cmath>

Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARTransMat.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARTransMat.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/INyARTransMat.cpp (revision 335)
@@ -1,28 +1,26 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "INyARTransMat.h"
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARLabelingLabelStack.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARLabelingLabelStack.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core/NyARLabelingLabelStack.cpp (revision 335)
@@ -1,64 +1,36 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARLabelingLabelStack.h"

namespace NyARToolkitCPP
{
- NyARLabelingLabelStack::NyARLabelingLabelStack(int i_length):NyObjectStack<NyARLabelingLabel>(i_length)
+ NyARLabelingLabelStack::NyARLabelingLabelStack(int i_length):NyARLabelInfoStack<NyARLabelingLabel>(i_length)
{
}
NyARLabelingLabelStack::~NyARLabelingLabelStack(void)
{
}
-
- void NyARLabelingLabelStack::sortByArea()
- {
- const int len=this->_length;
- int h = len *13/10;
- NyARLabelingLabel** item=this->_items->item;
- for(;;){
- int swaps = 0;
- for (int i = 0; i + h < len; i++) {
- if (item[i + h]->area > item[i]->area) {
- NyARLabelingLabel* temp = item[i + h];
- item[i + h] = item[i];
- item[i] = temp;
- swaps++;
- }
- }
- if (h == 1) {
- if (swaps == 0){
- break;
- }
- }else{
- h=h*10/13;
- }
- }
- return;
- }
}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core2/INyARRasterThresholdAnalyzer.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core2/INyARRasterThresholdAnalyzer.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core2/INyARRasterThresholdAnalyzer.cpp (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "INyARRasterThresholdAnalyzer.h"

namespace NyARToolkitCPP
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/core2/NyARRasterThresholdAnalyzer_SlidePTile.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/core2/NyARRasterThresholdAnalyzer_SlidePTile.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/core2/NyARRasterThresholdAnalyzer_SlidePTile.cpp (revision 335)
@@ -2,27 +2,25 @@
* PROJECT: NyARToolkitCPP
* --------------------------------------------------------------------------------
*
-* The NyARToolkitCS is C++ version NyARToolkit class library.
-*
-* Copyright (C)2008 R.Iizuka
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
*
-* 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 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 3 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 framework; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For further information please contact.
* http://nyatla.jp/nyatoolkit/
-* <airmail(at)ebony.plala.or.jp>
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
*
*/
#include "NyARRasterThresholdAnalyzer_SlidePTile.h"
@@ -246,6 +244,72 @@
}
};

+ /**
+ * WORD1D_R5G6B5_16LEÌıĘħďÉÀͶϚĎÉĘ
+ *
+ */
+ class CreateHistgramImpl_WORD1D_R5G6B5_16LE :public ICreateHistgramImpl
+ {
+ private:
+ int _v_interval;
+ public:
+ CreateHistgramImpl_WORD1D_R5G6B5_16LE(int i_v_interval)
+ {
+ this->_v_interval = i_v_interval;
+ return;
+ }
+ int createHistgramImpl(const INyARBufferReader& i_reader,const TNyARIntSize& i_size, int* o_histgram)
+ {
+ NyAR_ASSERT(i_reader.isEqualBufferType(INyARBufferReader::BUFFERFORMAT_WORD1D_R5G6B5_16LE));
+ unsigned short* input = (unsigned short*)i_reader.getBuffer();
+ int pix_count = i_size.w;
+ int pix_mod_part = pix_count - (pix_count % 8);
+ int sum = 0;
+ for (int y = i_size.h - 1; y >= 0; y -= this->_v_interval)
+ {
+ sum += i_size.w;
+ int pt = y * i_size.w;
+ int x;
+ unsigned short v;
+ for (x = pix_count - 1; x >= pix_mod_part; x--)
+ {
+ v =input[pt];
+ v = (((v & 0xf800) >> 8) + ((v & 0x07e0) >> 3) + ((v & 0x001f) << 3))/3;
+ o_histgram[v]++;
+ pt++;
+ }
+ //ĞăÊÓď
+ for (; x >= 0; x -= 8)
+ {
+ v =input[pt];pt++;
+ v = (((v & 0xf800) >> 8) + ((v & 0x07e0) >> 3) + ((v & 0x001f) << 3))/3;
+ o_histgram[v]++;
+ v =input[pt];pt++;
+ v = (((v & 0xf800) >> 8) + ((v & 0x07e0) >> 3) + ((v & 0x001f) << 3))/3;
+ o_histgram[v]++;
+ v =input[pt];pt++;
+ v = (((v & 0xf800) >> 8) + ((v & 0x07e0) >> 3) + ((v & 0x001f) << 3))/3;
+ o_histgram[v]++;
+ v =input[pt];pt++;
+ v = (((v & 0xf800) >> 8) + ((v & 0x07e0) >> 3) + ((v & 0x001f) << 3))/3;
+ o_histgram[v]++;
+ v =input[pt];pt++;
+ v = (((v & 0xf800) >> 8) + ((v & 0x07e0) >> 3) + ((v & 0x001f) << 3))/3;
+ o_histgram[v]++;
+ v =input[pt];pt++;
+ v = (((v & 0xf800) >> 8) + ((v & 0x07e0) >> 3) + ((v & 0x001f) << 3))/3;
+ o_histgram[v]++;
+ v =input[pt];pt++;
+ v = (((v & 0xf800) >> 8) + ((v & 0x07e0) >> 3) + ((v & 0x001f) << 3))/3;
+ o_histgram[v]++;
+ v =input[pt];pt++;
+ v = (((v & 0xf800) >> 8) + ((v & 0x07e0) >> 3) + ((v & 0x001f) << 3))/3;
+ o_histgram[v]++;
+ }
+ }
+ return sum;
+ }
+ };



@@ -254,71 +318,71 @@
* INT1D_X8R8G8B8_32ÌıĘħďÉÀͶϚĎÉĘ
*
*/
-/*
+ /*
class CreateHistgramImpl_INT1D_X8R8G8B8_32 :public ICreateHistgramImpl
{
private:
- int _v_interval;
+ int _v_interval;
public:
- CreateHistgramImpl_INT1D_X8R8G8B8_32(int i_v_interval)
- {
- this->_v_interval = i_v_interval;
- return;
- }
- int createHistgramImpl(const INyARBufferReader& i_reader,const TNyARIntSize& i_size, int* o_histgram)
- {
- NyAR_ASSERT(i_reader.isEqualBufferType(INyARBufferReader::BUFFERFORMAT_INT1D_X8R8G8B8_32));
- const int* input = (const int*)i_reader.getBuffer();
- int pix_count = i_size.w;
- int pix_mod_part = pix_count - (pix_count % 8);
- int sum = 0;
- for (int y = i_size.h - 1; y >= 0; y -= this->_v_interval)
- {
- sum += i_size.w;
- int pt = y * i_size.w;
- int x, v;
- int w;
- for (x = pix_count - 1; x >= pix_mod_part; x--)
- {
- w=input[pt];
- v = (((w>>16)&0xff)+((w>>8)&0xff)+(w&0xff));
- o_histgram[v]++;
- pt++;
- }
- //ĞăÊÓď
- for (; x >= 0; x -= 8)
- {
- w=input[pt+0];
- v = (((w>>16)&0xff)+((w>>8)&0xff)+(w&0xff));
- o_histgram[v]++;
- w=input[pt+1];
- v = (((w>>16)&0xff)+((w>>8)&0xff)+(w&0xff));
- o_histgram[v]++;
- w=input[pt+2];
- v = (((w>>16)&0xff)+((w>>8)&0xff)+(w&0xff));
- o_histgram[v]++;
- w=input[pt+3];
- v = (((w>>16)&0xff)+((w>>8)&0xff)+(w&0xff));
- o_histgram[v]++;
- w=input[pt+4];
- v = (((w>>16)&0xff)+((w>>8)&0xff)+(w&0xff));
- o_histgram[v]++;
- w=input[pt+5];
- v = (((w>>16)&0xff)+((w>>8)&0xff)+(w&0xff));
- o_histgram[v]++;
- w=input[pt+6];
- v = (((w>>16)&0xff)+((w>>8)&0xff)+(w&0xff));
- o_histgram[v]++;
- w=input[pt+7];
- v = (((w>>16)&0xff)+((w>>8)&0xff)+(w&0xff));
- o_histgram[v]++;
- pt += 8;
- }
- }
- return sum;
- }
+ CreateHistgramImpl_INT1D_X8R8G8B8_32(int i_v_interval)
+ {
+ this->_v_interval = i_v_interval;
+ return;
+ }
+ int createHistgramImpl(const INyARBufferReader& i_reader,const TNyARIntSize& i_size, int* o_histgram)
+ {
+ NyAR_ASSERT(i_reader.isEqualBufferType(INyARBufferReader::BUFFERFORMAT_INT1D_X8R8G8B8_32));
+ const int* input = (const int*)i_reader.getBuffer();
+ int pix_count = i_size.w;
+ int pix_mod_part = pix_count - (pix_count % 8);
+ int sum = 0;
+ for (int y = i_size.h - 1; y >= 0; y -= this->_v_interval)
+ {
+ sum += i_size.w;
+ int pt = y * i_size.w;
+ int x, v;
+ int w;
+ for (x = pix_count - 1; x >= pix_mod_part; x--)
+ {
+ w=input[pt];
+ v = (((w>>16)&0xff)+((w>>8)&0xff)+(w&0xff));
+ o_histgram[v]++;
+ pt++;
+ }
+ //ĞăÊÓď
+ for (; x >= 0; x -= 8)
+ {
+ w=input[pt+0];
+ v = (((w>>16)&0xff)+((w>>8)&0xff)+(w&0xff));
+ o_histgram[v]++;
+ w=input[pt+1];
+ v = (((w>>16)&0xff)+((w>>8)&0xff)+(w&0xff));
+ o_histgram[v]++;
+ w=input[pt+2];
+ v = (((w>>16)&0xff)+((w>>8)&0xff)+(w&0xff));
+ o_histgram[v]++;
+ w=input[pt+3];
+ v = (((w>>16)&0xff)+((w>>8)&0xff)+(w&0xff));
+ o_histgram[v]++;
+ w=input[pt+4];
+ v = (((w>>16)&0xff)+((w>>8)&0xff)+(w&0xff));
+ o_histgram[v]++;
+ w=input[pt+5];
+ v = (((w>>16)&0xff)+((w>>8)&0xff)+(w&0xff));
+ o_histgram[v]++;
+ w=input[pt+6];
+ v = (((w>>16)&0xff)+((w>>8)&0xff)+(w&0xff));
+ o_histgram[v]++;
+ w=input[pt+7];
+ v = (((w>>16)&0xff)+((w>>8)&0xff)+(w&0xff));
+ o_histgram[v]++;
+ pt += 8;
+ }
+ }
+ return sum;
+ }
};
-*/
+ */



@@ -346,6 +410,9 @@
case INyARBufferReader::BUFFERFORMAT_BYTE1D_X8R8G8B8_32:
this->_histgram = new CreateHistgramImpl_BYTE1D_X8R8G8B8_32(i_vertical_interval);
break;
+ case INyARBufferReader::BUFFERFORMAT_WORD1D_R5G6B5_16LE:
+ this->_histgram=new CreateHistgramImpl_WORD1D_R5G6B5_16LE(i_vertical_interval);
+ break;
default:
throw NyARException();
}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/sandbox/NyMath.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/sandbox/NyMath.cpp (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/sandbox/NyMath.cpp (revision 335)
@@ -0,0 +1,171 @@
+/*
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCS is C++ version NyARToolkit class library.
+*
+* Copyright (C)2008 R.Iizuka
+*
+* 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 framework; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp>
+*
+*/
+#include "NyMath.h"
+#include <cmath>
+#include "NyAR_types.h"
+namespace NyARToolkitCPP
+{
+ NyAR_INT64_t NyMath::sqrtFixdFloat16(NyAR_INT64_t i_ff16)
+ {
+ NyAR_INT64_t t=0,s;
+ s=i_ff16>0?i_ff16:-i_ff16;
+ if(i_ff16==0){
+ return 0;
+ }
+ for(int i=SQRT_LOOP;i>0;i--){
+ t = s;
+ s = (t+((i_ff16<<16)/t))>>1;
+ if(s==t){
+ break;
+ }
+ };
+ return t;
+ }
+ NyAR_INT64_t NyMath::sqrtFixdFloat(NyAR_INT64_t i_ff,int i_bit)
+ {
+ NyAR_INT64_t t=0,s;
+ s=i_ff>0?i_ff:-i_ff;
+ if(i_ff==0){
+ return 0;
+ }
+ for(int i=SQRT_LOOP;i>0;i--){
+ t = s;
+ s = (t+((i_ff<<i_bit)/t))>>1;
+ if(s==t){
+ break;
+ }
+ }
+ return t;
+ }
+ int NyMath::acosFixedFloat16(int i_ff24)
+ {/*
+ long x=i_ff24>>8;
+ long x2=(x*x)>>16;
+ long x3=(x2*x)>>16;
+ long x4=(x2*x2)>>16;
+ // return FF16_05PI-(int)(x+x3/6+(((3*x3*x2/(2*4*5)+(3*5*x4*x3)/(2*4*6*7)))>>16));
+ */
+ int result;
+ int abs_ff24=i_ff24>0?i_ff24:-i_ff24;
+ //(0<=n<=0.25) 0<=0-16384(65536/4)ÜÅÍy=PI/2-xÌÅ̟Η
+ //(0.25<n<=1/2PI) 16385-65536ÜÅÍ(128ĘĥĢĶӐɊ)Ìĥ›ĵËðϧذ
+
+ if(abs_ff24<FIXEDFLOAT24_0_25){
+ //0.25ÜÅÌՍɍ́2ΟÌ̟Ηή
+ result=(i_ff24>>8);
+ return FF16_05PI-result+((((result*result)>>16)*result)>>16)/6;
+ }else{
+ result=acos_table[((abs_ff24>>8)-FIXEDFLOAT16I_0_25)>>5];
+ if (i_ff24 < 0) {
+ return FF16_PI-result;
+ }else{
+ return result;
+ }
+ }
+ // return (int)(Math.acos((double)i_ff24/0x1000000)*0x10000);
+ }
+
+ int NyMath::sinFixedFloat24(int i_ff16)
+ {
+ int result;
+ //i_ff16ð0-2ĎÉЧ̀
+ int rad=i_ff16%FF16_2PI;
+ if(rad<0){
+ rad=rad+FF16_2PI;
+ }
+ //4ĵÍĢĎÉժʄ
+ int dv=rad/FF16_05PI;
+ //radð0-0.5PIÉЧ̀
+ rad=rad-dv*FF16_05PI;
+ //radðdvÉæè֢г
+ if(dv==1 || dv==3){
+ rad=FF16_05PI-rad;
+ }
+ //(0<=n<=0.25) 0<=0-16384(65536/4)ÜÅÍy=xÌÅ̟Η
+ //(0.25<n<=1/2PI) 16385-102944ÜÅÍ(256ĘĥĢĶӐɊ)Ìĥ›ĵËðϧذ
+ //ՉÉ·é
+ if(rad<FIXEDFLOAT16_0_25){
+ result=rad<<8;
+ }else{
+ result=sin_table[(rad-FIXEDFLOAT16I_0_25)>>8];
+ }
+ if(dv>=2){
+ result=-result;
+ }
+ return result;
+ // return (int)(Math.sin((double)i_ff16/0x10000)*0x1000000);
+ }
+ int NyMath::cosFixedFloat24(int i_ff16)
+ {
+ int result;
+ //i_ff16ð0-2ĎÉЧ̀
+ int rad=(i_ff16+FF16_05PI)%FF16_2PI;
+ if(rad<0){
+ rad=rad+FF16_2PI;
+ }
+ //4ĵÍĢĎÉժʄ
+ int dv=rad/FF16_05PI;
+ //radð0-0.5PIÉЧ̀
+ rad=rad-dv*FF16_05PI;
+ //radðdvÉæè֢г
+ if(dv==1 || dv==3){
+ rad=FF16_05PI-rad;
+ }
+ //(0<=n<=0.25) 0<=0-16384(65536/4)ÜÅÍy=xÌÅ̟Η
+ //(0.25<n<=1/2PI) 16385-102944ÜÅÍ(256ĘĥĢĶӐɊ)Ìĥ›ĵËðϧذ
+ //ՉÉ·é
+ if(rad<FIXEDFLOAT16_0_25){
+ result=rad<<8;
+ }else{
+ result=sin_table[(rad-FIXEDFLOAT16I_0_25)>>8];
+ }
+ if(dv>=2){
+ result=-result;
+ }
+ return result;
+ // return (int)(Math.cos((double)i_ff16/0x10000)*0x1000000);
+ }
+ void NyMath::initialize()
+ {
+
+ int step;
+ step=FIXEDFLOAT16I_0_25+256;
+ for(int i=0;i<339;i++){
+ sin_table[i]=(int)((sin((double) step / (double) FIXEDFLOAT16I_1))*FIXEDFLOAT24_1);
+ step+=256;
+ }
+ //acosĥ›ĵËω˺ɻ
+ step=FIXEDFLOAT16I_0_25+32;
+ for (int i = 0; i < 1537; i++) {
+ acos_table[i] =(int)((acos((double) step/(double) FIXEDFLOAT16I_1))*FIXEDFLOAT16_1);
+ step+=32;
+ }
+ return;
+ }
+
+}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/sandbox/NyARFixedFloatRotVector.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/sandbox/NyARFixedFloatRotVector.cpp (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/sandbox/NyARFixedFloatRotVector.cpp (revision 335)
@@ -0,0 +1 @@
+#include "INyARColorPatt.h"
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/sandbox/NyARTransMat_X2.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/sandbox/NyARTransMat_X2.cpp (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/sandbox/NyARTransMat_X2.cpp (revision 335)
@@ -0,0 +1 @@
+#include "INyARColorPatt.h"
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/sandbox/NyARFixedFloatRotTransOptimize_O2.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/sandbox/NyARFixedFloatRotTransOptimize_O2.cpp (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/sandbox/NyARFixedFloatRotTransOptimize_O2.cpp (revision 335)
@@ -0,0 +1,263 @@
+#include "NyARPerspectiveProjectionMatrix.h"
+#include "NyARDoubleMatrix33.h"
+#include "NyAR_types.h"
+#include "NyARRotMatrix.h"
+#include "NyAR_types.h"
+#include "NyMath.h"
+namespace NyARToolkitCPP{
+
+class NyARI64Matrix33
+{
+public:
+ NyAR_INT64_t m00;
+ NyAR_INT64_t m01;
+ NyAR_INT64_t m02;
+ NyAR_INT64_t m10;
+ NyAR_INT64_t m11;
+ NyAR_INT64_t m12;
+ NyAR_INT64_t m20;
+ NyAR_INT64_t m21;
+ NyAR_INT64_t m22;
+};
+
+
+ class NyARFixedFloatRotTransOptimize_O2
+ {
+ private:
+ const static int AR_GET_TRANS_MAT_MAX_LOOP_COUNT = 1;// #define AR_GET_TRANS_MAT_MAX_LOOP_COUNT 5
+ const NyARPerspectiveProjectionMatrix* _projection_mat_ref;
+ public:
+ NyARFixedFloatRotTransOptimize_O2(const NyARPerspectiveProjectionMatrix* i_projection_mat_ref)
+ {
+ this->_projection_mat_ref=i_projection_mat_ref;
+ return;
+ }
+
+ double optimize(NyARRotMatrix& io_rotmat,TNyARDoublePoint3d& io_transvec,const NyARFitVecCalculator& i_calculator)
+ {
+ const TNyARDoublePoint2d* fit_vertex=i_calculator.getFitSquare();
+ const TNyARDoublePoint3d* offset_square=i_calculator.getOffsetVertex()->vertex;
+
+ double err = -1;
+ err = modifyMatrix(io_rotmat,io_transvec,offset_square,fit_vertex);
+ /*˛ĶðԲ¯éĞăľÓďðARToolKitÆ͇í¹é½ßÉ֏ȱƵÄÜ·‚*/
+ for (int i = 0; ; i++)
+ {
+ // <arGetTransMat3>
+ err = modifyMatrix(io_rotmat, io_transvec, offset_square, fit_vertex);
+ i_calculator.calculateTransfer(io_rotmat, io_transvec);
+ err = modifyMatrix(io_rotmat, io_transvec, offset_square, fit_vertex);
+ // //</arGetTransMat3>
+ if (err < 1.0 || i == AR_GET_TRANS_MAT_MAX_LOOP_COUNT - 1)
+ {
+ break;
+ }
+ i_calculator.calculateTransfer(io_rotmat, io_transvec);
+ }
+ return err;
+ }
+
+// private final long[][] __modifyMatrix_double1D = new long[8][3];
+ private:
+ const static NyAR_INT64_t INITIAL_FACTOR=(NyAR_INT64_t)(0x10000*5.0 * 3.1415926535897932384626433832795 / 180.0);
+ /**
+ * arGetRotͶϚðˋҷɻµ½ModifyMatrix 896
+ *
+ * @param nyrot
+ * @param trans
+ * @param i_vertex3d
+ * [m][3]
+ * @param i_vertex2d
+ * [n][2]
+ * @return
+ * @throws NyARException
+ */
+ double modifyMatrix(NyARRotMatrix& io_rot,TNyARDoublePoint3d& trans,const TNyARDoublePoint3d* i_vertex3d, const TNyARDoublePoint2d* i_vertex2d)
+ {
+ NyAR_INT64_t a2, b2, c2;
+ NyAR_INT64_t h, x, y;
+ NyAR_INT64_t err, minerr = 0;
+ int t1, t2, t3;
+ int best_idx=0;
+
+ NyAR_INT64_t factor = INITIAL_FACTOR;
+ NyAR_INT64_t rot0, rot1, rot2;
+ NyAR_INT64_t combo00, combo01, combo02, combo03, combo10, combo11, combo12, combo13, combo20, combo21, combo22, combo23;
+ NyAR_INT64_t combo02_2, combo02_5, combo02_8, combo02_11;
+ NyAR_INT64_t combo22_2, combo22_5, combo22_8, combo22_11;
+ NyAR_INT64_t combo12_2, combo12_5, combo12_8, combo12_11;
+ // vertexԗˊ
+ NyAR_INT64_t VX00, VX01, VX02, VX10, VX11, VX12, VX20, VX21, VX22, VX30, VX31, VX32;
+ VX00 = (NyAR_INT64_t)(i_vertex3d[0].x*0x10000);
+ VX01 = (NyAR_INT64_t)(i_vertex3d[0].y*0x10000);
+ VX02 = (NyAR_INT64_t)(i_vertex3d[0].z*0x10000);
+ VX10 = (NyAR_INT64_t)(i_vertex3d[1].x*0x10000);
+ VX11 = (NyAR_INT64_t)(i_vertex3d[1].y*0x10000);
+ VX12 = (NyAR_INT64_t)(i_vertex3d[1].z*0x10000);
+ VX20 = (NyAR_INT64_t)(i_vertex3d[2].x*0x10000);
+ VX21 = (NyAR_INT64_t)(i_vertex3d[2].y*0x10000);
+ VX22 = (NyAR_INT64_t)(i_vertex3d[2].z*0x10000);
+ VX30 = (NyAR_INT64_t)(i_vertex3d[3].x*0x10000);
+ VX31 = (NyAR_INT64_t)(i_vertex3d[3].y*0x10000);
+ VX32 = (NyAR_INT64_t)(i_vertex3d[3].z*0x10000);
+ NyAR_INT64_t P2D00, P2D01, P2D10, P2D11, P2D20, P2D21, P2D30, P2D31;
+ P2D00 = (NyAR_INT64_t)(i_vertex2d[0].x*0x10000);
+ P2D01 = (NyAR_INT64_t)(i_vertex2d[0].y*0x10000);
+ P2D10 = (NyAR_INT64_t)(i_vertex2d[1].x*0x10000);
+ P2D11 = (NyAR_INT64_t)(i_vertex2d[1].y*0x10000);
+ P2D20 = (NyAR_INT64_t)(i_vertex2d[2].x*0x10000);
+ P2D21 = (NyAR_INT64_t)(i_vertex2d[2].y*0x10000);
+ P2D30 = (NyAR_INT64_t)(i_vertex2d[3].x*0x10000);
+ P2D31 = (NyAR_INT64_t)(i_vertex2d[3].y*0x10000);
+ const NyARPerspectiveProjectionMatrix& prjmat = *this->_projection_mat_ref;
+ NyAR_INT64_t CP0,CP1,CP2,CP3,CP4,CP5,CP6,CP7,CP8,CP9,CP10;
+ CP0 = (NyAR_INT64_t)(prjmat.m00*0x10000L);
+ CP1 = (NyAR_INT64_t)(prjmat.m01*0x10000L);
+ CP2 = (NyAR_INT64_t)(prjmat.m02*0x10000L);
+ CP4 = (NyAR_INT64_t)(prjmat.m10*0x10000L);
+ CP5 = (NyAR_INT64_t)(prjmat.m11*0x10000L);
+ CP6 = (NyAR_INT64_t)(prjmat.m12*0x10000L);
+ CP8 = (NyAR_INT64_t)(prjmat.m20*0x10000L);
+ CP9 = (NyAR_INT64_t)(prjmat.m21*0x10000L);
+ CP10 =(NyAR_INT64_t)(prjmat.m22*0x10000L);
+
+ NyAR_INT64_t trans_x=(NyAR_INT64_t)(trans.x*0x10000L);
+ NyAR_INT64_t trans_y=(NyAR_INT64_t)(trans.y*0x10000L);
+ NyAR_INT64_t trans_z=(NyAR_INT64_t)(trans.z*0x10000L);
+
+ combo03 = ((CP0 * trans_x + CP1 * trans_y + CP2 * trans_z)>>16) + (NyAR_INT64_t)(prjmat.m03*0x10000L);
+ combo13 = ((CP4 * trans_x + CP5 * trans_y + CP6 * trans_z)>>16) + (NyAR_INT64_t)(prjmat.m13*0x10000L);
+ combo23 = ((CP8 * trans_x + CP9 * trans_y + CP10 * trans_z)>>16) + (NyAR_INT64_t)(prjmat.m23*0x10000L);
+ NyAR_INT64_t CACA, SASA, SACA, CA, SA;
+ NyAR_INT64_t CACACB, SACACB, SASACB, CASB, SASB;
+ NyAR_INT64_t SACASC, SACACBSC, SACACBCC, SACACC;
+
+ NyAR_INT64_t a_factor[3];
+ NyAR_INT64_t sinb[3];
+ NyAR_INT64_t cosb[3];
+ NyAR_INT64_t b_factor[3];
+ NyAR_INT64_t sinc[3];
+ NyAR_INT64_t cosc[3];
+ NyAR_INT64_t c_factor[3];
+ NyAR_INT64_t w, w2;
+ NyAR_INT64_t wsin, wcos;
+
+ const TNyARDoublePoint3d& angle=io_rot.refAngle();// arGetAngle( rot, &a, &b, &c );
+ a2 =(NyAR_INT64_t)(angle.x*0x1000000);
+ b2 =(NyAR_INT64_t)(angle.y*0x1000000);
+ c2 =(NyAR_INT64_t)(angle.z*0x1000000);
+
+ // comboÌ3γךðѦÉͶϚ
+ for (int i = 0; i < 10; i++) {
+ minerr = 0x4000000000000000L;
+ // sin-cosĥ›ĵËðͶϚ(±êªˏÉЯ¹éÆÍ£‚)
+ for (int j = 0; j < 3; j++) {
+ w2 = factor * (j - 1);//S16
+ w = a2 + w2;//S16
+ a_factor[j] = w;//S16
+ w = b2 + w2;//S16
+ b_factor[j] = w;//S16
+ sinb[j] = NyMath::sinFixedFloat24((int)w);
+ cosb[j] = NyMath::cosFixedFloat24((int)w);
+ w = c2 + w2;//S16
+ c_factor[j] = w;//S16
+ sinc[j] = NyMath::sinFixedFloat24((int)w);
+ cosc[j] = NyMath::cosFixedFloat24((int)w);
+ }
+ //
+ for (t1 = 0; t1 < 3; t1++) {
+ SA = NyMath::sinFixedFloat24((int)a_factor[t1]);
+ CA = NyMath::cosFixedFloat24((int)a_factor[t1]);
+ // Optimize
+ CACA = (CA * CA)>>24;//S24
+ SASA = (SA * SA)>>24;//S24
+ SACA = (SA * CA)>>24;//S24
+ for (t2 = 0; t2 < 3; t2++) {
+ wsin = sinb[t2];//S24
+ wcos = cosb[t2];//S24
+ CACACB = (CACA * wcos)>>24;//S24
+ SACACB = (SACA * wcos)>>24;//S24
+ SASACB = (SASA * wcos)>>24;//S24
+ CASB = (CA * wsin)>>24;//S24
+ SASB = (SA * wsin)>>24;//S24
+
+ // comboÌͶϚ1
+ combo02 = (CP0 * CASB + CP1 * SASB + CP2 * wcos)>>24;//S24*S16>>24=S16
+ combo12 = (CP4 * CASB + CP5 * SASB + CP6 * wcos)>>24;//S24*S16>>24=S16
+ combo22 = (CP8 * CASB + CP9 * SASB + CP10 * wcos)>>24;//S24*S16>>24=S16
+
+ combo02_2 = ((combo02 * VX02)>>16) + combo03;//S16
+ combo02_5 = ((combo02 * VX12)>>16) + combo03;//S16
+ combo02_8 = ((combo02 * VX22)>>16) + combo03;//S16
+ combo02_11 = ((combo02 * VX32)>>16) + combo03;//S16
+ combo12_2 = ((combo12 * VX02)>>16) + combo13;//S16
+ combo12_5 = ((combo12 * VX12)>>16) + combo13;//S16
+ combo12_8 = ((combo12 * VX22)>>16) + combo13;//S16
+ combo12_11 = ((combo12 * VX32)>>16) + combo13;//S16
+ combo22_2 = ((combo22 * VX02)>>16) + combo23;//S16
+ combo22_5 = ((combo22 * VX12)>>16) + combo23;//S16
+ combo22_8 = ((combo22 * VX22)>>16) + combo23;//S16
+ combo22_11 = ((combo22 * VX32)>>16) + combo23;//S16
+ for (t3 = 0; t3 < 3; t3++) {
+ wsin = sinc[t3];//S24
+ wcos = cosc[t3];//S24
+ SACASC = (SACA * wsin)>>24;//S24
+ SACACC = (SACA * wcos)>>24;//S24
+ SACACBSC =(SACACB * wsin)>>24;//S24;
+ SACACBCC = (SACACB * wcos)>>24;//S24;
+
+ rot0 = ((CACACB * wcos + SASA * wcos)>>24) + SACACBSC - SACASC;//S24;
+ rot1 = SACACBCC - SACACC + ((SASACB * wsin + CACA * wsin)>>24);//S24;
+ rot2 = (-CASB * wcos - SASB * wsin)>>24;//S24;
+ combo00 = (CP0 * rot0 + CP1 * rot1 + CP2 * rot2)>>24;//S16
+ combo10 = (CP4 * rot0 + CP5 * rot1 + CP6 * rot2)>>24;//S16
+ combo20 = (CP8 * rot0 + CP9 * rot1 + CP10 * rot2)>>24;//S16
+
+ rot0 = ((-CACACB * wsin - SASA * wsin)>>24) + SACACBCC - SACACC;//S24
+ rot1 = -SACACBSC + SACASC + ((SASACB * wcos + CACA * wcos)>>24);//S24
+ rot2 = (CASB * wsin - SASB * wcos)>>24;//S24
+
+ combo01 =(CP0 * rot0 + CP1 * rot1 + CP2 * rot2)>>24;//S16
+ combo11 =(CP4 * rot0 + CP5 * rot1 + CP6 * rot2)>>24;//S16
+ combo21 =(CP8 * rot0 + CP9 * rot1 + CP10 * rot2)>>24;//S16
+ //
+ err =0;
+ h = ((combo20 * VX00 + combo21 * VX01)>>16) + combo22_2;//S16
+ x = P2D00 - ((((combo00 * VX00 + combo01 * VX01)>>16) + combo02_2)<<16) / h;//S16
+ y = P2D01 - ((((combo10 * VX00 + combo11 * VX01)>>16) + combo12_2)<<16) / h;//S16
+ err += ((x * x + y * y)>>16);
+ h = ((combo20 * VX10 + combo21 * VX11)>>16) + combo22_5;
+ x = P2D10 - ((((combo00 * VX10 + combo01 * VX11)>>16) + combo02_5)<<16) / h;//S16
+ y = P2D11 - ((((combo10 * VX10 + combo11 * VX11)>>16) + combo12_5)<<16) / h;//S16
+ err += ((x * x + y * y)>>16);
+ h = ((combo20 * VX20 + combo21 * VX21)>>16) + combo22_8;
+ x = P2D20 - ((((combo00 * VX20 + combo01 * VX21)>>16) + combo02_8)<<16) / h;//S16
+ y = P2D21 - ((((combo10 * VX20 + combo11 * VX21)>>16) + combo12_8)<<16) / h;//S16
+ err += ((x * x + y * y)>>16);
+ h = ((combo20 * VX30 + combo21 * VX31)>>16) + combo22_11;
+ x = P2D30 - ((((combo00 * VX30 + combo01 * VX31)>>16) + combo02_11)<<16) / h;//S16
+ y = P2D31 - ((((combo10 * VX30 + combo11 * VX31)>>16) + combo12_11)<<16) / h;//S16
+ err += ((x * x + y * y)>>16);
+ if (err < minerr) {
+ minerr = err;
+ a2 = a_factor[t1];
+ b2 = b_factor[t2];
+ c2 = c_factor[t3];
+ best_idx=t1+t2*3+t3*9;
+ }
+ }
+ }
+ }
+ if (best_idx==(1+3+9)) {
+ factor=factor>>1;
+ }
+ }
+ io_rot.setAngle((double)a2/NyMath::FIXEDFLOAT24_1,(double)b2/NyMath::FIXEDFLOAT24_1,(double)c2/NyMath::FIXEDFLOAT24_1);
+ /* printf("factor = %10.5f\n", factor*180.0/MD_PI); */
+ return (double)(minerr /4);//±ÌѝӨӬ¨©µ­Ëˆ16bitfixedfloatÈç16ÅʄçȢƂ
+ }
+
+
+ };
+
+}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/src/sandbox/NyARSquareDetector_X2.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/src/sandbox/NyARSquareDetector_X2.cpp (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/src/sandbox/NyARSquareDetector_X2.cpp (revision 335)
@@ -0,0 +1 @@
+#include "INyARColorPatt.h"
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/sample/idtest.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/sample/idtest.as (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/sample/idtest.as (revision 335)
@@ -1,134 +0,0 @@
-/**
- * Eclipseで動かない?そんな時は…
- *
- * 1.パッケージエクスプローラで、.swfのプロパティを見てみよう。UseHtmlTemplateは使っちゃダメだよ。
- * 2.FlashPlayerのローカルファイルアクセスのセキュリティ解除してみよう。場所は、
- * C:\WINDOWS\system32\Macromed\Flash\FlashPlayerTrust
- *
- *
- *
- */
-
-
-package{
- import flash.net.*;
- import jp.nyatla.as3utils.*;
- import jp.nyatla.nyartoolkit.as3.*;
- import flash.display.Sprite;
- import flash.text.*;
- import flash.events.*;
- import flash.utils.*;
-
- public class idtest extends Sprite
- {
- private var myTextBox:TextField = new TextField();
- private var myTextBox2:TextField = new TextField();
-
-
- public function msg(i_msg:String):void
- {
- myTextBox.text =i_msg+","+myTextBox.text;
- }
- //private var cpara:ByteArray;
- private var param:NyARParam;
- private var raster_bgra:NyARRgbRaster_BGRA;
- private var raster_xrgb:NyARRgbRaster_XRGB32;
- public function idtest()
- {
- myTextBox.y=0;
- myTextBox2.y=30;
- addChild(myTextBox);
- addChild(myTextBox2);
- //システムを初期化
-
-
- //ファイルをメンバ変数にロードする。
- var mf:NyMultiFileLoader=new NyMultiFileLoader();
- mf.addTarget(
- "camera_para.dat",URLLoaderDataFormat.BINARY,
- function(data:ByteArray):void
- {
- param=new NyARParam();
- param.loadARParamFile(data);
- });
- mf.addTarget(
- "320x240NyId.raw",URLLoaderDataFormat.BINARY,
- function(data:ByteArray):void
- {
- var r:NyARRgbRaster_BGRA=new NyARRgbRaster_BGRA(320,240);
- r.setFromByteArray(data);
- raster_bgra=r;
- });
- //終了後mainに遷移するよ―に設定
- mf.addEventListener(Event.COMPLETE,main);
- mf.multiLoad();//ロード開始
- return;//dispatch event
- }
- private function main(e:Event):void
- {
- msg("ready!");
- param.changeScreenSize(320,240);
- msg("main:-2");
- var enc:NyIdMarkerDataEncoder_RawBit=new NyIdMarkerDataEncoder_RawBit();
- msg("main:-1");
- var idproc:SingleNyIdMarkerProcesser=new SingleNyIdMarkerProcesser(param,enc,NyARRgbRaster.BUFFERFORMAT_BYTE1D_B8G8R8X8_32);
- msg("main:-5");
-
- idproc.setListener(new TestListener(this));
- idproc.detectMarker(raster_bgra);
-/* msg("main:0");
- idproc.setMarkerWidth(100);
- msg("main:1");
- idproc.reset(true);
- msg("main:2");
- var m:NyARPerspectiveProjectionMatrix=param.getPerspectiveProjectionMatrix();
- var c:Array=new Array(12);
- var v:Array=new Array(12);
- m.decompMat(c,v);
- msg(c.toString());
-
-
-*/
- msg("main:3");
-
-
- return;
- }
- }
-}
-
-import jp.nyatla.nyartoolkit.as3.*;
-class TestListener extends SingleNyIdMarkerProcesserListener
-{
- private var _parent:idtest;
- public function TestListener(i_parent:idtest)
- {
- this._parent=i_parent;
- return;
- }
- public override function onEnterHandler(i_data:INyIdMarkerData):void
- {
- this._parent.msg("enter");
- var raw:NyIdMarkerData_RawBit=i_data as NyIdMarkerData_RawBit;
- var p:Array=new Array();
- raw.getPacket(p);
- for(var i:int;i<p.length;i++){
- this._parent.msg(p[i]);
- }
- }
- public override function onLeaveHandler():void
- {
- }
- public override function onUpdateHandler(i_square:NyARSquare,i_transmat:NyARTransMatResult):void
- {
- this._parent.msg("update");
- var c:Array=new Array(3);
- i_transmat.getAngle(c);
- this._parent.msg(c[0]);
- this._parent.msg(c[1]);
- this._parent.msg(c[2]);
- }
-}
-
-
-
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/sample/rawtest.swf
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/sample/rawtest.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/sample/rawtest.as (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/sample/rawtest.as (revision 335)
@@ -13,10 +13,12 @@
package{
import flash.net.*;
import jp.nyatla.as3utils.*;
+ import jp.nyatla.alchemymaster.*;
+ import jp.nyatla.nyartoolkit.as3.proxy.*;
import jp.nyatla.nyartoolkit.as3.*;
import flash.display.Sprite;
import flash.text.*;
- import flash.events.*;
+ import flash.events.*;
import flash.utils.*;

public class rawtest extends Sprite
@@ -27,13 +29,14 @@

public function msg(i_msg:String):void
{
- myTextBox.text =i_msg+","+myTextBox.text;
+ myTextBox.text =myTextBox.text+","+i_msg;
}
//private var cpara:ByteArray;
private var code:NyARCode;
private var param:NyARParam;
private var raster_bgra:NyARRgbRaster_BGRA;
- private var raster_xrgb:NyARRgbRaster_XRGB32;
+ private var id_bgra:NyARRgbRaster_BGRA;
+// private var raster_xrgb:NyARRgbRaster_XRGB32;
public function rawtest()
{
myTextBox.y=0;
@@ -50,6 +53,7 @@
{
param=new NyARParam();
param.loadARParamFile(data);
+ param.changeScreenSize(320,240);
});
mf.addTarget(
"patt.hiro",URLLoaderDataFormat.TEXT,
@@ -67,80 +71,323 @@
r.setFromByteArray(data);
raster_bgra=r;
});
+ mf.addTarget(
+ "320x240NyId.raw",URLLoaderDataFormat.BINARY,
+ function(data:ByteArray):void
+ {
+ var r:NyARRgbRaster_BGRA=new NyARRgbRaster_BGRA(320,240);
+ r.setFromByteArray(data);
+ id_bgra=r;
+ });
//終了後mainに遷移するよ―に設定
mf.addEventListener(Event.COMPLETE,main);
mf.multiLoad();//ロード開始
- return;//dispatch event
+ return;//dispatch event*/
+ }
+ private function testNyARIntSize():void
+ {
+ var ma:Marshal=new Marshal();
+ msg("<NyARIntSize>");
+ var result:NyARIntSize=new NyARIntSize();
+ msg("create");
+ ma.prepareWrite();
+ ma.writeInt(999);
+ ma.writeInt(998);
+ result.setValue(ma);
+ result.getValue(ma);
+ ma.prepareRead();
+
+ msg("(setVale,getValue):"+(ma.readInt()==999 && ma.readInt()==998)?"OK":"NG");
+ result.dispose();
+ msg("</NyARIntSize>");
}
+ private function testNyARCode():void
+ {
+ msg("<NyARCode>");
+ var test:NyARCode=new NyARCode(16,16);
+ msg("create");
+ msg("w,h:"+test.getWidth()+","+test.getHeight());
+ test.dispose();
+ msg("</NyARCode>");
+ }
+ private function testNyARPerspectiveProjectionMatrix():void
+ {
+ var ma:Marshal=new Marshal();
+ msg("<NyARPerspectiveProjectionMatrix>");
+ var t2:NyARPerspectiveProjectionMatrix=new NyARPerspectiveProjectionMatrix();
+ msg("create");
+ t2.getValue(ma);
+ ma.prepareRead();
+ t2.dispose();
+ msg("</NyARPerspectiveProjectionMatrix>");
+ }
+ private function testNyARParam():void
+ {
+ msg("<NyARParam>");
+ var t2:NyARParam=new NyARParam();
+ msg("create");
+ t2.getPerspectiveProjectionMatrix();
+ msg("getPerspectiveProjectionMatrix");
+ t2.getScreenSize();
+ msg("getScreenSize");
+ t2.dispose();
+ msg("</NyARParam>");
+ }
+ private function testNyARMatchPatt_Color_WITHOUT_PCA():void
+ {
+ var code:NyARCode=new NyARCode(16,16);
+ msg("<NyARMatchPatt_Color_WITHOUT_PCA>");
+ var t:NyARMatchPatt_Color_WITHOUT_PCA=new NyARMatchPatt_Color_WITHOUT_PCA(code);
+ msg("create");
+ t.dispose();
+ msg("</NyARMatchPatt_Color_WITHOUT_PCA>");
+ code.dispose();
+ }
+ private function testNyARSquareDetector_Rle():void
+ {/*
+ var code:NyARCode=new NyARCode(16,16);
+ msg("<NyARSquareDetector_Rle>");
+ var t:NyARSquareDetector_Rle=new NyARSquareDetector_Rle(dist,size);
+ msg("create");
+ t.getValue(new Array());
+ t.dispose();
+ msg("</NyARSquareDetector_Rle>");
+ code.dispose(); */
+ }
+ private function testIdMarkerProcessor():void
+ {
+ msg("<IdMarkerProcessor>");
+ var t:IdMarkerProcessor=new IdMarkerProcessor(param,INyARBufferReader.BUFFERFORMAT_BYTE1D_B8G8R8X8_32,this);
+ t.detectMarker(id_bgra);
+ t.dispose();
+ msg("</IdMarkerProcessor>");
+ }
+ private function testNyARSingleDetectMarkerAS():void
+ {
+ var mret:NyARTransMatResult=new NyARTransMatResult();
+ msg("<NyARSingleDetectMarkerAS>");
+ var d:NyARSingleDetectMarkerAS=new NyARSingleDetectMarkerAS(param,code,80.0,INyARBufferReader.BUFFERFORMAT_BYTE1D_B8G8R8X8_32);
+ var ma:Marshal=new Marshal();
+ param.getPerspectiveProjectionMatrix().getValue(ma);
+ ma.prepareRead();
+ for(var i:int=0;i<12;i++){
+ msg(String(ma.readDouble()));
+ }
+ d.detectMarkerLite(raster_bgra,100);
+ msg("cf="+d.getConfidence());
+ mret.getValue(ma);
+ d.getTransformMatrix(mret);
+ mret.getValue(ma);
+ ma.prepareRead();
+ for(var i2:int=0;i2<12;i2++){
+ msg(String(ma.readDouble()));
+ }
+ msg("zxy="+d.getConfidence());
+ mret.getZXYAngle(ma);
+ ma.prepareRead();
+ for(i2=0;i2<3;i2++){
+ msg(String(ma.readDouble()));
+ }
+ msg("pickup image");
+ var patt_data:ByteArray=new ByteArray();
+ patt_data.endian=Endian.LITTLE_ENDIAN;
+ NyARColorPatt_Perspective_O2(d._patt).getData(patt_data);
+ //Pixel format XRGB(int)
+ for(i2=0;i2<16*16;i2++){
+ msg(String(patt_data.readInt()));
+ }
+ msg("performance test..."+d.getConfidence());
+
+ var date : Date = new Date();
+ for(i2=0;i2<1000;i2++){
+ d.detectMarkerLite(raster_bgra,100);
+ d.getTransformMatrix(mret);
+ }
+ var date2 : Date = new Date();
+ msg((date2.valueOf()-date.valueOf()).toString());
+
+ d.dispose();
+ msg("</NyARSingleDetectMarkerAS>");
+ mret.dispose();
+ }
+
+ private function testNyARDetectMarkerAS():void
+ {
+ var mret:NyARTransMatResult=new NyARTransMatResult();
+ msg("<NyARDetectMarkerAS>");
+ var codes:Vector.<NyARCode>=new Vector.<NyARCode>();
+ var codes_width:Vector.<Number>=new Vector.<Number>();
+ codes[0]=code;
+ codes_width[0]=80.0;
+ var t:NyARDetectMarkerAS=new NyARDetectMarkerAS(param,codes,codes_width,1,INyARBufferReader.BUFFERFORMAT_BYTE1D_B8G8R8X8_32);
+
+ var num_of_detect:int=t.detectMarkerLite(raster_bgra,100);
+ msg("found="+num_of_detect);
+ var ma:Marshal=new Marshal();
+ for(var i:int=0;i<num_of_detect;i++){
+ msg("no="+i);
+ t.getConfidence(i);
+ t.getDirection(i);
+ t.getTransformMatrix(i,mret);
+ mret.getValue(ma);
+ ma.prepareRead();
+ for(var i2:int=0;i2<12;i2++){
+ msg(String(ma.readDouble()));
+ }
+ }
+
+ t.dispose();
+ msg("</NyARDetectMarker>");
+ mret.dispose();
+ }
+ private function testSingleProcessorAS():void
+ {
+ var mret:NyARTransMatResult=new NyARTransMatResult();
+ msg("<SingleProcessorAS>");
+ var codes:Vector.<NyARCode>=new Vector.<NyARCode>();
+ var codes_width:Vector.<Number>=new Vector.<Number>();
+ codes[0]=code;
+ codes_width[0]=80.0;
+ var t:SingleProcessor=new SingleProcessor(param,INyARBufferReader.BUFFERFORMAT_BYTE1D_B8G8R8X8_32,this);
+ t.setARCodeTable(codes,16,80.0);
+ t.detectMarker(raster_bgra);
+ t.dispose();
+ msg("</SingleProcessorAS>");
+ mret.dispose();
+ }
private function main(e:Event):void
{
msg("ready!");
- param.changeScreenSize(320,240);
- msg("main:-1");
- var detector:NyARSingleDetectMarker=new NyARSingleDetectMarker(param,code,80.0,NyARRgbRaster.BUFFERFORMAT_BYTE1D_B8G8R8X8_32);
- msg("main:0");
+// testNyARIntSize();
+// testNyARCode();
+// testNyARPerspectiveProjectionMatrix();
+// testNyARParam();
+// testNyARMatchPatt_Color_WITHOUT_PCA();
+// testNyARSquareDetector_Rle();
+ testIdMarkerProcessor();
+ testNyARSingleDetectMarkerAS();
+ testNyARDetectMarkerAS();
+ testSingleProcessorAS();
+ //Test NyARIntSize class

+ msg("end");
+ return;
+ }
+ }
+}
+ import jp.nyatla.alchemymaster.*;
+ import jp.nyatla.nyartoolkit.as3.proxy.*;
+ import jp.nyatla.nyartoolkit.as3.*;

-
- var m:NyARPerspectiveProjectionMatrix=param.getPerspectiveProjectionMatrix();
- var c:Array=new Array(12);
- var v:Array=new Array(12);
- m.decompMat(c,v);
- msg("C["+c.toString()+"]");
-
-
-
- msg("main:1");
- msg(detector.detectMarkerLite(raster_bgra,100).toString());
- msg(detector.getConfidence().toString());
- msg("main:3");
-
- var result:NyARTransMatResult=new NyARTransMatResult();
- detector.getTransformMatrix(result);
- result.getValue(v);
- msg("transN["+v.toString()+"]");
- detector.setContinueMode(true);
- detector.getTransformMatrix(result);
- result.getValue(v);
- msg("transC["+v.toString()+"]");
- result.dispose();
- detector.dispose();
- param.dispose();
- code.dispose();
- raster_bgra.dispose();
- msg("main:finish");

-/*
+class SingleProcessor extends SingleARMarkerProcesserAS
+{
+ public var transmat:NyARTransMatResult=null;
+ public var current_code:int=-1;
+ private var _parent:rawtest;
+ private var _ma:Marshal=new Marshal();
+ public function SingleProcessor(i_cparam:NyARParam,i_raster_format:int,i_parent:rawtest)
+ {
+ super();
+ this._parent=i_parent;
+ initInstance(i_cparam,i_raster_format);
+ }
+
+ protected override function onEnterHandler(i_code:int):void
+ {
+ current_code=i_code;
+ _parent.msg("onEnterHandler:"+i_code);
+ }

- var ss:NyARIntSize=param.getScreenSize();
- var sss:Array=new Array(2);
- ss.getValue(sss);
- msg(sss.toString());
- var m:NyARPerspectiveProjectionMatrix=param.getPerspectiveProjectionMatrix();
- var c:Array=new Array(12);
- var v:Array=new Array(12);
- m.decompMat(c,v);
- msg(v.toString());
+ protected override function onLeaveHandler():void
+ {
+ }

-
- var start:int=getTimer();
- for(var i:int=0;i<100;i++){
- detector.detectMarkerLite(raster,100);
- detector.getTransmationMatrix(result);
+ protected override function onUpdateHandler(i_square:NyARSquare,result:NyARTransMatResult):void
+ {
+ _parent.msg("onUpdateHandler:"+current_code);
+ result.getValue(_ma);
+ _ma.prepareRead();
+ for(var i2:int=0;i2<12;i2++){
+ _parent.msg(String(_ma.readDouble()));
+ }
+ this.transmat=result;
+ }
+}
+
+class IdMarkerProcessor extends SingleNyIdMarkerProcesserAS
+{
+ public var transmat:NyARTransMatResult=null;
+ public var current_id:int=-1;
+ private var _parent:rawtest;
+ private var _encoder:NyIdMarkerDataEncoder_RawBit;
+
+ public function IdMarkerProcessor(i_cparam:NyARParam,i_raster_format:int,i_parent:rawtest)
+ {
+ //アプリケーションフレームワークの初期化
+ super();
+ this._parent=i_parent;
+ this._encoder=new NyIdMarkerDataEncoder_RawBit();
+ initInstance(i_cparam,this._encoder,i_raster_format);
+ return;
+ }
+ public override function dispose():void
+ {
+ super.dispose();
+ this._encoder.dispose();
+ return;
+ }
+ private var _ma:Marshal=new Marshal();
+ /**
+ * アプリケーションフレームワークのハンドラ(マーカ出現)
+ */
+ protected override function onEnterHandler(i_code:INyIdMarkerData):void
+ {
+ var code:NyIdMarkerData_RawBit=i_code as NyIdMarkerData_RawBit;
+
+ //read data from i_code via Marsial--Marshal経由で読み出す
+ code.getValue(this._ma);
+ this._ma.prepareRead();
+ var len:int =this._ma.readInt();
+ var data:Array=new Array();
+
+ var i:int;
+ for(i=0;i<len;i++){
+ data[i]=this._ma.readInt();
+ }
+ if(len>4){
+ //4バイト以上の時はint変換しない。
+ this.current_id=-1;//undefined_id
+ }else{
+ this.current_id=0;
+ //最大4バイト繋げて1個のint値に変換
+ for(i=0;i<len;i++){
+ this.current_id=(this.current_id<<8)|data[i];
}
- var end:Number=getTimer()-start;
- //アンマネージオブジェクトを破棄(dispose読んでからGCのカウントを下げること。)
- detector.dispose();
- detector=null;
- raster.dispose();
- raster=null;
- param.dispose();
- param=null;
- msg(end.toString());*/
- return;
}
+ _parent.msg("onEnterHandler:"+this.current_id);
+ this.transmat=null;
}
+ /**
+ * アプリケーションフレームワークのハンドラ(マーカ消滅)
+ */
+ protected override function onLeaveHandler():void
+ {
+ this.current_id=-1;
+ this.transmat=null;
+ return;
+ }
+ /**
+ * アプリケーションフレームワークのハンドラ(マーカ更新)
+ */
+ protected override function onUpdateHandler(i_square:NyARSquare,result:NyARTransMatResult):void
+ {
+ _parent.msg("onUpdateHandler:"+this.current_id);
+ result.getValue(_ma);
+ _ma.prepareRead();
+ for(var i2:int=0;i2<12;i2++){
+ _parent.msg(String(_ma.readDouble()));
+ }
+ this.transmat=result;
+ }
}
-
-
-
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/readme.ja.txt
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/readme.ja.txt (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/readme.ja.txt (revision 335)
@@ -0,0 +1,37 @@
+NyARToolkitCPP forAlchemy
+ Copyright (C)2009 Ryo Iizuka
+
+http://nyatla.jp/
+airmail(at)ebony.plala.or.jp
+--------------------------------------------------
+
+NyARToolKitをAlchemyでコンパイルしてswcファイルを作る為の
+ラッパークラス、プロキシクラス集です。
+
+
+
+
+・ライセンス
+後述するモジュールを除いたNyARToolKitCPP forAlchemyは、
+GPLv3とFLARToolKitバインドライセンスのデュアルライセンスを採用しています。
+
+以下のファイルは、GPLv3でのみ、使用できます。
+forAlchemy\NyARToolkitAS3\lib\nyartoolkit.swc
+
+※これは、nyartoolkit.swcが、Alchemyに含まれるavm2-libc.l.bc、avm2-libstdc++.l.bc
+ を結合している為です。これらのオブジェクトファイルは、GPLv2ライセンスで公開
+ されているため、リンクしたnyartoolkit.swcはGPLv3以外を選択できなくなります。
+
+
+
+
+ -GPL
+ LGPLについては、LICENCE.txtをお読みください。
+
+ -FLARToolKitバインドライセンス
+ FLARToolKitと同一のオブジェクトにコンパイルする場合に、
+ FLARToolKitの一部として使用できるライセンスです。
+
+
+
+
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/lib/nyartoolkit.swc
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_SingleNyIdMarkerProcessor.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_SingleNyIdMarkerProcessor.h (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_SingleNyIdMarkerProcessor.h (revision 335)
@@ -1,163 +0,0 @@
-/*
- * PROJECT: NyARToolkitCPP Alchemy bind
- * --------------------------------------------------------------------------------
- * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
- *
- * Copyright (C)2009 Ryo Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
-#pragma once
-#include "S_NyIdMarkerDataEncoder_RawBit.h"
-#include "S_INyIdMarkerData.h"
-#include "S_NyARTransMatResult.h"
-#include "S_NyARSquare.h"
-#include "SingleNyIdMarkerProcessor.h"
-
-
-
- class MarkerProcesser : public SingleNyIdMarkerProcesser
- {
- private:
- AS3_Val _as3_this;
- S_INyIdMarkerData _wrap_data;
- S_NyARTransMatResult _wrap_transmat;
- S_NyARSquare _wrap_square;
- public:
- const NyARTransMatResult* transmat;
- int current_id;
- public:
- MarkerProcesser(AS3_Val i_as3_this,const NyARParam *i_cparam,S_INyIdMarkerDataEncoder *i_encoder, int i_raster_format)
- {
- this->_as3_this=i_as3_this;
- AS3_Acquire(this->_as3_this);
- this->transmat=NULL;
- this->current_id=-1;
- initInstance(i_cparam,i_encoder->m_ref,i_raster_format);
- //アプリケーションフレームワークの初期化
-
- //ラップメンバの初期化
- this->_wrap_transmat.initWrapStub();
- this->_wrap_transmat.toHolderObject();
- this->_wrap_square.initWrapStub();
- this->_wrap_square.toHolderObject();
- this->_wrap_data.initWrapStub();
- this->_wrap_data.toHolderObject();
- return;
- }
- virtual ~MarkerProcesser()
- {
- AS3_Release(this->_as3_this);
- return;
- }
-
- /**
- * アプリケーションフレームワークのハンドラ(マーカ出現)
- */
- protected:
- void onEnterHandler(const INyIdMarkerData &i_code)
- {
- this->_wrap_data.wrapRef(&i_code);
- AS3_Val str =AS3_CallTS("onEnterHandler", this->_as3_this, "AS3ValType", this->_wrap_data.m_as3);
- this->_wrap_data.wrapRef(NULL);
- AS3_Release(str);
- }
- protected:
- void onLeaveHandler()
- {
- //イベント通知
- AS3_Val ret =AS3_CallTS("onLeaveHandler", this->_as3_this, "");
- AS3_Release(ret);
- }
- protected:
- void onUpdateHandler(const NyARSquare &i_square, const NyARTransMatResult &result)
- {
- //イベント通知
- this->_wrap_transmat.wrapRef(&result);
- this->_wrap_square.wrapRef(&i_square);
- AS3_Val ret =AS3_CallTS("onUpdateHandler", this->_as3_this, "AS3ValType,AS3ValType",this->_wrap_square.m_as3,this->_wrap_transmat.m_as3);
- this->_wrap_transmat.wrapRef(NULL);
- this->_wrap_square.wrapRef(NULL);
-
- AS3_Release(ret);
- }
- };
-
-class S_SingleNyIdMarkerProcesser : public AlchemyClassStub<MarkerProcesser>
-{
-public:
- static AS3_Val createInstance(void* self, AS3_Val args)
- {
- //param,encoderは外部参照になるので注意!
- S_SingleNyIdMarkerProcesser* inst=new S_SingleNyIdMarkerProcesser();
- AS3_Val as3_this;
- S_NyARParam* param;
- double width;
- int raster_type;
- S_NyIdMarkerDataEncoder_RawBit* encoder;
-
- AS3_ArrayValue(args, "AS3ValType,PtrType,PtrType,IntType",&as3_this,&param,&encoder,&raster_type);
- MarkerProcesser* proc=new MarkerProcesser(as3_this,param->m_ref,encoder,raster_type);
- inst->initRelStub(proc);
- //AS3オブジェクト化
-
- AS3_Release(as3_this);
- return inst->toAS3Object();
- }
-
- void initAS3Object(AS3ObjectBuilder& i_builder)
- {
- AlchemyClassStub<MarkerProcesser>::initAS3Object(i_builder);
- i_builder.addFunction("setMarkerWidth",S_SingleNyIdMarkerProcesser::setMarkerWidth);
- i_builder.addFunction("reset",S_SingleNyIdMarkerProcesser::reset);
- i_builder.addFunction("detectMarker",S_SingleNyIdMarkerProcesser::detectMarker);
- return;
- }
-private:
- static AS3_Val setMarkerWidth(void* self, AS3_Val args)
- {
- S_NyARSingleDetectMarker* inst;
- int width;
- AS3_ArrayValue(args, "PtrType,IntType", &inst,&width);
-
- ((MarkerProcesser*)(inst->m_ref))->setMarkerWidth(width);
- return AS3_Null();
- }
- static AS3_Val reset(void* self, AS3_Val args)
- {
- S_NyARSingleDetectMarker* inst;
- int width;
- int reset_bool;
- AS3_ArrayValue(args, "PtrType,IntType", &inst,&reset_bool);
-
- ((MarkerProcesser*)(inst->m_ref))->reset(reset_bool!=0?true:false);
- return AS3_Null();
- }
- static AS3_Val detectMarker(void* self, AS3_Val args)
- {
- S_NyARSingleDetectMarker* inst;
- AlchemyClassStub<void*>* stub;
-
- AS3_ArrayValue(args, "PtrType,PtrType", &inst,&stub);
- const INyARRgbRaster* raster=(const INyARRgbRaster*)(stub->getRef());
- ((MarkerProcesser*)(inst->m_ref))->detectMarker(*raster);
- return AS3_Null();
- }
-};
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_INyIdMarkerDataEncoder.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_INyIdMarkerDataEncoder.h (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_INyIdMarkerDataEncoder.h (revision 335)
@@ -1,12 +0,0 @@
-#pragma once
-#include "INyIdMarkerDataEncoder.h"
-#include "S_INyIdMarkerData.h"
-class S_INyIdMarkerDataEncoder : public AlchemyClassStub<INyIdMarkerDataEncoder>
-{
-public:
- void initAS3Object(AS3ObjectBuilder& i_builder)
- {
- AlchemyClassStub<INyIdMarkerDataEncoder>::initAS3Object(i_builder);
- }
- virtual S_INyIdMarkerData* createDataInstance()const=0;
-};
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARSingleDetectMarker.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARSingleDetectMarker.h (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARSingleDetectMarker.h (revision 335)
@@ -1,74 +0,0 @@
-#pragma once
-#include "NyARSingleDetectMarker.h"
-
-class S_NyARSingleDetectMarker : public AlchemyClassStub<NyARSingleDetectMarker>
-{
-public:
- static AS3_Val createInstance(void* self, AS3_Val args)
- {
- //この関数は引数codeからNyARCodeインスタンスをデタッチするので注意。
- //関数呼び出し後は、AS側で引数に渡したcodeインスタンスを確実にdisposeすること!
- S_NyARSingleDetectMarker* inst=new S_NyARSingleDetectMarker();
- S_NyARParam* param;
- S_NyARCode* code;
- double width;
- int raster_type;
-
- AS3_ArrayValue(args, "PtrType,PtrType,DoubleType,IntType",&param,&code,&width,&raster_type);
-
- inst->initRelStub(new NyARSingleDetectMarker(param->getRef(),code->getRef(),width,raster_type));
- //AS3オブジェクト化
- return inst->toAS3Object();
- }
-
- void initAS3Object(AS3ObjectBuilder& i_builder)
- {
- AlchemyClassStub<NyARSingleDetectMarker>::initAS3Object(i_builder);
- i_builder.addFunction("detectMarkerLite",S_NyARSingleDetectMarker::detectMarkerLite);
- i_builder.addFunction("getTransmationMatrix",S_NyARSingleDetectMarker::getTransmationMatrix);
- i_builder.addFunction("getConfidence",S_NyARSingleDetectMarker::getConfidence);
- i_builder.addFunction("getDirection",S_NyARSingleDetectMarker::getDirection);
- i_builder.addFunction("setContinueMode",S_NyARSingleDetectMarker::setContinueMode);
- return;
- }
-private:
- static AS3_Val detectMarkerLite(void* self, AS3_Val args)
- {
- S_NyARSingleDetectMarker* inst;
- AlchemyClassStub<void*>* stub;
- int th;
- AS3_ArrayValue(args, "PtrType,PtrType,IntType", &inst,&stub,&th);
- const INyARRgbRaster* raster=(const INyARRgbRaster*)(stub->getRef());
-
- bool ret=((NyARSingleDetectMarker*)(inst->m_ref))->detectMarkerLite(*raster,th);
- return ret?AS3_True():AS3_False();
- }
- static AS3_Val getConfidence(void* self, AS3_Val args)
- {
- S_NyARSingleDetectMarker* inst;
- AS3_ArrayValue(args, "PtrType", &inst);
- return AS3_Number(inst->m_ref->getConfidence());
- }
- static AS3_Val getDirection(void* self, AS3_Val args)
- {
- S_NyARSingleDetectMarker* inst;
- AS3_ArrayValue(args, "PtrType", &inst);
- return AS3_Int(inst->m_ref->getDirection());
- }
- static AS3_Val getTransmationMatrix(void* self, AS3_Val args)
- {
- S_NyARSingleDetectMarker* inst;
- S_NyARTransMatResult* v;
- AS3_ArrayValue(args, "PtrType,PtrType", &inst,&v);
- ((NyARSingleDetectMarker*)(inst->m_ref))->getTransmationMatrix(*((NyARTransMatResult*)(v->m_ref)));
- return AS3_Null();
- }
- static AS3_Val setContinueMode(void* self, AS3_Val args)
- {
- S_NyARSingleDetectMarker* inst;
- int v;
- AS3_ArrayValue(args, "PtrType,IntType", &inst,&v);
- ((NyARSingleDetectMarker*)(inst->m_ref))->setContinueMode(v!=0?true:false);
- return AS3_Null();
- }
-};
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyIdMarkerData_RawBit.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyIdMarkerData_RawBit.h (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyIdMarkerData_RawBit.h (revision 335)
@@ -1,34 +1,42 @@
#pragma once
#include "NyIdMarkerDataEncoder_RawBit.h"
-#include "S_INyIdMarkerData.h"
-class S_NyIdMarkerData_RawBit : public S_INyIdMarkerData
+#include "T_INyIdMarkerData.h"
+class S_NyIdMarkerData_RawBit : public T_INyIdMarkerData<NyIdMarkerData_RawBit>
{
public:
- //標準的なインスタンス生成関数です。
static AS3_Val createInstance(void* self, AS3_Val args)
{
- S_NyIdMarkerData_RawBit* inst=new S_NyIdMarkerData_RawBit();
- //初期化
- inst->initRelStub(new NyIdMarkerData_RawBit());
- //AS3オブジェクト化
- return inst->toAS3Object();
+ S_NyIdMarkerData_RawBit class_builder;
+ return class_builder.buildWithNativeInstance(self,args);
}
-
- void initAS3Object(AS3ObjectBuilder& i_builder)
+protected:
+ //自身のオブジェクトをAS3オブジェクトにする。
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,NyIdMarkerData_RawBit* i_native_inst)
{
- S_INyIdMarkerData::initAS3Object(i_builder);
- i_builder.addFunction("getPacket",S_NyIdMarkerData_RawBit::getPacket);
+ T_INyIdMarkerData<NyIdMarkerData_RawBit>::initAS3Member(i_builder,i_native_inst);
+ i_builder.addFunction("getValue",S_NyIdMarkerData_RawBit::getValue);
+ return;
}
+ /* AS3 Argument protocol
+ */
+ virtual NyIdMarkerData_RawBit* createNativeInstance(AS3_Val args)
+ {
+ return new NyIdMarkerData_RawBit();
+ }

- static AS3_Val getPacket(void* self, AS3_Val args)
+public:
+ /* AS3 Argument protocol
+ * _native : T*
+ * v : AS3_ByteArray as len:int ,int[len]
+ */
+ static AS3_Val getValue(void* self, AS3_Val args)
{
- S_NyIdMarkerData_RawBit* inst;
+ NyIdMarkerData_RawBit* native;
AS3_Val v;
- AS3_ArrayValue(args, "PtrType, AS3ValType", &inst,&v);
- const NyIdMarkerData_RawBit* data=(NyIdMarkerData_RawBit*)inst->m_ref;
+ AS3_ArrayValue(args, "PtrType, AS3ValType", &native,&v);
//コピーしてセット
- AS3_ByteArray_writeBytes(v,(void*)&(data->length),sizeof(int));
- AS3_ByteArray_writeBytes(v,(void*)(data->packet),sizeof(int)*data->length);
+ AS3_ByteArray_writeBytes(v,(void*)&(native->length),sizeof(int));
+ AS3_ByteArray_writeBytes(v,(void*)(native->packet),sizeof(int)*native->length);
//引数の参照カウント減算
AS3_Release(v);
return AS3_Null();
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyIdMarkerDataEncoder_RawBit.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyIdMarkerDataEncoder_RawBit.h (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyIdMarkerDataEncoder_RawBit.h (revision 335)
@@ -5,46 +5,46 @@
*
* Copyright (C)2009 Ryo Iizuka
*
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#pragma once
#include "S_NyIdMarkerData_RawBit.h"
-#include "S_INyIdMarkerDataEncoder.h"
-class S_NyIdMarkerDataEncoder_RawBit : public S_INyIdMarkerDataEncoder
+#include "T_INyIdMarkerDataEncoder.h"
+class S_NyIdMarkerDataEncoder_RawBit : public T_INyIdMarkerDataEncoder<NyIdMarkerDataEncoder_RawBit,S_NyIdMarkerData_RawBit,NyIdMarkerData_RawBit>
{
public:
- //標準的なインスタンス生成関数です。
static AS3_Val createInstance(void* self, AS3_Val args)
{
- S_NyIdMarkerDataEncoder_RawBit* inst=new S_NyIdMarkerDataEncoder_RawBit();
- //初期化
- inst->initRelStub(new NyIdMarkerDataEncoder_RawBit());
- //AS3オブジェクト化
- return inst->toAS3Object();
+ S_NyIdMarkerDataEncoder_RawBit class_builder;
+ return class_builder.buildWithNativeInstance(self,args);
}
- void initAS3Object(AS3ObjectBuilder& i_builder)
+protected:
+ //自身のオブジェクトをAS3オブジェクトにする。
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,NyIdMarkerDataEncoder_RawBit* i_native_inst)
{
- S_INyIdMarkerDataEncoder::initAS3Object(i_builder);
+ T_INyIdMarkerDataEncoder<NyIdMarkerDataEncoder_RawBit,S_NyIdMarkerData_RawBit,NyIdMarkerData_RawBit>::initAS3Member(i_builder,i_native_inst);
+ return;
}
- virtual S_INyIdMarkerData* createDataInstance()const
+ /* AS3 Argument protocol
+ */
+ virtual NyIdMarkerDataEncoder_RawBit* createNativeInstance(AS3_Val args)
{
- return new S_NyIdMarkerData_RawBit();
+ return new NyIdMarkerDataEncoder_RawBit();
}
};
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARColorPatt_Perspective_O2.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARColorPatt_Perspective_O2.h (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARColorPatt_Perspective_O2.h (revision 335)
@@ -0,0 +1,49 @@
+#pragma once
+#include "T_INyARColorPatt.h"
+#include "NyARColorPatt_Perspective_O2.h"
+class S_NyARColorPatt_Perspective_O2 : public T_INyARColorPatt<NyARColorPatt_Perspective_O2>
+{
+public:
+ static AS3_Val createInstance(void* self, AS3_Val args)
+ {
+ S_NyARColorPatt_Perspective_O2 class_builder;
+ return class_builder.buildWithNativeInstance(self,args);
+ }
+protected:
+ //自身のオブジェクトをAS3オブジェクトにする。
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,NyARColorPatt_Perspective_O2* i_native_inst)
+ {
+ T_INyARColorPatt<NyARColorPatt_Perspective_O2>::initAS3Member(i_builder,i_native_inst);
+ i_builder.addFunction("getData",S_NyARColorPatt_Perspective_O2::getData);
+ return;
+ }
+ /* AS3 Argument protocol
+ * w : int
+ * h : int
+ * res : int
+ * edge : int
+ */
+ virtual NyARColorPatt_Perspective_O2* createNativeInstance(AS3_Val args)
+ {
+ int w,h,res,edge;
+ AS3_ArrayValue(args, "IntType,IntType,IntType,IntType",&w,&h,&res,&edge);
+ //初期化
+ return new NyARColorPatt_Perspective_O2(w,h,res,edge);
+ }
+ /* AS3 Argument protocol
+ * native : NyARColorPatt_Perspective_O2*
+ * h : AS3_Val as ByteArray
+ */
+ static AS3_Val getData(void* self, AS3_Val args)
+ {
+ NyARColorPatt_Perspective_O2* native;
+ AS3_Val v;
+ AS3_ArrayValue(args, "PtrType,AS3ValType", &native,&v);
+ void* buf=(void*)(native->getBufferReader().getBuffer());
+ const TNyARIntSize& size=native->getSize();
+ AS3_ByteArray_writeBytes(v,buf,sizeof(int)*size.w*size.h);
+ //引数の参照カウント減算
+ AS3_Release(v);
+ return AS3_Null();
+ }
+};
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/T_INyARColorPatt.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/T_INyARColorPatt.h (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/T_INyARColorPatt.h (revision 335)
@@ -0,0 +1,50 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
+#pragma once
+#include "T_INyARRgbRaster.h"
+template<class T> class T_INyARColorPatt : public T_INyARRgbRaster<T>
+{
+public:
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,T* i_native_inst)
+ {
+ T_INyARRgbRaster<T>::initAS3Member(i_builder,i_native_inst);
+ i_builder.addFunction("pickFromRaster",T_INyARColorPatt<T>::pickFromRaster);
+ return;
+ }
+ /* AS3 Argument protocol
+ * _native : T*
+ * in_raster : INyARRgbRaster*
+ * out_square : NyARSquare*
+ */
+ static AS3_Val pickFromRaster(void* self, AS3_Val args)
+ {
+ T* native;
+ INyARRgbRaster* in_raster;
+ NyARSquare* out_square;
+ AS3_ArrayValue(args, "PtrType,PtrType,PtrType", &native,&in_raster,&out_square);
+ return native->pickFromRaster(*in_raster,*out_square)?AS3_True():AS3_False();
+ }
+};
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARMatchPattDeviationColorData.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARMatchPattDeviationColorData.h (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARMatchPattDeviationColorData.h (revision 335)
@@ -0,0 +1,68 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
+#pragma once
+#include "NyARMatchPattDeviationColorData.h"
+#include "INyARRaster.h"
+class S_NyARMatchPattDeviationColorData : public AlchemyClassBuilder<NyARMatchPattDeviationColorData>
+{
+public:
+ static AS3_Val createInstance(void* self, AS3_Val args)
+ {
+ S_NyARMatchPattDeviationColorData class_builder;
+ return class_builder.buildWithNativeInstance(self,args);
+ }
+protected:
+ //自身のオブジェクトをAS3オブジェクトにする。
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,NyARMatchPattDeviationColorData* i_native_inst)
+ {
+ AlchemyClassBuilder<NyARMatchPattDeviationColorData>::initAS3Member(i_builder,i_native_inst);
+ i_builder.addFunction("setRaster",S_NyARMatchPattDeviationColorData::setRaster);
+
+ return;
+ }
+ /* AS3 Argument protocol
+ */
+ virtual NyARMatchPattDeviationColorData* createNativeInstance(AS3_Val args)
+ {
+ int w,h;
+ AS3_ArrayValue(args, "IntType,IntType",&w,&h);
+ return new NyARMatchPattDeviationColorData(w,h);
+ }
+public:
+ /* AS3 Argument protocol
+ * _native : NyARMatchPattDeviationColorData*
+ * _raster : INyARRaster*
+ */
+ static AS3_Val setRaster(void* self, AS3_Val args)
+ {
+ NyARMatchPattDeviationColorData* native;
+ INyARRaster* raster;
+ int w,h;
+ AS3_ArrayValue(args, "PtrType, IntType", &native,&raster);
+ native->setRaster(*raster);
+ return AS3_Null();
+ }
+};
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARRgbRaster_XRGB32.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARRgbRaster_XRGB32.h (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARRgbRaster_XRGB32.h (revision 335)
@@ -1,7 +1,7 @@
#pragma once
#include "NyARRgbRaster_BasicClass.h"
#include "NyARRgbPixelReader_BYTE1D_X8R8G8B8_32.h"
-
+#include "T_INyARRgbRaster.h"
class NyARRgbRaster_XRGB32:public NyARRgbRaster_BasicClass
{
private:
@@ -52,67 +52,50 @@



-class S_NyARRgbRaster_XRGB32 : public AlchemyClassStub<NyARRgbRaster_XRGB32>
+class S_NyARRgbRaster_XRGB32 : public T_INyARRgbRaster<NyARRgbRaster_XRGB32>
{
public:
static AS3_Val createInstance(void* self, AS3_Val args)
{
- S_NyARRgbRaster_XRGB32* inst=new S_NyARRgbRaster_XRGB32();
- int w,h;
- AS3_ArrayValue(args, "IntType,IntType",&w,&h);
- //初期化
- inst->initRelStub(new NyARRgbRaster_XRGB32(w,h));
- //AS3オブジェクト化
- return inst->toAS3Object();
+ S_NyARRgbRaster_XRGB32 class_builder;
+ return class_builder.buildWithNativeInstance(self,args);
}
- static AS3_Val createReference(const NyARRgbRaster_XRGB32* i_ref)
- {
- //参照生成はm_bufの参照もコピーすること!
- return NULL;
- }
-
+protected:
//自身のオブジェクトをAS3オブジェクトにする。
- void initAS3Object(AS3ObjectBuilder& i_builder)
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,NyARRgbRaster_XRGB32* i_native_inst)
{
- AlchemyClassStub<NyARRgbRaster_XRGB32>::initAS3Object(i_builder);
+ T_INyARRgbRaster<NyARRgbRaster_XRGB32>::initAS3Member(i_builder,i_native_inst);
i_builder.addFunction("setData",S_NyARRgbRaster_XRGB32::setData);
i_builder.addFunction("getData",S_NyARRgbRaster_XRGB32::getData);
- i_builder.addFunction("getWidth",S_NyARRgbRaster_XRGB32::getWidth);
- i_builder.addFunction("getHeight",S_NyARRgbRaster_XRGB32::getHeight);
return;
}
+ /* AS3 Argument protocol
+ */
+ virtual NyARRgbRaster_XRGB32* createNativeInstance(AS3_Val args)
+ {
+ int w,h;
+ AS3_ArrayValue(args, "IntType,IntType", &w,&h);
+ return new NyARRgbRaster_XRGB32(w,h);
+ }
private:
static AS3_Val setData(void* self, AS3_Val args)
{
- S_NyARRgbRaster_XRGB32* inst;
+ NyARRgbRaster_XRGB32* native;
AS3_Val v;
- AS3_ArrayValue(args, "PtrType,AS3ValType", &inst,&v);
- ((NyARRgbRaster_XRGB32*)(inst->m_ref))->setBuffer(v);
+ AS3_ArrayValue(args, "PtrType,AS3ValType", &native,&v);
+ native->setBuffer(v);
//引数の参照カウント減算
AS3_Release(v);
return AS3_Null();
}
static AS3_Val getData(void* self, AS3_Val args)
{
- S_NyARRgbRaster_XRGB32* inst;
+ NyARRgbRaster_XRGB32* native;
AS3_Val v;
- AS3_ArrayValue(args, "PtrType,AS3ValType", &inst,&v);
- ((NyARRgbRaster_XRGB32*)(inst->m_ref))->getBuffer(v);
+ AS3_ArrayValue(args, "PtrType,AS3ValType", &native,&v);
+ native->getBuffer(v);
//引数の参照カウント減算
AS3_Release(v);
return AS3_Null();
}
- static AS3_Val getWidth(void* self, AS3_Val args)
- {
- S_NyARRgbRaster_XRGB32* inst;
- AS3_ArrayValue(args, "PtrType", &inst);
- return AS3_Int(inst->m_ref->getWidth());
- }
- static AS3_Val getHeight(void* self, AS3_Val args)
- {
- S_NyARRgbRaster_XRGB32* inst;
- AS3_ArrayValue(args, "PtrType", &inst);
- //コピーしてセット
- return AS3_Int(inst->m_ref->getHeight());
- }
};
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARMatchPattResult.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARMatchPattResult.h (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARMatchPattResult.h (revision 335)
@@ -0,0 +1,66 @@
+#pragma once
+#include "TNyARMatchPattResult.h"
+
+class S_NyARMatchPattResult: public AlchemyClassBuilder<TNyARMatchPattResult>
+{
+private:
+ struct TDataPack{
+ int direction;
+ double confidence;
+ };
+
+public:
+ static AS3_Val createInstance(void* self, AS3_Val args)
+ {
+ S_NyARMatchPattResult class_builder;
+ return class_builder.buildWithNativeInstance(self,args);
+ }
+protected:
+ //自身のオブジェクトをAS3オブジェクトにする。
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,TNyARMatchPattResult* i_native_inst)
+ {
+ AlchemyClassBuilder<TNyARMatchPattResult>::initAS3Member(i_builder,i_native_inst);
+ i_builder.addFunction("setValue",S_NyARMatchPattResult::setValue);
+ i_builder.addFunction("getValue",S_NyARMatchPattResult::getValue);
+ return;
+ }
+ /* AS3 Argument protocol
+ */
+ virtual TNyARMatchPattResult* createNativeInstance(AS3_Val args)
+ {
+ return new TNyARMatchPattResult();
+ }
+private:
+ /* AS3 Argument protocol
+ * _native : T*
+ * v : AS3_ByteArray as direction:int,confidence:double
+ */
+ static AS3_Val setValue(void* self, AS3_Val args)
+ {
+ TNyARMatchPattResult* native;
+ AS3_Val v;
+ AS3_ArrayValue(args, "PtrType, AS3ValType", &native,&v);
+ //
+ AS3_ByteArray_readBytes(&native->direction,v,sizeof(int));
+ AS3_ByteArray_readBytes(&native->confidence,v,sizeof(double));
+ //引数の参照カウント減算
+ AS3_Release(v);
+ return AS3_Null();
+ }
+ /* AS3 Argument protocol
+ * _native : T*
+ * v : AS3_ByteArray as direction:int,confidence:double
+ */
+ static AS3_Val getValue(void* self, AS3_Val args)
+ {
+ TNyARMatchPattResult* native;
+ AS3_Val v;
+ AS3_ArrayValue(args, "PtrType, AS3ValType", &native,&v);
+ //コピーしてセット
+ AS3_ByteArray_writeBytes(v,&native->direction,sizeof(int));
+ AS3_ByteArray_writeBytes(v,&native->confidence,sizeof(double));
+ //引数の参照カウント減算
+ AS3_Release(v);
+ return AS3_Null();
+ }
+};
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARIntSize.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARIntSize.h (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARIntSize.h (revision 335)
@@ -1,60 +1,61 @@
#pragma once
#include "NyAR_types.h"

-class S_NyARIntSize: public AlchemyClassStub<TNyARIntSize>
+class S_NyARIntSize: public AlchemyClassBuilder<TNyARIntSize>
{
public:
static AS3_Val createInstance(void* self, AS3_Val args)
{
- S_NyARIntSize* inst=new S_NyARIntSize();
- //初期化
- inst->initRelStub(new TNyARIntSize());
- //AS3オブジェクト化
- return inst->toAS3Object();
+ S_NyARIntSize class_builder;
+ return class_builder.buildWithNativeInstance(self,args);
}
- static AS3_Val createReference(const TNyARIntSize* i_ref)
- {
- S_NyARIntSize* inst=new S_NyARIntSize();
- //初期化
- inst->initRefStub(i_ref);
- //AS3オブジェクト化
- return inst->toAS3Object();
- }
+protected:
//自身のオブジェクトをAS3オブジェクトにする。
- void initAS3Object(AS3ObjectBuilder& i_builder)
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,TNyARIntSize* i_native_inst)
{
- AlchemyClassStub<TNyARIntSize>::initAS3Object(i_builder);
+ AlchemyClassBuilder<TNyARIntSize>::initAS3Member(i_builder,i_native_inst);
i_builder.addFunction("setValue",S_NyARIntSize::setValue);
i_builder.addFunction("getValue",S_NyARIntSize::getValue);
return;
}
+ /* AS3 Argument protocol
+ */
+ virtual TNyARIntSize* createNativeInstance(AS3_Val args)
+ {
+ return new TNyARIntSize();
+ }
private:
+ /* AS3 Argument protocol
+ * _native : AlchemyClassStub<T>*
+ * v : AS3_ByteArray
+ */
static AS3_Val setValue(void* self, AS3_Val args)
{
- S_NyARIntSize* inst;
+ TNyARIntSize* native;
AS3_Val v;
- AS3_ArrayValue(args, "PtrType, AS3ValType", &inst,&v);
+ AS3_ArrayValue(args, "PtrType, AS3ValType", &native,&v);
//
int work[2];
AS3_ByteArray_readBytes(work,v,sizeof(int)*2);
- //Cのアクセス制御を強引に突破する。
- TNyARIntSize* s=(TNyARIntSize*)inst->m_ref;
- s->w=work[0];
- s->h=work[1];
+ native->w=work[0];
+ native->h=work[1];
//引数の参照カウント減算
AS3_Release(v);
return AS3_Null();
}
+ /* AS3 Argument protocol
+ * _native : AlchemyClassStub<T>*
+ * v : AS3_ByteArray
+ */
static AS3_Val getValue(void* self, AS3_Val args)
{
- S_NyARIntSize* inst;
+ TNyARIntSize* native;
AS3_Val v;
- AS3_ArrayValue(args, "PtrType, AS3ValType", &inst,&v);
+ AS3_ArrayValue(args, "PtrType, AS3ValType", &native,&v);
//コピーしてセット
int work[2];
- TNyARIntSize* s=(TNyARIntSize*)inst->m_ref;
- work[0]=s->w;
- work[1]=s->h;
+ work[0]=native->w;
+ work[1]=native->h;
AS3_ByteArray_writeBytes(v,work,sizeof(int)*4);
//引数の参照カウント減算
AS3_Release(v);
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARSquareStack.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARSquareStack.h (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARSquareStack.h (revision 335)
@@ -0,0 +1,80 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
+#pragma once
+#include "S_NyARSquare.h"
+#include "NyARSquareStack.h"
+class S_NyARSquareStack : public AlchemyClassBuilder<NyARSquareStack>
+{
+public:
+ static AS3_Val createInstance(void* self, AS3_Val args)
+ {
+ S_NyARSquareStack class_builder;
+ return class_builder.buildWithNativeInstance(self,args);
+ }
+protected:
+ //自身のオブジェクトをAS3オブジェクトにする。
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,NyARSquareStack* i_native_inst)
+ {
+ AlchemyClassBuilder<NyARSquareStack>::initAS3Member(i_builder,i_native_inst);
+ i_builder.addFunction("getLength",S_NyARSquareStack::getLength);
+ i_builder.addFunction("getItem",S_NyARSquareStack::getItem);
+ return;
+ }
+ /* AS3 Argument protocol
+ * length :int
+ */
+ virtual NyARSquareStack* createNativeInstance(AS3_Val args)
+ {
+ int len;
+ AS3_ArrayValue(args, "IntType",&len);
+ return new NyARSquareStack(len);
+ }
+
+public:
+ /* AS3 Argument protocol
+ * _native :NyARSquareStack*
+ * return :int
+ */
+ static AS3_Val getLength(void* self, AS3_Val args)
+ {
+ NyARSquareStack* native;
+ AS3_ArrayValue(args, "PtrType", &native);
+ return AS3_Int(native->getLength());
+ }
+ /* AS3 Argument protocol
+ * _native :NyARSquareStack
+ * index :int
+ * return :AS3_Val as NyARStack
+ */
+ static AS3_Val getItem(void* self, AS3_Val args)
+ {
+ NyARSquareStack* native;
+ int index;
+ AS3_ArrayValue(args, "PtrType,IntType", &native,&index);
+ S_NyARSquare class_builder;
+ return class_builder.buildWithOutNativeInstance(native->getItem(index));
+ }
+};
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARRgbRaster_BGRA.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARRgbRaster_BGRA.h (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARRgbRaster_BGRA.h (revision 335)
@@ -1,72 +1,72 @@
#pragma once
#include "NyARRgbRaster_BGRA.h"

-class S_NyARRgbRaster_BGRA : public AlchemyClassStub<NyARRgbRaster_BGRA>
+//バッファを保持するタイプのNyARRgbRaster_BGRA
+class NyARRgbRaster_BGRA2 :public NyARRgbRaster_BGRA
{
-private:
- //m_instに同期するリソース
+public:
NyAR_BYTE_t* m_buf;
public:
- static AS3_Val createInstance(void* self, AS3_Val args)
+ static NyARRgbRaster_BGRA2* createAttachedRaster(int i_width,int i_height)
{
- S_NyARRgbRaster_BGRA* inst=new S_NyARRgbRaster_BGRA();
- int w,h;
- AS3_ArrayValue(args, "IntType,IntType",&w,&h);
- //初期化
- inst->initRelStub(new NyARRgbRaster_BGRA(w,h));
- inst->m_buf=new NyAR_BYTE_t[w*h*4*sizeof(NyAR_BYTE_t)];
- inst->m_inst->setBuffer(inst->m_buf);
- //AS3オブジェクト化
- return inst->toAS3Object();
+ NyAR_BYTE_t* buf= new NyAR_BYTE_t[i_width*i_height*4];
+ return new NyARRgbRaster_BGRA2(buf,i_width,i_height);
}
- static AS3_Val createReference(const NyARRgbRaster_BGRA* i_ref)
+private:
+ NyARRgbRaster_BGRA2(const NyAR_BYTE_t* i_buffer,int i_width,int i_height):NyARRgbRaster_BGRA(i_buffer,i_width,i_height)
{
- //参照生成はm_bufの参照もコピーすること!
- return NULL;
+ this->m_buf=(NyAR_BYTE_t*)i_buffer;
}
+public:
+ NyARRgbRaster_BGRA2::~NyARRgbRaster_BGRA2()
+ {
+ delete this->m_buf;
+ return;
+ }
+};

+class S_NyARRgbRaster_BGRA : public T_INyARRgbRaster<NyARRgbRaster_BGRA2>
+{
+public:
+ static AS3_Val createInstance(void* self, AS3_Val args)
+ {
+ S_NyARRgbRaster_BGRA class_builder;
+ return class_builder.buildWithNativeInstance(self,args);
+ }
+protected:
//自身のオブジェクトをAS3オブジェクトにする。
- void initAS3Object(AS3ObjectBuilder& i_builder)
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,NyARRgbRaster_BGRA2* i_native_inst)
{
- AlchemyClassStub<NyARRgbRaster_BGRA>::initAS3Object(i_builder);
+ T_INyARRgbRaster<NyARRgbRaster_BGRA2>::initAS3Member(i_builder,i_native_inst);
i_builder.addFunction("setData",S_NyARRgbRaster_BGRA::setData);
- i_builder.addFunction("getWidth",S_NyARRgbRaster_BGRA::getWidth);
- i_builder.addFunction("getHeight",S_NyARRgbRaster_BGRA::getHeight);
return;
}
- ~S_NyARRgbRaster_BGRA()
+ /* AS3 Argument protocol
+ */
+ virtual NyARRgbRaster_BGRA2* createNativeInstance(AS3_Val args)
{
- if(this->m_inst!=NULL){
- delete this->m_buf;
- this->m_buf=NULL;
- }
+ int w,h;
+ AS3_ArrayValue(args, "IntType,IntType", &w,&h);
+ return NyARRgbRaster_BGRA2::createAttachedRaster(w,h);
}
+
private:
+ /* AS3 Argument protocol
+ * _native : NyARRgbRaster_BGRA2*
+ * v : AS3_ByteArray
+ */
static AS3_Val setData(void* self, AS3_Val args)
{
- S_NyARRgbRaster_BGRA* inst;
+ NyARRgbRaster_BGRA2* native;
AS3_Val v;
- AS3_ArrayValue(args, "PtrType,AS3ValType", &inst,&v);
+ AS3_ArrayValue(args, "PtrType,AS3ValType", &native,&v);
//コピーサイズを決める(4*w*h)
- int w=inst->m_ref->getWidth();
- int h=inst->m_ref->getHeight();
+ int w=native->getWidth();
+ int h=native->getHeight();
//BYTEデータをコピー
- AS3_ByteArray_readBytes(inst->m_buf,v,w*h*4*sizeof(NyAR_BYTE_t));
+ AS3_ByteArray_readBytes(native->m_buf,v,w*h*4*sizeof(NyAR_BYTE_t));
//引数の参照カウント減算
AS3_Release(v);
return AS3_Null();
}
- static AS3_Val getWidth(void* self, AS3_Val args)
- {
- S_NyARRgbRaster_BGRA* inst;
- AS3_ArrayValue(args, "PtrType", &inst);
- return AS3_Int(inst->m_ref->getWidth());
- }
- static AS3_Val getHeight(void* self, AS3_Val args)
- {
- S_NyARRgbRaster_BGRA* inst;
- AS3_ArrayValue(args, "PtrType", &inst);
- //コピーしてセット
- return AS3_Int(inst->m_ref->getHeight());
- }
};
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyIdMarkerPickup.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyIdMarkerPickup.h (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyIdMarkerPickup.h (revision 335)
@@ -0,0 +1,49 @@
+#pragma once
+#include "NyIdMarkerPickup.h"
+#include "NyIdMarkerPattern.h"
+#include "NyIdMarkerParam.h"
+class S_NyIdMarkerPickup: public AlchemyClassBuilder<NyIdMarkerPickup>
+{
+public:
+ static AS3_Val createInstance(void* self, AS3_Val args)
+ {
+ S_NyIdMarkerPickup class_builder;
+ return class_builder.buildWithNativeInstance(self,args);
+ }
+protected:
+ //自身のオブジェクトをAS3オブジェクトにする。
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,NyIdMarkerPickup* i_native_inst)
+ {
+ AlchemyClassBuilder<NyIdMarkerPickup>::initAS3Member(i_builder,i_native_inst);
+ i_builder.addFunction("pickFromRaster",S_NyIdMarkerPickup::pickFromRaster);
+ return;
+ }
+ /* AS3 Argument protocol
+ */
+ virtual NyIdMarkerPickup* createNativeInstance(AS3_Val args)
+ {
+ return new NyIdMarkerPickup();
+ }
+
+private:
+ /* AS3 Argument protocol
+ * _native : S_NyARMatchPatt_Color_WITHOUT_PCA*
+ * image : NyARMatchPattDeviationColorData*
+ * i_square : TNyARMatchPattResult*
+ * o_data : NyIdMarkerPattern
+ * o_param : NyIdMarkerParam
+ * return : AS3_Val as Boolean
+ */
+ static AS3_Val pickFromRaster(void* self, AS3_Val args)
+ {
+ NyIdMarkerPickup* native;
+ INyARRgbRaster* image;
+ NyARSquare* i_square;
+ TNyIdMarkerPattern* o_data;
+ TNyIdMarkerParam* o_param;
+ AS3_ArrayValue(args, "PtrType,PtrType,PtrType,PtrType,PtrType", &native,&image,&i_square,&o_data,&o_param);
+ bool ret=native->pickFromRaster(*image,*i_square,*o_data,*o_param);
+ return ret?AS3_True():AS3_False();
+ }
+
+};
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARTransMatResult.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARTransMatResult.h (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARTransMatResult.h (revision 335)
@@ -3,36 +3,45 @@
class S_NyARTransMatResult : public T_NyARDoubleMatrix34<NyARTransMatResult>
{
public:
- //標準的なインスタンス生成関数です。
static AS3_Val createInstance(void* self, AS3_Val args)
{
- S_NyARTransMatResult* inst=new S_NyARTransMatResult();
- //初期化
- inst->initRelStub(new NyARTransMatResult());
- //AS3オブジェクト化
- return inst->toAS3Object();
+ S_NyARTransMatResult class_builder;
+ return class_builder.buildWithNativeInstance(self,args);
}
- void initAS3Object(AS3ObjectBuilder& i_builder)
+protected:
+ //自身のオブジェクトをAS3オブジェクトにする。
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,NyARTransMatResult* i_native_inst)
{
- T_NyARDoubleMatrix34<NyARTransMatResult>::initAS3Object(i_builder);
- i_builder.addFunction("getHasValue",S_NyARTransMatResult::getHasValue);
- i_builder.addFunction("getAngle",S_NyARTransMatResult::getAngle);
+ T_NyARDoubleMatrix34<NyARTransMatResult>::initAS3Member(i_builder,i_native_inst);
+ i_builder.addFunction("getZXYAngle",S_NyARTransMatResult::getZXYAngle);
+ return;
}
- static AS3_Val getHasValue(void* self, AS3_Val args)
+ /* AS3 Argument protocol
+ * _param : NyARParam*
+ */
+ virtual NyARTransMatResult* createNativeInstance(AS3_Val args)
{
- S_NyARTransMatResult* inst;
- AS3_ArrayValue(args, "PtrType", &inst);
- return inst->m_ref->has_value?AS3_True():AS3_False();
+ return new NyARTransMatResult();
}
- static AS3_Val getAngle(void* self, AS3_Val args)
+public:
+ /* AS3 Argument protocol
+ * _native :NyARSquareStack
+ * index :int
+ * return :AS3_Val as double x,y,z
+ */
+ static AS3_Val getZXYAngle(void* self, AS3_Val args)
{
- S_NyARTransMatResult* inst;
+ NyARTransMatResult* native;
AS3_Val v;
- AS3_ArrayValue(args, "PtrType, AS3ValType", &inst,&v);
- //コピーしてセット
- AS3_ByteArray_writeBytes(v,(void*)&(inst->m_ref->angle),sizeof(double)*3);
- //引数の参照カウント減算
- AS3_Release(v);
+ AS3_ArrayValue(args, "PtrType, AS3ValType", &native,&v);
+ TNyARDoublePoint3d ang;
+ native->getZXYAngle(ang);
+ double work[3];
+ work[0]=ang.x;
+ work[1]=ang.y;
+ work[2]=ang.z;
+ AS3_ByteArray_writeBytes(v,work,sizeof(double)*3);
return AS3_Null();
}
+
};
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARBinRaster.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARBinRaster.h (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARBinRaster.h (revision 335)
@@ -0,0 +1,71 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
+#pragma once
+#include "NyARBinRaster.h"
+class S_NyARBinRaster : public AlchemyClassBuilder<NyARBinRaster>
+{
+public:
+ static AS3_Val createInstance(void* self, AS3_Val args)
+ {
+ S_NyARBinRaster class_builder;
+ return class_builder.buildWithNativeInstance(self,args);
+ }
+protected:
+ //自身のオブジェクトをAS3オブジェクトにする。
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,NyARBinRaster* i_native_inst)
+ {
+ AlchemyClassBuilder<NyARBinRaster>::initAS3Member(i_builder,i_native_inst);
+ i_builder.addFunction("getSum",S_NyARBinRaster::getSum);
+ return;
+ }
+ /* AS3 Argument protocol
+ * w :int
+ * h :int
+ */
+ virtual NyARBinRaster* createNativeInstance(AS3_Val args)
+ {
+ int w,h;
+ AS3_ArrayValue(args, "IntType,IntType",&w,&h);
+ return new NyARBinRaster(w,h);
+ }
+public:
+ /* This is Debug function
+ * AS3 Argument protocol
+ * native :S_NyARBinRaster*
+ */
+ static AS3_Val getSum(void* self, AS3_Val args)
+ {
+ NyARBinRaster* inst;
+ AS3_ArrayValue(args, "PtrType", &inst);
+ int* p=(int*)(inst->getBufferReader().getBuffer());
+ int len=inst->getSize().w*inst->getSize().h;
+ int sum=0;
+ for(int i=0;i<len;i++){
+ sum+=*(i+p);
+ }
+ return AS3_Int(sum);
+ }
+};
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARMatchPatt_Color_WITHOUT_PCA.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARMatchPatt_Color_WITHOUT_PCA.h (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARMatchPatt_Color_WITHOUT_PCA.h (revision 335)
@@ -0,0 +1,70 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
+#pragma once
+#include "NyARMatchPatt_Color_WITHOUT_PCA.h"
+#include "S_NyARCode.h"
+class S_NyARMatchPatt_Color_WITHOUT_PCA : public AlchemyClassBuilder<NyARMatchPatt_Color_WITHOUT_PCA>
+{
+public:
+ static AS3_Val createInstance(void* self, AS3_Val args)
+ {
+ S_NyARMatchPatt_Color_WITHOUT_PCA class_builder;
+ return class_builder.buildWithNativeInstance(self,args);
+ }
+protected:
+ //自身のオブジェクトをAS3オブジェクトにする。
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,NyARMatchPatt_Color_WITHOUT_PCA* i_native_inst)
+ {
+ AlchemyClassBuilder<NyARMatchPatt_Color_WITHOUT_PCA>::initAS3Member(i_builder,i_native_inst);
+ i_builder.addFunction("evaluate",S_NyARMatchPatt_Color_WITHOUT_PCA::evaluate);
+ return;
+ }
+ /* AS3 Argument protocol
+ * code : NyARCode*
+ */
+ virtual NyARMatchPatt_Color_WITHOUT_PCA* createNativeInstance(AS3_Val args)
+ {
+ NyARCode* code;
+ AS3_ArrayValue(args, "PtrType",&code);
+ //初期化
+ return new NyARMatchPatt_Color_WITHOUT_PCA(code);
+ }
+private:
+ /* AS3 Argument protocol
+ * _native : S_NyARMatchPatt_Color_WITHOUT_PCA*
+ * data : NyARMatchPattDeviationColorData*
+ * result : TNyARMatchPattResult*
+ * return : AS3_Val as Boolean
+ */
+ static AS3_Val evaluate(void* self, AS3_Val args)
+ {
+ NyARMatchPatt_Color_WITHOUT_PCA* native;
+ NyARMatchPattDeviationColorData* data;
+ TNyARMatchPattResult* result;
+ AS3_ArrayValue(args, "PtrType,PtrType,PtrType", &native,&data,&result);
+ return native->evaluate(*data,*result)?AS3_True():AS3_False();
+ }
+};
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyIdMarkerParam.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyIdMarkerParam.h (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyIdMarkerParam.h (revision 335)
@@ -0,0 +1,42 @@
+#pragma once
+#include "NyIdMarkerParam.h"
+
+class S_NyIdMarkerParam: public AlchemyClassBuilder<TNyIdMarkerParam>
+{
+public:
+ static AS3_Val createInstance(void* self, AS3_Val args)
+ {
+ S_NyIdMarkerParam class_builder;
+ return class_builder.buildWithNativeInstance(self,args);
+ }
+protected:
+ //自身のオブジェクトをAS3オブジェクトにする。
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,TNyIdMarkerParam* i_native_inst)
+ {
+ AlchemyClassBuilder<TNyIdMarkerParam>::initAS3Member(i_builder,i_native_inst);
+ i_builder.addFunction("getValue",S_NyIdMarkerParam::getValue);
+ return;
+ }
+ virtual TNyIdMarkerParam* createNativeInstance(AS3_Val args)
+ {
+ return new TNyIdMarkerParam();
+ }
+ /* AS3 Argument protocol
+ * _native : TNyIdMarkerParam*
+ * v : AS3_ByteArray as int,int
+ */
+ static AS3_Val getValue(void* self, AS3_Val args)
+ {
+ TNyIdMarkerParam* native;
+ AS3_Val v;
+ AS3_ArrayValue(args, "PtrType, AS3ValType", &native,&v);
+ //コピーしてセット
+ int work[2];
+ work[0]=native->direction;
+ work[1]=native->threshold;
+ AS3_ByteArray_writeBytes(v,work,sizeof(int)*2);
+ //引数の参照カウント減算
+ AS3_Release(v);
+ return AS3_Null();
+ }
+};
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/T_INyARRasterThresholdAnalyzer.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/T_INyARRasterThresholdAnalyzer.h (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/T_INyARRasterThresholdAnalyzer.h (revision 335)
@@ -0,0 +1,36 @@
+#pragma once
+#include "INyARRasterThresholdAnalyzer.h"
+#include "INyARRgbRaster.h"
+template<class T> class T_INyARRasterThresholdAnalyzer : public AlchemyClassBuilder<T>
+{
+public:
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,T* i_native_inst)
+ {
+ AlchemyClassBuilder<T>::initAS3Member(i_builder,i_native_inst);
+ i_builder.addFunction("analyzeRaster",T_INyARRasterThresholdAnalyzer<T>::analyzeRaster);
+ i_builder.addFunction("getThreshold",T_INyARRasterThresholdAnalyzer<T>::getThreshold);
+ return;
+ }
+protected:
+ /* AS3 Argument protocol
+ * _native : T*
+ * in_raster : INyARRaster*
+ */
+ static AS3_Val analyzeRaster(void* self, AS3_Val args)
+ {
+ T* native;
+ INyARRaster* input;
+ AS3_ArrayValue(args, "PtrType,PtrType", &native,&input);
+ native->analyzeRaster(*input);
+ return AS3_Null();
+ }
+ /* AS3 Argument protocol
+ * _native : T*
+ */
+ static AS3_Val getThreshold(void* self, AS3_Val args)
+ {
+ T* native;
+ AS3_ArrayValue(args, "PtrType", &native);
+ return AS3_Int(native->getThreshold());
+ }
+};
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARParam.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARParam.h (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARParam.h (revision 335)
@@ -1,62 +1,67 @@
#pragma once
#include "NyARParam.h"
+#include "S_NyARPerspectiveProjectionMatrix.h"
+#include "S_NyARIntSize.h"
+#include "S_NyARCameraDistortionFactor.h"

-class S_NyARParam : public AlchemyClassStub<NyARParam>
+class S_NyARParam : public AlchemyClassBuilder<NyARParam>
{
public:
static AS3_Val createInstance(void* self, AS3_Val args)
{
- S_NyARParam* inst=new S_NyARParam();
- //初期化
- inst->initRelStub(new NyARParam());
- //AS3オブジェクト化
- return inst->toAS3Object();
+ S_NyARParam class_builder;
+ return class_builder.buildWithNativeInstance(self,args);
}
+protected:
//自身のオブジェクトをAS3オブジェクトにする。
- void initAS3Object(AS3ObjectBuilder& i_builder)
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,NyARParam* i_native_inst)
{
- AlchemyClassStub<NyARParam>::initAS3Object(i_builder);
+ AlchemyClassBuilder<NyARParam>::initAS3Member(i_builder,i_native_inst);
i_builder.addFunction("changeScreenSize",S_NyARParam::changeScreenSize);
- i_builder.addFunction("getPerspectiveProjectionMatrix",S_NyARParam::getPerspectiveProjectionMatrix);
i_builder.addFunction("loadARParamFile",S_NyARParam::loadARParamFile);
- i_builder.addFunction("getScreenSize",S_NyARParam::getScreenSize);
+ //getPerspectiveProjectionMatrixはAS3側で実装
+ //getScreenSizeはAS3側で実装

+ //AS3ポインターオブジェクト(dispose時にGC経由で解放される(はず))
+ S_NyARIntSize size;
+ S_NyARPerspectiveProjectionMatrix pmat;
+ S_NyARCameraDistortionFactor distfactor;
+
+ i_builder.addAS3Val("_screen_size",size.buildWithOutNativeInstance((TNyARIntSize*)&(i_native_inst->getScreenSize())));
+ i_builder.addAS3Val("_perspective_matrix",pmat.buildWithOutNativeInstance((NyARPerspectiveProjectionMatrix*)&(i_native_inst->getPerspectiveProjectionMatrix())));
+ i_builder.addAS3Val("_distortion_factor",distfactor.buildWithOutNativeInstance((NyARCameraDistortionFactor*)&(i_native_inst->getDistortionFactor())));
+
return;
}
- S_NyARParam()
+ /* AS3 Argument protocol
+ */
+ virtual NyARParam* createNativeInstance(AS3_Val args)
{
- //メンバの初期化
- this->_wrap_size.initWrapStub();
- this->_wrap_size.toHolderObject();
- this->_wrap_prjmat.initWrapStub();
- this->_wrap_prjmat.toHolderObject();
+ return new NyARParam();
}
private:
- S_NyARPerspectiveProjectionMatrix _wrap_prjmat;
- S_NyARIntSize _wrap_size;
-private:
+ /* AS3 Argument protocol
+ * _native : AlchemyClassStub<T>*
+ * w : int
+ * h : int
+ */
static AS3_Val changeScreenSize(void* self, AS3_Val args)
{
- S_NyARParam* inst;
+ NyARParam* native;
int w,h;
- AS3_ArrayValue(args, "PtrType, IntType, IntType", &inst,&w,&h);
- ((NyARParam*)(inst->m_inst))->changeScreenSize(w,h);
+ AS3_ArrayValue(args, "PtrType, IntType, IntType", &native,&w,&h);
+ native->changeScreenSize(w,h);
return AS3_Null();
}
- static AS3_Val getPerspectiveProjectionMatrix(void* self, AS3_Val args)
- {
- S_NyARParam* inst;
- int w,h;
- AS3_ArrayValue(args, "PtrType", &inst);
- //このオブジェクトはS_NyARParamと同期したAS3オブジェクト
- inst->_wrap_prjmat.wrapRef(&((NyARParam*)(inst->m_ref))->getPerspectiveProjectionMatrix());
- return inst->_wrap_prjmat.m_as3;
- }
+ /* AS3 Argument protocol
+ * _native : NyARParam*
+ * v : AS3_ByteArray as int[12],int[4]
+ */
static AS3_Val loadARParamFile(void* self, AS3_Val args)
{
- S_NyARParam* inst;
+ NyARParam* native;
AS3_Val v;
- AS3_ArrayValue(args, "PtrType,AS3ValType", &inst,&v);
+ AS3_ArrayValue(args, "PtrType,AS3ValType", &native,&v);
NyARParamFileStruct work;
AS3_ByteArray_readBytes(&work,v,sizeof(NyARParamFileStruct));
#if AL_ENDIAN==AL_ENDIAN_LITTLE
@@ -70,11 +75,19 @@
work.distortion[i]=NyStdLib::byteSwap(work.distortion[i]);
}
#endif
- //Cのアクセス制御を強引に突破する。
- ((NyARParam*)inst->m_ref)->loadARParam(work);
+ native->loadARParam(work);
//引数の参照カウント減算
AS3_Release(v);
return AS3_Null();
+ }/*
+ static AS3_Val getPerspectiveProjectionMatrix(void* self, AS3_Val args)
+ {
+ NyARParam* native;
+ int w,h;
+ AS3_ArrayValue(args, "PtrType", &native);
+ //このオブジェクトはS_NyARParamと同期したAS3オブジェクト
+ inst->_wrap_prjmat.wrapRef(native->getPerspectiveProjectionMatrix());
+ return inst->_wrap_prjmat.m_as3;
}
static AS3_Val getScreenSize(void* self, AS3_Val args)
{
@@ -84,5 +97,5 @@
//このオブジェクトはS_NyARParamと同期したAS3オブジェクト
inst->_wrap_size.wrapRef(&((NyARParam*)(inst->m_ref))->getScreenSize());
return inst->_wrap_size.m_as3;
- }
+ }*/
};
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARSquare.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARSquare.h (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARSquare.h (revision 335)
@@ -1,32 +1,60 @@
#pragma once
#include "NyARSquare.h"

-class S_NyARSquare : public AlchemyClassStub<NyARSquare>
+class S_NyARSquare : public AlchemyClassBuilder<NyARSquare>
{
-private:
public:
static AS3_Val createInstance(void* self, AS3_Val args)
{
- S_NyARSquare* inst=new S_NyARSquare();
- //初期化
- inst->initRelStub(new NyARSquare());
- //AS3オブジェクト化
- return inst->toAS3Object();
+ S_NyARSquare class_builder;
+ return class_builder.buildWithNativeInstance(self,args);
}
- static AS3_Val createReference(const NyARSquare* i_ref)
- {
- //参照生成はm_bufの参照もコピーすること!
- return NULL;
- }
-
+protected:
//自身のオブジェクトをAS3オブジェクトにする。
- void initAS3Object(AS3ObjectBuilder& i_builder)
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,NyARSquare* i_native_inst)
{
- AlchemyClassStub<NyARSquare>::initAS3Object(i_builder);
+ AlchemyClassBuilder<NyARSquare>::initAS3Member(i_builder,i_native_inst);
+ i_builder.addFunction("getValue",S_NyARSquare::getValue);
return;
}
- ~S_NyARSquare()
+ /* AS3 Argument protocol
+ */
+ virtual NyARSquare* createNativeInstance(AS3_Val args)
{
+ return new NyARSquare();
}
-private:
+ /* AS3 Argument protocol
+ * _native :NyARSquareStack
+ * return :AS3_Val
+ * as int dir,int impos[4,2],double[4*3] line,double sqpos[4,2]
+ */
+ static AS3_Val getValue(void* self, AS3_Val args)
+ {
+ NyARSquare* native;
+ AS3_Val marshal;
+ int wi[9];
+ double wd[20];
+ AS3_ArrayValue(args, "PtrType,AS3ValType", &native,&marshal);
+ //set int param
+ wi[0]=native->direction;
+ for(int i=0;i<4;i++){
+ wi[1+i*2]=native->imvertex[i].x;
+ wi[2+i*2]=native->imvertex[i].y;
+ }
+ for(int i=0;i<4;i++){
+ wd[i*3] =native->line[i].rise;
+ wd[i*3+1]=native->line[i].run;
+ wd[i*3+2]=native->line[i].intercept;
+ }
+ for(int i=0;i<4;i++){
+ wd[i*2+12]=native->sqvertex[i].x;
+ wd[i*2+13]=native->sqvertex[i].y;
+ }
+ AS3_ByteArray_writeBytes(marshal,wi,sizeof(int)*9);
+ AS3_ByteArray_writeBytes(marshal,wd,sizeof(double)*20);
+
+ return AS3_Null();
+ }
+
+
};
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARRasterThresholdAnalyzer_SlidePTile.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARRasterThresholdAnalyzer_SlidePTile.h (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARRasterThresholdAnalyzer_SlidePTile.h (revision 335)
@@ -0,0 +1,55 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
+#pragma once
+#include "T_INyARRasterThresholdAnalyzer.h"
+#include "NyARRasterThresholdAnalyzer_SlidePTile.h"
+class S_NyARRasterThresholdAnalyzer_SlidePTile : public T_INyARRasterThresholdAnalyzer<NyARRasterThresholdAnalyzer_SlidePTile>
+{
+public:
+ static AS3_Val createInstance(void* self, AS3_Val args)
+ {
+ S_NyARRasterThresholdAnalyzer_SlidePTile class_builder;
+ return class_builder.buildWithNativeInstance(self,args);
+ }
+protected:
+ //自身のオブジェクトをAS3オブジェクトにする。
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,NyARRasterThresholdAnalyzer_SlidePTile* i_native_inst)
+ {
+ T_INyARRasterThresholdAnalyzer<NyARRasterThresholdAnalyzer_SlidePTile>::initAS3Member(i_builder,i_native_inst);
+ return;
+ }
+ /* AS3 Argument protocol
+ * i_persentage :int
+ * i_raster_format :int
+ * i_vertical_interval:int
+ */
+ virtual NyARRasterThresholdAnalyzer_SlidePTile* createNativeInstance(AS3_Val args)
+ {
+ int persentage,raster_format,vertical_interval;
+ AS3_ArrayValue(args, "IntType,IntType,IntType", &persentage,&raster_format,&vertical_interval);
+ return new NyARRasterThresholdAnalyzer_SlidePTile(persentage,raster_format,vertical_interval);
+ }
+};
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/T_INyARSquareDetector.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/T_INyARSquareDetector.h (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/T_INyARSquareDetector.h (revision 335)
@@ -0,0 +1,60 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
+#pragma once
+#include "INyARSquareDetector.h"
+#include "NyARBinRaster.h"
+#include "NyARSquareStack.h"
+#include "S_NyARBinRaster.h"
+#include "S_NyARSquareStack.h"
+template<class T> class T_INyARSquareDetector : public AlchemyClassBuilder<T>
+{
+public:
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,T* i_native_inst)
+ {
+ AlchemyClassBuilder<T>::initAS3Member(i_builder,i_native_inst);
+ i_builder.addFunction("detectMarker",T_INyARSquareDetector<T>::detectMarker);
+ return;
+ }
+
+protected:
+ /* AS3 Argument protocol
+ * _native : T*
+ * bin : NyARBinRaster*
+ * sq : NyARSquareStack*
+ */
+ static AS3_Val detectMarker(void* self, AS3_Val args)
+ {
+ INyARSquareDetector* native;
+ NyARBinRaster* bin;
+ NyARSquareStack* sq;
+ AS3_ArrayValue(args, "PtrType,PtrType,PtrType", &native,&bin,&sq);
+
+ //APIコール
+ native->detectMarker(*bin,*sq);
+ return AS3_Null();
+ }
+};
+
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/T_INyARRgbRaster.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/T_INyARRgbRaster.h (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/T_INyARRgbRaster.h (revision 335)
@@ -0,0 +1,59 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
+#pragma once
+#include "S_NyARBinRaster.h"
+#include "S_NyARSquareStack.h"
+template<class T> class T_INyARRgbRaster : public AlchemyClassBuilder<T>
+{
+public:
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,T* i_native_inst)
+ {
+ AlchemyClassBuilder<T>::initAS3Member(i_builder,i_native_inst);
+ i_builder.addFunction("getWidth",T_INyARRgbRaster<T>::getWidth);
+ i_builder.addFunction("getHeight",T_INyARRgbRaster<T>::getHeight);
+ return;
+ }
+protected:
+ /* AS3 Argument protocol
+ * _native : T*
+ */
+ static AS3_Val getWidth(void* self, AS3_Val args)
+ {
+ T* inst;
+ AS3_ArrayValue(args, "PtrType", &inst);
+ return AS3_Int(inst->getWidth());
+ }
+ /* AS3 Argument protocol
+ * _native : T*
+ */
+ static AS3_Val getHeight(void* self, AS3_Val args)
+ {
+ T* inst;
+ AS3_ArrayValue(args, "PtrType", &inst);
+ //コピーしてセット
+ return AS3_Int(inst->getHeight());
+ }
+};
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARDoubleMatrix34.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARDoubleMatrix34.h (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARDoubleMatrix34.h (revision 335)
@@ -3,18 +3,22 @@
class S_NyARDoubleMatrix34 : public T_NyARDoubleMatrix34<NyARDoubleMatrix34>
{
public:
- //標準的なインスタンス生成関数です。
static AS3_Val createInstance(void* self, AS3_Val args)
{
- S_NyARDoubleMatrix34* inst=new S_NyARDoubleMatrix34();
- //初期化
- inst->initRelStub(new NyARDoubleMatrix34());
- //AS3オブジェクト化
- return inst->toAS3Object();
+ S_NyARDoubleMatrix34 class_builder;
+ return class_builder.buildWithNativeInstance(self,args);
}
+protected:
//自身のオブジェクトをAS3オブジェクトにする。
- void initAS3Object(AS3ObjectBuilder& i_builder)
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,NyARDoubleMatrix34* i_native_inst)
{
- T_NyARDoubleMatrix34<NyARDoubleMatrix34>::initAS3Object(i_builder);
+ T_NyARDoubleMatrix34<NyARDoubleMatrix34>::initAS3Member(i_builder,i_native_inst);
+ return;
}
+ /* AS3 Argument protocol
+ */
+ virtual NyARDoubleMatrix34* createNativeInstance(AS3_Val args)
+ {
+ return new NyARDoubleMatrix34();
+ }
};
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARCameraDistortionFactor.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARCameraDistortionFactor.h (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARCameraDistortionFactor.h (revision 335)
@@ -1,47 +1,59 @@
#pragma once
#include "NyARCameraDistortionFactor.h"
-class S_NyARCameraDistortionFactor: public AlchemyClassStub<NyARCameraDistortionFactor>
+class S_NyARCameraDistortionFactor: public AlchemyClassBuilder<NyARCameraDistortionFactor>
{
public:
static AS3_Val createInstance(void* self, AS3_Val args)
{
- S_NyARCameraDistortionFactor* inst=new S_NyARCameraDistortionFactor();
- //初期化
- inst->initRelStub(new NyARCameraDistortionFactor());
- //AS3オブジェクト化
- return inst->toAS3Object();
+ S_NyARCameraDistortionFactor class_builder;
+ return class_builder.buildWithNativeInstance(self,args);
}
+protected:
//自身のオブジェクトをAS3オブジェクトにする。
- void initAS3Object(AS3ObjectBuilder& i_builder)
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,NyARCameraDistortionFactor* i_native_inst)
{
- AlchemyClassStub<NyARCameraDistortionFactor>::initAS3Object(i_builder);
+ AlchemyClassBuilder<NyARCameraDistortionFactor>::initAS3Member(i_builder,i_native_inst);
i_builder.addFunction("setValue",S_NyARCameraDistortionFactor::setValue);
i_builder.addFunction("getValue",S_NyARCameraDistortionFactor::getValue);
return;
}
+ /* AS3 Argument protocol
+ */
+ virtual NyARCameraDistortionFactor* createNativeInstance(AS3_Val args)
+ {
+ return new NyARCameraDistortionFactor();
+ }
private:
+ /* AS3 Argument protocol
+ * native :NyARCameraDistortionFactor*
+ * v :ByteArray as double[4]
+ */
static AS3_Val setValue(void* self, AS3_Val args)
{
- S_NyARCameraDistortionFactor* inst;
+ NyARCameraDistortionFactor* inst;
AS3_Val v;
AS3_ArrayValue(args, "PtrType, AS3ValType", &inst,&v);
//
double work[4];
AS3_ByteArray_readBytes(work,v,sizeof(double)*4);
//Cのアクセス制御を強引に突破する。
- ((NyARCameraDistortionFactor*)inst->m_ref)->setValue(work);
+ inst->setValue(work);
//引数の参照カウント減算
AS3_Release(v);
return AS3_Null();
}
+ /* AS3 Argument protocol
+ * native :NyARCameraDistortionFactor*
+ * v :ByteArray as double[4]
+ */
static AS3_Val getValue(void* self, AS3_Val args)
{
- S_NyARCameraDistortionFactor* inst;
+ NyARCameraDistortionFactor* inst;
AS3_Val v;
AS3_ArrayValue(args, "PtrType, AS3ValType", &inst,&v);
//コピーしてセット
double work[4];
- inst->m_ref->getValue(work);
+ inst->getValue(work);
AS3_ByteArray_writeBytes(v,work,sizeof(double)*4);
//引数の参照カウント減算
AS3_Release(v);
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/T_INyARRasterFilter_RgbToBin.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/T_INyARRasterFilter_RgbToBin.h (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/T_INyARRasterFilter_RgbToBin.h (revision 335)
@@ -0,0 +1,28 @@
+#pragma once
+#include "NyARBinRaster.h"
+#include "INyARRgbRaster.h"
+template<class T> class T_INyARRasterFilter_RgbToBin : public AlchemyClassBuilder<T>
+{
+public:
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,T* i_native_inst)
+ {
+ AlchemyClassBuilder<T>::initAS3Member(i_builder,i_native_inst);
+ i_builder.addFunction("doFilter",T_INyARRasterFilter_RgbToBin<T>::doFilter);
+ return;
+ }
+protected:
+ /* AS3 Argument protocol
+ * _native : T*
+ * in_raster : INyARRgbRaster*
+ * out_raster : NyARBinRaster*
+ */
+ static AS3_Val doFilter(void* self, AS3_Val args)
+ {
+ T* native;
+ INyARRgbRaster* in_raster;
+ NyARBinRaster* out_raster;
+ AS3_ArrayValue(args, "PtrType,PtrType,PtrType", &native,&in_raster,&out_raster);
+ native->doFilter(*in_raster,*out_raster);
+ return AS3_Null();
+ }
+};
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyIdMarkerPattern.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyIdMarkerPattern.h (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyIdMarkerPattern.h (revision 335)
@@ -0,0 +1,25 @@
+#pragma once
+#include "NyIdMarkerPattern.h"
+
+class S_NyIdMarkerPattern: public AlchemyClassBuilder<TNyIdMarkerPattern>
+{
+public:
+ static AS3_Val createInstance(void* self, AS3_Val args)
+ {
+ S_NyIdMarkerPattern class_builder;
+ return class_builder.buildWithNativeInstance(self,args);
+ }
+protected:
+ //自身のオブジェクトをAS3オブジェクトにする。
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,TNyIdMarkerPattern* i_native_inst)
+ {
+ AlchemyClassBuilder<TNyIdMarkerPattern>::initAS3Member(i_builder,i_native_inst);
+ return;
+ }
+ /* AS3 Argument protocol
+ */
+ virtual TNyIdMarkerPattern* createNativeInstance(AS3_Val args)
+ {
+ return new TNyIdMarkerPattern();
+ }
+};
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_INyIdMarkerData.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_INyIdMarkerData.h (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_INyIdMarkerData.h (revision 335)
@@ -1,11 +0,0 @@
-#pragma once
-#include "INyIdMarkerData.h"
-class S_INyIdMarkerData : public AlchemyClassStub<INyIdMarkerData>
-{
-public:
- void initAS3Object(AS3ObjectBuilder& i_builder)
- {
- AlchemyClassStub<INyIdMarkerData>::initAS3Object(i_builder);
- }
-
-};
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_INyIdMarkerData.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_INyIdMarkerData.h (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_INyIdMarkerData.h (revision 335)
@@ -0,0 +1,29 @@
+#pragma once
+#include "INyIdMarkerData.h"
+#include "T_INyIdMarkerData.h"
+class S_INyIdMarkerData : public T_INyIdMarkerData<INyIdMarkerData>
+{
+public:
+ static AS3_Val createInstance(void* self, AS3_Val args)
+ {
+ S_NyIdMarkerData_RawBit class_builder;
+ return class_builder.buildWithNativeInstance(self,args);
+ }
+protected:
+ //自身のオブジェクトをAS3オブジェクトにする。
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,INyIdMarkerData* i_native_inst)
+ {
+ T_INyIdMarkerData<INyIdMarkerData>::initAS3Member(i_builder,i_native_inst);
+ return;
+ }
+ /* AS3 Argument protocol
+ */
+ virtual INyIdMarkerData* createNativeInstance(AS3_Val args)
+ {
+ //このクラスはインスタンス化出来ない。
+ return NULL;
+ }
+
+
+
+};
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/T_INyIdMarkerDataEncoder.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/T_INyIdMarkerDataEncoder.h (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/T_INyIdMarkerDataEncoder.h (revision 335)
@@ -0,0 +1,44 @@
+#pragma once
+#include "INyIdMarkerDataEncoder.h"
+#include "NyIdMarkerPattern.h"
+#include "S_INyIdMarkerData.h"
+template<class T,class TSData,class TData> class T_INyIdMarkerDataEncoder : public AlchemyClassBuilder<T>
+{
+public:
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,T* i_native_inst)
+ {
+ AlchemyClassBuilder<T>::initAS3Member(i_builder,i_native_inst);
+ i_builder.addFunction("encode",T_INyIdMarkerDataEncoder<T,TSData,TData>::encode);
+ i_builder.addFunction("createDataInstance",T_INyIdMarkerDataEncoder<T,TSData,TData>::createDataInstance);
+ return;
+ }
+
+ /* AS3 Argument protocol
+ * _native : T*
+ * i_data : NyIdMarkerPattern*
+ * o_dest : INyIdMarkerData*
+ * return : AS_Val al Boolean
+ */
+ static AS3_Val encode(void* self, AS3_Val args)
+ {
+ T* native;
+ TNyIdMarkerPattern* i_data;
+ INyIdMarkerData* o_dest;
+
+ AS3_ArrayValue(args, "PtrType,PtrType,PtrType", &native,&i_data,&o_dest);
+ //APIコール
+ return native->encode(*i_data,*o_dest)?AS3_True():AS3_False();
+ }
+ /* AS3 Argument protocol
+ * _native : T*
+ */
+ static AS3_Val createDataInstance(void* self, AS3_Val args)
+ {
+ T* native;
+ AS3_ArrayValue(args, "PtrType", &native);
+
+ //APIコール
+ TSData class_builder;
+ return class_builder.buildWithOutNativeInstance((TData*)native->createDataInstance());
+ }
+};
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/T_INyIdMarkerData.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/T_INyIdMarkerData.h (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/T_INyIdMarkerData.h (revision 335)
@@ -0,0 +1,43 @@
+#pragma once
+#include "INyIdMarkerData.h"
+template<class T> class T_INyIdMarkerData : public AlchemyClassBuilder<T>
+{
+public:
+
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,T* i_native_inst)
+ {
+ AlchemyClassBuilder<T>::initAS3Member(i_builder,i_native_inst);
+ i_builder.addFunction("isEqual",T_INyIdMarkerData<T>::isEqual);
+ i_builder.addFunction("copyFrom",T_INyIdMarkerData<T>::copyFrom);
+ return;
+ }
+private:
+ /* AS3 Argument protocol
+ * _native : T*
+ * i_target : INyIdMarkerData*
+ * return : AS3_Val as Boolean
+ */
+ static AS3_Val isEqual(void* self, AS3_Val args)
+ {
+ T* native;
+ T* i_target;
+
+ AS3_ArrayValue(args, "PtrType,PtrType", &native,&i_target);
+ //APIコール
+ return native->isEqual(*i_target)?AS3_True():AS3_False();
+ }
+ /* AS3 Argument protocol
+ * _native : T*
+ * i_target : INyIdMarkerData*
+ */
+ static AS3_Val copyFrom(void* self, AS3_Val args)
+ {
+ T* native;
+ T* i_target;
+
+ AS3_ArrayValue(args, "PtrType,PtrType", &native,&i_target);
+ //APIコール
+ native->copyFrom(*i_target);
+ return AS3_Null();
+ }
+};
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARTransMat.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARTransMat.h (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARTransMat.h (revision 335)
@@ -0,0 +1,96 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
+#pragma once
+#include "NyARTransMat.h"
+class S_NyARTransMat : public AlchemyClassBuilder<NyARTransMat>
+{
+public:
+ static AS3_Val createInstance(void* self, AS3_Val args)
+ {
+ S_NyARTransMat class_builder;
+ return class_builder.buildWithNativeInstance(self,args);
+ }
+protected:
+ //自身のオブジェクトをAS3オブジェクトにする。
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,NyARTransMat* i_native_inst)
+ {
+ AlchemyClassBuilder<NyARTransMat>::initAS3Member(i_builder,i_native_inst);
+ i_builder.addFunction("transMat",S_NyARTransMat::transMat);
+ return;
+ }
+ /* AS3 Argument protocol
+ * _param : NyARTransMat*
+ */
+ virtual NyARTransMat* createNativeInstance(AS3_Val args)
+ {
+ NyARParam* param;
+ AS3_ArrayValue(args, "PtrType",&param);
+ return new NyARTransMat(param);
+ }
+public:
+ /* AS3 Argument protocol
+ * _native :NyARTransMat*
+ * square :NyARSquare*
+ * direction:int
+ * width:double
+ * result:NyARTransMatResult*
+ */
+ static AS3_Val transMat(void* self, AS3_Val args)
+ {
+ NyARTransMat* native;
+ NyARSquare* square;
+ int direction;
+ double width;
+ NyARTransMatResult* result;
+ AS3_ArrayValue(args,
+ "PtrType,PtrType,IntType,DoubleType,PtrType",
+ &native,&square,&direction,&width,&result);
+
+ native->transMat(*square,direction,width,*result);
+ return AS3_Null();
+ }
+ /* AS3 Argument protocol
+ * _native :NyARSquareStack*
+ * square :NyARSquare*
+ * direction:int
+ * width:double
+ * height:double
+ * result:NyARTransMatResult*
+ */
+ static AS3_Val transMatContinue(void* self, AS3_Val args)
+ {
+ NyARTransMat* native;
+ NyARSquare* square;
+ int direction;
+ double width;
+ NyARTransMatResult* result;
+ AS3_ArrayValue(args,
+ "PtrType,PtrType,IntType,DoubleType,PtrType",
+ &native,&square,&direction,&width,&result);
+ native->transMatContinue(*square,direction,width,*result);
+ return AS3_Null();
+ }
+};
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARSquareDetector_Rle.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARSquareDetector_Rle.h (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARSquareDetector_Rle.h (revision 335)
@@ -0,0 +1,31 @@
+#pragma once
+#include "T_INyARSquareDetector.h"
+#include "NyARSquareDetector_Rle.h"
+
+class S_NyARSquareDetector_Rle : public T_INyARSquareDetector<NyARSquareDetector_Rle>
+{
+public:
+ static AS3_Val createInstance(void* self, AS3_Val args)
+ {
+ S_NyARSquareDetector_Rle class_builder;
+ return class_builder.buildWithNativeInstance(self,args);
+ }
+protected:
+ //自身のオブジェクトをAS3オブジェクトにする。
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,NyARSquareDetector_Rle* i_native_inst)
+ {
+ T_INyARSquareDetector<NyARSquareDetector_Rle>::initAS3Member(i_builder,i_native_inst);
+ return;
+ }
+ /* AS3 Argument protocol
+ * _dist :NyARCameraDistortionFactor*;
+ * _size :TNyARIntSize*
+ */
+ virtual NyARSquareDetector_Rle* createNativeInstance(AS3_Val args)
+ {
+ NyARCameraDistortionFactor* dist;
+ TNyARIntSize* size;
+ AS3_ArrayValue(args, "PtrType,PtrType", &dist,&size);
+ return new NyARSquareDetector_Rle(*dist,*size);
+ }
+};
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/NyARToolkitAS3.cpp
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/NyARToolkitAS3.cpp (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/NyARToolkitAS3.cpp (revision 335)
@@ -46,11 +46,29 @@
#include "S_NyARCode.h"
#include "S_NyARRgbRaster_XRGB32.h"
#include "S_NyARRgbRaster_BGRA.h"
-#include "S_NyARTransMatResult.h"
-#include "S_NyARSingleDetectMarker.h"
+/*#include "S_NyARSingleDetectMarker.h"
#include "S_SingleNyIdMarkerProcessor.h"
#include "S_NyIdMarkerDataEncoder_RawBit.h"
+*/
+#include "S_NyARSquareStack.h"
+#include "S_NyARSquare.h"
+#include "S_NyARBinRaster.h"

+#include "S_NyARMatchPatt_Color_WITHOUT_PCA.h"
+#include "S_NyARSquareDetector_Rle.h"
+#include "S_NyARTransMat.h"
+#include "S_NyARTransMatResult.h"
+#include "S_NyARMatchPattDeviationColorData.h"
+#include "S_NyARSquareStack.h"
+#include "S_NyARColorPatt_Perspective_O2.h"
+#include "S_NyARMatchPattResult.h"
+#include "S_NyARRasterFilter_ARToolkitThreshold.h"
+#include "S_NyARRasterThresholdAnalyzer_SlidePTile.h"
+#include "S_NyIdMarkerPattern.h"
+#include "S_NyIdMarkerParam.h"
+#include "S_NyIdMarkerPickup.h"
+#include "S_NyIdMarkerDataEncoder_RawBit.h"
+#include "S_NyIdMarkerData_RawBit.h"
/********************************************************************************
*
* Alchemy Entry point
@@ -59,7 +77,7 @@
********************************************************************************/
static AS3_Val getVersion(void* self, AS3_Val args)
{
- return AS3_String("NyARToolkitCPP/0.10.0");
+ return AS3_String("NyARToolkitCPP/2.4.0");
}


@@ -74,12 +92,30 @@
builder.addFunction("NyARPerspectiveProjectionMatrix_createInstance",S_NyARPerspectiveProjectionMatrix::createInstance);
builder.addFunction("NyARCode_createInstance",S_NyARCode::createInstance);
builder.addFunction("NyARRgbRaster_BGRA_createInstance",S_NyARRgbRaster_BGRA::createInstance);
- builder.addFunction("NyARSingleDetectMarker_createInstance",S_NyARSingleDetectMarker::createInstance);
- builder.addFunction("NyARTransMatResult_createInstance",S_NyARTransMatResult::createInstance);
+/* builder.addFunction("NyARSingleDetectMarker_createInstance",S_NyARSingleDetectMarker::createInstance);
+*/ builder.addFunction("NyARTransMatResult_createInstance",S_NyARTransMatResult::createInstance);
+ builder.addFunction("NyARTransMat_createInstance",S_NyARTransMat::createInstance);
builder.addFunction("NyARRgbRaster_XRGB32_createInstance",S_NyARRgbRaster_XRGB32::createInstance);
builder.addFunction("NyARIntSize_createInstance",S_NyARIntSize::createInstance);
- builder.addFunction("SingleNyIdMarkerProcesser_createInstance",S_SingleNyIdMarkerProcesser::createInstance);
+/* builder.addFunction("SingleNyIdMarkerProcesser_createInstance",S_SingleNyIdMarkerProcesser::createInstance);
+*/ builder.addFunction("NyARSquareStack_createInstance",S_NyARSquareStack::createInstance);
+ builder.addFunction("NyARSquareDetector_Rle_createInstance",S_NyARSquareDetector_Rle::createInstance);
+ builder.addFunction("NyARBinRaster_createInstance",S_NyARBinRaster::createInstance);
+ builder.addFunction("NyARMatchPatt_Color_WITHOUT_PCA_createInstance",S_NyARMatchPatt_Color_WITHOUT_PCA::createInstance);
+ builder.addFunction("NyARMatchPattDeviationColorData_createInstance",S_NyARMatchPattDeviationColorData::createInstance);
+ builder.addFunction("NyARColorPatt_Perspective_O2_createInstance",S_NyARColorPatt_Perspective_O2::createInstance);
+ builder.addFunction("NyARMatchPattResult_createInstance",S_NyARMatchPattResult::createInstance);
+ builder.addFunction("NyARRasterFilter_ARToolkitThreshold_createInstance",S_NyARRasterFilter_ARToolkitThreshold::createInstance);
+
+ builder.addFunction("NyIdMarkerPattern_createInstance",S_NyIdMarkerPattern::createInstance);
+ builder.addFunction("NyIdMarkerParam_createInstance",S_NyIdMarkerParam::createInstance);
+ builder.addFunction("NyIdMarkerPickup_createInstance",S_NyIdMarkerPickup::createInstance);
builder.addFunction("NyIdMarkerDataEncoder_RawBit_createInstance",S_NyIdMarkerDataEncoder_RawBit::createInstance);
+ builder.addFunction("NyIdMarkerData_RawBit_createInstance",S_NyIdMarkerData_RawBit::createInstance);
+
+
+ builder.addFunction("NyARRasterThresholdAnalyzer_SlidePTile_createInstance",S_NyARRasterThresholdAnalyzer_SlidePTile::createInstance);
+
// notify that we initialized -- THIS DOES NOT RETURN!
AS3_LibInit( result );

Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/T_NyARDoubleMatrix34.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/T_NyARDoubleMatrix34.h (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/T_NyARDoubleMatrix34.h (revision 335)
@@ -27,41 +27,46 @@
#pragma once


-template<class T> class T_NyARDoubleMatrix34 : public AlchemyClassStub<T>
+template<class T> class T_NyARDoubleMatrix34 : public AlchemyClassBuilder<T>
{
public:
-
- //自身のオブジェクトをAS3オブジェクトにする。
- void initAS3Object(AS3ObjectBuilder& i_builder)
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,T* i_native_inst)
{
- AlchemyClassStub<T>::initAS3Object(i_builder);
+ AlchemyClassBuilder<T>::initAS3Member(i_builder,i_native_inst);
i_builder.addFunction("setValue",T_NyARDoubleMatrix34<T>::setValue);
i_builder.addFunction("getValue",T_NyARDoubleMatrix34<T>::getValue);
+ return;
}
-
protected:
+ /* AS3 Argument protocol
+ * _native : T*
+ * v : AS3_ByteArray
+ */
static AS3_Val setValue(void* self, AS3_Val args)
{
- T_NyARDoubleMatrix34<T>* inst;
+ T* native;
AS3_Val v;
- AS3_ArrayValue(args, "PtrType, AS3ValType", &inst,&v);
+ AS3_ArrayValue(args, "PtrType, AS3ValType", &native,&v);
//
double work[12];
AS3_ByteArray_readBytes(work,v,sizeof(double)*12);
- //Cのアクセス制御を強引に突破する。
- ((T*)inst->m_ref)->setValue(work);
+ native->setValue(work);
//引数の参照カウント減算
AS3_Release(v);
return AS3_Null();
}
+ /* AS3 Argument protocol
+ * _native : T*
+ * v : AS3_ByteArray as diuble[12]
+ */
static AS3_Val getValue(void* self, AS3_Val args)
{
- T_NyARDoubleMatrix34<T>* inst;
+ T* native;
AS3_Val v;
- AS3_ArrayValue(args, "PtrType, AS3ValType", &inst,&v);
+ AS3_ArrayValue(args, "PtrType, AS3ValType", &native,&v);
//コピーしてセット
double work[12];
- inst->m_ref->getValue(work);
+ native->getValue(work);
AS3_ByteArray_writeBytes(v,work,sizeof(double)*12);
//引数の参照カウント減算
AS3_Release(v);
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARCode.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARCode.h (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARCode.h (revision 335)
@@ -1,36 +1,47 @@
#pragma once
#include "NyARCode.h"
-class S_NyARCode : public AlchemyClassStub<NyARCode>
+class S_NyARCode : public AlchemyClassBuilder<NyARCode>
{
public:
static AS3_Val createInstance(void* self, AS3_Val args)
{
- S_NyARCode* inst=new S_NyARCode();
- int w,h;
- AS3_ArrayValue(args, "IntType,IntType",&w,&h);
- //初期化
- inst->initRelStub(new NyARCode(w,h));
- //AS3オブジェクト化
- return inst->toAS3Object();
+ S_NyARCode class_builder;
+ return class_builder.buildWithNativeInstance(self,args);
}
+protected:
//自身のオブジェクトをAS3オブジェクトにする。
- void initAS3Object(AS3ObjectBuilder& i_builder)
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,NyARCode* i_native_inst)
{
- AlchemyClassStub<NyARCode>::initAS3Object(i_builder);
+ AlchemyClassBuilder<NyARCode>::initAS3Member(i_builder,i_native_inst);
i_builder.addFunction("loadARPatt",S_NyARCode::loadARPatt);
i_builder.addFunction("getWidth",S_NyARCode::getWidth);
i_builder.addFunction("getHeight",S_NyARCode::getHeight);
return;
}
+ /* AS3 Argument protocol
+ * w : int
+ * h : int
+ */
+ virtual NyARCode* createNativeInstance(AS3_Val args)
+ {
+ int w,h;
+ AS3_ArrayValue(args, "IntType,IntType",&w,&h);
+ //初期化
+ return new NyARCode(w,h);
+ }
private:
+ /* AS3 Argument protocol
+ * _native : AlchemyClassStub<T>*
+ * v : AS3_ByteArray
+ */
static AS3_Val loadARPatt(void* self, AS3_Val args)
{
- S_NyARCode* inst;
+ NyARCode* native;
AS3_Val v;
- AS3_ArrayValue(args, "PtrType,AS3ValType", &inst,&v);
+ AS3_ArrayValue(args, "PtrType,AS3ValType", &native,&v);
//配列のサイズを決定
- int w=inst->m_ref->getWidth();
- int h=inst->m_ref->getHeight();
+ int w=native->getWidth();
+ int h=native->getHeight();
//Intで送信されてくるので、unsigned charに変換
unsigned char* work=new unsigned char[4*w*h*3];
int temp[12];
@@ -40,24 +51,29 @@
work[(12*i)+i2]=(unsigned char)temp[i2];
}
}
- //Cのアクセス制御を強引に突破する。
- ((NyARCode*)inst->m_ref)->loadARPatt(work);
+ native->loadARPatt(work);
delete work;
//引数の参照カウント減算
AS3_Release(v);
return AS3_Null();
}
+ /* AS3 Argument protocol
+ * _native : AlchemyClassStub<T>*
+ */
static AS3_Val getWidth(void* self, AS3_Val args)
{
- S_NyARCode* inst;
- AS3_ArrayValue(args, "PtrType", &inst);
- return AS3_Int(inst->m_ref->getWidth());
+ NyARCode* native;
+ AS3_ArrayValue(args, "PtrType", &native);
+ return AS3_Int(native->getWidth());
}
+ /* AS3 Argument protocol
+ * _native : AlchemyClassStub<T>*
+ */
static AS3_Val getHeight(void* self, AS3_Val args)
{
- S_NyARCode* inst;
- AS3_ArrayValue(args, "PtrType", &inst);
+ NyARCode* native;
+ AS3_ArrayValue(args, "PtrType", &native);
//コピーしてセット
- return AS3_Int(inst->m_ref->getHeight());
+ return AS3_Int(native->getHeight());
}
};
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARPerspectiveProjectionMatrix.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARPerspectiveProjectionMatrix.h (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARPerspectiveProjectionMatrix.h (revision 335)
@@ -1,44 +1,46 @@
#pragma once
+#include "T_NyARDoubleMatrix34.h"
#include "NyARPerspectiveProjectionMatrix.h"

class S_NyARPerspectiveProjectionMatrix : public T_NyARDoubleMatrix34<NyARPerspectiveProjectionMatrix>
{
public:
- //標準的なインスタンス生成関数です。
static AS3_Val createInstance(void* self, AS3_Val args)
{
- S_NyARPerspectiveProjectionMatrix* inst=new S_NyARPerspectiveProjectionMatrix();
- //初期化
- inst->initRelStub(new NyARPerspectiveProjectionMatrix());
- //AS3オブジェクト化
- return inst->toAS3Object();
+ S_NyARPerspectiveProjectionMatrix class_builder;
+ return class_builder.buildWithNativeInstance(self,args);
}
- static AS3_Val createReference(const NyARPerspectiveProjectionMatrix* i_ref)
+protected:
+ //自身のオブジェクトをAS3オブジェクトにする。
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,NyARPerspectiveProjectionMatrix* i_native_inst)
{
- S_NyARPerspectiveProjectionMatrix* inst=new S_NyARPerspectiveProjectionMatrix();
- //初期化
- inst->initRefStub(i_ref);
- //AS3オブジェクト化
- return inst->toAS3Object();
+ T_NyARDoubleMatrix34<NyARPerspectiveProjectionMatrix>::initAS3Member(i_builder,i_native_inst);
+ i_builder.addFunction("decompMat",S_NyARPerspectiveProjectionMatrix::decompMat);
+ return;
}
-
- void initAS3Object(AS3ObjectBuilder& i_builder)
+ /* AS3 Argument protocol
+ */
+ virtual NyARPerspectiveProjectionMatrix* createNativeInstance(AS3_Val args)
{
- T_NyARDoubleMatrix34<NyARPerspectiveProjectionMatrix>::initAS3Object(i_builder);
- i_builder.addFunction("decompMat",S_NyARPerspectiveProjectionMatrix::decompMat);
+ return new NyARPerspectiveProjectionMatrix();
}

+public:
+ /* AS3 Argument protocol
+ * _native : AlchemyClassStub<T>*
+ * v : AS3_ByteArray
+ */
static AS3_Val decompMat(void* self, AS3_Val args)
{
//本来はNyARMatで転送すべきだけど、ByteArrayに配列突っ込んで転送する。
//フォーマットは、o_cpara[3][4]o_trans[3][4]
- S_NyARPerspectiveProjectionMatrix* inst;
+ NyARPerspectiveProjectionMatrix* native;
AS3_Val marshal;
- AS3_ArrayValue(args, "PtrType,AS3ValType", &inst,&marshal);
+ AS3_ArrayValue(args, "PtrType,AS3ValType", &native,&marshal);
NyARMat c(3,4);
NyARMat t(3,4);
//数値計算
- inst->m_ref->decompMat(c,t);
+ native->decompMat(c,t);
//byteArrayにコピー(cpara[12],trans[12]で格納)
AS3_ByteArray_writeBytes(marshal,c.getArray(),sizeof(double)*12);
AS3_ByteArray_writeBytes(marshal,t.getArray(),sizeof(double)*12);
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARRasterFilter_ARToolkitThreshold.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARRasterFilter_ARToolkitThreshold.h (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/c/S_NyARRasterFilter_ARToolkitThreshold.h (revision 335)
@@ -0,0 +1,71 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
+#pragma once
+#include "T_INyARRasterFilter_RgbToBin.h"
+#include "NyARRasterFilter_ARToolkitThreshold.h"
+class S_NyARRasterFilter_ARToolkitThreshold : public T_INyARRasterFilter_RgbToBin<NyARRasterFilter_ARToolkitThreshold>
+{
+public:
+ static AS3_Val createInstance(void* self, AS3_Val args)
+ {
+ S_NyARRasterFilter_ARToolkitThreshold class_builder;
+ return class_builder.buildWithNativeInstance(self,args);
+ }
+protected:
+ //自身のオブジェクトをAS3オブジェクトにする。
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,NyARRasterFilter_ARToolkitThreshold* i_native_inst)
+ {
+ T_INyARRasterFilter_RgbToBin<NyARRasterFilter_ARToolkitThreshold>::initAS3Member(i_builder,i_native_inst);
+ i_builder.addFunction("setThreshold",S_NyARRasterFilter_ARToolkitThreshold::setThreshold);
+ return;
+ }
+ /* AS3 Argument protocol
+ * th :int
+ * input_raster_type :int
+ */
+ virtual NyARRasterFilter_ARToolkitThreshold* createNativeInstance(AS3_Val args)
+ {
+ int input_raster_type,th;
+ AS3_ArrayValue(args, "IntType,IntType", &th,&input_raster_type);
+ return new NyARRasterFilter_ARToolkitThreshold(th,input_raster_type);
+ }
+protected:
+ /* AS3 Argument protocol
+ * _native :NyARTransMat*
+ * th :int
+ */
+ static AS3_Val setThreshold(void* self, AS3_Val args)
+ {
+ NyARRasterFilter_ARToolkitThreshold* native;
+ int th;
+ AS3_ArrayValue(args,
+ "PtrType,IntType",
+ &native,&th);
+ native->setThreshold(th);
+ return AS3_Null();
+ }
+};
+
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARIntSize.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARIntSize.as (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARIntSize.as (revision 335)
@@ -1,112 +0,0 @@
-/*
- * PROJECT: NyARToolkitCPP Alchemy bind
- * --------------------------------------------------------------------------------
- * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
- *
- * Copyright (C)2009 Ryo Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
-package jp.nyatla.nyartoolkit.as3
-{
- import jp.nyatla.alchemymaster.*;
- import flash.utils.ByteArray;
- import jp.nyatla.as3utils.*;
-
- public class NyARIntSize extends AlchemyClassProxy
- {
- /**
- * function NyARIntSize()
- * AlchemyObjectを所有するインスタンスを作成します。
- * function NyARIntSize(arg:CONST_BASECLASS)
- * 継承用コンストラクタです。
- * function NyARIntSize(arg:CONST_WRAPCLASS)
- * AlchemyObjectをラップするインスタンスを作成します。
- */
- public function NyARIntSize(...args:Array)
- {
- switch(args.length){
- case 0:
- //function NyARIntSize()
- this.attachAlchemyObject(
- NyARToolkitAS3.cmodule.NyARIntSize_createInstance()
- );
- return;
- case 1:
- if(args[0] is CONST_BASECLASS)
- {
- //Base Class
- return;
- }else if(args[0] is CONST_WRAPCLASS){
- //function NyARIntSize(arg:CONST_WRAPCLASS)
- //Empty Wrapper
- return;
- }
- break;
- default:
- }
- throw new Error();
- }
-/*
-
-
- public static function createInstance():NyARIntSize
- {
- NyAS3Utils.assert(NyARToolkitAS3._cmodule!=null);
- var inst:NyARIntSize=new NyARIntSize();
- inst.attachAlchemyObject(
- NyARToolkitAS3._cmodule.NyARIntSize_createInstance()
- );
- return inst;
- }
- public static function createReference(i_alchemy_stub:Object):NyARIntSize
- {
- var inst:NyARIntSize=new NyARIntSize();
- //Wrapper
- return inst;
- }
-*/
- //OK
- public function setValue(i_value:Array):void
- {
- var ma:Marshal=this._ma;
- ma.position=0;//MA:INIT POS
- for(var i:int=0;i<2;i++){
- ma.writeInt(i_value[i]);
- }
- ma.position=0;//MA:INIT POS
- this._alchemy_stub.setValue(this._alchemy_ptr,ma);
- return;
- }
- //OK
- public function getValue(o_value:Array):void
- {
- var ma:Marshal=this._ma;
- ma.position=0;//MA:INIT POS
- this._alchemy_stub.getValue(this._alchemy_ptr,ma);
- ma.position=0;//MA:INIT POS
- for(var i:int=0;i<2;i++){
- o_value[i]=ma.readInt();
- }
- return;
- }
-
- }
-}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARRgbRaster_BGRA.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARRgbRaster_BGRA.as (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARRgbRaster_BGRA.as (revision 335)
@@ -1,82 +0,0 @@
-/*
- * PROJECT: NyARToolkitCPP Alchemy bind
- * --------------------------------------------------------------------------------
- * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
- *
- * Copyright (C)2009 Ryo Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
-package jp.nyatla.nyartoolkit.as3{
- import jp.nyatla.alchemymaster.*;
- import flash.utils.ByteArray;
- import jp.nyatla.as3utils.*;
-
- public class NyARRgbRaster_BGRA extends NyARRgbRaster
- {
- /**
- * function NyARRgbRaster_BGRA(i_width:int,i_height:int)
- * AlchemyObjectを所有するインスタンスを作成します。
- * function NyARRgbRaster_BGRA(arg:CONST_BASECLASS)
- * 継承用コンストラクタです。
- */
- public function NyARRgbRaster_BGRA(...args:Array)
- {
- super(NyARToolkitAS3.BASECLASS);
- switch(args.length){
- case 1:
- if(args[0] is CONST_BASECLASS)
- { //Base Class
- return;
- }
- break;
- case 2:
- //function NyARRgbRaster_BGRA(i_width:int,i_height:int)
- this.attachAlchemyObject(
- NyARToolkitAS3.cmodule.NyARRgbRaster_BGRA_createInstance(int(args[0]),int(args[1]))
- );
- return;
- default:
- }
- throw new Error();
- }
-/*
- public static function createInstance(i_width:int,i_height:int):NyARRgbRaster_BGRA
- {
- NyAS3Utils.assert(NyARToolkitAS3._cmodule!=null);
- var inst:NyARRgbRaster_BGRA=new NyARRgbRaster_BGRA();
- inst.attachAlchemyObject(
- NyARToolkitAS3._cmodule.NyARRgbRaster_BGRA_createInstance(i_width,i_height)
- );
- return inst;
- }
-*/
- //現在の位置からBGRA(BYTE)形式データを読み込みます。
- public function setFromByteArray(i_source:ByteArray):void
- {
- var old:int=i_source.position;
- this._alchemy_stub.setData(this._alchemy_ptr,i_source);
- i_source.position=old;
- return;
- }
-
- }
-}
-
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARTransMatResult.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARTransMatResult.as (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARTransMatResult.as (revision 335)
@@ -1,100 +0,0 @@
-/*
- * PROJECT: NyARToolkitCPP Alchemy bind
- * --------------------------------------------------------------------------------
- * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
- *
- * Copyright (C)2009 Ryo Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
-package jp.nyatla.nyartoolkit.as3
-{
- import jp.nyatla.alchemymaster.*;
- import flash.utils.ByteArray;
- import jp.nyatla.as3utils.*;
-
- public class NyARTransMatResult extends NyARDoubleMatrix34
- {
- /**
- * function NyARTransMatResult()
- * AlchemyObjectを所有するインスタンスを作成します。
- * function NyARTransMatResult(arg:CONST_BASECLASS)
- * 継承用コンストラクタです。
- * function NyARTransMatResult(arg:CONST_WRAPCLASS)
- * AlchemyObjectをラップするインスタンスを作成します。
- */
- public function NyARTransMatResult(...args:Array)
- {
- super(NyARToolkitAS3.BASECLASS);
- switch(args.length){
- case 0:
- //function NyARTransMatResult(width:int,height:int)
- this.attachAlchemyObject(
- NyARToolkitAS3.cmodule.NyARTransMatResult_createInstance()
- );
- return;
- case 1:
- if(args[0] is CONST_BASECLASS)
- { //Base Class
- return;
- }else if(args[0] is CONST_WRAPCLASS){
- //function NyARTransMatResult(arg:CONST_WRAPCLASS)
- //Empty Wrapper
- return;
- }
- break;
- default:
- }
- throw new Error();
- }
-/*
- public static function createInstance():NyARTransMatResult
- {
- NyAS3Utils.assert(NyARToolkitAS3._cmodule!=null);
- var inst:NyARTransMatResult=new NyARTransMatResult();
- inst.attachAlchemyObject(
- NyARToolkitAS3._cmodule.NyARTransMatResult_createInstance()
- );
- return inst;
- }
- public static function createReference(i_alchemy_stub:Object):NyARTransMatResult
- {
- var inst:NyARTransMatResult=new NyARTransMatResult();
- //WRAPPER
- return inst;
- }*/
- public function getHasValue():Boolean
- {
- return this._alchemy_stub.getHasValue(this._alchemy_ptr);
- }
- //o_value:Array[3]に返します。
- public function getAngle(o_value:Array):void
- {
- var ma:Marshal=this._ma;
- ma.position=0;//MA:INIT POS
- this._alchemy_stub.getAngle(this._alchemy_ptr,ma);
- ma.position=0;//MA:INIT POS
- for(var i:int=0;i<3;i++){
- o_value[i]=ma.readDouble();
- }
- return;
- }
- }
-}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARRgbRaster.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARRgbRaster.as (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARRgbRaster.as (revision 335)
@@ -1,58 +0,0 @@
-/*
- * PROJECT: NyARToolkitCPP Alchemy bind
- * --------------------------------------------------------------------------------
- * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
- *
- * Copyright (C)2009 Ryo Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
-package jp.nyatla.nyartoolkit.as3{
- import jp.nyatla.alchemymaster.*;
-
- public class NyARRgbRaster extends AlchemyClassProxy
- {
- public static const BYTE1D:int =0x00010000;
- public static const INT2D:int =0x00020000;
- public static const SHORT1D:int=0x00030000;
- public static const INT1D:int =0x00040000;
- public static const BUFFERFORMAT_INT1D_X8R8G8B8_32:int = INT1D|0x0102;
- public static const BUFFERFORMAT_BYTE1D_B8G8R8X8_32:int = BYTE1D|0x0101;
- public static const BUFFERFORMAT_BYTE1D_X8R8G8B8_32:int = BYTE1D|0x0102;
-
- /**
- * function NyARRgbRaster(arg:CONST_BASECLASS)
- * 継承用コンストラクタです。
- */
- public function NyARRgbRaster(...args:Array)
- {
- switch(args.length){
- case 1:
- if(args[0] is CONST_BASECLASS)
- { //Base Class
- return;
- }
- default:
- }
- throw new Error();
- }
- }
-}
-
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARToolkitAS3.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARToolkitAS3.as (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARToolkitAS3.as (revision 335)
@@ -1,53 +0,0 @@
-/*
- * PROJECT: NyARToolkitCPP Alchemy bind
- * --------------------------------------------------------------------------------
- * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
- *
- * Copyright (C)2009 Ryo Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
-package jp.nyatla.nyartoolkit.as3
-{
- import cmodule.nyartoolkit.CLibInit;
- public class NyARToolkitAS3
- {
- public static const WRAPCLASS:CONST_WRAPCLASS=new CONST_WRAPCLASS();
- public static const BASECLASS:CONST_BASECLASS=new CONST_BASECLASS();
-
- public static const cmodule:Object=(new CLibInit()).init();
- /*初期化タイミングの調整が必要な場合は、こちらを使ってください。
- public static var cmodule:Object=null;
- public static function initialize():void
- {
- if(NyARToolkitAS3.cmodule!=null)
- {
- return;
- }
- NyARToolkitAS3.cmodule=(new CLibInit()).init();
- }
- public static function finalize():void
- {
- //no work!
- NyARToolkitAS3.cmodule=null;//??
- }
- */
- }
-}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARParam.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARParam.as (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARParam.as (revision 335)
@@ -1,128 +0,0 @@
-/*
- * PROJECT: NyARToolkitCPP Alchemy bind
- * --------------------------------------------------------------------------------
- * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
- *
- * Copyright (C)2009 Ryo Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
-package jp.nyatla.nyartoolkit.as3
-{
- import jp.nyatla.alchemymaster.*;
- import flash.utils.ByteArray;
- import jp.nyatla.as3utils.*;
-
- public class NyARParam extends AlchemyClassProxy
- {
- private var _projection_matrix:NyARPerspectiveProjectionMatrix;
- private var _screen_size:NyARIntSize;
- /**
- * function NyARParam()
- * AlchemyObjectを所有するインスタンスを作成します。
- * function NyARParam(arg:CONST_BASECLASS)
- * 継承用コンストラクタです。
- */
- public function NyARParam(...args:Array)
- {
- //メンバオブジェクト
- this._screen_size=new NyARIntSize(NyARToolkitAS3.WRAPCLASS);
- this._projection_matrix=new NyARPerspectiveProjectionMatrix(NyARToolkitAS3.WRAPCLASS);
- //
- switch(args.length){
- case 0:
- //function NyARParam()
- this.attachAlchemyObject(
- NyARToolkitAS3.cmodule.NyARParam_createInstance()
- );
- return;
- case 1:
- //function NyARParam(i_class:CONST_BASECLASS)
- if(args[0] is CONST_BASECLASS)
- { //Base Class
- return;
- }
- return;
- default:
- }
- throw new Error();
- }
-/*
-
-
- public static function createInstance():NyARParam
- {
- NyAS3Utils.assert(NyARToolkitAS3._cmodule!=null);
- var inst:NyARParam=new NyARParam();
- inst.attachAlchemyObject(
- NyARToolkitAS3._cmodule.NyARParam_createInstance()
- );
- return inst;
- }
- public override function setAlchemyObject(i_alchemy_stub:Object):void
- {
- super.setAlchemyObject(i_alchemy_stub);
-
- return;
- }
-*/
-
- public function changeScreenSize(i_xsize:int, i_ysize:int):void
- {
- this._alchemy_stub.changeScreenSize(this._alchemy_ptr,i_xsize,i_ysize);
- return;
- }
- /**
- * この関数の返すオブジェクトの寿命は、NyARParamと同期しています。
- * NyARParamをdisposeした瞬間に、オブジェクトは正しい値を返さなくなります。注意してください。
- */
- public function getPerspectiveProjectionMatrix():NyARPerspectiveProjectionMatrix
- {
- this._projection_matrix.setAlchemyObject(this._alchemy_stub.getPerspectiveProjectionMatrix(this._alchemy_ptr))
- return this._projection_matrix;
- }
- /**
- * この関数の返すオブジェクトの寿命は、NyARParamと同期しています。
- * NyARParamをdisposeした瞬間に、オブジェクトは正しい値を返さなくなります。注意してください。
- */
- public function getScreenSize():NyARIntSize
- {
- this._screen_size.setAlchemyObject(this._alchemy_stub.getScreenSize(this._alchemy_ptr));
- return this._screen_size;
- }
-
- //OK
- //i_streamのカレント位置から読みだします。
- public function loadARParamFile(i_stream:ByteArray):void
- {
- var old_pos:int=i_stream.position;
- this._alchemy_stub.loadARParamFile(this._alchemy_ptr,i_stream);
- i_stream.position=old_pos;
- return;
- }
- public override function dispose():void
- {
- this._projection_matrix=null;
- this._screen_size=null;
- super.dispose();
- return;
- }
- }
-}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARSquare.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARSquare.as (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARSquare.as (revision 335)
@@ -1,66 +0,0 @@
-/*
- * PROJECT: NyARToolkitCPP Alchemy bind
- * --------------------------------------------------------------------------------
- * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
- *
- * Copyright (C)2009 Ryo Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
-package jp.nyatla.nyartoolkit.as3
-{
- import jp.nyatla.alchemymaster.*;
- import flash.utils.ByteArray;
- import jp.nyatla.as3utils.*;
-
- public class NyARSquare extends AlchemyClassProxy
- {
- /**
- * function NyARSquare(arg:CONST_BASECLASS)
- * 継承用コンストラクタです。
- * function NyARSquare(arg:CONST_WRAPCLASS)
- * AlchemyObjectをラップするインスタンスを作成します。
- */
- public function NyARSquare(...args:Array)
- {
- switch(args.length){
- case 1:
- if(args[0] is CONST_BASECLASS)
- { //Base Class
- return;
- }else if(args[0] is CONST_WRAPCLASS){
- //function NyARSquare(arg:CONST_WRAPCLASS)
- //Empty Wrapper
- return;
- }
- break;
- default:
- }
- throw new Error();
- }
-/*
- public static function createReference(i_alchemy_stub:Object):NyARSquare
- {
- var inst:NyARSquare=new NyARSquare();
- //WRAPPER
- return inst;
- } */
- }
-}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/SingleNyIdMarkerProcesser.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/SingleNyIdMarkerProcesser.as (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/SingleNyIdMarkerProcesser.as (revision 335)
@@ -1,157 +0,0 @@
-/*
- * PROJECT: NyARToolkitCPP Alchemy bind
- * --------------------------------------------------------------------------------
- * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
- *
- * Copyright (C)2009 Ryo Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
-package jp.nyatla.nyartoolkit.as3
-{
- import jp.nyatla.alchemymaster.*;
- import flash.utils.ByteArray;
- import jp.nyatla.as3utils.*;
-
- public class SingleNyIdMarkerProcesser extends AlchemyClassProxy
- {
- private var _listener:SingleNyIdMarkerProcesserListener;
- private var _wrap_data:INyIdMarkerData;
- private var _wrap_sq:NyARSquare;
- private var _wrap_tramsmat:NyARTransMatResult;
- /**
- * function NyIdMarkerDataEncoder_RawBit(param:NyARParam,encoder:INyIdMarkerDataEncoder,raster_type:int)
- * AlchemyObjectを所有するインスタンスを作成します。
- * function NyIdMarkerDataEncoder_RawBit(arg:CONST_BASECLASS,encoder:INyIdMarkerDataEncoder)
- * 継承用コンストラクタです。
- */
- public function SingleNyIdMarkerProcesser(...args:Array)
- {
- this._wrap_sq=new NyARSquare(NyARToolkitAS3.WRAPCLASS);
- this._wrap_tramsmat=new NyARTransMatResult(NyARToolkitAS3.WRAPCLASS);
- var encoder:INyIdMarkerDataEncoder;
- switch(args.length){
- case 2:
- if(args[0] is CONST_BASECLASS)
- {
- //Base Class
- encoder=INyIdMarkerDataEncoder(args[1]);
- this._wrap_data=encoder.createIdMarkerDataWrapper();
- return;
- }
- break;
- case 3:
- encoder=INyIdMarkerDataEncoder(args[1]);
- this._wrap_data=encoder.createIdMarkerDataWrapper();
- //function SingleNyIdMarkerProcesser(param:NyARParam,encoder:INyIdMarkerDataEncoder,)
- this.attachAlchemyObject(
- NyARToolkitAS3.cmodule.SingleNyIdMarkerProcesser_createInstance(
- this,
- NyARParam(args[0])._alchemy_ptr,
- encoder._alchemy_ptr,
- int(args[2]))
- );
- return;
- default:
- }
- throw new Error();
- }
- /*
-
- public static function createInstance(
- i_param:NyARParam,
- i_encoder:INyIdMarkerDataEncoder,
- i_raster_type:int):SingleNyIdMarkerProcesser
- {
- NyAS3Utils.assert(NyARToolkitAS3._cmodule!=null);
- var inst:SingleNyIdMarkerProcesser=new SingleNyIdMarkerProcesser();
- inst.attachAlchemyObject(
- NyARToolkitAS3._cmodule.SingleNyIdMarkerProcesser_createInstance(
- inst,
- i_param._alchemy_ptr,
- i_encoder._alchemy_ptr,
- i_raster_type)
- );
- //クラス本体メンバを初期化している。このせいでクラスのfinal指定が掛かる。
- inst._wrap_data=i_encoder.createIdMarkerData();
- inst._wrap_sq=new NyARSquare();
- inst._wrap_tramsmat=new NyARTransMatResult();
-
- return inst;
- }*/
- public function setListener(i_listener:SingleNyIdMarkerProcesserListener):void
- {
- this._listener=i_listener;
- }
- public function setMarkerWidth(i_width:int):void
- {
- this._alchemy_stub.setMarkerWidth(this._alchemy_ptr,i_width);
- return;
- }
- public function reset(i_is_force:Boolean):void
- {
- this._alchemy_stub.reset(this._alchemy_ptr,i_is_force?1:0);
- return;
- }
- public function detectMarker(i_raster:NyARRgbRaster):void
- {
- this._alchemy_stub.detectMarker(this._alchemy_ptr,i_raster._alchemy_ptr);
- return;
- }
-
- public function onEnterHandler(i_param:Object):void
- {
- if(this._listener==null){
- return;
- }
- this._wrap_data.setAlchemyObject(i_param);
- this._listener.onEnterHandler(this._wrap_data);
- this._wrap_data.setAlchemyObject(null);
-
- }
- public function onLeaveHandler():void
- {
- if(this._listener==null){
- return;
- }
- this._listener.onLeaveHandler();
- }
- public function onUpdateHandler(i_param1:Object,i_param2:Object):void
- {
- if(this._listener==null){
- return;
- }
- this._wrap_sq.setAlchemyObject(i_param1);
- this._wrap_tramsmat.setAlchemyObject(i_param2);
- this._listener.onUpdateHandler(this._wrap_sq,this._wrap_tramsmat);
- this._wrap_sq.setAlchemyObject(null);
- this._wrap_tramsmat.setAlchemyObject(null);
- }
- public override function dispose():void
- {
- this._wrap_data.dispose();
- this._wrap_sq.dispose();
- this._wrap_tramsmat.dispose();
-
- super.dispose();
- return;
- }
- }
-}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARDoubleMatrix34.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARDoubleMatrix34.as (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARDoubleMatrix34.as (revision 335)
@@ -1,103 +0,0 @@
-/*
- * PROJECT: NyARToolkitCPP Alchemy bind
- * --------------------------------------------------------------------------------
- * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
- *
- * Copyright (C)2009 Ryo Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
-package jp.nyatla.nyartoolkit.as3
-{
- import jp.nyatla.alchemymaster.*;
- import flash.utils.ByteArray;
- import jp.nyatla.as3utils.*;
-
- public class NyARDoubleMatrix34 extends AlchemyClassProxy
- {
- /**
- * function NyARDoubleMatrix34()
- * AlchemyObjectを所有するインスタンスを作成します。
- * function NyARDoubleMatrix34(arg:CONST_BASECLASS)
- * 継承用コンストラクタです。
- * function NyARDoubleMatrix34(arg:CONST_WRAPCLASS)
- * AlchemyObjectをラップするインスタンスを作成します。
- */
- public function NyARDoubleMatrix34(...args:Array)
- {
- switch(args.length){
- case 0:
- //function NyARDoubleMatrix34()
- this.attachAlchemyObject(
- NyARToolkitAS3.cmodule.NyARDoubleMatrix34_createInstance()
- );
- return;
- case 1:
- if(args[0] is CONST_BASECLASS)
- { //Base Class
- return;
- }else if(args[0] is CONST_WRAPCLASS){
- //function NyARDoubleMatrix34(arg:CONST_WRAPCLASS)
- //Empty Wrapper
- return;
- }
- break;
- default:
- }
- throw new Error();
- }
-/*
- public static function createInstance():NyARDoubleMatrix34
- {
- NyAS3Utils.assert(NyARToolkitAS3._cmodule!=null);
- var inst:NyARDoubleMatrix34=new NyARDoubleMatrix34();
- inst.attachAlchemyObject(
- NyARToolkitAS3._cmodule.NyARDoubleMatrix34_createInstance()
- );
- return inst;
- }
-*/
- //OK
- public function setValue(i_value:Array):void
- {
- var ma:Marshal=this._ma;
- ma.position=0;//MA:INIT POS
- for(var i:int=0;i<12;i++){
- ma.writeDouble(i_value[i]);
- }
- ma.position=0;//MA:INIT POS
- this._alchemy_stub.setValue(this._alchemy_ptr,ma);
- return;
- }
- //OK
- public function getValue(o_value:Array):void
- {
- var ma:Marshal=this._ma;
- ma.position=0;//MA:INIT POS
- this._alchemy_stub.getValue(this._alchemy_ptr,ma);
- ma.position=0;//MA:INIT POS
- for(var i:int=0;i<12;i++){
- o_value[i]=ma.readDouble();
- }
- return;
- }
-
- }
-}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/SingleNyIdMarkerProcesserListener.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/SingleNyIdMarkerProcesserListener.as (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/SingleNyIdMarkerProcesserListener.as (revision 335)
@@ -1,54 +0,0 @@
-/*
- * PROJECT: NyARToolkitCPP Alchemy bind
- * --------------------------------------------------------------------------------
- * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
- *
- * Copyright (C)2009 Ryo Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
-package jp.nyatla.nyartoolkit.as3
-{
- import jp.nyatla.as3utils.*;
-
- public class SingleNyIdMarkerProcesserListener
- {
- /**
- * この関数の引数オブジェクトの寿命は、コールバック関数内のみです。
- * コールバック関数が終了すると同時に、オブジェクトは正しい値を返さなくなります。注意してください。
- */
- public function onEnterHandler(i_data:INyIdMarkerData):void
- {
- //この関数内で発生した例外は捕捉できません。
- }
- public function onLeaveHandler():void
- {
- //この関数内で発生した例外は捕捉できません。
- }
- /**
- * この関数の引数オブジェクトの寿命は、コールバック関数内のみです。
- * コールバック関数が終了すると同時に、オブジェクトは正しい値を返さなくなります。注意してください。
- */
- public function onUpdateHandler(i_square:NyARSquare,i_transmat:NyARTransMatResult):void
- {
- //この関数内で発生した例外は捕捉できません。
- }
- }
-}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARCode.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARCode.as (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARCode.as (revision 335)
@@ -1,129 +0,0 @@
-/*
- * PROJECT: NyARToolkitCPP Alchemy bind
- * --------------------------------------------------------------------------------
- * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
- *
- * Copyright (C)2009 Ryo Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
-package jp.nyatla.nyartoolkit.as3
-{
- import jp.nyatla.as3utils.*;
- import jp.nyatla.alchemymaster.*;
- import flash.utils.ByteArray;
-
- public class NyARCode extends AlchemyClassProxy
- {
- /**
- * function NyARCode(width:int,height:int)
- * AlchemyObjectを所有するインスタンスを作成します。
- * function NyARCode(arg:CONST_BASECLASS)
- * 継承用コンストラクタです。
- * function NyARCode(arg:CONST_WRAPCLASS)
- * AlchemyObjectをラップするインスタンスを作成します。
- */
- public function NyARCode(...args:Array)
- {
- switch(args.length){
- case 1:
- if(args[0] is CONST_BASECLASS)
- { //Base Class
- return;
- }else if(args[0] is CONST_WRAPCLASS){
- //function NyARCode(arg:CONST_WRAPCLASS)
- //Empty Wrapper
- return;
- }
- break;
- case 2:
- //function NyARCode(width:int,height:int)
- this.attachAlchemyObject(
- NyARToolkitAS3.cmodule.NyARCode_createInstance(int(args[0]),int(args[1]))
- );
- return;
- default:
- }
- throw new Error();
- }
-
-/*
- public static function createInstance(i_width:int,i_height:int):NyARCode
- {
- NyAS3Utils.assert(NyARToolkitAS3._cmodule!=null);
- NyAS3Utils.assert(NyARToolkitAS3._cmodule!=null);
- var inst:NyARCode=new NyARCode();
- inst.setAlchemyObject(
- NyARToolkitAS3._cmodule.NyARCode_createInstance(
- i_width,i_height),true
- );
- return inst;
- }
-*/
- //i_streamのカレント位置から読みだします。
- public function loadARPattFromFile(i_stream:String):void
- {
- var width:int=this._alchemy_stub.getWidth(this._alchemy_ptr);
- var height:int=this._alchemy_stub.getHeight(this._alchemy_ptr);
-
- var token:Array = i_stream.match(/\d+/g);
- var ma:Marshal=this._ma;
- ma.position=0;//MA:INIT POS
- var h:int;
- var i3:int;
- var i2:int;
- var i1:int;
- var val:int;
- for (h = 0;h < 4; h++) {
- for (i3 = 0;i3 < 3; i3++) {
- for (i2 = 0;i2 < height; i2++) {
- for (i1 = 0;i1 < width; i1++) {
- // 数値のみ読み出す
- val = parseInt(token.shift());
- if(isNaN(val)){
- throw new Error("syntax error in pattern file.");
- }
- ma.writeInt(val);
- }
- }
- }
- }
- ma.position=0;//MA:INIT POS
- this._alchemy_stub.loadARPatt(this._alchemy_ptr,ma);
- return;
- }
- public function getPatPow(o_value:Array):void
- {
- var ma:Marshal=this._ma;
- ma.position=0;//MA:INIT POS
- this._alchemy_stub.getPatPow(this._alchemy_ptr,ma);
- ma.position=0;//MA:INIT POS
- for(var i:int=0;i<4;i++){
- o_value[i]=ma.readDouble();
- }
- return;
- }
- public override function dispose():void
- {
- super.dispose();
- return;
- }
- }
-}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/CONST_WRAPCLASS.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/CONST_WRAPCLASS.as (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/CONST_WRAPCLASS.as (revision 335)
@@ -1,36 +0,0 @@
-/*
- * PROJECT: NyARToolkitCPP Alchemy bind
- * --------------------------------------------------------------------------------
- * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
- *
- * Copyright (C)2009 Ryo Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
-package jp.nyatla.nyartoolkit.as3
-{
- import jp.nyatla.alchemymaster.*;
- import flash.utils.ByteArray;
- import jp.nyatla.as3utils.*;
-
- public class CONST_WRAPCLASS
- {
- }
-}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARPerspectiveProjectionMatrix.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARPerspectiveProjectionMatrix.as (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARPerspectiveProjectionMatrix.as (revision 335)
@@ -1,97 +0,0 @@
-/*
- * PROJECT: NyARToolkitCPP Alchemy bind
- * --------------------------------------------------------------------------------
- * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
- *
- * Copyright (C)2009 Ryo Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
-package jp.nyatla.nyartoolkit.as3
-{
- import jp.nyatla.alchemymaster.*;
- import flash.utils.ByteArray;
- import jp.nyatla.as3utils.*;
-
- public class NyARPerspectiveProjectionMatrix extends NyARDoubleMatrix34
- {
- /**
- * function NyARPerspectiveProjectionMatrix()
- * AlchemyObjectを所有するインスタンスを作成します。
- * function NyARPerspectiveProjectionMatrix(arg:CONST_BASECLASS)
- * 継承用コンストラクタです。
- * function NyARPerspectiveProjectionMatrix(arg:CONST_WRAPCLASS)
- * AlchemyObjectをラップするインスタンスを作成します。
- */
- public function NyARPerspectiveProjectionMatrix(...args:Array)
- {
- super(NyARToolkitAS3.BASECLASS);
- switch(args.length){
- case 0:
- //function NyARPerspectiveProjectionMatrix()
- this.attachAlchemyObject(
- NyARToolkitAS3.cmodule.NyARPerspectiveProjectionMatrix_createInstance()
- );
- return;
- case 1:
- if(args[0] is CONST_BASECLASS)
- { //Base Class
- return;
- }else if(args[0] is CONST_WRAPCLASS){
- //function NyARPerspectiveProjectionMatrix(arg:CONST_WRAPCLASS)
- //Empty Wrapper
- return;
- }
- break;
- default:
- }
- throw new Error();
- }
- /*
- public static function createInstance():NyARPerspectiveProjectionMatrix
- {
- NyAS3Utils.assert(NyARToolkitAS3._cmodule!=null);
- var inst:NyARPerspectiveProjectionMatrix=new NyARPerspectiveProjectionMatrix();
- inst.attachAlchemyObject(NyARToolkitAS3._cmodule.NyARPerspectiveProjectionMatrix_createInstance());
- return inst;
- }
- public static function createReference(i_alchemy_stub:Object):NyARPerspectiveProjectionMatrix
- {
- var inst:NyARPerspectiveProjectionMatrix=new NyARPerspectiveProjectionMatrix();
- //Wrapper
- return inst;
- }*/
- public function decompMat(o_cpara:Array,o_trans:Array):void
- {
- var ma:Marshal=this._ma;
- ma.position=0;//MA:INIT POS
- this._alchemy_stub.decompMat(this._alchemy_ptr,ma);
- ma.position=0;//MA:INIT POS
- for(var i:int=0;i<12;i++){
- o_cpara[i]=ma.readDouble();
- }
- for(var i2:int=0;i2<12;i2++){
- o_trans[i2]=ma.readDouble();
- }
- return;
- }
-
- }
-}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/CONST_BASECLASS.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/CONST_BASECLASS.as (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/CONST_BASECLASS.as (revision 335)
@@ -1,36 +0,0 @@
-/*
- * PROJECT: NyARToolkitCPP Alchemy bind
- * --------------------------------------------------------------------------------
- * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
- *
- * Copyright (C)2009 Ryo Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
-package jp.nyatla.nyartoolkit.as3
-{
- import jp.nyatla.alchemymaster.*;
- import flash.utils.ByteArray;
- import jp.nyatla.as3utils.*;
-
- public class CONST_BASECLASS
- {
- }
-}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARSingleDetectMarker.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARSingleDetectMarker.as (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARSingleDetectMarker.as (revision 335)
@@ -1,85 +0,0 @@
-/*
- * PROJECT: NyARToolkitCPP Alchemy bind
- * --------------------------------------------------------------------------------
- * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
- *
- * Copyright (C)2009 Ryo Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
-package jp.nyatla.nyartoolkit.as3
-{
- import jp.nyatla.alchemymaster.*;
- import flash.utils.ByteArray;
- import jp.nyatla.as3utils.*;
-
- public class NyARSingleDetectMarker extends AlchemyClassProxy
- {
- /**
- * function NyARSingleDetectMarker(i_param:NyARParam,i_code:NyARCode,i_width:Number, i_raster_type:int)
- * AlchemyObjectを所有するインスタンスを作成します。
- * i_code,i_paramは生成したNyARSingleDetectMarkerをdisposeするまでの間、disposeしないでください。
- * function NyARSingleDetectMarker(arg:CONST_BASECLASS)
- * 継承用コンストラクタです。
- */
- public function NyARSingleDetectMarker(...args:Array)
- {
- switch(args.length){
- case 1:
- if(args[0] is CONST_BASECLASS)
- { //Base Class
- return;
- }
- break;
- case 4:
- //function NyARRgbRaster_XRGB32(i_param:NyARParam,i_code:NyARCode,i_width:Number, i_raster_type:int)
- this.attachAlchemyObject(
- NyARToolkitAS3.cmodule.NyARSingleDetectMarker_createInstance(NyARParam(args[0])._alchemy_ptr,NyARCode(args[1])._alchemy_ptr,Number(args[2]),int(args[3]))
- );
- return;
- default:
- }
- throw new Error();
- }
-
- public function detectMarkerLite(i_raster:NyARRgbRaster,i_threshold:int):Boolean
- {
- return this._alchemy_stub.detectMarkerLite(this._alchemy_ptr,i_raster._alchemy_ptr,i_threshold);
- }
- public function getConfidence():Number
- {
- return this._alchemy_stub.getConfidence(this._alchemy_ptr);
- }
- public function getDirection():int
- {
- return this._alchemy_stub.getDirection(this._alchemy_ptr);
- }
- public function getTransformMatrix(o_result:NyARTransMatResult):void
- {
- this._alchemy_stub.getTransmationMatrix(this._alchemy_ptr,o_result._alchemy_ptr);
- return;
- }
- public function setContinueMode(i_is_continue:Boolean):void
- {
- this._alchemy_stub.setContinueMode(this._alchemy_ptr,i_is_continue?1:0);
- return;
- }
- }
-}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyIdMarkerDataEncoder_RawBit.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyIdMarkerDataEncoder_RawBit.as (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyIdMarkerDataEncoder_RawBit.as (revision 335)
@@ -1,76 +0,0 @@
-/*
- * PROJECT: NyARToolkitCPP Alchemy bind
- * --------------------------------------------------------------------------------
- * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
- *
- * Copyright (C)2009 Ryo Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
-package jp.nyatla.nyartoolkit.as3
-{
- import jp.nyatla.alchemymaster.*;
- import flash.utils.ByteArray;
- import jp.nyatla.as3utils.*;
-
- public class NyIdMarkerDataEncoder_RawBit extends INyIdMarkerDataEncoder
- {
- /**
- * function NyIdMarkerDataEncoder_RawBit()
- * AlchemyObjectを所有するインスタンスを作成します。
- * function NyIdMarkerDataEncoder_RawBit(arg:CONST_BASECLASS)
- * 継承用コンストラクタです。
- */
- public function NyIdMarkerDataEncoder_RawBit(...args:Array)
- {
- switch(args.length){
- case 0:
- //function NyIdMarkerDataEncoder_RawBit()
- this.attachAlchemyObject(
- NyARToolkitAS3.cmodule.NyIdMarkerDataEncoder_RawBit_createInstance()
- );
- return;
- case 1:
- if(args[0] is CONST_BASECLASS)
- { //Base Class
- return;
- }
- break;
- default:
- }
- throw new Error();
- }
-/*
- public static function createInstance():NyIdMarkerDataEncoder_RawBit
- {
- NyAS3Utils.assert(NyARToolkitAS3._cmodule!=null);
- var inst:NyIdMarkerDataEncoder_RawBit=new NyIdMarkerDataEncoder_RawBit();
- inst.attachAlchemyObject(
- NyARToolkitAS3._cmodule.NyIdMarkerDataEncoder_RawBit_createInstance()
- );
- return inst;
- }
-*/
- public override function createIdMarkerDataWrapper():INyIdMarkerData
- {
- return new NyIdMarkerData_RawBit(NyARToolkitAS3.WRAPCLASS);
- }
- }
-}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyIdMarkerData_RawBit.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyIdMarkerData_RawBit.as (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyIdMarkerData_RawBit.as (revision 335)
@@ -1,81 +0,0 @@
-/*
- * PROJECT: NyARToolkitCPP Alchemy bind
- * --------------------------------------------------------------------------------
- * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
- *
- * Copyright (C)2009 Ryo Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
-package jp.nyatla.nyartoolkit.as3
-{
- import jp.nyatla.alchemymaster.*;
- import flash.utils.ByteArray;
- import jp.nyatla.as3utils.*;
-
- public class NyIdMarkerData_RawBit extends INyIdMarkerData
- {
- /**
- * function NyIdMarkerData_RawBit(arg:CONST_BASECLASS)
- * 継承用コンストラクタです。
- * function NyIdMarkerData_RawBit(arg:CONST_WRAPCLASS)
- * AlchemyObjectをラップするインスタンスを作成します。
- */
- public function NyIdMarkerData_RawBit(...args:Array)
- {
- switch(args.length){
- case 1:
- if(args[0] is CONST_BASECLASS)
- { //Base Class
- return;
- }else if(args[0] is CONST_WRAPCLASS){
- //function NyIdMarkerData_RawBit(arg:CONST_WRAPCLASS)
- //Empty Wrapper
- return;
- }
- break;
- default:
- }
- throw new Error();
- }
- //o_arrayに現在のパケットを返す。o_arrayの長さは調整される。
- public function getPacket(o_array:Array):void
- {
- var ma:Marshal=this._ma;
- ma.position=0;//MA:INIT POS
- //クラスのダンプを転送
- this._alchemy_stub.getPacket(this._alchemy_ptr,ma);
- ma.position=0;//MA:INIT POS
- //int[1]
- var len:int=ma.readInt();
- o_array.length=len;
- //double[22]
- for(var i:int=0;i<len;i++){
- o_array[i]=ma.readInt();
- }
- return;
- }
- //キャッシュ付リード/ライト(速度が必要になったら実装しようかな)
- public function writeCACHE():void{};
- public function readCACHE():void{};
- public function getPacketCACHE(o_array:Array):void
- {return;}
- }
-}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/INyIdMarkerDataEncoder.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/INyIdMarkerDataEncoder.as (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/INyIdMarkerDataEncoder.as (revision 335)
@@ -1,41 +0,0 @@
-/*
- * PROJECT: NyARToolkitCPP Alchemy bind
- * --------------------------------------------------------------------------------
- * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
- *
- * Copyright (C)2009 Ryo Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
-package jp.nyatla.nyartoolkit.as3
-{
- import jp.nyatla.alchemymaster.*;
- import flash.utils.ByteArray;
- import jp.nyatla.as3utils.*;
-
- public class INyIdMarkerDataEncoder extends AlchemyClassProxy
- {
- public function createIdMarkerDataWrapper():INyIdMarkerData
- {
- //この関数は対応するデータクラスを作って返します。
- return null;
- }
- }
-}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/INyIdMarkerData.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/INyIdMarkerData.as (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/INyIdMarkerData.as (revision 335)
@@ -1,36 +0,0 @@
-/*
- * PROJECT: NyARToolkitCPP Alchemy bind
- * --------------------------------------------------------------------------------
- * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
- *
- * Copyright (C)2009 Ryo Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
-package jp.nyatla.nyartoolkit.as3
-{
- import jp.nyatla.alchemymaster.*;
- import flash.utils.ByteArray;
- import jp.nyatla.as3utils.*;
-
- public class INyIdMarkerData extends AlchemyClassProxy
- {
- }
-}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARRgbRaster_XRGB32.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARRgbRaster_XRGB32.as (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARRgbRaster_XRGB32.as (revision 335)
@@ -1,87 +0,0 @@
-/*
- * PROJECT: NyARToolkitCPP Alchemy bind
- * --------------------------------------------------------------------------------
- * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
- *
- * Copyright (C)2009 Ryo Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
-package jp.nyatla.nyartoolkit.as3{
- import jp.nyatla.alchemymaster.*;
- import flash.utils.ByteArray;
- import jp.nyatla.as3utils.*;
-
- public class NyARRgbRaster_XRGB32 extends NyARRgbRaster
- {
- /**
- * function NyARRgbRaster_XRGB32(i_width:int,i_height:int)
- * AlchemyObjectを所有するインスタンスを作成します。
- * function NyARRgbRaster_XRGB32(arg:CONST_BASECLASS)
- * 継承用コンストラクタです。
- */
- public function NyARRgbRaster_XRGB32(...args:Array)
- {
- super(NyARToolkitAS3.BASECLASS);
- switch(args.length){
- case 1:
- if(args[0] is CONST_BASECLASS)
- { //Base Class
- return;
- }
- break;
- case 2:
- //function NyARRgbRaster_XRGB32(i_width:int,i_height:int)
- this.attachAlchemyObject(
- NyARToolkitAS3.cmodule.NyARRgbRaster_XRGB32_createInstance(int(args[0]),int(args[1]))
- );
- return;
- default:
- }
- throw new Error();
- }
-/*
- public static function createInstance(i_width:int,i_height:int):NyARRgbRaster_XRGB32
- {
- NyAS3Utils.assert(NyARToolkitAS3._cmodule!=null);
- var inst:NyARRgbRaster_XRGB32=new NyARRgbRaster_XRGB32();
- inst.attachAlchemyObject(
- NyARToolkitAS3._cmodule.NyARRgbRaster_XRGB32_createInstance(i_width,i_height)
- );
- return inst;
- }
-*/
- //現在の位置からXRGB(BYTE)形式データを読み込みます。
- public function setByteArray(i_source:ByteArray):void
- {
- var old:int=i_source.position;
- this._alchemy_stub.setData(this._alchemy_ptr,i_source);
- i_source.position=old;
- return;
- }
- public function getByteArray(o_dest:ByteArray):void
- {
- var old:int=o_dest.position;
- this._alchemy_stub.getData(this._alchemy_ptr,o_dest);
- o_dest.position=old;
- return;
- }
- }
-}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARBaseClassAS.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARBaseClassAS.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARBaseClassAS.as (revision 335)
@@ -0,0 +1,13 @@
+package jp.nyatla.nyartoolkit.as3
+{
+ import flash.utils.ByteArray;
+ import flash.utils.Endian;
+
+ public class NyARBaseClassAS
+ {
+ public function dispose():void
+ {
+ return;
+ }
+ }
+}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARIntSize.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARIntSize.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARIntSize.as (revision 335)
@@ -0,0 +1,82 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class NyARIntSize extends AlchemyClassProxy
+ {
+ public function NyARIntSize(...args:Array)
+ {
+ switch(args.length){
+ case 0:
+ //function NyARIntSize()
+ this.attachAlchemyObject(
+ NyARToolkitAS3.cmodule.NyARIntSize_createInstance()
+ );
+ return;
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ {
+ //Base Class
+ return;
+ }else if(args[0] is CONST_WRAPCLASS){
+ //function NyARIntSize(arg:CONST_WRAPCLASS)
+ //Empty Wrapper
+ return;
+ }
+ break;
+ default:
+ break;
+ }
+ throw new Error("NyARIntSize");
+ }
+ /**
+ * Marshaling format
+ * [SET] w:int,h:int
+ */
+ public function setValue(i_argument:Marshal):void
+ {
+ i_argument.prepareCallAlchmy();
+ this._alchemy_stub.setValue(this._alchemy_stub._native,i_argument);
+ return;
+ }
+ /**
+ * Marshaling format
+ * [GET] w:int,h:int
+ */
+ public function getValue(o_argument:Marshal):void
+ {
+ o_argument.prepareCallAlchmy();
+ this._alchemy_stub.getValue(this._alchemy_stub._native,o_argument);
+ return;
+ }
+
+ }
+}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyIdMarkerPickup.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyIdMarkerPickup.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyIdMarkerPickup.as (revision 335)
@@ -0,0 +1,45 @@
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class NyIdMarkerPickup extends AlchemyClassProxy
+ {
+
+ public function NyIdMarkerPickup(...args:Array)
+ {
+ switch(args.length){
+ case 0:
+ this.attachAlchemyObject(
+ NyARToolkitAS3.cmodule.NyIdMarkerPickup_createInstance()
+ );
+ return;
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ { //Base Class
+ return;
+ }else if(args[0] is CONST_WRAPCLASS){
+ //function NyIdMarkerPickup(arg:CONST_WRAPCLASS)
+ //Empty Wrapper
+ return;
+ }
+ break;
+ default:
+ break;
+ }
+ throw new Error();
+ }
+ //
+ public function pickFromRaster(image:INyARRgbRaster,i_square:NyARSquare,o_data:NyIdMarkerPattern,o_param:NyIdMarkerParam):Boolean
+ {
+ return this._alchemy_stub.pickFromRaster(
+ this._alchemy_stub._native,
+ image._alchemy_stub._native,
+ i_square._alchemy_stub._native,
+ o_data._alchemy_stub._native,
+ o_param._alchemy_stub._native
+ );
+ }
+ }
+}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARMatchPatt_Color_WITHOUT_PCA.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARMatchPatt_Color_WITHOUT_PCA.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARMatchPatt_Color_WITHOUT_PCA.as (revision 335)
@@ -0,0 +1,69 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class NyARMatchPatt_Color_WITHOUT_PCA extends INyARMatchPatt
+ {
+ public function NyARMatchPatt_Color_WITHOUT_PCA(...args:Array)
+ {
+ super(NyARToolkitAS3.BASECLASS);
+ switch(args.length){
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ {
+ //Base Class
+ return;
+ }else if(args[0] is CONST_WRAPCLASS){
+ //function NyARMatchPatt_Color_WITHOUT_PCA(arg:CONST_WRAPCLASS)
+ //Empty Wrapper
+ return;
+ }else if(args[0] is NyARCode){
+ //function NyARMatchPatt_Color_WITHOUT_PCA(arg:NyARCode)
+ this.attachAlchemyObject(
+ NyARToolkitAS3.cmodule.NyARMatchPatt_Color_WITHOUT_PCA_createInstance(args[0]._alchemy_stub._native));
+ return;
+ }
+ break;
+ default:
+ break;
+ }
+ throw new Error("NyARMatchPatt_Color_WITHOUT_PCA");
+ }
+ public function evaluate(i_data:NyARMatchPattDeviationColorData,o_result:NyARMatchPattResult):Boolean
+ {
+ return this._alchemy_stub.evaluate(
+ this._alchemy_stub._native,
+ i_data._alchemy_stub._native,
+ o_result._alchemy_stub._native);
+ return;
+ }
+ }
+}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARBinRaster.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARBinRaster.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARBinRaster.as (revision 335)
@@ -0,0 +1,66 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class NyARBinRaster extends AlchemyClassProxy
+ {
+ public function NyARBinRaster(...args:Array)
+ {
+ switch(args.length){
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ {
+ //Base Class
+ return;
+ }else if(args[0] is CONST_WRAPCLASS){
+ //function NyARBinRaster(arg:CONST_WRAPCLASS)
+ //Empty Wrapper
+ return;
+ }
+ break;
+ case 2:
+ //function NyARBinRaster(w:int,h:int)
+ this.attachAlchemyObject(
+ NyARToolkitAS3.cmodule.NyARBinRaster_createInstance(int(args[0]),int(args[1]))
+ );
+ return;
+ default:
+ break;
+ }
+ throw new Error("NyARBinRaster");
+ }
+ public function getSum():int
+ {
+ return this._alchemy_stub.getSum(this._alchemy_stub._native);
+ }
+ }
+
+}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARToolkitAS3.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARToolkitAS3.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARToolkitAS3.as (revision 335)
@@ -0,0 +1,57 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import cmodule.nyartoolkit.CLibInit;
+ public class NyARToolkitAS3
+ {
+ public static const WRAPCLASS:CONST_WRAPCLASS=new CONST_WRAPCLASS();
+ public static const BASECLASS:CONST_BASECLASS=new CONST_BASECLASS();
+ public static function Assert(f:Boolean):void
+ {
+ if(!f){throw new Error("NyARToolkitAS3::Assert");};
+ }
+
+ public static const cmodule:Object=(new CLibInit()).init();
+ /*初期化タイミングの調整が必要な場合は、こちらを使ってください。
+ public static var cmodule:Object=null;
+ public static function initialize():void
+ {
+ if(NyARToolkitAS3.cmodule!=null)
+ {
+ return;
+ }
+ NyARToolkitAS3.cmodule=(new CLibInit()).init();
+ }
+ public static function finalize():void
+ {
+ //no work!
+ NyARToolkitAS3.cmodule=null;//??
+ }
+ */
+ }
+}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARSquareDetector_Rle.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARSquareDetector_Rle.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARSquareDetector_Rle.as (revision 335)
@@ -0,0 +1,36 @@
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class NyARSquareDetector_Rle extends INyARSquareDetector
+ {
+ public function NyARSquareDetector_Rle(...args:Array)
+ {
+ super(NyARToolkitAS3.BASECLASS);
+ switch(args.length){
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ {
+ //Base Class
+ return;
+ }else if(args[0] is CONST_WRAPCLASS){
+ //function NyARSquareDetector_Rle(arg:CONST_WRAPCLASS)
+ //Empty Wrapper
+ return;
+ }
+ break;
+ case 2:
+ //function NyARSquareDetector_Rle(NyARCameraDistorsionFactor,NyARIntSize)
+ this.attachAlchemyObject(
+ NyARToolkitAS3.cmodule.NyARSquareDetector_Rle_createInstance(args[0]._alchemy_stub._native,args[1]._alchemy_stub._native)
+ );
+ return;
+ default:
+ break;
+ }
+ throw new Error("NyARSquareDetector_Rle");
+ }
+ }
+}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/INyARRasterThresholdAnalyzer.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/INyARRasterThresholdAnalyzer.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/INyARRasterThresholdAnalyzer.as (revision 335)
@@ -0,0 +1,69 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class INyARRasterThresholdAnalyzer extends AlchemyClassProxy
+ {
+ public function INyARRasterThresholdAnalyzer(...args:Array)
+ {
+ switch(args.length){
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ {
+ //Base Class
+ return;
+ }else if(args[0] is CONST_WRAPCLASS){
+ //function INyARMatchPatt(arg:CONST_WRAPCLASS)
+ //Empty Wrapper
+ return;
+ }
+ break;
+ default:
+ break;
+ }
+ throw new Error("INyARRasterThresholdAnalyzer");
+ }
+ public function analyzeRaster(i_input:INyARRgbRaster):void
+ {
+ this._alchemy_stub.analyzeRaster(
+ this._alchemy_stub._native,
+ i_input._alchemy_stub._native);
+ return;
+ }
+
+ public function getThreshold():int
+ {
+ return this._alchemy_stub.getThreshold(
+ this._alchemy_stub._native);
+ }
+
+ }
+}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARRasterThresholdAnalyzer_SlidePTile.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARRasterThresholdAnalyzer_SlidePTile.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARRasterThresholdAnalyzer_SlidePTile.as (revision 335)
@@ -0,0 +1,35 @@
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class NyARRasterThresholdAnalyzer_SlidePTile extends INyARRasterThresholdAnalyzer
+ {
+ public function NyARRasterThresholdAnalyzer_SlidePTile(...args:Array)
+ {
+ super(NyARToolkitAS3.BASECLASS);
+ switch(args.length){
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ {
+ //Base Class
+ return;
+ }else if(args[0] is CONST_WRAPCLASS){
+ //function NyARRasterFilter_ARToolkitThreshold(arg:CONST_WRAPCLASS)
+ //Empty Wrapper
+ return;
+ }
+ break;
+ case 3:
+ //function NyARRasterFilter_ARToolkitThreshold(i_persentage:int,i_raster_format:int,i_vertical_interval:int)
+ this.attachAlchemyObject(
+ NyARToolkitAS3.cmodule.NyARRasterThresholdAnalyzer_SlidePTile_createInstance(int(args[0]),int(args[1]),int(args[2])));
+ return;
+ default:
+ break;
+ }
+ throw new Error("NyARRasterFilter_ARToolkitThreshold");
+ }
+ }
+}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/INyARTransMat.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/INyARTransMat.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/INyARTransMat.as (revision 335)
@@ -0,0 +1,75 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class INyARTransMat extends AlchemyClassProxy
+ {
+ public function INyARTransMat(...args:Array)
+ {
+ switch(args.length){
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ {
+ //Base Class
+ return;
+ }else if(args[0] is CONST_WRAPCLASS){
+ //function INyARTransMat(arg:CONST_WRAPCLASS)
+ //Empty Wrapper
+ return;
+ }
+ break;
+ default:
+ }
+ throw new Error("INyARTransMat");
+ }
+ public function transMat(i_square:NyARSquare,i_direction:int,i_width:Number,o_result:NyARTransMatResult):void
+ {
+ this._alchemy_stub.transMat(
+ this._alchemy_stub._native,
+ i_square._alchemy_stub._native,
+ i_direction,
+ i_width,
+ o_result._alchemy_stub._native);
+ return;
+ }
+
+ public function transMatContinue(i_square:NyARSquare,i_direction:int,i_width:Number,o_result:NyARTransMatResult):void
+ {
+ this._alchemy_stub.transMat(
+ this._alchemy_stub._native,
+ i_square._alchemy_stub._native,
+ i_direction,
+ i_width,
+ o_result._alchemy_stub._native);
+ return;
+ }
+ }
+}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/INyARSquareDetector.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/INyARSquareDetector.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/INyARSquareDetector.as (revision 335)
@@ -0,0 +1,37 @@
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class INyARSquareDetector extends AlchemyClassProxy
+ {
+ public function INyARSquareDetector(...args:Array)
+ {
+ switch(args.length){
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ { //Base Class
+ return;
+ }else if(args[0] is CONST_WRAPCLASS){
+ //function INyARSquareDetector(arg:CONST_WRAPCLASS)
+ //Empty Wrapper
+ return;
+ }
+ break;
+ default:
+ break;
+ }
+ throw new Error();
+ }
+ public function detectMarker(i_raster:NyARBinRaster,o_square_stack:NyARSquareStack):void
+ {
+ this._alchemy_stub.detectMarker(
+ this._alchemy_stub._native,
+ i_raster._alchemy_stub._native,
+ o_square_stack._alchemy_stub._native);
+ return;
+ }
+ }
+
+}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/INyARRgbRaster.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/INyARRgbRaster.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/INyARRgbRaster.as (revision 335)
@@ -0,0 +1,57 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+
+ public class INyARRgbRaster extends AlchemyClassProxy
+ {
+
+ /**
+ * function NyARRgbRaster(arg:CONST_BASECLASS)
+ * 継承用コンストラクタです。
+ */
+ public function INyARRgbRaster(...args:Array)
+ {
+ switch(args.length){
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ { //Base Class
+ return;
+ }else if(args[0] is CONST_WRAPCLASS){
+ //function INyARSquareDetector(arg:CONST_WRAPCLASS)
+ //Empty Wrapper
+ return;
+ }
+ default:
+ break;
+ }
+ throw new Error();
+ }
+ }
+}
+
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyIdMarkerPattern.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyIdMarkerPattern.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyIdMarkerPattern.as (revision 335)
@@ -0,0 +1,35 @@
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class NyIdMarkerPattern extends AlchemyClassProxy
+ {
+ public static const DIRECTION_UNKNOWN:int =-1;
+
+ public function NyIdMarkerPattern(...args:Array)
+ {
+ switch(args.length){
+ case 0:
+ this.attachAlchemyObject(
+ NyARToolkitAS3.cmodule.NyIdMarkerPattern_createInstance()
+ );
+ return;
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ { //Base Class
+ return;
+ }else if(args[0] is CONST_WRAPCLASS){
+ //function NyIdMarkerPattern(arg:CONST_WRAPCLASS)
+ //Empty Wrapper
+ return;
+ }
+ break;
+ default:
+ break;
+ }
+ throw new Error();
+ }
+ }
+}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARCode.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARCode.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARCode.as (revision 335)
@@ -0,0 +1,113 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.as3utils.*;
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+
+ public class NyARCode extends AlchemyClassProxy
+ {
+ /**
+ * function NyARCode(width:int,height:int)
+ * AlchemyObjectを所有するインスタンスを作成します。
+ * function NyARCode(arg:CONST_BASECLASS)
+ * 継承用コンストラクタです。
+ * function NyARCode(arg:CONST_WRAPCLASS)
+ * AlchemyObjectをラップするインスタンスを作成します。
+ */
+ public function NyARCode(...args:Array)
+ {
+ switch(args.length){
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ { //Base Class
+ return;
+ }else if(args[0] is CONST_WRAPCLASS){
+ //function NyARCode(arg:CONST_WRAPCLASS)
+ //Empty Wrapper
+ return;
+ }
+ break;
+ case 2:
+ //function NyARCode(width:int,height:int)
+ this.attachAlchemyObject(
+ NyARToolkitAS3.cmodule.NyARCode_createInstance(int(args[0]),int(args[1]))
+ );
+ return;
+ default:
+ break;
+ }
+ throw new Error("NyARCode");
+ }
+ //i_streamのカレント位置から読みだします。
+ public function loadARPattFromFile(i_stream:String):void
+ {
+ var width:int=this._alchemy_stub.getWidth(this._alchemy_stub._native);
+ var height:int=this._alchemy_stub.getHeight(this._alchemy_stub._native);
+
+ var token:Array = i_stream.match(/\d+/g);
+ var ma:Marshal=new Marshal();
+ ma.prepareWrite();//データの投入準備
+ var h:int;
+ var i3:int;
+ var i2:int;
+ var i1:int;
+ var val:int;
+ for (h = 0;h < 4; h++) {
+ for (i3 = 0;i3 < 3; i3++) {
+ for (i2 = 0;i2 < height; i2++) {
+ for (i1 = 0;i1 < width; i1++) {
+ // 数値のみ読み出す
+ val = parseInt(token.shift());
+ if(isNaN(val)){
+ throw new Error("syntax error in pattern file.");
+ }
+ ma.writeInt(val);
+ }
+ }
+ }
+ }
+ ma.prepareCallAlchmy();//Alchemyのコール準備
+ this._alchemy_stub.loadARPatt(this._alchemy_stub._native,ma);
+ return;
+ }
+ public function getWidth():int
+ {
+ return this._alchemy_stub.getWidth(this._alchemy_stub._native);
+ }
+ public function getHeight():int
+ {
+ return this._alchemy_stub.getHeight(this._alchemy_stub._native);
+ }
+ public override function dispose():void
+ {
+ super.dispose();
+ return;
+ }
+ }
+}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/INyIdMarkerDataEncoder.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/INyIdMarkerDataEncoder.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/INyIdMarkerDataEncoder.as (revision 335)
@@ -0,0 +1,63 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class INyIdMarkerDataEncoder extends AlchemyClassProxy
+ {
+ public function INyIdMarkerDataEncoder(...args:Array)
+ {
+ switch(args.length){
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ { //Base Class
+ return;
+ }else if(args[0] is CONST_WRAPCLASS){
+ //function INyARSquareDetector(arg:CONST_WRAPCLASS)
+ //Empty Wrapper
+ return;
+ }
+ break;
+ default:
+ break;
+ }
+ throw new Error("INyIdMarkerDataEncoder");
+ }
+ public virtual function createDataInstance():INyIdMarkerData
+ {
+ //継承した関数で、この関数をオーバライドして、適切な型のデータラッパを作成します。
+ throw new Error("INyIdMarkerDataEncoder::createDataInstance");
+ }
+ public function encode(i_data:NyIdMarkerPattern,o_dest:INyIdMarkerData):Boolean
+ {
+ return this._alchemy_stub.encode(this._alchemy_stub._native,i_data._alchemy_stub._native,o_dest._alchemy_stub._native);
+ }
+ }
+}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARColorPatt_Perspective_O2.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARColorPatt_Perspective_O2.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARColorPatt_Perspective_O2.as (revision 335)
@@ -0,0 +1,80 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class NyARColorPatt_Perspective_O2 extends INyARColorPatt
+ {
+ public function NyARColorPatt_Perspective_O2(...args:Array)
+ {
+ super(NyARToolkitAS3.BASECLASS);
+ switch(args.length){
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ {
+ //Base Class
+ return;
+ }else if(args[0] is CONST_WRAPCLASS){
+ //function NyARColorPatt_Perspective_O2(arg:CONST_WRAPCLASS)
+ //Empty Wrapper
+ return;
+ }
+ break;
+ case 4:
+ //function NyARColorPatt_Perspective_O2(int,int,int,int)
+ this.attachAlchemyObject(
+ NyARToolkitAS3.cmodule.NyARColorPatt_Perspective_O2_createInstance(int(args[0]),int(args[1]),int(args[2]),int(args[3]))
+ );
+ return;
+ default:
+ }
+ throw new Error("NyARColorPatt_Perspective_O2");
+ }
+ /**
+ * This function write all pixel data to o_dest. Pixel format is INT-XRGB by little endian.
+ * The function does not change current position of BytreArray.
+ * --
+ * この関数は、イメージのピクセルデータを、Int形式にして、o_destに書き込みます。
+ * ピクセルフォーマットはLittle endianのXRGB形式で、o_destの初期位置から
+ * w*h個のintデータを保存します。
+ *
+ * Marshaling format
+ * [GET] int[0],int[1]....int[w*h-1]
+ *
+ */
+ public function getData(o_dest:ByteArray):void
+ {
+ var old:int=o_dest.position;
+ this._alchemy_stub.getData(this._alchemy_stub._native,o_dest);
+ o_dest.position=old;
+ return;
+ }
+ }
+}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARRgbRaster_XRGB32.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARRgbRaster_XRGB32.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARRgbRaster_XRGB32.as (revision 335)
@@ -0,0 +1,73 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class NyARRgbRaster_XRGB32 extends INyARRgbRaster
+ {
+ public function NyARRgbRaster_XRGB32(...args:Array)
+ {
+ super(NyARToolkitAS3.BASECLASS);
+ switch(args.length){
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ { //Base Class
+ return;
+ }
+ break;
+ case 2:
+ //function NyARRgbRaster_XRGB32(i_width:int,i_height:int)
+ this.attachAlchemyObject(
+ NyARToolkitAS3.cmodule.NyARRgbRaster_XRGB32_createInstance(int(args[0]),int(args[1]))
+ );
+ return;
+ default:
+ break;
+ }
+ throw new Error();
+ }
+
+ //現在の位置からXRGB(BYTE)形式データを読み込みます。
+ public function setByteArray(i_source:ByteArray):void
+ {
+ var old:int=i_source.position;
+ this._alchemy_stub.setData(this._alchemy_stub._native,i_source);
+ i_source.position=old;
+ return;
+ }
+ public function getByteArray(o_dest:ByteArray):void
+ {
+ var old:int=o_dest.position;
+ this._alchemy_stub.getData(this._alchemy_stub._native,o_dest);
+ o_dest.position=old;
+ return;
+ }
+ }
+}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARMatchPattResult.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARMatchPattResult.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARMatchPattResult.as (revision 335)
@@ -0,0 +1,82 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class NyARMatchPattResult extends AlchemyClassProxy
+ {
+ public function NyARMatchPattResult(...args:Array)
+ {
+ switch(args.length){
+ case 0:
+ //function NyARIntSize()
+ this.attachAlchemyObject(
+ NyARToolkitAS3.cmodule.NyARMatchPattResult_createInstance()
+ );
+ return;
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ {
+ //Base Class
+ return;
+ }else if(args[0] is CONST_WRAPCLASS){
+ //function NyARMatchPattResult(arg:CONST_WRAPCLASS)
+ //Empty Wrapper
+ return;
+ }
+ break;
+ default:
+ break;
+ }
+ throw new Error("NyARMatchPattResult");
+ }
+ /**
+ * Marshaling format
+ * [SET] direction:int,confidence:double
+ */
+ public function setValue(i_argument:Marshal):void
+ {
+ i_argument.prepareCallAlchmy();
+ this._alchemy_stub.setValue(this._alchemy_stub._native,i_argument);
+ return;
+ }
+ /**
+ * Marshaling format
+ * [GET] direction:int,confidence:double
+ */
+ public function getValue(o_argument:Marshal):void
+ {
+ o_argument.prepareCallAlchmy();
+ this._alchemy_stub.getValue(this._alchemy_stub._native,o_argument);
+ return;
+ }
+
+ }
+}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARRgbRaster_BGRA.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARRgbRaster_BGRA.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARRgbRaster_BGRA.as (revision 335)
@@ -0,0 +1,67 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class NyARRgbRaster_BGRA extends INyARRgbRaster
+ {
+ public function NyARRgbRaster_BGRA(...args:Array)
+ {
+ super(NyARToolkitAS3.BASECLASS);
+ switch(args.length){
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ { //Base Class
+ return;
+ }
+ break;
+ case 2:
+ //function NyARRgbRaster_BGRA(i_width:int,i_height:int)
+ this.attachAlchemyObject(
+ NyARToolkitAS3.cmodule.NyARRgbRaster_BGRA_createInstance(int(args[0]),int(args[1]))
+ );
+ return;
+ default:
+ break;
+ }
+ throw new Error("NyARRgbRaster_BGRA");
+ }
+ //現在の位置からBGRA(BYTE)形式データを読み込みます。
+ public function setFromByteArray(i_source:ByteArray):void
+ {
+ var old:int=i_source.position;
+ this._alchemy_stub.setData(this._alchemy_stub._native,i_source);
+ i_source.position=old;
+ return;
+ }
+
+ }
+}
+
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARSquareStack.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARSquareStack.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARSquareStack.as (revision 335)
@@ -0,0 +1,70 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.as3utils.*;
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+
+ public class NyARSquareStack extends AlchemyClassProxy
+ {
+ public function NyARSquareStack(...args:Array)
+ {
+ switch(args.length){
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ { //Base Class
+ return;
+ }else if(args[0] is CONST_WRAPCLASS){
+ //function NyARCode(arg:CONST_WRAPCLASS)
+ //Empty Wrapper
+ return;
+ }else{
+ //function NyARSqureStack(length:int)
+ this.attachAlchemyObject(
+ NyARToolkitAS3.cmodule.NyARSquareStack_createInstance(int(args[0]))
+ );
+ return;
+ }
+ break;
+ default:
+ break;
+ }
+ throw new Error("NyARSquareStack");
+ }
+ public function getLength():int
+ {
+ return this._alchemy_stub.getLength(this._alchemy_stub._native);
+ }
+ public function getItem(i_index:int):NyARSquare
+ {
+ var sq:NyARSquare=new NyARSquare(NyARToolkitAS3.WRAPCLASS);
+ sq.setAlchemyObject(this._alchemy_stub.getItem(this._alchemy_stub._native,i_index));
+ return sq;
+ }
+ }
+}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARTransMatResult.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARTransMatResult.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARTransMatResult.as (revision 335)
@@ -0,0 +1,74 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class NyARTransMatResult extends NyARDoubleMatrix34
+ {
+ public function NyARTransMatResult(...args:Array)
+ {
+ super(NyARToolkitAS3.BASECLASS);
+ switch(args.length){
+ case 0:
+ //function NyARTransMatResult(width:int,height:int)
+ this.attachAlchemyObject(
+ NyARToolkitAS3.cmodule.NyARTransMatResult_createInstance()
+ );
+ return;
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ { //Base Class
+ return;
+ }else if(args[0] is CONST_WRAPCLASS){
+ //function NyARTransMatResult(arg:CONST_WRAPCLASS)
+ //Empty Wrapper
+ return;
+ }
+ break;
+ default:
+ break;
+ }
+ throw new Error();
+ }
+ public function getHasValue():Boolean
+ {
+ return this._alchemy_stub.getHasValue(this._alchemy_stub._native);
+ }
+ /**
+ * Marshaling format
+ * [GET] x:double,y:double,z:double
+ */
+ public function getZXYAngle(o_argument:Marshal):void
+ {
+ o_argument.prepareCallAlchmy();
+ this._alchemy_stub.getZXYAngle(this._alchemy_stub._native,o_argument);
+ }
+ }
+}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARTransMat.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARTransMat.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARTransMat.as (revision 335)
@@ -0,0 +1,60 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class NyARTransMat extends INyARTransMat
+ {
+ public function NyARTransMat(...args:Array)
+ {
+ super(NyARToolkitAS3.BASECLASS);
+ switch(args.length){
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ { //Base Class
+ return;
+ }else if(args[0] is CONST_WRAPCLASS){
+ //function NyARTransMat(arg:CONST_WRAPCLASS)
+ //Empty Wrapper
+ return;
+ }else{
+ //function NyARTransMat(NyARParam)
+ this.attachAlchemyObject(
+ NyARToolkitAS3.cmodule.NyARTransMat_createInstance(args[0]._alchemy_stub._native)
+ );
+ return;
+ }
+ default:
+ break;
+ }
+ throw new Error();
+ }
+ }
+}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyIdMarkerParam.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyIdMarkerParam.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyIdMarkerParam.as (revision 335)
@@ -0,0 +1,45 @@
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class NyIdMarkerParam extends AlchemyClassProxy
+ {
+ public static const DIRECTION_UNKNOWN:int =-1;
+
+ public function NyIdMarkerParam(...args:Array)
+ {
+ switch(args.length){
+ case 0:
+ this.attachAlchemyObject(
+ NyARToolkitAS3.cmodule.NyIdMarkerParam_createInstance()
+ );
+ return;
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ { //Base Class
+ return;
+ }else if(args[0] is CONST_WRAPCLASS){
+ //function NyIdMarkerParam(arg:CONST_WRAPCLASS)
+ //Empty Wrapper
+ return;
+ }
+ break;
+ default:
+ break;
+ }
+ throw new Error();
+ }
+ /**
+ * Marshal
+ * [GET] direction:int,threshold:int
+ */
+ public function getValue(o_argument:Marshal):void
+ {
+ o_argument.prepareCallAlchmy();
+ this._alchemy_stub.getValue(this._alchemy_stub._native,o_argument);
+ return;
+ }
+ }
+}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/INyARMatchPatt.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/INyARMatchPatt.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/INyARMatchPatt.as (revision 335)
@@ -0,0 +1,60 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class INyARMatchPatt extends AlchemyClassProxy
+ {
+ public function INyARMatchPatt(...args:Array)
+ {
+ switch(args.length){
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ {
+ //Base Class
+ return;
+ }else if(args[0] is CONST_WRAPCLASS){
+ //function INyARMatchPatt(arg:CONST_WRAPCLASS)
+ //Empty Wrapper
+ return;
+ }
+ break;
+ default:
+ break;
+ }
+ throw new Error("INyARMatchPatt");
+ }
+ public virtual function evalute():void
+ {
+ throw new Error("evalute not impleimented");
+ return;
+ }
+ }
+}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARParam.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARParam.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARParam.as (revision 335)
@@ -0,0 +1,117 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class NyARParam extends AlchemyClassProxy
+ {
+ private var _screen_size:NyARIntSize;
+ private var _projection_matrix:NyARPerspectiveProjectionMatrix;
+ private var _distfactor:NyARCameraDistortionFactor;
+ /**
+ * function NyARParam()
+ * AlchemyObjectを所有するインスタンスを作成します。
+ * function NyARParam(arg:CONST_BASECLASS)
+ * 継承用コンストラクタです。
+ */
+ public function NyARParam(...args:Array)
+ {
+ //メンバオブジェクト
+ this._screen_size=new NyARIntSize(NyARToolkitAS3.WRAPCLASS);
+ this._projection_matrix=new NyARPerspectiveProjectionMatrix(NyARToolkitAS3.WRAPCLASS);
+ this._distfactor=new NyARCameraDistortionFactor(NyARToolkitAS3.WRAPCLASS);
+ //
+ switch(args.length){
+ case 0:
+ //function NyARParam()
+ this.attachAlchemyObject(
+ NyARToolkitAS3.cmodule.NyARParam_createInstance()
+ );
+ return;
+ case 1:
+ //function NyARParam(i_class:CONST_BASECLASS)
+ if(args[0] is CONST_BASECLASS)
+ { //Base Class
+ return;
+ }
+ break;
+ default:
+ break;
+ }
+ throw new Error();
+ }
+ public function changeScreenSize(i_xsize:int, i_ysize:int):void
+ {
+ this._alchemy_stub.changeScreenSize(this._alchemy_stub._native,i_xsize,i_ysize);
+ return;
+ }
+ //i_streamのカレント位置から読みだします。
+ public function loadARParamFile(i_stream:ByteArray):void
+ {
+ var old_pos:int=i_stream.position;
+ this._alchemy_stub.loadARParamFile(this._alchemy_stub._native,i_stream);
+ i_stream.position=old_pos;
+ return;
+ }
+
+ /**
+ * この関数の返すオブジェクトの寿命は、NyARParamと同期しています。
+ * NyARParamをdisposeした瞬間に、オブジェクトは正しい値を返さなくなります。注意してください。
+ */
+ public function getPerspectiveProjectionMatrix():NyARPerspectiveProjectionMatrix
+ {
+ this._projection_matrix.setAlchemyObject(this._alchemy_stub._perspective_matrix);
+ return this._projection_matrix;
+ }
+ /**
+ * この関数の返すオブジェクトの寿命は、NyARParamと同期しています。
+ * NyARParamをdisposeした瞬間に、オブジェクトは正しい値を返さなくなります。注意してください。
+ */
+ public function getScreenSize():NyARIntSize
+ {
+ this._screen_size.setAlchemyObject(this._alchemy_stub._screen_size);
+ return this._screen_size;
+ }
+ public function getDistortionFactor():NyARCameraDistortionFactor
+ {
+ this._distfactor.setAlchemyObject(this._alchemy_stub._distortion_factor);
+ return this._distfactor;
+ }
+ //OK
+
+ public override function dispose():void
+ {
+ this._projection_matrix=null;
+ this._screen_size=null;
+ super.dispose();
+ return;
+ }
+ }
+}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARSquare.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARSquare.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARSquare.as (revision 335)
@@ -0,0 +1,67 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class NyARSquare extends AlchemyClassProxy
+ {
+ public static const DIRECTION_UNKNOWN:int =-1;
+
+ public function NyARSquare(...args:Array)
+ {
+ switch(args.length){
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ { //Base Class
+ return;
+ }else if(args[0] is CONST_WRAPCLASS){
+ //function NyARSquare(arg:CONST_WRAPCLASS)
+ //Empty Wrapper
+ return;
+ }
+ break;
+ default:
+ break;
+ }
+ throw new Error();
+ }
+ /**
+ * Marshaling format
+ * [GET]
+ * dir:int,impos[4,2]:int,line:double[4*3],sqpos[4,2]:double
+ */
+ public function getValue(o_argument:Marshal):void
+ {
+ o_argument.prepareCallAlchmy();
+ this._alchemy_stub.getValue(this._alchemy_stub._native,o_argument);
+ return;
+ }
+ }
+}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/INyARRasterFilter_RgbToBin.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/INyARRasterFilter_RgbToBin.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/INyARRasterFilter_RgbToBin.as (revision 335)
@@ -0,0 +1,63 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class INyARRasterFilter_RgbToBin extends AlchemyClassProxy
+ {
+ public function INyARRasterFilter_RgbToBin(...args:Array)
+ {
+ switch(args.length){
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ {
+ //Base Class
+ return;
+ }else if(args[0] is CONST_WRAPCLASS){
+ //function INyARRasterFilter_RgbToBin(arg:CONST_WRAPCLASS)
+ //Empty Wrapper
+ return;
+ }
+ break;
+ default:
+ break;
+ }
+ throw new Error("INyARRasterFilter_RgbToBin");
+ }
+ public function doFilter(i_raster:INyARRgbRaster,o_raster:NyARBinRaster):void
+ {
+ this._alchemy_stub.doFilter(
+ this._alchemy_stub._native,
+ i_raster._alchemy_stub._native,
+ o_raster._alchemy_stub._native);
+ return;
+ }
+ }
+}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/INyARBufferReader.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/INyARBufferReader.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/INyARBufferReader.as (revision 335)
@@ -0,0 +1,60 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+
+ public class INyARBufferReader extends AlchemyClassProxy
+ {
+ public static const BYTE1D:int =0x00010000;
+ public static const INT2D:int =0x00020000;
+ public static const SHORT1D:int=0x00030000;
+ public static const INT1D:int =0x00040000;
+ public static const BUFFERFORMAT_INT1D_X8R8G8B8_32:int = INT1D|0x0102;
+ public static const BUFFERFORMAT_BYTE1D_B8G8R8X8_32:int = BYTE1D|0x0101;
+ public static const BUFFERFORMAT_BYTE1D_X8R8G8B8_32:int = BYTE1D|0x0102;
+
+ /**
+ * function NyARRgbRaster(arg:CONST_BASECLASS)
+ * 継承用コンストラクタです。
+ */
+ public function INyARBufferReader(...args:Array)
+ {
+ switch(args.length){
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ { //Base Class
+ return;
+ }
+ break;
+ default:
+ }
+ throw new Error();
+ }
+ }
+}
+
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARCameraDistortionFactor.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARCameraDistortionFactor.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARCameraDistortionFactor.as (revision 335)
@@ -0,0 +1,33 @@
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class NyARCameraDistortionFactor extends AlchemyClassProxy
+ {
+ public function NyARCameraDistortionFactor(...args:Array)
+ {
+ switch(args.length){
+ case 0:
+ //function NyARCameraDistortionFactor()
+ this.attachAlchemyObject(
+ NyARToolkitAS3.cmodule.NyARCameraDistortionFactor_createInstance()
+ );
+ return;
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ { //Base Class
+ return;
+ }else if(args[0] is CONST_WRAPCLASS){
+ //function NyARCameraDistortionFactor(arg:CONST_WRAPCLASS)
+ //Empty Wrapper
+ return;
+ }
+ break;
+ default:
+ }
+ throw new Error("NyARCameraDistortionFactor");
+ }
+ }
+}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARDoubleMatrix34.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARDoubleMatrix34.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARDoubleMatrix34.as (revision 335)
@@ -0,0 +1,81 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class NyARDoubleMatrix34 extends AlchemyClassProxy
+ {
+ public function NyARDoubleMatrix34(...args:Array)
+ {
+ switch(args.length){
+ case 0:
+ //function NyARDoubleMatrix34()
+ this.attachAlchemyObject(
+ NyARToolkitAS3.cmodule.NyARDoubleMatrix34_createInstance()
+ );
+ return;
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ { //Base Class
+ return;
+ }else if(args[0] is CONST_WRAPCLASS){
+ //function NyARDoubleMatrix34(arg:CONST_WRAPCLASS)
+ //Empty Wrapper
+ return;
+ }
+ break;
+ default:
+ break;
+ }
+ throw new Error();
+ }
+ /**
+ * Marshaling format
+ * [SET] int[12]
+ */
+ public function setValue(i_argument:Marshal):void
+ {
+ i_argument.prepareCallAlchmy();
+ this._alchemy_stub.setValue(this._alchemy_stub._native,i_argument);
+ return;
+ }
+ /**
+ * Marshaling format
+ * [GET] int[12]
+ */
+ public function getValue(o_argument:Marshal):void
+ {
+ o_argument.prepareCallAlchmy();
+ this._alchemy_stub.getValue(this._alchemy_stub._native,o_argument);
+ return;
+ }
+
+ }
+}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/CONST_WRAPCLASS.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/CONST_WRAPCLASS.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/CONST_WRAPCLASS.as (revision 335)
@@ -0,0 +1,36 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class CONST_WRAPCLASS
+ {
+ }
+}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARPerspectiveProjectionMatrix.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARPerspectiveProjectionMatrix.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARPerspectiveProjectionMatrix.as (revision 335)
@@ -0,0 +1,81 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class NyARPerspectiveProjectionMatrix extends NyARDoubleMatrix34
+ {
+ /**
+ * function NyARPerspectiveProjectionMatrix()
+ * AlchemyObjectを所有するインスタンスを作成します。
+ * function NyARPerspectiveProjectionMatrix(arg:CONST_BASECLASS)
+ * 継承用コンストラクタです。
+ * function NyARPerspectiveProjectionMatrix(arg:CONST_WRAPCLASS)
+ * AlchemyObjectをラップするインスタンスを作成します。
+ */
+ public function NyARPerspectiveProjectionMatrix(...args:Array)
+ {
+ super(NyARToolkitAS3.BASECLASS);
+ switch(args.length){
+ case 0:
+ //function NyARPerspectiveProjectionMatrix()
+ this.attachAlchemyObject(
+ NyARToolkitAS3.cmodule.NyARPerspectiveProjectionMatrix_createInstance()
+ );
+ return;
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ { //Base Class
+ return;
+ }else if(args[0] is CONST_WRAPCLASS){
+ //function NyARPerspectiveProjectionMatrix(arg:CONST_WRAPCLASS)
+ //Empty Wrapper
+ return;
+ }
+ break;
+ default:
+ break;
+ }
+ throw new Error("NyARPerspectiveProjectionMatrix");
+ }
+ /**
+ * Marshaling format
+ * [GET]
+ * o_cpara[12]:double,o_trans[12]:double
+ */
+ public function decompMat(o_argument:Marshal):void
+ {
+ o_argument.prepareCallAlchmy();
+ this._alchemy_stub.decompMat(this._alchemy_stub._native,o_argument);
+ return;
+ }
+
+ }
+}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARRasterFilter_ARToolkitThreshold.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARRasterFilter_ARToolkitThreshold.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARRasterFilter_ARToolkitThreshold.as (revision 335)
@@ -0,0 +1,68 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class NyARRasterFilter_ARToolkitThreshold extends INyARRasterFilter_RgbToBin
+ {
+ public function NyARRasterFilter_ARToolkitThreshold(...args:Array)
+ {
+ super(NyARToolkitAS3.BASECLASS);
+ switch(args.length){
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ {
+ //Base Class
+ return;
+ }else if(args[0] is CONST_WRAPCLASS){
+ //function NyARRasterFilter_ARToolkitThreshold(arg:CONST_WRAPCLASS)
+ //Empty Wrapper
+ return;
+ }
+ break;
+ case 2:
+ //function NyARRasterFilter_ARToolkitThreshold(i_threshold:int,i_raster_type:int)
+ this.attachAlchemyObject(
+ NyARToolkitAS3.cmodule.NyARRasterFilter_ARToolkitThreshold_createInstance(int(args[0]),int(args[1]))
+ );
+ return;
+ default:
+ break;
+ }
+ throw new Error("NyARRasterFilter_ARToolkitThreshold");
+ }
+ public function setThreshold(i_threshold:int):void
+ {
+ this._alchemy_stub.setThreshold(this._alchemy_stub._native,i_threshold);
+ return;
+ }
+
+ }
+}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/CONST_BASECLASS.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/CONST_BASECLASS.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/CONST_BASECLASS.as (revision 335)
@@ -0,0 +1,36 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class CONST_BASECLASS
+ {
+ }
+}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyIdMarkerDataEncoder_RawBit.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyIdMarkerDataEncoder_RawBit.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyIdMarkerDataEncoder_RawBit.as (revision 335)
@@ -0,0 +1,70 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class NyIdMarkerDataEncoder_RawBit extends INyIdMarkerDataEncoder
+ {
+ /**
+ * function NyIdMarkerDataEncoder_RawBit()
+ * AlchemyObjectを所有するインスタンスを作成します。
+ * function NyIdMarkerDataEncoder_RawBit(arg:CONST_BASECLASS)
+ * 継承用コンストラクタです。
+ */
+ public function NyIdMarkerDataEncoder_RawBit(...args:Array)
+ {
+ super(NyARToolkitAS3.BASECLASS);
+ switch(args.length){
+ case 0:
+ //function NyIdMarkerDataEncoder_RawBit()
+ this.attachAlchemyObject(
+ NyARToolkitAS3.cmodule.NyIdMarkerDataEncoder_RawBit_createInstance()
+ );
+ return;
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ { //Base Class
+ return;
+ }
+ break;
+ default:
+ break;
+ }
+ throw new Error();
+ }
+ public override function createDataInstance():INyIdMarkerData
+ {
+ var obj:NyIdMarkerData_RawBit=new NyIdMarkerData_RawBit(NyARToolkitAS3.WRAPCLASS);
+ obj.setAlchemyObject(this._alchemy_stub.createDataInstance(this._alchemy_stub._native));
+ return obj;
+ }
+
+ }
+}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyIdMarkerData_RawBit.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyIdMarkerData_RawBit.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyIdMarkerData_RawBit.as (revision 335)
@@ -0,0 +1,72 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class NyIdMarkerData_RawBit extends INyIdMarkerData
+ {
+ /**
+ * function NyIdMarkerData_RawBit(arg:CONST_BASECLASS)
+ * 継承用コンストラクタです。
+ * function NyIdMarkerData_RawBit(arg:CONST_WRAPCLASS)
+ * AlchemyObjectをラップするインスタンスを作成します。
+ */
+ public function NyIdMarkerData_RawBit(...args:Array)
+ {
+ super(NyARToolkitAS3.BASECLASS);
+ switch(args.length){
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ { //Base Class
+ return;
+ }else if(args[0] is CONST_WRAPCLASS){
+ //function NyIdMarkerData_RawBit(arg:CONST_WRAPCLASS)
+ //Empty Wrapper
+ return;
+ }
+ break;
+ default:
+ break;
+ }
+ throw new Error();
+ }
+ /**
+ * Marshaling format
+ * [GET]
+ * length:int,data[length]:int
+ */
+ public function getValue(o_argument:Marshal):void
+ {
+ o_argument.prepareCallAlchmy();
+ this._alchemy_stub.getValue(this._alchemy_stub._native,o_argument);
+ return;
+ }
+ }
+}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/INyIdMarkerData.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/INyIdMarkerData.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/INyIdMarkerData.as (revision 335)
@@ -0,0 +1,66 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class INyIdMarkerData extends AlchemyClassProxy
+ {
+ public function INyIdMarkerData(...args:Array)
+ {
+ switch(args.length){
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ { //Base Class
+ return;
+ }else if(args[0] is CONST_WRAPCLASS){
+ //function INyIdMarkerData(arg:CONST_WRAPCLASS)
+ //Empty Wrapper
+ return;
+ }
+ break;
+ default:
+ break;
+ }
+ throw new Error("INyIdMarkerData");
+ }
+ public function isEqual(i_target:INyIdMarkerData):Boolean
+ {
+ return this._alchemy_stub.isEqual(
+ this._alchemy_stub._native,
+ i_target._alchemy_stub._native);
+ }
+ public function copyFrom(i_source:INyIdMarkerData):void
+ {
+ this._alchemy_stub.copyFrom(
+ this._alchemy_stub._native,
+ i_source._alchemy_stub._native);
+ }
+ }
+}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/INyARColorPatt.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/INyARColorPatt.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/INyARColorPatt.as (revision 335)
@@ -0,0 +1,63 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class INyARColorPatt extends INyARRgbRaster
+ {
+ public function INyARColorPatt(...args:Array)
+ {
+ super(NyARToolkitAS3.BASECLASS);
+ switch(args.length){
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ {
+ //Base Class
+ return;
+ }else if(args[0] is CONST_WRAPCLASS){
+ //function INyARColorPatt(arg:CONST_WRAPCLASS)
+ //Empty Wrapper
+ return;
+ }
+ break;
+ default:
+ break;
+ }
+ throw new Error("INyARColorPatt");
+ }
+ public function pickFromRaster(i_raster:INyARRgbRaster,i_square:NyARSquare):Boolean
+ {
+ return this._alchemy_stub.pickFromRaster(
+ this._alchemy_stub._native,
+ i_raster._alchemy_stub._native,
+ i_square._alchemy_stub._native);
+ }
+ }
+}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARMatchPattDeviationColorData.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARMatchPattDeviationColorData.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/proxy/NyARMatchPattDeviationColorData.as (revision 335)
@@ -0,0 +1,74 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.proxy
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class NyARMatchPattDeviationColorData extends AlchemyClassProxy
+ {
+ /**
+ * function NyARIntSize()
+ * AlchemyObjectを所有するインスタンスを作成します。
+ * function NyARIntSize(arg:CONST_BASECLASS)
+ * 継承用コンストラクタです。
+ * function NyARIntSize(arg:CONST_WRAPCLASS)
+ * AlchemyObjectをラップするインスタンスを作成します。
+ */
+ public function NyARMatchPattDeviationColorData(...args:Array)
+ {
+ switch(args.length){
+ case 1:
+ if(args[0] is CONST_BASECLASS)
+ {
+ //Base Class
+ return;
+ }else if(args[0] is CONST_WRAPCLASS){
+ //function NyARMatchPattDeviationColorData(arg:CONST_WRAPCLASS)
+ //Empty Wrapper
+ return;
+ }
+ break;
+ case 2:
+ //function NyARMatchPattDeviationColorData(width:int,height:int)
+ this.attachAlchemyObject(
+ NyARToolkitAS3.cmodule.NyARMatchPattDeviationColorData_createInstance(int(args[0]),int(args[1]))
+ );
+ return;
+ default:
+ break;
+ }
+ throw new Error("NyARMatchPattDeviationColorData");
+ }
+ public function setRaster(i_raster:INyARRgbRaster):void
+ {
+ this._alchemy_stub.setRaster(this._alchemy_stub._native,i_raster._alchemy_stub._native);
+ return;
+ }
+ }
+}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/type/TNyARMatchPattResult.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/type/TNyARMatchPattResult.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/type/TNyARMatchPattResult.as (revision 335)
@@ -0,0 +1,38 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.type
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class TNyARMatchPattResult
+ {
+ public var direction:int;
+ public var confidence:Number;
+ }
+}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/type/TNyARIntSize.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/type/TNyARIntSize.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/type/TNyARIntSize.as (revision 335)
@@ -0,0 +1,38 @@
+/*
+ * PROJECT: NyARToolkitCPP Alchemy bind
+ * --------------------------------------------------------------------------------
+ * The NyARToolkitCPP Alchemy bind is stub/proxy classes for NyARToolkitCPP and Adobe Alchemy.
+ *
+ * Copyright (C)2009 Ryo Iizuka
+ *
+ * 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 framework; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For further information please contact.
+ * http://nyatla.jp/nyatoolkit/
+ * <airmail(at)ebony.plala.or.jp>
+ *
+ */
+package jp.nyatla.nyartoolkit.as3.type
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+
+ public class TNyARIntSize
+ {
+ public var w:int;
+ public var h:Number;
+ }
+}
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/SingleARMarkerProcesserAS.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/SingleARMarkerProcesserAS.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/SingleARMarkerProcesserAS.as (revision 335)
@@ -0,0 +1,371 @@
+package jp.nyatla.nyartoolkit.as3
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+ import jp.nyatla.nyartoolkit.as3.proxy.*;
+ import jp.nyatla.nyartoolkit.as3.type.*;
+
+ public class SingleARMarkerProcesserAS extends NyARBaseClassAS
+ {
+ private var _ma:Marshal=new Marshal();
+
+ /**オーナーが自由に使えるタグ変数です。
+ */
+ public var tag:Object;
+
+ private var _lost_delay_count:int = 0;
+
+ private var _lost_delay:int = 5;
+
+ private var _square_detect:INyARSquareDetector;
+
+ protected var _transmat:INyARTransMat;
+
+ private var _marker_width:Number;
+
+ private var _match_patt:Vector.<NyARMatchPatt_Color_WITHOUT_PCA>;
+
+ private var _square_list:NyARSquareStack = new NyARSquareStack(100);
+
+ private var _patt:INyARColorPatt = null;
+
+ private var _cf_threshold_new:Number = 0.30;
+ private var _cf_threshold_exist:Number = 0.15;
+
+ private var _threshold:int = 110;
+ // [AR]検出結果の保存用
+ private var _bin_raster:NyARBinRaster;
+
+ private var _tobin_filter:NyARRasterFilter_ARToolkitThreshold;
+
+ protected var _current_arcode_index:int = -1;
+
+ private var _deviation_data:NyARMatchPattDeviationColorData;
+ private var _threshold_detect:NyARRasterThresholdAnalyzer_SlidePTile;
+
+ public function SingleARMarkerProcesserAS()
+ {
+ return;
+ }
+
+ private function freeARCodeTable():void
+ {
+ //割当済のオブジェクトを削除
+ this._patt.dispose();
+ this._deviation_data.dispose();
+ if(this._match_patt!=null){
+ for(var i:int=0;i<this._match_patt.length;i++){
+ this._match_patt[i].dispose();
+ }
+ }
+ return;
+ }
+ public override function dispose():void
+ {
+ super.dispose();
+ //setARCodeTableで割り当てられたオブジェクトを開放
+ freeARCodeTable();
+ this._square_list.dispose();
+ if(this._initialized==true){
+ //initInstanceで割り当てたオブジェクトを開放
+ this._square_detect.dispose();
+ this._transmat.dispose();
+ this._bin_raster.dispose();
+ this._tobin_filter.dispose();
+ this._threshold_detect.dispose();
+ }
+ return;
+ }
+
+ private var _initialized:Boolean=false;
+
+ protected function initInstance(i_param:NyARParam,i_raster_type:int):void
+ {
+ //初期化済?
+
+ NyARToolkitAS3.Assert(this._initialized==false);
+
+ var scr_size:NyARIntSize = i_param.getScreenSize();
+ // 解析オブジェクトを作る
+ this._square_detect = new NyARSquareDetector_Rle(i_param.getDistortionFactor(), scr_size);
+ this._transmat = new NyARTransMat(i_param);
+ this._tobin_filter=new NyARRasterFilter_ARToolkitThreshold(110,i_raster_type);
+
+ //サイズの読み出し
+ scr_size.getValue(_ma);
+ _ma.prepareRead();
+ var size_w:int=_ma.readInt();
+ var size_h:int=_ma.readInt();
+
+
+ // 2値画像バッファを作る
+ this._bin_raster = new NyARBinRaster(size_w,size_h);
+ this._threshold_detect=new NyARRasterThresholdAnalyzer_SlidePTile(15,i_raster_type,4);
+ this._initialized=true;
+ return;
+ }
+
+ /*自動・手動の設定が出来ないので、コメントアウト
+ public void setThreshold(int i_threshold)
+ {
+ this._threshold = i_threshold;
+ return;
+ }*/
+
+ /**検出するマーカコードの配列を指定します。 検出状態でこの関数を実行すると、
+ * オブジェクト状態に強制リセットがかかります。
+ */
+ public function setARCodeTable(i_ref_code_table:Vector.<NyARCode>,i_code_resolution:int,i_marker_width:Number):void
+ {
+ if (this._current_arcode_index != -1) {
+ // 強制リセット
+ reset(true);
+ }
+ //検出するマーカセット、情報、検出器を作り直す。(1ピクセル4ポイントサンプリング,マーカのパターン領域は50%)
+ this._patt = new NyARColorPatt_Perspective_O2(i_code_resolution, i_code_resolution,4,25);
+ this._deviation_data=new NyARMatchPattDeviationColorData(i_code_resolution, i_code_resolution);
+ this._marker_width = i_marker_width;
+
+ this._match_patt = new Vector.<NyARMatchPatt_Color_WITHOUT_PCA>(i_ref_code_table.length);
+ for(var i:int=0;i<i_ref_code_table.length;i++){
+ this._match_patt[i]=new NyARMatchPatt_Color_WITHOUT_PCA(i_ref_code_table[i]);
+ }
+ return;
+ }
+
+ public function reset(i_is_force:Boolean):void
+ {
+ if (this._current_arcode_index != -1 && i_is_force == false) {
+ // 強制書き換えでなければイベントコール
+ this.onLeaveHandler();
+ }
+ // カレントマーカをリセット
+ this._current_arcode_index = -1;
+ return;
+ }
+
+ public function detectMarker(i_raster:INyARRgbRaster):void
+ {
+ // サイズチェック
+ //assert(this._bin_raster.getSize().isEqualSize(i_raster.getSize().w, i_raster.getSize().h));
+
+ // コードテーブルが無ければここで終わり
+ if (this._match_patt== null) {
+ return;
+ }
+
+ // ラスタを(1/4の画像の)2値イメージに変換する.
+ this._tobin_filter.setThreshold(this._threshold);
+ this._tobin_filter.doFilter(i_raster, this._bin_raster);
+
+ var square_stack:NyARSquareStack = this._square_list;
+ // スクエアコードを探す
+ this._square_detect.detectMarker(this._bin_raster, square_stack);
+ // 認識処理
+ if (this._current_arcode_index == -1) { // マーカ未認識
+ detectNewMarker(i_raster, square_stack);
+ } else { // マーカ認識中
+ detectExistMarker(i_raster, square_stack, this._current_arcode_index);
+ }
+ return;
+ }
+
+
+ private var __detectMarkerLite_mr:NyARMatchPattResult=new NyARMatchPattResult();
+
+ /**ARCodeのリストから、最も一致するコード番号を検索します。
+ */
+ private function selectARCodeIndexFromList(i_raster:INyARRgbRaster,i_square:NyARSquare,o_result:TResult_selectARCodeIndex):Boolean
+ {
+ // 現在コードテーブルはアクティブ?
+ if (this._match_patt==null) {
+ return false;
+ }
+ // 評価基準になるパターンをイメージから切り出す
+ if (!this._patt.pickFromRaster(i_raster, i_square)) {
+ return false;
+ }
+ //評価データを作成して、評価器にセット
+ this._deviation_data.setRaster(this._patt);
+ var mr:NyARMatchPattResult=this.__detectMarkerLite_mr;
+ var code_index:int = 0;
+ var dir:int = 0;
+ var c1:Number = 0;
+ // コードと比較する
+ var ma:Marshal=this._ma;
+ for (var i:int = 0; i < this._match_patt.length; i++) {
+ this._match_patt[i].evaluate(this._deviation_data,mr);
+
+ //mrから値を読み出し
+ mr.getValue(ma);
+ ma.prepareRead();
+ var mr_direction:int =ma.readInt();
+ var c2:Number = ma.readDouble();
+ if (c1 < c2) {
+ code_index = i;
+ c1 = c2;
+ dir = mr_direction;
+ }
+ }
+ o_result.code_index = code_index;
+ o_result.direction = dir;
+ o_result.confidence = c1;
+ return true;
+ }
+
+ private var __detect_X_Marker_detect_result:TResult_selectARCodeIndex = new TResult_selectARCodeIndex();
+
+ /**新規マーカ検索 現在認識中のマーカがないものとして、最も認識しやすいマーカを1個認識します。
+ */
+ private function detectNewMarker(i_raster:INyARRgbRaster,i_stack:NyARSquareStack):void
+ {
+ var number_of_square:int = i_stack.getLength();
+ var cf:Number = 0;
+ var dir:int = 0;
+ var code_index:int = -1;
+ var square_index:int = 0;
+ var detect_result:TResult_selectARCodeIndex = this.__detect_X_Marker_detect_result;
+ for (var i:int = 0; i < number_of_square; i++) {
+ if (!selectARCodeIndexFromList(i_raster, (i_stack.getItem(i)), detect_result)) {
+ // 見つからない。
+ return;
+ }
+ if (detect_result.confidence < this._cf_threshold_new) {
+ continue;
+ }
+ if (detect_result.confidence < cf) {
+ // 一致度が低い。
+ continue;
+ }
+ cf = detect_result.confidence;
+ code_index = detect_result.code_index;
+ square_index = i;
+ dir = detect_result.direction;
+ }
+ // 認識状態を更新
+ var is_id_found:Boolean=updateStatus(this._square_list.getItem(square_index), code_index, cf, dir);
+ //閾値フィードバック(detectExistMarkerにもあるよ)
+ if(!is_id_found){
+ //マーカがなければ、探索+DualPTailで基準輝度検索
+ this._threshold_detect.analyzeRaster(i_raster);
+ this._threshold=(this._threshold+this._threshold_detect.getThreshold())/2;
+ }
+ }
+
+ /**マーカの継続認識 現在認識中のマーカを優先して認識します。
+ * (注)この機能はたぶん今後いろいろ発展するからNewと混ぜないこと。
+ */
+ private function detectExistMarker(i_raster:INyARRgbRaster,i_stack:NyARSquareStack,i_current_id:int):void
+ {
+ var number_of_square:int = i_stack.getLength();
+ var cf:Number = 0;
+ var dir:int = 0;
+ var code_index:int = -1;
+ var square_index:int = 0;
+ var detect_result:TResult_selectARCodeIndex = this.__detect_X_Marker_detect_result;
+ for (var i:int = 0; i < number_of_square; i++) {
+ if (!selectARCodeIndexFromList(i_raster,i_stack.getItem(i), detect_result)) {
+ // 見つからない。
+ return;
+ }
+ // 現在のマーカを認識したか?
+ if (detect_result.code_index != i_current_id) {
+ // 認識中のマーカではないので無視
+ continue;
+ }
+ if (detect_result.confidence < this._cf_threshold_exist) {
+ continue;
+ }
+ if (detect_result.confidence < cf) {
+ // 一致度が高い方を選ぶ
+ continue;
+ }
+ cf = detect_result.confidence;
+ code_index = detect_result.code_index;
+ dir = detect_result.direction;
+ square_index = i;
+ }
+ // 認識状態を更新
+ var is_id_found:Boolean=updateStatus(this._square_list.getItem(square_index), code_index, cf, dir);
+ //閾値フィードバック(detectExistMarkerにもあるよ)
+ if(!is_id_found){
+ //マーカがなければ、探索+DualPTailで基準輝度検索
+ this._threshold_detect.analyzeRaster(i_raster);
+ this._threshold=(this._threshold+this._threshold_detect.getThreshold())/2;
+ }
+
+ }
+
+ private var __NyARSquare_result:NyARTransMatResult = new NyARTransMatResult();
+
+ /** オブジェクトのステータスを更新し、必要に応じてハンドル関数を駆動します。
+ * 戻り値は、「実際にマーカを発見する事ができたか」です。クラスの状態とは異なります。
+ */
+ private function updateStatus(i_square:NyARSquare,i_code_index:int,i_cf:Number,i_dir:int):Boolean
+ {
+ var result:NyARTransMatResult = this.__NyARSquare_result;
+ if (this._current_arcode_index < 0) {// 未認識中
+ if (i_code_index < 0) {// 未認識から未認識の遷移
+ // なにもしないよーん。
+ return false;
+ } else {// 未認識から認識の遷移
+ this._current_arcode_index = i_code_index;
+ // イベント生成
+ // OnEnter
+ this.onEnterHandler(i_code_index);
+ // 変換行列を作成
+ this._transmat.transMat(i_square, i_dir, this._marker_width, result);
+ // OnUpdate
+ this.onUpdateHandler(i_square, result);
+ this._lost_delay_count = 0;
+ return true;
+ }
+ } else {// 認識中
+ if (i_code_index < 0) {// 認識から未認識の遷移
+ this._lost_delay_count++;
+ if (this._lost_delay < this._lost_delay_count) {
+ // OnLeave
+ this._current_arcode_index = -1;
+ this.onLeaveHandler();
+ }
+ return false;
+ } else if (i_code_index == this._current_arcode_index) {// 同じARCodeの再認識
+ // イベント生成
+ // 変換行列を作成
+ this._transmat.transMat(i_square, i_dir, this._marker_width, result);
+ // OnUpdate
+ this.onUpdateHandler(i_square, result);
+ this._lost_delay_count = 0;
+ return true;
+ } else {// 異なるコードの認識→今はサポートしない。
+ throw new Error("updateStatus");
+ }
+ }
+ }
+
+ protected virtual function onEnterHandler(i_code:int):void
+ {
+ }
+
+ protected virtual function onLeaveHandler():void
+ {
+ }
+
+ protected virtual function onUpdateHandler(i_square:NyARSquare,result:NyARTransMatResult):void
+ {
+ }
+ }
+}
+
+/**selectARCodeIndexFromListが値を返す時に使う変数型です。
+ */
+
+class TResult_selectARCodeIndex
+{
+ public var direction:int;
+
+ public var confidence:Number;
+
+ public var code_index:int;
+}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/SingleNyIdMarkerProcesserAS.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/SingleNyIdMarkerProcesserAS.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/SingleNyIdMarkerProcesserAS.as (revision 335)
@@ -0,0 +1,291 @@
+package jp.nyatla.nyartoolkit.as3
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+ import jp.nyatla.nyartoolkit.as3.proxy.*;
+ import jp.nyatla.nyartoolkit.as3.type.*;
+
+
+
+public class SingleNyIdMarkerProcesserAS extends NyARBaseClassAS
+{
+ private var _ma:Marshal=new Marshal();
+ /**
+ * オーナーが自由に使えるタグ変数です。
+ */
+ public var tag:Object;
+ /**
+ * ロスト遅延の管理
+ */
+ private var _lost_delay_count:int = 0;
+ private var _lost_delay:int = 5;
+
+ private var _square_detect:NyARSquareDetector_Rle;
+ protected var _transmat:INyARTransMat;
+ private var _marker_width:Number=100;
+
+ private var _square_list:NyARSquareStack = new NyARSquareStack(100);
+ private var _encoder:INyIdMarkerDataEncoder;
+ private var _is_active:Boolean;
+ private var _data_temp:INyIdMarkerData;
+ private var _data_current:INyIdMarkerData;
+
+ private var _current_threshold:int=110;
+ // [AR]検出結果の保存用
+ private var _bin_raster:NyARBinRaster;
+
+ private var _tobin_filter:NyARRasterFilter_ARToolkitThreshold;
+
+ private var _id_pickup:NyIdMarkerPickup = new NyIdMarkerPickup();
+ private var _initialized:Boolean=false;
+
+ private var _threshold_detect:NyARRasterThresholdAnalyzer_SlidePTile;
+
+ private var _marker_data:NyIdMarkerPattern=new NyIdMarkerPattern();
+ private var _marker_param:NyIdMarkerParam=new NyIdMarkerParam();
+ private var __NyARSquare_result:NyARTransMatResult = new NyARTransMatResult();
+
+
+ public function SingleNyIdMarkerProcesserAS()
+ {
+ return;
+ }
+ public override function dispose():void
+ {
+ super.dispose();
+ this._square_list.dispose();
+ this._id_pickup.dispose();
+ this._marker_data.dispose();
+ this._marker_param.dispose();
+ this.__NyARSquare_result.dispose();
+
+ if(this._initialized==true){
+ this._square_detect.dispose();
+ this._transmat.dispose();
+ this._bin_raster.dispose();
+ this._data_temp.dispose();
+ this._data_current.dispose();
+ this._tobin_filter.dispose();
+ this._threshold_detect.dispose();
+ this._initialized=false;
+ }
+ return;
+ }
+ protected function initInstance(i_param:NyARParam,i_encoder:INyIdMarkerDataEncoder,i_raster_format:int):void
+ {
+ NyARToolkitAS3.Assert(this._initialized==false);
+
+ var scr_size:NyARIntSize = i_param.getScreenSize();
+ // 解析オブジェクトを作る
+ this._square_detect = new NyARSquareDetector_Rle(i_param.getDistortionFactor(), scr_size);
+ this._transmat = new NyARTransMat(i_param);
+ this._encoder=i_encoder;
+
+ //サイズの読み出し
+ scr_size.getValue(_ma);
+ _ma.prepareRead();
+ var size_w:int=_ma.readInt();
+ var size_h:int=_ma.readInt();
+
+ // 2値画像バッファを作る
+ this._bin_raster = new NyARBinRaster(size_w,size_h);
+ //ワーク用のデータオブジェクトを2個作る
+ this._is_active=false;
+ this._data_temp=i_encoder.createDataInstance();
+ this._data_current=i_encoder.createDataInstance();
+ this._tobin_filter = new NyARRasterFilter_ARToolkitThreshold(110,i_raster_format);
+ this._threshold_detect=new NyARRasterThresholdAnalyzer_SlidePTile(15,i_raster_format,4);
+ this._initialized=true;
+ return;
+
+ }
+
+ public function setMarkerWidth(i_width:int):void
+ {
+ this._marker_width=i_width;
+ return;
+ }
+
+ public function reset(i_is_force:Boolean):void
+ {
+ if (this._data_current!=null && i_is_force == false) {
+ // 強制書き換えでなければイベントコール
+ this.onLeaveHandler();
+ }
+ // カレントマーカをリセット
+ this._data_current = null;
+ return;
+ }
+
+ public function detectMarker(i_raster:INyARRgbRaster):void
+ {
+ // サイズチェック
+ //if (!this._bin_raster.getSize().isEqualSize(i_raster.getSize().w, i_raster.getSize().h)) {
+ // throw new NyARException();
+ //}
+ // ラスタを2値イメージに変換する.
+ this._tobin_filter.setThreshold(this._current_threshold);
+ this._tobin_filter.doFilter(i_raster, this._bin_raster);
+
+ var square_stack:NyARSquareStack = this._square_list;
+ // スクエアコードを探す
+ this._square_detect.detectMarker(this._bin_raster, square_stack);
+ // 認識処理
+ if (!this._is_active) {
+ // マーカ未認識→新規認識
+ detectNewMarker(i_raster, square_stack);
+ } else {
+ // マーカ認識依頼→継続認識
+ detectExistMarker(i_raster, square_stack);
+ }
+ return;
+ }
+
+
+
+ /**新規マーカ検索 現在認識中のマーカがないものとして、最も認識しやすいマーカを1個認識します。
+ */
+ private function detectNewMarker(i_raster:INyARRgbRaster,i_stack:NyARSquareStack):void
+ {
+ var param:NyIdMarkerParam=this._marker_param;
+ var patt_data:NyIdMarkerPattern=this._marker_data;
+ var number_of_square:int = i_stack.getLength();
+ var current_square:NyARSquare=null;
+ var marker_id:INyIdMarkerData=null;
+ for (var i:int = 0; i < number_of_square; i++) {
+ // 評価基準になるパターンをイメージから切り出す
+ current_square=i_stack.getItem(i);
+ if (!this._id_pickup.pickFromRaster(i_raster,current_square, patt_data, param)) {
+ continue;
+ }
+ //エンコード
+ if(!this._encoder.encode(patt_data,this._data_temp)){
+ continue;
+ }
+ //認識率が一番高いもの(占有面積が一番大きいもの)を選択する(省略)
+ //id認識が成功したら終了
+ marker_id=this._data_temp;
+ break;
+ }
+ param.getValue(_ma);
+ _ma.prepareRead();
+ var param_dir:int=_ma.readInt();
+ var param_th:int=_ma.readInt();
+
+ // 認識状態を更新
+ var is_id_found:Boolean=updateStatus(current_square,marker_id, param_dir);
+
+ //閾値フィードバック(detectExistMarkerにもあるよ)
+ if(is_id_found){
+ //マーカがあれば、マーカの周辺閾値を反映
+ this._current_threshold=(this._current_threshold+param_th)/2;
+ }else{
+ //マーカがなければ、探索+DualPTailで基準輝度検索
+ this._threshold_detect.analyzeRaster(i_raster);
+ this._current_threshold=(this._current_threshold+this._threshold_detect.getThreshold())/2;
+ }
+ return;
+ }
+
+ /**マーカの継続認識 現在認識中のマーカを優先して認識します。
+ * (注)この機能はたぶん今後いろいろ発展するからNewと混ぜないこと。
+ */
+ private function detectExistMarker(i_raster:INyARRgbRaster,i_stack:NyARSquareStack):void
+ {
+ var param:NyIdMarkerParam=this._marker_param;
+ var patt_data:NyIdMarkerPattern =this._marker_data;
+ var number_of_square:int = i_stack.getLength();
+ var current_square:NyARSquare=null;
+ var marker_id:INyIdMarkerData=null;
+ for (var i:int = 0; i < number_of_square; i++){
+ //idマーカを認識
+ current_square=i_stack.getItem(i);
+ if (!this._id_pickup.pickFromRaster(i_raster, current_square, patt_data, param)) {
+ continue;
+ }
+ if(!this._encoder.encode(patt_data,this._data_temp)){
+ continue;
+ }
+ //現在認識中のidか確認
+ if(!this._data_current.isEqual((this._data_temp))){
+ continue;
+ }
+ //現在認識中のものであれば、終了
+ marker_id=this._data_temp;
+ break;
+ }
+ param.getValue(_ma);
+ _ma.prepareRead();
+ var param_dir:int=_ma.readInt();
+ var param_th:int=_ma.readInt();
+
+ // 認識状態を更新
+ var is_id_found:Boolean=updateStatus(current_square,marker_id,param_dir);
+
+ //閾値フィードバック(detectExistMarkerにもあるよ)
+ if(is_id_found){
+ //マーカがあれば、マーカの周辺閾値を反映
+ this._current_threshold=(this._current_threshold+param_th)/2;
+ }else{
+ //マーカがなければ、探索+DualPTailで基準輝度検索
+ this._threshold_detect.analyzeRaster(i_raster);
+ this._current_threshold=(this._current_threshold+this._threshold_detect.getThreshold())/2;
+ }
+ return;
+ }
+
+
+ /**オブジェクトのステータスを更新し、必要に応じてハンドル関数を駆動します。
+ */
+ private function updateStatus(i_square:NyARSquare, i_marker_data:INyIdMarkerData,i_param_direction:int):Boolean
+ {
+ var is_id_found:Boolean=false;
+ var result:NyARTransMatResult = this.__NyARSquare_result;
+ if (!this._is_active) {// 未認識中
+ if (i_marker_data==null) {// 未認識から未認識の遷移
+ // なにもしないよーん。
+ this._is_active=false;
+ } else {// 未認識から認識の遷移
+
+ this._data_current.copyFrom(i_marker_data);
+
+ // イベント生成
+ // OnEnter
+ this.onEnterHandler(this._data_current);
+ // 変換行列を作成
+ this._transmat.transMat(i_square,i_param_direction, this._marker_width, result);
+ // OnUpdate
+ this.onUpdateHandler(i_square, result);
+ this._lost_delay_count = 0;
+ this._is_active=true;
+ is_id_found=true;
+ }
+ } else {// 認識中
+ if (i_marker_data==null) {
+ // 認識から未認識の遷移
+ this._lost_delay_count++;
+ if (this._lost_delay < this._lost_delay_count) {
+ // OnLeave
+ this.onLeaveHandler();
+ this._is_active=false;
+ }
+ } else if(this._data_current.isEqual(i_marker_data)) {
+ //同じidの再認識
+ this._transmat.transMat(i_square, i_param_direction, this._marker_width, result);
+ // OnUpdate
+ this.onUpdateHandler(i_square, result);
+ this._lost_delay_count = 0;
+ is_id_found=true;
+ } else {// 異なるコードの認識→今はサポートしない。
+ throw new Error("updateStatus");
+ }
+ }
+ return is_id_found;
+ }
+ //通知ハンドラ
+ protected virtual function onEnterHandler(i_code:INyIdMarkerData):void{};
+ protected virtual function onLeaveHandler():void{};
+ protected virtual function onUpdateHandler(i_square:NyARSquare,result:NyARTransMatResult):void{};
+}
+}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARCustomSingleDetectMarkerAS.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARCustomSingleDetectMarkerAS.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARCustomSingleDetectMarkerAS.as (revision 335)
@@ -0,0 +1,228 @@
+package jp.nyatla.nyartoolkit.as3
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+ import jp.nyatla.nyartoolkit.as3.proxy.*;
+ import jp.nyatla.nyartoolkit.as3.type.*;
+
+ /**
+ * 画像からARCodeに最も一致するマーカーを1個検出し、その変換行列を計算するクラスです。
+ * 変換行列を求めるには、detectMarkerLite関数にラスタイメージを入力して、計算対象の矩形を特定します。
+ * detectMarkerLiteが成功すると、getTransmationMatrix等の関数が使用可能な状態になり、変換行列を求めることができます。
+ *
+ *
+ */
+ public class NyARCustomSingleDetectMarkerAS extends NyARBaseClassAS
+ {
+ private var _ma:Marshal=new Marshal();
+ private static const AR_SQUARE_MAX:int=100;
+ private var _is_continue:Boolean=false;
+ private var _match_patt:NyARMatchPatt_Color_WITHOUT_PCA;
+ private var _square_detect:INyARSquareDetector;
+ private var _square_list:NyARSquareStack = new NyARSquareStack(AR_SQUARE_MAX);
+
+ protected var _transmat:INyARTransMat;
+ private var _marker_width:Number;
+ // 検出結果の保存用
+ private var _detected_direction:int;
+ private var _detected_confidence:Number;
+ private var _detected_square:NyARSquare;
+ public var _patt:INyARColorPatt;
+ //画処理用
+ private var _bin_raster:NyARBinRaster;
+ protected var _tobin_filter:INyARRasterFilter_RgbToBin;
+ private var _deviation_data:NyARMatchPattDeviationColorData;
+
+ public override function dispose():void
+ {
+ super.dispose();
+ this._square_list.dispose();
+ this._bin_raster.dispose();
+ this._match_patt.dispose();
+ this._deviation_data.dispose();
+ this._transmat.dispose();
+ this._patt.dispose();
+ this._square_detect.dispose();
+ return;
+ }
+ public function NyARCustomSingleDetectMarkerAS()
+ {
+ return;
+ }
+ protected virtual function initInstance(...args:Array):void
+ {
+ var i_patt_inst:INyARColorPatt =args[0];
+ var i_sqdetect_inst:INyARSquareDetector =args[1];
+ var i_transmat_inst:INyARTransMat =args[2];
+ var i_filter:INyARRasterFilter_RgbToBin =args[3];
+ var i_ref_param:NyARParam =args[4];
+ var i_ref_code:NyARCode =args[5];
+ var i_marker_width:Number =args[6];
+ //
+ var scr_size:NyARIntSize=i_ref_param.getScreenSize();
+ //サイズの読み出し
+ scr_size.getValue(_ma);
+ _ma.prepareRead();
+ var w:int=_ma.readInt();
+ var h:int=_ma.readInt();
+
+ // 解析オブジェクトを作る
+ this._square_detect = i_sqdetect_inst;
+ this._transmat = i_transmat_inst;
+ this._tobin_filter=i_filter;
+ // 比較コードを保存
+ this._marker_width = i_marker_width;
+ //パターンピックアップを作成
+ this._patt = i_patt_inst;
+ //取得パターンの差分データ器を作成
+ this._deviation_data=new NyARMatchPattDeviationColorData(i_ref_code.getWidth(),i_ref_code.getHeight());
+ //i_code用の評価器を作成
+ this._match_patt = new NyARMatchPatt_Color_WITHOUT_PCA(i_ref_code);
+ //2値画像バッファを作る
+ this._bin_raster=new NyARBinRaster(w,h);
+
+ return;
+
+ }
+
+ private var __detectMarkerLite_mr:NyARMatchPattResult=new NyARMatchPattResult();
+
+ /**
+ * i_imageにマーカー検出処理を実行し、結果を記録します。
+ *
+ * @param i_raster
+ * マーカーを検出するイメージを指定します。イメージサイズは、カメラパラメータ
+ * と一致していなければなりません。
+ * @return マーカーが検出できたかを真偽値で返します。
+ * @throws NyARException
+ */
+ public virtual function detectMarkerLite(...args:Array):Boolean
+ {
+ //argument
+ var i_raster:INyARRgbRaster=args[0];
+
+// //サイズチェック 
+// if(!this._bin_raster.getSize().isEqualSize(i_raster.getSize())){
+// throw new NyARException();
+// }
+//
+ //ラスタを2値イメージに変換する.
+ this._tobin_filter.doFilter(i_raster,this._bin_raster);
+
+
+
+ this._detected_square = null;
+ var l_square_list:NyARSquareStack = this._square_list;
+ // スクエアコードを探す
+ this._square_detect.detectMarker(this._bin_raster, l_square_list);
+
+
+ var number_of_square:int = l_square_list.getLength();
+ // コードは見つかった?
+ if (number_of_square < 1) {
+ return false;
+ }
+
+ var result:Boolean=false;
+ var mr:NyARMatchPattResult=this.__detectMarkerLite_mr;
+ var square_index:int = 0;
+ var direction:int = NyARSquare.DIRECTION_UNKNOWN;
+ var confidence:Number = 0;
+
+ for(var i:int=0;i<number_of_square;i++){
+ // 評価基準になるパターンをイメージから切り出す
+ if (!this._patt.pickFromRaster(i_raster, l_square_list.getItem(i))){
+ continue;
+ }
+ //取得パターンをカラー差分データに変換して評価する。
+ this._deviation_data.setRaster(this._patt);
+ if(!this._match_patt.evaluate(this._deviation_data,mr)){
+ continue;
+ }
+ //mrから値を読み出し
+ var ma:Marshal=this._ma;
+ mr.getValue(ma);
+
+ ma.prepareRead();
+ var mr_direction:int =ma.readInt(); //direction [0]
+ var c2:Number =ma.readDouble(); //confidence[1]
+
+ if (confidence > c2) {
+ continue;
+ }
+ // もっと一致するマーカーがあったぽい
+ square_index = i;
+ direction = mr_direction;
+ confidence = c2;
+ result=true;
+ }
+
+ // マーカー情報を保存
+ this._detected_square = l_square_list.getItem(square_index);
+ this._detected_direction = direction;
+ this._detected_confidence = confidence;
+
+ return result;
+ }
+
+ /**
+ * 検出したマーカーの変換行列を計算して、o_resultへ値を返します。
+ * 直前に実行したdetectMarkerLiteが成功していないと使えません。
+ *
+ * @param o_result
+ * 変換行列を受け取るオブジェクトを指定します。
+ * @throws NyARException
+ */
+ public function getTransformMatrix(o_result:NyARTransMatResult):void
+ {
+ // 一番一致したマーカーの位置とかその辺を計算
+ if (this._is_continue) {
+ this._transmat.transMatContinue(this._detected_square,this._detected_direction,this._marker_width, o_result);
+ } else {
+ this._transmat.transMat(this._detected_square,this._detected_direction,this._marker_width, o_result);
+ }
+ return;
+ }
+ /**
+ * 検出したマーカー情報を格納した、NyARSquareオブジェクトを返します。
+ * 直前に実行したdetectMarkerLiteが成功していないと使えません。
+ */
+ public function getDetectSquare():NyARSquare
+ {
+ return this._detected_square;
+ }
+
+ /**
+ * 検出したマーカーの一致度を返します。
+ *
+ * @return マーカーの一致度を返します。0~1までの値をとります。 一致度が低い場合には、誤認識の可能性が高くなります。
+ * @throws NyARException
+ */
+ public function getConfidence():Number
+ {
+ return this._detected_confidence;
+ }
+
+ /**
+ * 検出したマーカーの方位を返します。
+ *
+ * @return 0,1,2,3の何れかを返します。
+ */
+ public function getDirection():int
+ {
+ return this._detected_direction;
+ }
+
+ /**
+ * getTransmationMatrixの計算モードを設定します。 初期値はTRUEです。
+ *
+ * @param i_is_continue
+ * TRUEなら、transMatCont互換の計算をします。 FALSEなら、transMat互換の計算をします。
+ */
+ public function setContinueMode(i_is_continue:Boolean):void
+ {
+ this._is_continue = i_is_continue;
+ }
+}
+};
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARDetectMarkerAS.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARDetectMarkerAS.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARDetectMarkerAS.as (revision 335)
@@ -0,0 +1,311 @@
+package jp.nyatla.nyartoolkit.as3
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+ import jp.nyatla.nyartoolkit.as3.proxy.*;
+ import jp.nyatla.nyartoolkit.as3.type.*;
+
+
+ /**
+ * 複数のマーカーを検出し、それぞれに最も一致するARコードを、コンストラクタで登録したARコードから 探すクラスです。最大300個を認識しますが、ゴミラベルを認識したりするので100個程度が限界です。
+ *
+ */
+ public class NyARDetectMarkerAS extends NyARBaseClassAS
+ {
+ private var _ma:Marshal=new Marshal();
+
+ private static const AR_SQUARE_MAX:int = 300;
+
+ private var _is_continue:Boolean = false;
+
+ private var _match_patt:Vector.<NyARMatchPatt_Color_WITHOUT_PCA>;
+
+ private var _square_detect:INyARSquareDetector;
+
+ private var _square_list:NyARSquareStack = new NyARSquareStack(AR_SQUARE_MAX);
+
+ protected var _transmat:INyARTransMat;
+
+ private var _marker_width:Vector.<Number>;
+
+ // 検出結果の保存用
+ private var _patt:INyARColorPatt;
+
+ private var _result_holder:NyARDetectMarkerResultHolder = new NyARDetectMarkerResultHolder();
+ private var _deviation_data:NyARMatchPattDeviationColorData;
+ /**
+ * 複数のマーカーを検出し、最も一致するARCodeをi_codeから検索するオブジェクトを作ります。
+ *
+ * @param i_param
+ * カメラパラメータを指定します。
+ * @param i_code
+ * 検出するマーカーのARCode配列を指定します。
+ * 配列要素のインデックス番号が、そのままgetARCodeIndex関数で得られるARCodeインデックスになります。
+ * 例えば、要素[1]のARCodeに一致したマーカーである場合は、getARCodeIndexは1を返します。
+ * @param i_marker_width
+ * i_codeのマーカーサイズをミリメートルで指定した配列を指定します。 先頭からi_number_of_code個の要素には、有効な値を指定する必要があります。
+ * @param i_number_of_code
+ * i_codeに含まれる、ARCodeの数を指定します。
+ * @param i_input_raster_type
+ * 入力ラスタのピクセルタイプを指定します。この値は、INyARBufferReaderインタフェイスのgetBufferTypeの戻り値を指定します。
+ * @throws NyARException
+ */
+ public function NyARDetectMarkerAS(i_param:NyARParam,i_code:Vector.<NyARCode>,i_marker_width:Vector.<Number>, i_number_of_code:int,i_input_raster_type:int)
+ {
+ initInstance(i_param,i_code,i_marker_width,i_number_of_code,i_input_raster_type);
+ return;
+ }
+
+ public override function dispose():void
+ {
+ super.dispose();
+ this._square_list.dispose();
+ this._transmat.dispose();
+ for(var i:int=0;i<this._match_patt.length;i++){
+ this._match_patt[i].dispose();
+ }
+ this._patt.dispose();
+ this._square_detect.dispose();
+ this._tobin_filter.dispose();
+ this._deviation_data.dispose();
+ this._bin_raster.dispose();
+ return;
+ }
+
+ protected function initInstance(
+ i_ref_param:NyARParam,
+ i_ref_code:Vector.<NyARCode>,
+ i_marker_width:Vector.<Number>,
+ i_number_of_code:int,
+ i_input_raster_type:int):void
+ {
+
+ var scr_size:NyARIntSize=i_ref_param.getScreenSize();
+ // 解析オブジェクトを作る
+
+ this._transmat = new NyARTransMat(i_ref_param);
+ //各コード用の比較器を作る。
+ this._match_patt=new Vector.<NyARMatchPatt_Color_WITHOUT_PCA>(i_number_of_code);
+ var cw:int = i_ref_code[0].getWidth();
+ var ch:int = i_ref_code[0].getHeight();
+ this._match_patt[0]=new NyARMatchPatt_Color_WITHOUT_PCA(i_ref_code[0]);
+ for (var i:int = 1; i < i_number_of_code; i++){
+ //解像度チェック
+ if (cw != i_ref_code[i].getWidth() || ch != i_ref_code[i].getHeight()) {
+ throw new Error("NyARDetectMarker");
+ }
+ this._match_patt[i]=new NyARMatchPatt_Color_WITHOUT_PCA(i_ref_code[i]);
+ }
+ //NyARToolkitプロファイル
+ this._patt =new NyARColorPatt_Perspective_O2(cw, ch,4,25);
+ this._square_detect =new NyARSquareDetector_Rle(i_ref_param.getDistortionFactor(),i_ref_param.getScreenSize());
+ this._tobin_filter=new NyARRasterFilter_ARToolkitThreshold(100,i_input_raster_type);
+
+ //実サイズ保存
+ this._marker_width = i_marker_width;
+ //差分データインスタンスの作成
+ this._deviation_data=new NyARMatchPattDeviationColorData(cw,ch);
+
+ //サイズの読み出し
+ scr_size.getValue(_ma);
+ _ma.prepareRead();
+ var scr_size_w:int=_ma.readInt();
+ var scr_size_h:int=_ma.readInt();
+ //2値画像バッファを作る
+ this._bin_raster=new NyARBinRaster(scr_size_w,scr_size_h);
+ return;
+ }
+
+ private var _bin_raster:NyARBinRaster;
+
+ private var _tobin_filter:INyARRasterFilter_RgbToBin;
+ private var __detectMarkerLite_mr:NyARMatchPattResult=new NyARMatchPattResult();
+
+ /**
+ * i_imageにマーカー検出処理を実行し、結果を記録します。
+ *
+ * @param i_raster
+ * マーカーを検出するイメージを指定します。
+ * @param i_thresh
+ * 検出閾値を指定します。0~255の範囲で指定してください。 通常は100~130くらいを指定します。
+ * @return 見つかったマーカーの数を返します。 マーカーが見つからない場合は0を返します。
+ * @throws NyARException
+ */
+ public function detectMarkerLite(i_raster:INyARRgbRaster,i_threshold:int):int
+ {
+ // サイズチェック
+ //if (!this._bin_raster.getSize().isEqualSize(i_raster.getSize())) {
+ // throw new NyARException();
+ //}
+
+ // ラスタを2値イメージに変換する.
+ ((NyARRasterFilter_ARToolkitThreshold)(this._tobin_filter)).setThreshold(i_threshold);
+ this._tobin_filter.doFilter(i_raster, this._bin_raster);
+
+ var l_square_list:NyARSquareStack = this._square_list;
+ // スクエアコードを探す
+ this._square_detect.detectMarker(this._bin_raster, l_square_list);
+
+ var number_of_square:int = l_square_list.getLength();
+ // コードは見つかった?
+ if (number_of_square < 1) {
+ // ないや。おしまい。
+ return 0;
+ }
+ // 保持リストのサイズを調整
+ this._result_holder.reservHolder(number_of_square);
+ var mr:NyARMatchPattResult=this.__detectMarkerLite_mr;
+
+ // 1スクエア毎に、一致するコードを決定していく
+ for (var i:int = 0; i < number_of_square; i++) {
+ var square:NyARSquare = (l_square_list.getItem(i));
+
+ // 評価基準になるパターンをイメージから切り出す
+ if (!this._patt.pickFromRaster(i_raster, square)) {
+ // イメージの切り出しは失敗することもある。
+ continue;
+ }
+ //取得パターンをカラー差分データに変換する。
+ this._deviation_data.setRaster(this._patt);
+ var square_index:int = 0;
+ var direction:int = NyARSquare.DIRECTION_UNKNOWN;
+ var confidence:Number = 0;
+ for(var i2:int=0;i2<this._match_patt.length;i2++){
+ this._match_patt[i2].evaluate(this._deviation_data,mr);
+
+ //mrから値を読み出し
+ var ma:Marshal=this._ma;
+ mr.getValue(ma);
+
+ ma.prepareRead();
+ var mr_direction:int =ma.readInt(); //direction [0]
+ var c2:Number =ma.readDouble(); //confidence[1]
+
+ if (confidence > c2) {
+ continue;
+ }
+ // もっと一致するマーカーがあったぽい
+ square_index = i2;
+ direction = mr_direction;
+ confidence = c2;
+ }
+ // i番目のパターン情報を記録する。
+ var result:NyARDetectMarkerResult = this._result_holder.result_array[i];
+ result.arcode_id = square_index;
+ result.confidence = confidence;
+ result.direction = direction;
+ result.ref_square = square;
+ }
+ return number_of_square;
+ }
+
+ /**
+ * i_indexのマーカーに対する変換行列を計算し、結果値をo_resultへ格納します。 直前に実行したdetectMarkerLiteが成功していないと使えません。
+ *
+ * @param i_index
+ * マーカーのインデックス番号を指定します。 直前に実行したdetectMarkerLiteの戻り値未満かつ0以上である必要があります。
+ * @param o_result
+ * 結果値を受け取るオブジェクトを指定してください。
+ * @throws NyARException
+ */
+ public function getTransformMatrix(i_index:int,o_result:NyARTransMatResult):void
+ {
+ var result:NyARDetectMarkerResult = this._result_holder.result_array[i_index];
+ // 一番一致したマーカーの位置とかその辺を計算
+ if (_is_continue) {
+ _transmat.transMatContinue(result.ref_square, result.direction, _marker_width[result.arcode_id], o_result);
+ } else {
+ _transmat.transMat(result.ref_square, result.direction, _marker_width[result.arcode_id], o_result);
+ }
+ return;
+ }
+
+ /**
+ * i_indexのマーカーの一致度を返します。
+ *
+ * @param i_index
+ * マーカーのインデックス番号を指定します。 直前に実行したdetectMarkerLiteの戻り値未満かつ0以上である必要があります。
+ * @return マーカーの一致度を返します。0~1までの値をとります。 一致度が低い場合には、誤認識の可能性が高くなります。
+ * @throws NyARException
+ */
+ public function getConfidence(i_index:int):Number
+ {
+ return this._result_holder.result_array[i_index].confidence;
+ }
+
+ /**
+ * i_indexのマーカーの方位を返します。
+ *
+ * @param i_index
+ * マーカーのインデックス番号を指定します。 直前に実行したdetectMarkerLiteの戻り値未満かつ0以上である必要があります。
+ * @return 0,1,2,3の何れかを返します。
+ */
+ public function getDirection(i_index:int):int
+ {
+ return this._result_holder.result_array[i_index].direction;
+ }
+
+ /**
+ * i_indexのマーカーのARCodeインデックスを返します。
+ *
+ * @param i_index
+ * マーカーのインデックス番号を指定します。 直前に実行したdetectMarkerLiteの戻り値未満かつ0以上である必要があります。
+ * @return
+ */
+ public function getARCodeIndex(i_index:int):int
+ {
+ return this._result_holder.result_array[i_index].arcode_id;
+ }
+
+ /**
+ * getTransmationMatrixの計算モードを設定します。
+ *
+ * @param i_is_continue
+ * TRUEなら、transMatContinueを使用します。 FALSEなら、transMatを使用します。
+ */
+ public function setContinueMode(i_is_continue:Boolean):void
+ {
+ this._is_continue = i_is_continue;
+ }
+
+ }
+}
+
+import jp.nyatla.alchemymaster.*;
+import flash.utils.ByteArray;
+import jp.nyatla.as3utils.*;
+import jp.nyatla.nyartoolkit.as3.proxy.*;
+import jp.nyatla.nyartoolkit.as3.type.*;
+
+class NyARDetectMarkerResult
+{
+ public var arcode_id:int;
+
+ public var direction:int;
+
+ public var confidence:Number;
+
+ public var ref_square:NyARSquare;
+}
+
+class NyARDetectMarkerResultHolder
+{
+ public var result_array:Vector.<NyARDetectMarkerResult> = new Vector.<NyARDetectMarkerResult>();
+
+ /**
+ * result_holderを最大i_reserve_size個の要素を格納できるように予約します。
+ *
+ * @param i_reserve_size
+ */
+ public function reservHolder(i_reserve_size:int):void
+ {
+ if (i_reserve_size >= result_array.length) {
+ var new_size:int = i_reserve_size + 5;
+ this.result_array= new Vector.<NyARDetectMarkerResult>(new_size);
+ for (var i:int = 0; i < new_size; i++) {
+ result_array[i] = new NyARDetectMarkerResult();
+ }
+ }
+ }
+}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARSingleDetectMarkerAS.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARSingleDetectMarkerAS.as (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/src/as3/jp/nyatla/nyartoolkit/as3/NyARSingleDetectMarkerAS.as (revision 335)
@@ -0,0 +1,106 @@
+package jp.nyatla.nyartoolkit.as3
+{
+ import jp.nyatla.alchemymaster.*;
+ import flash.utils.ByteArray;
+ import jp.nyatla.as3utils.*;
+ import jp.nyatla.nyartoolkit.as3.proxy.*;
+ import jp.nyatla.nyartoolkit.as3.type.*;
+
+ /**
+ * 画像からARCodeに最も一致するマーカーを1個検出し、その変換行列を計算するクラスです。
+ * 変換行列を求めるには、detectMarkerLite関数にラスタイメージを入力して、計算対象の矩形を特定します。
+ * detectMarkerLiteが成功すると、getTransmationMatrix等の関数が使用可能な状態になり、変換行列を求めることができます。
+ *
+ *
+ */
+public class NyARSingleDetectMarkerAS extends NyARCustomSingleDetectMarkerAS
+{
+ public static const PF_ARTOOLKIT_COMPATIBLE:int=1;
+ public static const PF_NYARTOOLKIT:int=2;
+ public static const PF_NYARTOOLKIT_ARTOOLKIT_FITTING:int=100;
+ public static const PF_TEST2:int=201;
+
+ private var _threshold:NyARRasterFilter_ARToolkitThreshold;
+
+ /**
+ * 検出するARCodeとカメラパラメータから、1個のARCodeを検出するNyARSingleDetectMarkerインスタンスを作ります。
+ *
+ * @param i_param
+ * カメラパラメータを指定します。
+ * @param i_code
+ * 検出するARCodeを指定します。
+ * @param i_marker_width
+ * ARコードの物理サイズを、ミリメートルで指定します。
+ * @param i_input_raster_type
+ * 入力ラスタのピクセルタイプを指定します。この値は、INyARBufferReaderインタフェイスのgetBufferTypeの戻り値を指定します。
+ * @throws NyARException
+ */
+ public function NyARSingleDetectMarkerAS(i_param:NyARParam,i_code:NyARCode,i_marker_width:Number,i_input_raster_type:int)
+ {
+ super();
+ initInstance(i_param,i_code,i_marker_width,i_input_raster_type,PF_NYARTOOLKIT);
+ return;
+ }
+ /**
+ * コンストラクタから呼び出す関数です。
+ * @param i_ref_param
+ * @param i_ref_code
+ * @param i_marker_width
+ * @param i_input_raster_type
+ * @param i_profile_id
+ * @throws NyARException
+ */
+ protected override function initInstance(
+ ...args:Array):void
+ {
+ var i_ref_param:NyARParam =args[0];
+ var i_ref_code:NyARCode =args[1];
+ var i_marker_width:Number =args[2];
+ var i_input_raster_type:int=args[3];
+ var i_profile_id:int =args[4];
+ //
+ this._threshold=new NyARRasterFilter_ARToolkitThreshold(100,i_input_raster_type);
+ var patt_inst:INyARColorPatt;
+ var sqdetect_inst:INyARSquareDetector;
+ var transmat_inst:INyARTransMat;
+
+ switch(i_profile_id){
+ case PF_NYARTOOLKIT://default
+ patt_inst=new NyARColorPatt_Perspective_O2(i_ref_code.getWidth(), i_ref_code.getHeight(),4,25);
+ sqdetect_inst=new NyARSquareDetector_Rle(i_ref_param.getDistortionFactor(),i_ref_param.getScreenSize());
+ transmat_inst=new NyARTransMat(i_ref_param);
+ break;
+ default:
+ throw new Error("NyARSingleDetectMarker::initInstance");
+ }
+ super.initInstance(patt_inst,sqdetect_inst,transmat_inst,this._threshold,i_ref_param,i_ref_code,i_marker_width);
+ }
+
+ public override function dispose():void
+ {
+ super.dispose();
+ this._threshold.dispose();
+ return;
+ }
+
+ /**
+ * i_imageにマーカー検出処理を実行し、結果を記録します。
+ *
+ * @param i_raster
+ * マーカーを検出するイメージを指定します。イメージサイズは、コンストラクタで指定i_paramの
+ * スクリーンサイズと一致し、かつi_input_raster_typeに指定した形式でなければいけません。
+ * @return マーカーが検出できたかを真偽値で返します。
+ * @throws NyARException
+ */
+ public override function detectMarkerLite(...args:Array):Boolean
+ {
+ var i_raster:INyARRgbRaster=args[0];
+ var i_threshold:int=args[1];
+ //
+ this._threshold.setThreshold(i_threshold);
+ return super.detectMarkerLite(i_raster);
+ }
+}
+
+
+};
\ No newline at end of file
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/makefile
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/makefile (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/makefile (revision 335)
@@ -39,12 +39,13 @@


OBJ_SWC=$(OBJ_ALC) $(OBJ_NYA_CORE) $(OBJ_NYA_CORE2) $(OBJ_NYA_UTILS) $(OBJ_NYA_PROC) $(OBJ_NYA_IDMK)
+OBJ_LIB=$(OBJ_NYA_CORE) $(OBJ_NYA_CORE2) $(OBJ_NYA_UTILS) $(OBJ_NYA_PROC) $(OBJ_NYA_IDMK)
#command




-all:rawtest.swf idtest.swf
+all:rawtest.swf
obj:$(OBJ_SWC)
swc:lib/$(NAME_TARGET_SWC).swc

@@ -52,6 +53,7 @@
clean:
cd obj/alc;rm -f *.o
cd obj/nya;rm -f *.o
+ cd obj/sample;rm -f *.o
cd lib;rm -f *.swc


@@ -63,30 +65,42 @@
rawtest.swf:lib/$(NAME_TARGET_SWC).swc
mxmlc -library-path+=lib/$(NAME_TARGET_SWC).swc $(addprefix -source-path+=,$(AS3_INC)) --target-player=10.0.0 sample/rawtest.as

-idtest.swf:lib/$(NAME_TARGET_SWC).swc
- mxmlc -library-path+=lib/$(NAME_TARGET_SWC).swc $(addprefix -source-path+=,$(AS3_INC)) --target-player=10.0.0 sample/idtest.as


+#LLVM-exe
+debug.exe:$(OBJ_LIB) obj/sample/rawtest.o
+ $(ALC_ON);cd sample;g++ -O2 $(addprefix ../,$^) $(CFLAGS) -o $(notdir $@);cd ..;$(ALC_OFF)


+
+
+
lib/$(NAME_TARGET_SWC).swc:$(OBJ_SWC)
- $(ALC_ON);cd lib;g++ -swc -O3 $(addprefix ../,$^) -o $(notdir $@);cd ..;$(ALC_OFF)
+ $(ALC_ON);cd lib;g++ -swc -O2 $(addprefix ../,$^) -o $(notdir $@);cd ..;$(ALC_OFF)


+
+
obj/nya/%.o:src/c/%.cpp
- $(ALC_ON);g++ -O3 $(addprefix -I,$(NYA_INC) $(ALC_INC)) $(CFLAGS) -c $< -o $@ ;$(ALC_OFF)
+ $(ALC_ON);g++ -O2 $(addprefix -I,$(NYA_INC) $(ALC_INC)) $(CFLAGS) -c $< -o $@ ;$(ALC_OFF)

obj/alc/%.o:../../src/core/%.cpp
- $(ALC_ON);g++ -O3 $(addprefix -I,$(NYA_INC)) $(CFLAGS) -c $< -o $@ ;$(ALC_OFF)
+ $(ALC_ON);g++ -O2 $(addprefix -I,$(NYA_INC)) $(CFLAGS) -c $< -o $@ ;$(ALC_OFF)

obj/alc/%.o:../../src/utils/%.cpp
- $(ALC_ON);g++ -O3 $(addprefix -I,$(NYA_INC)) $(CFLAGS) -c $< -o $@ ;$(ALC_OFF)
+ $(ALC_ON);g++ -O2 $(addprefix -I,$(NYA_INC)) $(CFLAGS) -c $< -o $@ ;$(ALC_OFF)

obj/alc/%.o:../../src/core2/%.cpp
- $(ALC_ON);g++ -O3 $(addprefix -I,$(NYA_INC)) $(CFLAGS) -c $< -o $@ ;$(ALC_OFF)
+ $(ALC_ON);g++ -O2 $(addprefix -I,$(NYA_INC)) $(CFLAGS) -c $< -o $@ ;$(ALC_OFF)

obj/alc/%.o:../../src/processor/%.cpp
- $(ALC_ON);g++ -O3 $(addprefix -I,$(NYA_INC)) $(CFLAGS) -c $< -o $@ ;$(ALC_OFF)
+ $(ALC_ON);g++ -O2 $(addprefix -I,$(NYA_INC)) $(CFLAGS) -c $< -o $@ ;$(ALC_OFF)

obj/alc/%.o:../../src/nyidmarker/%.cpp
- $(ALC_ON);g++ -O3 $(addprefix -I,$(NYA_INC)) $(CFLAGS) -c $< -o $@ ;$(ALC_OFF)
\ No newline at end of file
+ $(ALC_ON);g++ -O2 $(addprefix -I,$(NYA_INC)) $(CFLAGS) -c $< -o $@ ;$(ALC_OFF)
+
+obj/sample/%.o:sample/%.cpp
+ $(ALC_ON);g++ -O2 $(addprefix -I,$(NYA_INC)) $(CFLAGS) -c $< -o $@ ;$(ALC_OFF)
+
+
+
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/how_to_compile.ja.txt
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/how_to_compile.ja.txt (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/NyARToolkitAS3/how_to_compile.ja.txt (revision 335)
@@ -31,7 +31,17 @@



+*alchemyのバグ修正

+Alchemyのatan2にはバグがあるので、修正します。
+http://forums.adobe.com/message/2353764#2353764
+ここの2番目のコメントに、方法が書いてあります。
+
+
+コンパイル済みのbcについては、NyARToolKitのページでも公開予定です。
+
+
+
*コンパイル

1.ディレクトリに移動してください。
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/AlchemyMaster/c/alchemymaster.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/AlchemyMaster/c/alchemymaster.h (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/AlchemyMaster/c/alchemymaster.h (revision 335)
@@ -28,7 +28,10 @@
#include <assert.h>
#include "AS3.h"

+class AS3ValUtils
+{

+};

// AS3オブジェクトを作成するヘルパークラス
class AS3ObjectBuilder
@@ -60,120 +63,135 @@
AS3_Release(as3val);
return;
}
-
+ /**
+ * 追加すると、所有権ごと移動することに注意してね
+ */
+ void addAS3Val(const char* i_name,AS3_Val i_as3val)
+ {
+ AS3_SetS(this->m_target,i_name,i_as3val);
+ AS3_Release(i_as3val);
+ return;
+ }
+ void addInteger(const char* i_name,int i_integer)
+ {
+ setMember_Integer(this->m_target,i_name,i_integer);
+ return;
+ }
+ public:
+ static void setMember_Null(AS3_Val i_target,const char* i_name)
+ {
+ AS3_SetS(i_target,i_name,AS3_Null());
+ }
+ static void setMember_Integer(AS3_Val i_target,const char* i_name,int i_integer)
+ {
+ AS3_Val as3val= AS3_Int(i_integer);
+ AS3_SetS(i_target,i_name,as3val);
+ AS3_Release(as3val);
+ }
};




-
-
-//C++クラスのスタブテンプレート
-template<class T> class AlchemyClassStub
+template<class T> class AlchemyClassBuilder
{
-public:
- T* m_inst;
- const T* m_ref;
- AS3_Val m_as3;
protected:
//初期化済みスタブオブジェクト(i_inst)をAS3オブジェクト化します。
//AS3オブジェクトを生成するためにこの関数をオーバライドしてください。
- virtual void initAS3Object(AS3ObjectBuilder& i_builder)
+ virtual void initAS3Member(AS3ObjectBuilder& i_builder,T* i_native_inst)
{
- i_builder.addPointer("ptr",this);
- i_builder.addFunction("dispose",AlchemyClassStub<T>::dispose);
};
+ /*
+ * ネイティブインスタンスを返す関数を実装して下さい。
+ */
+ virtual T* createNativeInstance(AS3_Val args)=0;
+private:
+ void initBasicMember(AS3ObjectBuilder& i_builder,bool i_is_disposable,T* i_native_inst=NULL)
+ {
+ i_builder.addInteger("_is_disposable",i_is_disposable?1:0);//nativeリソースをdisposeかのうかどうか。
+ i_builder.addPointer("_native",i_native_inst);//
+ i_builder.addFunction("dispose",AlchemyClassBuilder<T>::dispose);
+ };
public:
- //この関数はm_instに新しいCオブジェクトを作成します。
- //新しい初期化ルールが必要な時はオーバライドしてください。
- virtual void initRelStub(T* i_inst)
+ /*
+ * nativeリソースを伴うオブジェクトを作成する。
+ * この関数で作成したオブジェクトは、Alchemy領域に管理下にあるリソースを持つ。
+ * ガーベイジコレクタによって回収される前に、必ずdisposeを呼び出さなければ為らない。
+ */
+ AS3_Val buildWithNativeInstance(void* self, AS3_Val args)
{
- this->m_inst=i_inst;
- this->m_ref=this->m_inst;
- this->m_as3=NULL;
- return;
- }
- //この関数はすでにあるCオブジェクトi_refをラップします。
- //基本的にオーバライドの必要はありません。
- virtual void initRefStub(const T* i_ref)
- {
- this->m_inst=NULL;
- this->m_ref=i_ref;
- this->m_as3=NULL;
- return;
- }
- //この関数はラッパーオブジェクトを初期化します。
- //基本的にオーバライドの必要はありません。
- virtual void initWrapStub()
- {
- this->m_inst=NULL;
- this->m_ref=NULL;
- this->m_as3=NULL;
- return;
- }
+ //返却するAS3オブジェクトを作成
+ AS3_Val result = AS3_Object("");

-public:
- //この関数は現在所有しているインスタンスをデタッチします。
- //m_instをトリガに他のメンバ所有権を管理するクラスでは、その所有権も移譲するようにしてください。
- T* detachInst()
- {
- T* inst=this->m_inst;
- this->m_inst=NULL;
- return inst;
+ //ガーベイジコレクタによる破棄を防止(disposeを呼ばれるまで解除しない)
+ AS3_Acquire(result);
+ AS3ObjectBuilder builder(result);
+
+ //アタッチするNativeInstanceを要求
+ T* native_inst=createNativeInstance(args);
+
+ //AS3オブジェクトに追加する標準パラメータリストを追加
+ initBasicMember(builder,true,native_inst);
+
+ //AS3オブジェクトに追加するパラメータリストを要求
+ initAS3Member(builder,native_inst);
+ return result;
}
- const T* getRef()
+ /*
+ * nativeリソースを伴わない、参照型オブジェクトを作成する。
+ * この関数で作成したオブジェクトは、Alchemy領域に管理下にあるリソースを持たない。
+ * どんなタイミングでも、ガーベイジコレクタによって解放できなければならない。
+ */
+ AS3_Val buildWithOutNativeInstance(T* i_instance)
{
- return this->m_ref;
- }
- virtual void wrapRef(const T* i_ref)
- {
- //assert(this->m_inst==NULL);
- this->m_ref=i_ref;
- return;
- }
-public:
- //インスタンスをAS3オブジェクトに変換します。
- //この関数は継承クラスのcreateInstanceから呼び出して下さい。
- AS3_Val toAS3Object()
- {
- assert(this->m_as3==NULL);
+ //返却するAS3オブジェクトを作成
AS3_Val result = AS3_Object("");
AS3ObjectBuilder builder(result);
- this->initAS3Object(builder);
+
+ //AS3オブジェクトに追加する標準パラメータリストを追加
+ initBasicMember(builder,false,i_instance);
+
+ //AS3オブジェクトに追加するパラメータリストを要求
+ initAS3Member(builder,i_instance);
return result;
}
- //インスタンスをAS3ホルダオブジェクトに変換します。
- //ホルダオブジェクトは、m_as3メンバ変数が有効です。
- void toHolderObject()
- {
- this->m_as3=toAS3Object();
- }

- virtual ~AlchemyClassStub<T>()
+ virtual ~AlchemyClassBuilder<T>()
{
- if(this->m_inst!=NULL){
- delete this->m_inst;
- this->m_inst=NULL;
- }
- if(this->m_as3!=NULL){
- AS3_Release(this->m_as3);
- }
return;
}
public:
+ /* AS3 Argument protocol
+ * inst : AS3_Val
+ * _is_disposable: int
+ * _native : AlchemyClassBuilder<T>*
+ *
+ * nativeリソースを持っている場合、disposeは動作するが、それ以外の場合、特になにもしない。
+ * 参照解除も行わない。
+ */
static AS3_Val dispose(void* self, AS3_Val args)
{
- AlchemyClassStub<T>* inst;
- AS3_ArrayValue(args, "PtrType", &inst);
- if(inst==NULL){
- return AS3_False();
- }
- assert(inst->m_as3==NULL);//HolderObjectをdisposeしてはいけない。
- delete inst;
- return AS3_True();
+ //引数展開
+ int is_disposable;
+ AS3_Val inst;
+ T* native;
+ AS3_ArrayValue(args, "AS3ValType,IntType,PtrType",&inst,&is_disposable, &native);
+ if(is_disposable==1){
+ if(native!=NULL){
+ AS3_Release(inst);//ガーベイジコレクタによる解放を許可
+ delete native;
+ }
+ //値の書き換えはAS3Proxy側でやる
+ //setMember_Null(inst,"_native");
+ }
+ AS3_Release(inst);
+ return AS3_Null();
}
+
+
};




+
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/AlchemyMaster/readme.ja.txt
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/AlchemyMaster/readme.ja.txt (revision 0)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/AlchemyMaster/readme.ja.txt (revision 335)
@@ -0,0 +1,36 @@
+Alchemy Master.
+ Copyright (C)2009 Ryo Iizuka
+
+http://nyatla.jp/
+airmail(at)ebony.plala.or.jp
+--------------------------------------------------
+
+AlchemyMasterは、Adobe AlchemyとC++間の通信プロトコルを規定する
+為の、ヘルパークラス集です。
+
+C++側にはクラスをスタブ化するためのテンプレート、AS3側にはスタブ
+を呼び出す為のベースクラスがそれぞれ宣言されています。
+
+既存のC++クラスをこれらのベースクラスでラップすることにより、
+一定の記述ルールで、C++の継承関係や所有関係を、ActionScript
+APIとして公開することが出来ます。
+
+
+
+
+
+・ライセンス
+AlchemyMasterのライセンスは、LGPLv3とFLARToolKitバインドライセンス
+のデュアルライセンスを採用しています。
+
+
+ -LGPL
+ LGPLについては、LICENCE.txtをお読みください。
+
+ -FLARToolKitバインドライセンス
+ FLARToolKitと同一のオブジェクトにコンパイルする場合に、
+ FLARToolKitの一部として使用できるライセンスです。
+
+
+
+
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/AlchemyMaster/as3/jp/nyatla/alchemymaster/Marshal.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/AlchemyMaster/as3/jp/nyatla/alchemymaster/Marshal.as (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/AlchemyMaster/as3/jp/nyatla/alchemymaster/Marshal.as (revision 335)
@@ -28,10 +28,38 @@

public class Marshal extends ByteArray
{
+ private var _st:int;
public function Marshal()
{
this.endian=Endian.LITTLE_ENDIAN;
return;
}
+ /**
+ * This function prepares to write from ByteArray.
+ * Must call this function to write ByteArray before call setValue API in proxy class.
+ * --
+ * この関数は、Marshalクラスに値をセットする準備をします。ByteArrayに値をセットする前に呼び出してください。
+ *
+ */
+ public function prepareWrite():void
+ {
+ this.position=0;
+ }
+ /**
+ * This function prepares to read from ByteArray.
+ * Must call this function to read ByteArray after called getValue API in proxy class.
+ * --
+ * この関数は、Marshalクラスから値をゲットする準備をします。ByteArrayから値をゲットする前に呼び出してください。
+ */
+ public function prepareRead():void
+ {
+ this.position=0;
+ }
+ public function prepareCallAlchmy():void
+ {
+ this.position=0;
+ }
+
}
+
}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/AlchemyMaster/as3/jp/nyatla/alchemymaster/AlchemyClassProxy.as
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/AlchemyMaster/as3/jp/nyatla/alchemymaster/AlchemyClassProxy.as (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/forAlchemy/AlchemyMaster/as3/jp/nyatla/alchemymaster/AlchemyClassProxy.as (revision 335)
@@ -30,37 +30,31 @@

public class AlchemyClassProxy
{
- protected var _alchemy_stub:Object;
+ public var _alchemy_stub:Object;
public var _has_alchemy_object:Boolean=false;
- public var _alchemy_ptr:uint;
- protected var _ma:Marshal=new Marshal();
public var debug_str:String=new String();
- public function dumpMarshalStr():String
- {
- return this._ma.toString();
- }
- public function dumpMarshalInt(i_len:int):String
- {
- var s:String=new String();
- this._ma.position=0;
- for(var i:int=0;i<i_len;i++){
- s+=(this._ma.readInt().toString()+",");
- }
- return s;
- }
+ /**
+ * 現在取り付けてあるAlchemyオブジェクトがdisposableならば解放し、
+ * Alchemyオブジェクトとのリンクを切断します。
+ */
public function dispose():void
{
if(this._alchemy_stub==null){
return;
}
- //スタブを持っていたら解放
- this._alchemy_stub.dispose(this._alchemy_ptr);
-
+ if(this._alchemy_stub._is_disposable==1){
+ this._alchemy_stub.dispose(
+ this._alchemy_stub,
+ this._alchemy_stub._is_disposable,
+ this._alchemy_stub._native);
+ }
this._alchemy_stub=null;
- this._alchemy_ptr =0;
return;
}
-
+ /**
+ * ProxyにAlchemyオブジェクトを取り付けます。
+ * 一度取り付けると、他のAlchemyオブジェクトとリンクさせることが出来なくなります。
+ */
public final function attachAlchemyObject(i_alchemy_stub:Object):void
{
//有効なオブジェクトしかアタッチできない。
@@ -70,10 +64,13 @@
setAlchemyObject(i_alchemy_stub);
//保持フラグをON
this._has_alchemy_object=true;
+ this._alchemy_stub=i_alchemy_stub;
return;
}

- //proxyの初期化
+ /**
+ * ProxyにAlchemyオブジェクトを参照させます。
+ */
public final function setAlchemyObject(i_alchemy_stub:Object):void
{
//既にアタッチ済みのオブジェクトにアタッチすることはできない。
@@ -83,10 +80,8 @@
//参照をセットする。
if(i_alchemy_stub!=null){
this._alchemy_stub=i_alchemy_stub;
- this._alchemy_ptr=this._alchemy_stub.ptr;
}else{
this._alchemy_stub=null;
- this._alchemy_ptr=0;
}
return;
}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/inc/NyAR_utils.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/inc/NyAR_utils.h (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/inc/NyAR_utils.h (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#pragma once

#include "../utils/NyARArray.h"
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/inc/processor/SingleARMarkerProcessor.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/inc/processor/SingleARMarkerProcessor.h (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/inc/processor/SingleARMarkerProcessor.h (revision 335)
@@ -1,33 +1,128 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
+#pragma once
+#include "NyARParam.h"
+#include "NyARMatchPatt_Color_WITHOUT_PCA.h"
+#include "INyARSquareDetector.h"
+#include "INyARTransMat.h"
+#include "NyARTransMat.h"
+#include "NyARRasterFilter_ARToolkitThreshold.h"
+#include "NyARTransMatResult.h"
+#include "NyARColorPatt_Perspective_O2.h"
+#include "NyARSquareStack.h"
+#include "NyAR_types.h"
+#include "NyARSquareDetector_Rle.h"
+#include "NyARRasterThresholdAnalyzer_SlidePTile.h"


namespace NyARToolkitCPP
{
+ typedef struct TResult_selectARCodeIndex_t
+ {
+ int direction;
+ double confidence;
+ int code_index;
+ }TResult_selectARCodeIndex;
+ /**
+ * ±ÌĎÉĘ́ӯΞÉÐ͂ÌĽ›Ċðψם·é±ÆÌÅ«éāĶÊЛĖÇÓĶÍĚĢĔÅ·‚
+ * Ľ›ĊÌЯ̻…ɚӮ…ЁׅðăĸÓħÅӊӭ·é±ÆªÅ«Ü·‚
+ * ĎÉĘÉÍաДÌĽ›ĊðԯٞÅ«Ü·‚ɪÂÌĽ›Ċª̩©éƁĶÍĚĢĔÍͰѱµÄӯ¶Ľ›Ċð
+ * о¯Նίµѱ¯̩θ¤ÜÅÌ˔ÍѼÌĽ›ĊðՆίµÜ¹ñ‚
+ *
+ * ăĸÓħ́ OnEnterhOnUpdate[n]hOnLeaveÌχÅԭжµÜ·‚
+ * Ľ›Ċª̩©éÆܸOnEnterªÐԸԭжµÄɽՔÌĽ›Ċªԭ̩³ê½©ªí©èÜ·‚
+ * ΟÉOnUpdateÉæè̻ΝÌ֏ʷγرªفѱµÄԮ³êÜ·‚΅ͣÉĽ›Ċð̩θ¤ÆOnLeave
+ * ăĸÓħªԭжµÜ·‚
+ *
+ */
+ class SingleARMarkerProcesser:public NyARBaseClass
+ {
+ public:
+ /**ĉ›ĩ›ªΩؒÉϧ¦éĞď֏ДÅ·‚
+ */
+ void* tag;
+ private:
+ int _lost_delay_count;
+ int _lost_delay;
+ INyARSquareDetector* _square_detect;
+ protected:
+ NyARTransMat* _transmat;

+ private:
+ double _marker_width;
+ NyArray<NyARMatchPatt_Color_WITHOUT_PCA*>* _match_patt;
+ NyARSquareStack* _square_list;
+
+ INyARColorPatt* _patt;
+
+ double _cf_threshold_new ;
+ double _cf_threshold_exist;
+ int _threshold;
+ private:
+ NyARBinRaster* _bin_raster;
+ NyARRasterFilter_ARToolkitThreshold* _tobin_filter;
+ bool _initialized;
+
+ protected:
+ int _current_arcode_index;
+ private:
+ NyARMatchPattDeviationColorData* _deviation_data;
+ NyARRasterThresholdAnalyzer_SlidePTile* _threshold_detect;
+
+ protected:
+ SingleARMarkerProcesser();
+ virtual ~SingleARMarkerProcesser();
+ void initInstance(const NyARParam* i_param,int i_raster_type);
+ private:
+ void freeARCodeTable();
+ public:
+ void setARCodeTable(NyARCode* const i_ref_code_table[],int i_number_of_code, int i_code_resolution, double i_marker_width);
+ void reset(bool i_is_force);
+ void detectMarker(const INyARRgbRaster& i_raster);
+ private:
+ /**ARCodeÌÊĘħ©ç΅àɪӶ·éĒ›ĨՔ͆ð̟εµÜ·‚
+ */
+ bool selectARCodeIndexFromList(const INyARRgbRaster& i_raster,const NyARSquare& i_square, TResult_selectARCodeIndex& o_result);
+ /**і̋Ľ›Ċ̟ε ̻ΝՆί҆ÌĽ›ĊªÈ¢àÌƵā΅àՆίµâ·¢Ľ›ĊðÐ͂ՆίµÜ·‚
+ */
+ void detectNewMarker(const INyARRgbRaster& i_raster,NyARSquareStack& i_stack);
+ /**Ľ›ĊÌͰѱՆί ̻ΝՆί҆ÌĽ›Ċð؄ѦµÄՆίµÜ·‚
+ * ©ҍª±Ì̀՜ͽÔñͣ͡¢ë¢ëԭԗ·é©çNewÆͬºÈ¢±Æ‚
+ */
+ void detectExistMarker(const INyARRgbRaster& i_raster,const NyARSquareStack& i_stack, int i_current_id);
+ private:
+ NyARTransMatResult __NyARSquare_result;
+
+ /** ĉĵėĆĎħÌĘĥ›ĞĘðΘіµ֋ضÉɞ¶ÄĮÓĨË˖Дð̬ӮµÜ·‚
+ * ןèӬ́µπΛÉĽ›Ċðԭ̩·éΖªÅ«½©¶Å·‚ĎÉĘÌгҔÆÍəÈèÜ·‚
+ */
+ bool updateStatus(const NyARSquare& i_square, int i_code_index, double i_cf, int i_dir);
+ protected:
+ virtual void onEnterHandler(int i_code)=0;
+ virtual void onLeaveHandler()=0;
+ virtual void onUpdateHandler(const NyARSquare& i_square, const NyARTransMatResult& result)=0;
+ };
}
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/inc/processor/SingleNyIdMarkerProcessor.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/inc/processor/SingleNyIdMarkerProcessor.h (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/inc/processor/SingleNyIdMarkerProcessor.h (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARBaseClass.h"
#include "NyARTransMat.h"
#include "NyARSquareStack.h"
@@ -36,7 +34,7 @@
#include "NyIdMarkerPattern.h"
#include "NyIdMarkerParam.h"
#include "NyARRasterThresholdAnalyzer_SlidePTile.h"
-#include "NyARSquareDetector.h"
+#include "NyARSquareDetector_Rle.h"

namespace NyARToolkitCPP
{
@@ -48,9 +46,10 @@
int _lost_delay_count;
int _lost_delay;
private:
- NyARSquareDetector* _square_detect;
+ NyARSquareDetector_Rle* _square_detect;
+ bool _initialized;
protected:
- NyARTransMat* _transmat;
+ INyARTransMat* _transmat;
private:
double _marker_width;
private:
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/inc/utils/NyObjectStack.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/inc/utils/NyObjectStack.h (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/inc/utils/NyObjectStack.h (revision 335)
@@ -1,5 +1,32 @@
+/*
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#pragma once
#include "NyArray.h"
+#include <exception>
+using namespace std;
namespace NyARToolkitCPP
{
template <class T> class NyObjectStack
@@ -34,13 +61,13 @@
delete this->_items;
return;
}
- T* prePush()
+ T* prePush()
{
// ֋ضÉɞ¶ÄāÍЛħ
if (this->_length >= this->_allocated_size) {
// ضˁ³ê½ăÓĦĎĘÍՍɍˏ
if (this->_length >= this->_items->length) {
- throw NyARException();
+ throw exception();
}
// ӇʁāÍЛħՍɍðͶϚ
int range = this->_length + ARRAY_APPEND_STEP;
@@ -56,15 +83,22 @@
this->_length++;
return ret;
}
- T* pop()
+ T* pop()
{
if(this->_length<1){
- throw NyARException();
+ throw exception();
}
this->_length--;
return this->getItem(this->_length);
}
-
+ void pops(int i_count)
+ {
+ if(this->_length<i_count){
+ throw exception();
+ }
+ this->_length-=i_count;
+ return;
+ }
const NyArray<T*>& getArray() const
{
return *(this->_items);
@@ -96,7 +130,7 @@
if (i_number_of_item >= this->_allocated_size) {
// ضˁ³ê½ăÓĦĎĘÍՍɍˏ
if (i_number_of_item >= this->_items->length) {
- throw NyARException();
+ throw exception();
}
// ӇʁāÍЛħՍɍðͶϚ
int range = i_number_of_item+ARRAY_APPEND_STEP;
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/inc/utils/NyArray.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/inc/utils/NyArray.h (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/inc/utils/NyArray.h (revision 335)
@@ -1,3 +1,28 @@
+/*
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#pragma once
namespace NyARToolkitCPP
{
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/inc/utils/NyStdLib.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/inc/utils/NyStdLib.h (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/inc/utils/NyStdLib.h (revision 335)
@@ -1,3 +1,28 @@
+/*
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#pragma once

namespace NyARToolkitCPP
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/inc/nyidmarker/NyIdMarkerPickup.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/inc/nyidmarker/NyIdMarkerPickup.h (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/inc/nyidmarker/NyIdMarkerPickup.h (revision 335)
@@ -1,30 +1,28 @@
/*
- * PROJECT: NyARToolkitCPP
- * --------------------------------------------------------------------------------
- *
- * The NyARToolkitCS is C++ version NyARToolkit class library.
- *
- * Copyright (C)2008 R.Iizuka
- *
- * 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 framework; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * For further information please contact.
- * http://nyatla.jp/nyatoolkit/
- * <airmail(at)ebony.plala.or.jp>
- *
- */
+* PROJECT: NyARToolkitCPP
+* --------------------------------------------------------------------------------
+*
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+*
+* For further information please contact.
+* http://nyatla.jp/nyatoolkit/
+* <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
+*
+*/
#include "NyARBaseClass.h"
#include "NyARSquare.h"
#include "NyIdMarkerPattern.h"
Index: D:/project.sorceforge/NyARToolkitCPP/trunk/inc/nyidmarker/NyIdMarkerPattern.h
===================================================================
--- D:/project.sorceforge/NyARToolkitCPP/trunk/inc/nyidmarker/NyIdMarkerPattern.h (revision 272)
+++ D:/project.sorceforge/NyARToolkitCPP/trunk/inc/nyidmarker/NyIdMarkerPattern.h (revision 335)
@@ -2,27 +2,25 @@
* PROJECT: NyARToolkitCPP
* --------------------------------------------------------------------------------
*
-* The NyARToolkitCS is C++ version NyARToolkit class library.
-*
-* Copyright (C)2008 R.Iizuka
+* The NyARToolkitCPP is C++ version NyARToolkit class library.
+* Copyright (C)2008-2009 Ryo Iizuka
*
-* 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 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 3 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