20 lines
479 B
Text
20 lines
479 B
Text
// Convert grayscale image (8 bits/pixel) into RGB (24 bits/pixel)
|
|
// #20 = buffer that contains image data
|
|
// On return:
|
|
// #10 = buffer for the new RGB image
|
|
|
|
:GRAYSCALE_TO_RGB:
|
|
File_Open("|(VEDIT_TEMP)\RGB.data", OVERWRITE+NOEVENT+NOMSG)
|
|
#10 = Buf_Num
|
|
BOF
|
|
Del_Char(ALL)
|
|
Buf_Switch(#20) // input image (grayscale)
|
|
BOF
|
|
Repeat(File_Size) {
|
|
#9 = Cur_Char()
|
|
Char
|
|
Buf_Switch(#10) // output image (RGB)
|
|
Ins_Char(#9, COUNT, 3)
|
|
Buf_Switch(#20)
|
|
}
|
|
Return
|