Class: X11Image
- Inherits:
-
Object
- Object
- X11Image
- Defined in:
- lib/rex/proto/x11/window.rb
Overview
for future use def create_overlay_map(screen_width, screen_height, windows)
Initialize a 2D array to represent the screen
screen = Array.new(screen_height) { Array.new(screen_width, nil) } windows.each_with_index do |window, i| puts window.inspect x, y, width, height = window # Mark the visible region occupied by the window (y...y + height).each do |row| (x...x + width).each do |col| screen[col] = i end end end screen.each do |row| puts row.join('') end end
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(width, height, image_data, color_data) ⇒ X11Image
constructor
A new instance of X11Image.
Constructor Details
#initialize(width, height, image_data, color_data) ⇒ X11Image
Returns a new instance of X11Image.
212 213 214 215 216 217 |
# File 'lib/rex/proto/x11/window.rb', line 212 def initialize(width, height, image_data, color_data) @width = width # integer, 1024 in 1024x768 @height = height # integer, 768 in 1024x768 @image_data = image_data # from X11GetImageResponse @color_data = color_data # from X11GetColorsResponse end |
Class Method Details
.from_replies(width, height, image_reply, color_reply) ⇒ Object
219 220 221 |
# File 'lib/rex/proto/x11/window.rb', line 219 def self.from_replies(width, height, image_reply, color_reply) new(width, height, image_reply.image_data, color_reply.colors) end |