stbi_flip_vertically   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/external/stb_image.xtm

Implementation

(bind-func stbi_flip_vertically
  (lambda (width:i32 height:i32 ncomp:i32 data:i8*)
    (let ((stride (* ncomp width))
          (tmp 0))
      (doloop (i (/ height 2))
        (doloop (j stride)
          (set! tmp (pref data (+ (* i stride) j)))
          (pset! data (+ (* i stride) j) (pref data (+ (* (- height i 1) stride) j)))
          (pset! data (+ (* (- height i 1) stride) j) tmp))))))


Back to Index

Similar Entries