[Fxruby-commits] CVS: FXRuby/examples image.rb,1.11.2.1,1.11.2.2
Status: Inactive
Brought to you by:
lyle
|
From: Lyle J. <ly...@us...> - 2002-05-08 16:45:12
|
Update of /cvsroot/fxruby/FXRuby/examples
In directory usw-pr-cvs1:/tmp/cvs-serv5170/examples
Modified Files:
Tag: release10
image.rb
Log Message:
Modified the interface to FXImage#data so that it returns an
FXMemoryBuffer instance instead of a string (See SF Bug #550996).
The primary difference is that FXMemoryBuffer wraps the actual
data pointer stored by the FXImage instead of making a copy; this
way you should be able to modify the buffer and re-render the image
as you can in C++.
Index: image.rb
===================================================================
RCS file: /cvsroot/fxruby/FXRuby/examples/image.rb,v
retrieving revision 1.11.2.1
retrieving revision 1.11.2.2
diff -C2 -d -r1.11.2.1 -r1.11.2.2
*** image.rb 8 May 2002 16:32:41 -0000 1.11.2.1
--- image.rb 8 May 2002 16:45:09 -0000 1.11.2.2
***************
*** 117,138 ****
(0...512).each { |x|
(0...50).each { |y|
! @grey_ramp[3*(y*512+x) ] = (x/2)
! @grey_ramp[3*(y*512+x)+1] = (x/2)
! @grey_ramp[3*(y*512+x)+2] = (x/2)
}
(0...50).each { |y|
! @red_ramp[3*(y*512+x) ] = (x/2)
! @red_ramp[3*(y*512+x)+1] = 0
! @red_ramp[3*(y*512+x)+2] = 0
}
(0...50).each { |y|
! @green_ramp[3*(y*512+x) ] = 0
! @green_ramp[3*(y*512+x)+1] = (x/2)
! @green_ramp[3*(y*512+x)+2] = 0
}
(0...50).each { |y|
! @blue_ramp[3*(y*512+x) ] = 0
! @blue_ramp[3*(y*512+x)+1] = 0
! @blue_ramp[3*(y*512+x)+2] = (x/2)
}
}
--- 117,138 ----
(0...512).each { |x|
(0...50).each { |y|
! @grey.data[3*(y*512+x) ] = (x/2)
! @grey.data[3*(y*512+x)+1] = (x/2)
! @grey.data[3*(y*512+x)+2] = (x/2)
}
(0...50).each { |y|
! @red.data[3*(y*512+x) ] = (x/2)
! @red.data[3*(y*512+x)+1] = 0
! @red.data[3*(y*512+x)+2] = 0
}
(0...50).each { |y|
! @green.data[3*(y*512+x) ] = 0
! @green.data[3*(y*512+x)+1] = (x/2)
! @green.data[3*(y*512+x)+2] = 0
}
(0...50).each { |y|
! @blue.data[3*(y*512+x) ] = 0
! @blue.data[3*(y*512+x)+1] = 0
! @blue.data[3*(y*512+x)+2] = (x/2)
}
}
|