Module: BitmapCmdEditor
- Defined in:
- lib/bitmap_cmd_editor/bitmap.rb,
lib/bitmap_cmd_editor/client.rb,
lib/bitmap_cmd_editor/version.rb,
lib/bitmap_cmd_editor/exceptions.rb,
lib/bitmap_cmd_editor/validators/error_message.rb,
lib/bitmap_cmd_editor/validators/command_validator.rb,
lib/bitmap_cmd_editor/validators/validator_herlper.rb,
lib/bitmap_cmd_editor/validators/clear_image_validator.rb,
lib/bitmap_cmd_editor/validators/fill_region_validator.rb,
lib/bitmap_cmd_editor/validators/print_table_validator.rb,
lib/bitmap_cmd_editor/validators/colour_pixel_validator.rb,
lib/bitmap_cmd_editor/validators/create_image_validator.rb,
lib/bitmap_cmd_editor/validators/vertical_line_validator.rb,
lib/bitmap_cmd_editor/validators/horizontal_line_validator.rb
Defined Under Namespace
Modules: Validators Classes: Bitmap, ClearImageArgumentError, Client, ColourPixelArgumentError, CreateImageArgumentError, FillRegionArgumentError, HorizontalLineArgumentError, LessColumnsThanAllowed, LessRowsThanAllowed, MoreColumnsThanAllowed, MoreRowsThanAllowed, NotImplementedCommand, OutOfRange, PrintTableArgumentError, VerticalLineArgumentError
Constant Summary collapse
- VERSION =
"1.0.4"
- COMMANDS =
['X','I','C','L','V','H','F','S']
- MAX_COLUMNS =
250
- MIN_COLUMNS =
1
- MAX_ROWS =
250
- MIN_ROWS =
1
- WELCOME_MESSAGE =
<<-EOF Welcome to the Bitmap Command Editor ------------------------------------ Available Commands: ------------------- I M N - Create a new M x N image with all pixels coloured white (O). C - Clears the table, setting all pixels to white (O). L X Y C - Colours the pixel (X,Y) with colour C. V X Y1 Y2 C - Draw a vertical segment of colour C in column X between rows Y1 and Y2 (inclusive). H X1 X2 Y C - Draw a horizontal segment of colour C in row Y between columns X1 and X2 (inclusive). F X Y C - Fill the region R with the colour C. R is defined as: Pixel (X,Y) belongs to R. Any other pixel which is the same colour as (X,Y) and shares a common side with any pixel in R also belongs to this region. S - Show the contents of the current image X - Terminate the session EOF