2710 y2 := yEnd. |
2710 y2 := yEnd. |
2711 |
2711 |
2712 srcIndex := (width * 3 * y1) + (x1 * 3) + 1 . |
2712 srcIndex := (width * 3 * y1) + (x1 * 3) + 1 . |
2713 bytesPerRow := self bytesPerRow. |
2713 bytesPerRow := self bytesPerRow. |
2714 bytes := self bits. |
2714 bytes := self bits. |
|
2715 %{ |
|
2716 OBJFUNC codeVal; |
|
2717 |
|
2718 if (__bothSmallInteger(x1, x2) |
|
2719 && __bothSmallInteger(y1, y2) |
|
2720 && __bothSmallInteger(srcIndex, bytesPerRow) |
|
2721 && __isByteArrayLike(bytes) |
|
2722 && __isBlockLike(aBlock) |
|
2723 && (__BlockInstPtr(aBlock)->b_nargs == __mkSmallInteger(3)) |
|
2724 && ((codeVal = __BlockInstPtr(aBlock)->b_code) != (OBJFUNC)nil) |
|
2725 ) { |
|
2726 int _x1 = __intVal(x1)-1; |
|
2727 int _x2 = __intVal(x2)-1; |
|
2728 int _y1 = __intVal(y1)-1; |
|
2729 int _y2 = __intVal(y2)-1; |
|
2730 int _w = __intVal(__INST(width)); |
|
2731 int _h = __intVal(__INST(height)); |
|
2732 int _srcIndex = __intVal(srcIndex); |
|
2733 int _bytesPerRow = __intVal(bytesPerRow); |
|
2734 int _y, _x; |
|
2735 OBJ rHome; |
|
2736 |
|
2737 rHome = __BlockInstPtr(aBlock)->b_home; |
|
2738 if ((rHome == nil) || (__qSpace(rHome) >= STACKSPACE)) { |
|
2739 if ((((unsigned)_y1) < _h) |
|
2740 && (((unsigned)_y2) < _h) |
|
2741 && (((unsigned)_x1) < _w) |
|
2742 && (((unsigned)_x1) < _w)) { |
|
2743 for (_y=_y1; _y<=_y2; _y++) { |
|
2744 int _srcNext = _srcIndex + _bytesPerRow; |
|
2745 for (_x=_x1; _x<=_x2; _x++) { |
|
2746 int _value = __ByteArrayInstPtr(bytes)->ba_element[_srcIndex]; |
|
2747 _value = (_value<<8) | __ByteArrayInstPtr(bytes)->ba_element[_srcIndex+1]; |
|
2748 _value = (_value<<8) | __ByteArrayInstPtr(bytes)->ba_element[_srcIndex+2]; |
|
2749 (*codeVal)(rHome, __mkSmallInteger(_x), __mkSmallInteger(_y), __mkSmallInteger(_value)); |
|
2750 _srcIndex = _srcIndex + 3; |
|
2751 } |
|
2752 _srcIndex = _srcNext; |
|
2753 } |
|
2754 } |
|
2755 RETURN(self); |
|
2756 } |
|
2757 } |
|
2758 %}. |
2715 |
2759 |
2716 y1 to:y2 do:[:y | |
2760 y1 to:y2 do:[:y | |
2717 srcNext := srcIndex + bytesPerRow. |
2761 srcNext := srcIndex + bytesPerRow. |
2718 x1 to:x2 do:[:x | |
2762 x1 to:x2 do:[:x | |
2719 value := bytes at:srcIndex. |
2763 value := bytes at:srcIndex. |