チェンジセット 1992
- コミット日時:
- 2008/12/10 15:56:43 (3 年前)
- ファイル:
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
as3/FLARToolKit/trunk/src/org/libspark/flartoolkit/core/FLARCode.as
r1862 r1992 54 54 private var width:int; 55 55 private var height:int; 56 56 private var averagePat:int; 57 58 public function get averageOfPattern():int 59 { 60 return this.averagePat; 61 } 57 62 public function getPat():Array { 58 63 return pat; … … 168 173 169 174 l /= (height * width * 3); 170 175 this.averagePat = l; 171 176 var m:int = 0; 172 177 for (var i:int = 0;i < height; i++) { … … 220 225 //幅・高さのチェック 221 226 if (this.height != patArray.length || this.width != patArray[0].length) { 227 trace(this.height, patArray.length, this.width, patArray[0].length); 222 228 throw new ArgumentError("パターンの幅・高さが、Codeの幅・高さと異なっています"); 223 229 } … … 253 259 } 254 260 l /= (this.width * this.height * 3); 261 this.averagePat = l; 255 262 for (y = 0; y < this.height; y++) { 256 263 for (x = 0; x < this.width; x++) { … … 279 286 280 287 private function generatePatFileString(pat:Array):String { 281 var x:int, y:int, c:int ;288 var x:int, y:int, c:int, h:int; 282 289 var out:String = ''; 283 for (c = 2; c >= 0; c--) { 284 for (x = 15; x >= 0; x--) { 285 for (y = 0; y < 16; y++) { 286 out += String(' ' + int(pat[y][x][c])).substr(-4); 287 } 288 out += '\n'; 289 } 290 } 291 out += '\n'; 292 for (c = 2; c >= 0; c--) { 293 for (y = 15; y >= 0; y--) { 294 for (x = 15; x >= 0; x--) { 295 out += String(' ' + int(pat[y][x][c])).substr(-4); 296 } 297 out += '\n'; 298 } 299 } 300 out += '\n'; 301 for (c = 2; c >= 0; c--) { 302 for (x = 0; x < 16; x++) { 303 for (y = 15; y >= 0; y--) { 304 out += String(' ' + int(pat[y][x][c])).substr(-4); 305 } 306 out += '\n'; 307 } 308 } 309 out += '\n'; 310 for (c = 2; c >= 0; c--) { 311 for (y = 0; y < 16; y++) { 312 for (x = 0; x < 16; x++) { 313 out += String(' ' + int(pat[y][x][c])).substr(-4); 314 } 315 out += '\n'; 316 } 317 } 318 out += '\n'; 290 var width:int = this.getWidth(); 291 var height:int = this.getHeight(); 292 for (h = 0; h < pat.length;h++) { 293 for (c = 2; c >= 0; c--) { 294 for (y = 0; y < height; y++) { 295 for (x = 0; x < width; x++) { 296 out += String(' ' + int((255-(pat[h][y][x][c])-this.averagePat)&0xFF)).substr(-4); 297 } 298 out += '\n'; 299 } 300 } 301 out += '\n'; 302 } 319 303 return out; 320 304 }

