| .gitignore | ||
| greyscale.asm | ||
| increase_brightness.asm | ||
| README.md | ||
| README.txt | ||
MIPS Assembly image processing software
README for increase_brightness.asm and greyscale.asm
These programs have been tested to work in QtSpim on Linux 6.5.4 and macOS 14.0 Sonoma. Running on Windows is possible if the file open flags are adjusted.
USAGE & INFORMATION
Please adjust the file paths before running the programs!
- The input and output file paths can be found on lines 2 and 3 respectively in each program.
- Use absolute file paths.
- Example input file path: /home/Deku/Documents/BLLCHA013_CSC2002S_Arch_Assignment/sample_images/tree_64_in_ascii_lf.ppm
- Example output file path: /home/Deku/Documents/BLLCHA013_CSC2002S_Arch_Assignment/output.ppm
If you are using Windows, please see the WINDOWS USERS section below on line 36.
These programs handle input files using LF or CR. CRLF (CR and LF together) is NOT supported. These programs will write the output file using LF (tested on Linux 6.5.4 and macOS 14.0 Sonoma). Linux, UNIX, and UNIX-derivatives such as macOS (Mac OS X) and FreeBSD use LF line-end encoding.
These programs are designed to correctly handle file creation and truncation when writing on Linux and macOS.
- If no output file exists, one will be created with UNIX file mode 644 (rw-r--r--) permissions.
- If an output file exists, it will be truncated.
If file creation, truncation, or writing does not work as expected, please adjust the file open() flag in the programs.
- File open() flags can differ by operating system and/or MIPS simulator.
- Adjust line 126 in increase_brightness.asm
- Adjust line 132 in greyscale.asm
- Comments with additional information are available in the programs around the lines mentioned.
WINDOWS USERS
Please adjust the file open() flags to run on Windows (see line 29). Please note that the input and output file paths must look like this (example): C:/Users/Deku/Documents/BLLCHA013_CSC2002S_Arch_Assignment/file.ppm
ERRORS
Learn what to do if you encounter one of the following errors (or similar):
"Error: a read error occurred."
- Ensure that the input file exists.
- Ensure the input file path is correct. It must be an absolute path.
- Ensure that the user the program will run under has read permissions on the input file.
- Ensure that the MIPS simulator software (like QtSpim) has read permissions on the input file.
"Error: the input file is too short. Expected length: 24594<=x<=49171 bytes. Got: 1152"
- Ensure that the input file is valid, complete, and not corrupt.
- Both programs require a color PPM file of 64x64 size.
"Error: a write error occurred."
- Ensure the output file path is correct. It must be an absolute path.
- Ensure that an output file that is unwritiable by the user the program will run under doesn't exist.
- Ensure appropriate write permissions for the directory the output file will reside in.
- Ensure that the MIPS simulator software (like QtSpim) has write permissions on the output directory/file.
- Ensure there is enough free space on the file system where the output file will be written to.
- There may be a problem with the file open() flags depending on your operating system and/or MIPS simulator. See above in this README file for more information (line 29).