Revision 29713 branches/v2_0_0_prep/libraries/libRaster_io/src/org/gvsig/fmap/dal/coverage/dataset/io/ErmapperDriver.java

View differences:

ErmapperDriver.java
456 456
				if(b != null) {
457 457
					if(i == 0) {
458 458
						for (int line = 0; line < rasterBuf.getHeight(); line++) {
459
							file.readLineRGBA(pRGBArray);
460
							for(int col = 0; col < pRGBArray.length; col ++){
461
								rasterBuf.setElem(line, col, bandR, (byte)((pRGBArray[col] & 0x00ff0000) >> 16));
462
								rasterBuf.setElem(line, col, bandG, (byte)((pRGBArray[col] & 0x00ff0000) >> 16));
463
								rasterBuf.setElem(line, col, bandB, (byte)((pRGBArray[col] & 0x00ff0000) >> 16));
459
							try {
460
								file.readLineRGBA(pRGBArray);
461
								for(int col = 0; col < pRGBArray.length; col ++){
462
									rasterBuf.setElem(line, col, bandR, (byte)((pRGBArray[col] & 0x00ff0000) >> 16));
463
									rasterBuf.setElem(line, col, bandG, (byte)((pRGBArray[col] & 0x00ff0000) >> 16));
464
									rasterBuf.setElem(line, col, bandB, (byte)((pRGBArray[col] & 0x00ff0000) >> 16));
465
								}
466
							} catch (JNCSException exc) {
464 467
							}
465 468
						}
466 469
						return;
467 470
					}
468 471
					if(i == 1) {
469 472
						for (int line = 0; line < rasterBuf.getHeight(); line++) {
470
							file.readLineRGBA(pRGBArray);
471
							for(int col = 0; col < pRGBArray.length; col ++){
472
								rasterBuf.setElem(line, col, bandR, (byte)((pRGBArray[col] & 0x0000ff00) >> 8));
473
								rasterBuf.setElem(line, col, bandG, (byte)((pRGBArray[col] & 0x0000ff00) >> 8));
474
								rasterBuf.setElem(line, col, bandB, (byte)((pRGBArray[col] & 0x0000ff00) >> 8));
473
							try {
474
								file.readLineRGBA(pRGBArray);
475
								for(int col = 0; col < pRGBArray.length; col ++){
476
									rasterBuf.setElem(line, col, bandR, (byte)((pRGBArray[col] & 0x0000ff00) >> 8));
477
									rasterBuf.setElem(line, col, bandG, (byte)((pRGBArray[col] & 0x0000ff00) >> 8));
478
									rasterBuf.setElem(line, col, bandB, (byte)((pRGBArray[col] & 0x0000ff00) >> 8));
479
								}
480
							} catch (JNCSException exc) {
475 481
							}
476 482
						}
477 483
						return;
478 484
					}
479 485
					if(i == 2) {
480 486
						for (int line = 0; line < rasterBuf.getHeight(); line++) {
481
							file.readLineRGBA(pRGBArray);
482
							for(int col = 0; col < pRGBArray.length; col ++){
483
								rasterBuf.setElem(line, col, bandR, (byte)(pRGBArray[col] & 0x000000ff));
484
								rasterBuf.setElem(line, col, bandG, (byte)(pRGBArray[col] & 0x000000ff));
485
								rasterBuf.setElem(line, col, bandB, (byte)(pRGBArray[col] & 0x000000ff));
487
							try {
488
								file.readLineRGBA(pRGBArray);
489
								for(int col = 0; col < pRGBArray.length; col ++){
490
									rasterBuf.setElem(line, col, bandR, (byte)(pRGBArray[col] & 0x000000ff));
491
									rasterBuf.setElem(line, col, bandG, (byte)(pRGBArray[col] & 0x000000ff));
492
									rasterBuf.setElem(line, col, bandB, (byte)(pRGBArray[col] & 0x000000ff));
493
								}
494
							} catch (JNCSException exc) {
486 495
							}
487 496
						}
488 497
						return;
......
497 506

  
498 507
		if(bandR >= 0 && bandG >= 0 && bandB >= 0) {
499 508
			for (int line = 0; line < rasterBuf.getHeight(); line++) {
500
				file.readLineRGBA(pRGBArray);
501
				for(int col = 0; col < pRGBArray.length; col ++){
502
					rasterBuf.setElem(line, col, bandR, (byte)((pRGBArray[col] & 0x00ff0000) >> 16));
503
					rasterBuf.setElem(line, col, bandG, (byte)((pRGBArray[col] & 0x0000ff00) >> 8));
504
					rasterBuf.setElem(line, col, bandB, (byte)(pRGBArray[col] & 0x000000ff));
509
				try {
510
					file.readLineRGBA(pRGBArray);
511
					for(int col = 0; col < pRGBArray.length; col ++){
512
						rasterBuf.setElem(line, col, bandR, (byte)((pRGBArray[col] & 0x00ff0000) >> 16));
513
						rasterBuf.setElem(line, col, bandG, (byte)((pRGBArray[col] & 0x0000ff00) >> 8));
514
						rasterBuf.setElem(line, col, bandB, (byte)(pRGBArray[col] & 0x000000ff));
515
					}
516
				} catch (JNCSException exc) {
505 517
				}
506 518
			}
507 519
			return;
......
512 524

  
513 525
		if(bandR >= 0 && bandG >= 0) {
514 526
			for (int line = 0; line < rasterBuf.getHeight(); line++) {
515
				file.readLineRGBA(pRGBArray);
516
				for(int col = 0; col < pRGBArray.length; col ++){
517
					rasterBuf.setElem(line, col, bandR, (byte)((pRGBArray[col] & 0x00ff0000) >> 16));
518
					rasterBuf.setElem(line, col, bandG, (byte)((pRGBArray[col] & 0x0000ff00) >> 8));
527
				try {
528
					file.readLineRGBA(pRGBArray);
529
					for(int col = 0; col < pRGBArray.length; col ++){
530
						rasterBuf.setElem(line, col, bandR, (byte)((pRGBArray[col] & 0x00ff0000) >> 16));
531
						rasterBuf.setElem(line, col, bandG, (byte)((pRGBArray[col] & 0x0000ff00) >> 8));
532
					}
533
				} catch (JNCSException exc) {
519 534
				}
520 535
			}
521 536
			return;
......
526 541

  
527 542
		if(bandR >= 0){
528 543
			for (int line = 0; line < rasterBuf.getHeight(); line++) {
529
				file.readLineRGBA(pRGBArray);
530
				for(int col = 0; col < pRGBArray.length; col ++)
531
					rasterBuf.setElem(line, col, bandR, (byte)((pRGBArray[col] & 0x00ff0000) >> 16));
544
				try {
545
					file.readLineRGBA(pRGBArray);
546
					for(int col = 0; col < pRGBArray.length; col ++)
547
						rasterBuf.setElem(line, col, bandR, (byte)((pRGBArray[col] & 0x00ff0000) >> 16));
548
				} catch (JNCSException exc) {
549
				}
532 550
			}
533 551
			return;
534 552
		}

Also available in: Unified diff