@@ -210,20 +210,23 @@ fn C.stbi_write_jpg(filename &char, w int, h int, comp int, buffer &u8, quality
210210
211211// stbi_write_png write on path a PNG file
212212// row_stride_in_bytes is usually equal to: w * comp
213+ // comp is the number of channels
213214pub fn stbi_write_png (path string , w int , h int , comp int , buf & u8 , row_stride_in_bytes int ) ! {
214215 if 0 == C.stbi_write_png (& char (path.str), w, h, comp, buf, row_stride_in_bytes) {
215216 return error ('stbi_image failed to write png file to "${path }"' )
216217 }
217218}
218219
219220// stbi_write_png write on path a BMP file
221+ // comp is the number of channels
220222pub fn stbi_write_bmp (path string , w int , h int , comp int , buf & u8 ) ! {
221223 if 0 == C.stbi_write_bmp (& char (path.str), w, h, comp, buf) {
222224 return error ('stbi_image failed to write bmp file to "${path }"' )
223225 }
224226}
225227
226228// stbi_write_png write on path a TGA file
229+ // comp is the number of channels
227230pub fn stbi_write_tga (path string , w int , h int , comp int , buf & u8 ) ! {
228231 if 0 == C.stbi_write_tga (& char (path.str), w, h, comp, buf) {
229232 return error ('stbi_image failed to write tga file to "${path }"' )
@@ -233,6 +236,7 @@ pub fn stbi_write_tga(path string, w int, h int, comp int, buf &u8) ! {
233236// stbi_write_png write on path a JPG file
234237// quality select the compression quality of the JPG
235238// quality is between 1 and 100. Higher quality looks better but results in a bigger image.
239+ // comp is the number of channels
236240pub fn stbi_write_jpg (path string , w int , h int , comp int , buf & u8 , quality int ) ! {
237241 if 0 == C.stbi_write_jpg (& char (path.str), w, h, comp, buf, quality) {
238242 return error ('stbi_image failed to write jpg file to "${path }"' )
0 commit comments