1 # This file is part of NIT ( http://www.nitlanguage.org ).
3 # Copyright 2015 Budi Kurniawan <budi2020@gmail.com>
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # This file tests the Bitmap class in the bitmap module
18 # It has to be called by passing two arguments:
20 # - An input bitmap file
21 # - An output bitmap file
23 # It converts the input bitmap to grayscale and save it to the specified
24 # output file. In addition, it creates a blank.bmp file in the current directory.
27 # A module for testing the classes in the bitmap module
28 module test_bitmap
is test_suite
37 var bitmap
= new Bitmap.with_size
(400, 300)
39 for x
in [0..200] do bitmap
.set_pixel
(x
, y
, 0x0077AAAA)
42 bitmap
.save
("./blank.bmp")