reference-libobs-graphics-image-file.rst 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. .. _image_file_helper:
  2. Image File Helper
  3. =================
  4. Helper functions/type for easily loading/managing image files, including
  5. animated gif files.
  6. .. code:: cpp
  7. #include <graphics/image-file.h>
  8. .. struct:: gs_image_file
  9. Image file structure
  10. .. type:: gs_texture_t *gs_image_file.texture
  11. Texture
  12. .. type:: struct gs_image_file gs_image_file_t
  13. Image file type
  14. ---------------------
  15. .. function:: void gs_image_file_init(gs_image_file_t *image, const char *file)
  16. Loads an initializes an image file helper. Does not initialize the
  17. texture; call :c:func:`gs_image_file_init_texture()` to initialize
  18. the texture.
  19. :param image: Image file helper to initialize
  20. :param file: Path to the image file to load
  21. ---------------------
  22. .. function:: void gs_image_file_free(gs_image_file_t *image)
  23. Frees an image file helper
  24. :param image: Image file helper
  25. ---------------------
  26. .. function:: void gs_image_file_init_texture(gs_image_file_t *image)
  27. Initializes the texture of an image file helper. This is separate
  28. from :c:func:`gs_image_file_init()` because it allows deferring the
  29. graphics initialization if needed.
  30. :param image: Image file helper
  31. ---------------------
  32. .. function:: bool gs_image_file_tick(gs_image_file_t *image, uint64_t elapsed_time_ns)
  33. Performs a tick operation on the image file helper (used primarily
  34. for animated file). Does not update the texture until
  35. :c:func:`gs_image_file_update_texture()` is called.
  36. :param image: Image file helper
  37. :param elapsed_time_ns: Elapsed time in nanoseconds
  38. ---------------------
  39. .. function:: void gs_image_file_update_texture(gs_image_file_t *image)
  40. Updates the texture (used primarily for animated files)
  41. :param image: Image file helper