00001 /*-----------------------------------------------------------------------* 00002 Project: Nintendo Augmented Reality Library. 00003 File: narMarkerPattern.h 00004 00005 Copyright (C)2011-2012 Nintendo Co., Ltd. All rights reserved. 00006 00007 These coded instructions, statements, and computer programs contain 00008 proprietary information of Nintendo and/or its licensed developers 00009 and are protected by national and international copyright laws. They 00010 may not be disclosed to third parties or copied or duplicated in any 00011 form, in whole or in part, without the prior written consent of 00012 Nintendo. 00013 The content herein is highly confidential and should be handled 00014 accordingly. 00015 *-----------------------------------------------------------------------*/ 00020 #ifndef NAR_MARKER_PATTERN_H__ 00021 #define NAR_MARKER_PATTERN_H__ 00022 00023 #include "narPort.h" 00024 #include "narVec2.h" 00025 #include "narMesh.h" 00026 00027 namespace mw { namespace nar 00028 { 00031 class PatternVtxData_cl :public MeshVtxData_tc< e_MeshDiv15 > 00032 { 00033 public: 00036 const Vec2F_st & GetDirVtx( s32 t, s32 s, s32 dir ) const; 00037 }; 00038 00040 00042 const u8 c_MarkerDivide = 15; 00043 00044 class Image_cl; 00045 struct Vec2F_st ; 00046 struct MarkerTemplate_st; 00047 struct MarkerPatternWeight_st; 00048 00051 class PatternColorData_cl :public MeshColorData_tc< e_MeshDiv15 > 00052 { 00053 public: 00056 const Color_st & GetColorDirected( s32 t, s32 s, s32 dir ) const; 00057 }; 00058 00062 struct MarkerPattern_st 00063 { 00064 const Color_st & 00065 GetColor( s32 t, s32 s ) const { return maa_MarkerDesign[ t ][ s ]; } 00066 00067 Color_st & 00068 GetColor( s32 t, s32 s ) { return maa_MarkerDesign[ t ][ s ]; } 00069 00072 void 00073 Extract( const Image_cl & cr_Image, const Vec2F_st * cap_Points, PatternVtxData_cl * p_VtxData ); 00074 00078 void 00079 ExtractFast( const Image_cl & cr_Image, const Vec2F_st * cap_Pointsm, PatternVtxData_cl * p_VtxData ); 00080 00084 void 00085 ExtractStrictly( const Image_cl & cr_Image, const Vec2F_st * cap_Points, PatternVtxData_cl * p_VtxData ); 00086 00089 f32 00090 GetCorrelation( const MarkerTemplate_st & cr, s32 dir ) const; 00091 00094 bool 00095 ExtractForTemplate( const Image_cl & cr_Image, const Vec2F_st * cap_Points, MarkerPatternWeight_st & r_w ); 00096 00099 void 00100 Print() const; 00101 00103 Color_st 00104 maa_MarkerDesign[ c_MarkerDivide ][ c_MarkerDivide ]; 00105 00107 s8 00108 m_Offset; 00109 00111 f32 00112 m_Average; 00113 00115 f32 00116 m_Stdevp; 00117 00118 }; 00119 00122 class MarkerPatternData_cl :public MeshColorData_ac 00123 { 00124 public: 00125 MarkerPatternData_cl( MarkerPattern_st & r_Pattern ) 00126 : mr_Pattern( r_Pattern ) 00127 {} 00128 virtual const Color_st & 00129 GetColor( s32 t, s32 s ) const { return mr_Pattern.GetColor( t, s ); } 00130 00131 virtual Color_st & 00132 GetColor( s32 t, s32 s ) { return mr_Pattern.GetColor( t, s ); } 00133 private: 00134 MarkerPattern_st & mr_Pattern; 00135 }; 00137 00138 } 00139 } 00140 #endif
© 2011-2012 Nintendo. All rights reserved.
CONFIDENTIAL