RosettaCodeData/Task/Bitmap-Read-a-PPM-file/Vedit-macro-language/bitmap-read-a-ppm-file-2.vedit

20 lines
352 B
Text
Raw Permalink Normal View History

2013-04-10 22:43:41 -07:00
// Load RGB image
Reg_Set(10, "|(USER_MACRO)\example.ppm")
Call("LOAD_PPM")
// Convert to grayscale
#10 = Buf_Num
Call("RGB_TO_GRAYSCALE")
Buf_Switch(#10) Buf_Quit(OK)
// Convert to RGB
Call("GRAYSCALE_TO_RGB")
// Save the image
Reg_Set(10, "|(USER_MACRO)\example_gray.ppm")
Call("SAVE_PPM")
// Cleanup and exit
Buf_Switch(#20) Buf_Quit(OK)
return