imgui_tex_inspect.pyi 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  1. ###############################################################################
  2. # This file is a part of Dear ImGui Bundle, NOT a part of imgui_tex_inspect
  3. # -----------------------------------------------------------------------------
  4. # imgui_tex_inspect.pyi: auto-generated bindings for imgui_tex_inspect,
  5. # a texture inspector tool for Dear ImGui. See https://github.com/andyborrell/imgui_tex_inspect
  6. #
  7. # Most of the code of this file is automatically generated (using https://pthom.github.io/litgen/),
  8. # and is generally very close to the C++ version. Comments, docs are identical.
  9. # Do not manually edit the autogenerated parts (look for "Autogenerated" comments)!
  10. ###############################################################################
  11. # ruff: noqa: F821, B008
  12. from typing import overload, Optional
  13. import enum
  14. import imgui_bundle
  15. from imgui_bundle.imgui import ImVec2, ImTextureID, ImDrawList, ImU32, ImVec2Like, ImVec4Like
  16. from imgui_bundle import imgui
  17. ImGuiTexInspect = imgui_bundle.imgui_tex_inspect
  18. ImGuiID = imgui.ID
  19. InspectorFlags = int
  20. def create_context() -> int:
  21. """Creates a context and returns it address"""
  22. pass
  23. def destroy_context(ctx_address: int) -> None:
  24. """Destroy a context and returns it address"""
  25. pass
  26. def set_current_context(ctx_address: int) -> None:
  27. pass
  28. # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! AUTOGENERATED CODE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  29. # <litgen_stub> // Autogenerated code below! Do not edit!
  30. #################### <generated_from:imgui_tex_inspect.h> ####################
  31. # ImGuiTexInspect, a texture inspector widget for dear imgui
  32. #-------------------------------------------------------------------------
  33. # [SECTION] INIT & SHUTDOWN
  34. #-------------------------------------------------------------------------
  35. def init() -> None:
  36. pass
  37. def shutdown() -> None:
  38. pass
  39. #-------------------------------------------------------------------------
  40. # [SECTION] BASIC USAGE
  41. #-------------------------------------------------------------------------
  42. class InspectorAlphaMode(enum.IntEnum):
  43. im_gui = enum.auto() # (= 0) # Alpha is transparency so you see the ImGui panel background behind image
  44. black = enum.auto() # (= 1) # Alpha is used to blend over a black background
  45. white = enum.auto() # (= 2) # Alpha is used to blend over a white background
  46. custom_color = enum.auto() # (= 3) # Alpha is used to blend over a custom colour.
  47. class InspectorFlags_(enum.IntEnum):
  48. show_wrap = enum.auto() # (= 1 << 0) # Draw beyong the [0,1] uv range. What you see will depend on API
  49. no_force_filter_nearest = enum.auto() # (= 1 << 1) # Normally we force nearest neighbour sampling when zoomed in. Set to disable this.
  50. no_grid = enum.auto() # (= 1 << 2) # By default a grid is shown at high zoom levels
  51. no_tooltip = enum.auto() # (= 1 << 3) # Disable tooltip on hover
  52. fill_horizontal = enum.auto() # (= 1 << 4) # Scale to fill available space horizontally
  53. fill_vertical = enum.auto() # (= 1 << 5) # Scale to fill available space vertically
  54. no_auto_read_texture = enum.auto() # (= 1 << 6) # By default texture data is read to CPU every frame for tooltip and annotations
  55. flip_x = enum.auto() # (= 1 << 7) # Horizontally flip the way the texture is displayed
  56. flip_y = enum.auto() # (= 1 << 8) # Vertically flip the way the texture is displayed
  57. # Use one of these Size structs if you want to specify an exact size for the inspector panel.
  58. # * E.g.
  59. # * BeginInspectorPanel("MyPanel", texture_1K, ImVec2(1024,1024), 0, SizeExcludingBorder(ImVec2(1024,1024)));
  60. # *
  61. # * However, most of the time the default size will be fine. E.g.
  62. # *
  63. # * BeginInspectorPanel("MyPanel", texture_1K, ImVec2(1024,1024));
  64. #
  65. class SizeIncludingBorder:
  66. size: ImVec2
  67. def __init__(self, size: ImVec2Like) -> None:
  68. pass
  69. class SizeExcludingBorder:
  70. size: ImVec2
  71. def __init__(self, size: ImVec2Like) -> None:
  72. pass
  73. # BeginInspectorPanel
  74. # * Returns True if panel is drawn. Note that flags will only be considered on the first call
  75. @overload
  76. def begin_inspector_panel(
  77. name: str,
  78. param_1: ImTextureID,
  79. texture_size: ImVec2Like,
  80. flags: InspectorFlags = 0
  81. ) -> bool:
  82. pass
  83. @overload
  84. def begin_inspector_panel(
  85. name: str,
  86. param_1: ImTextureID,
  87. texture_size: ImVec2Like,
  88. flags: InspectorFlags,
  89. size: SizeIncludingBorder
  90. ) -> bool:
  91. pass
  92. @overload
  93. def begin_inspector_panel(
  94. name: str,
  95. param_1: ImTextureID,
  96. texture_size: ImVec2Like,
  97. flags: InspectorFlags,
  98. size: SizeExcludingBorder
  99. ) -> bool:
  100. pass
  101. def end_inspector_panel() -> None:
  102. """ EndInspectorPanel
  103. * Always call after BeginInspectorPanel and after you have drawn any required annotations
  104. """
  105. pass
  106. def release_inspector_data(id: ImGuiID) -> None:
  107. """ ReleaseInspectorData
  108. * ImGuiTexInspect keeps texture data cached in memory. If you know you won't
  109. * be displaying a particular panel for a while you can call this to release
  110. * the memory. It won't be allocated again until next time you call
  111. * BeginInspectorPanel. If id is None then the current (most recent) inspector
  112. * will be affected. Unless you have a lot of different Inspector instances
  113. * you can probably not worry about this. Call CurrentInspector_GetID to get
  114. * the ID of an inspector.
  115. """
  116. pass
  117. #-------------------------------------------------------------------------
  118. # [SECTION] CURRENT INSPECTOR MANIPULATORS
  119. #-------------------------------------------------------------------------
  120. #/* All the functions starting with CurrentInspector_ can be used after calling
  121. # * BeginInspector until the end of the frame. It is not necessary to call them
  122. # * before the matching EndInspectorPanel
  123. # */
  124. # CurrentInspector_SetAlphaMode - see enum comments for details
  125. def current_inspector_set_alpha_mode(param_0: InspectorAlphaMode) -> None:
  126. pass
  127. def current_inspector_set_flags(
  128. to_set: InspectorFlags,
  129. to_clear: InspectorFlags = 0
  130. ) -> None:
  131. pass
  132. def current_inspector_clear_flags(to_clear: InspectorFlags) -> None:
  133. pass
  134. def current_inspector_set_grid_color(color: ImU32) -> None:
  135. pass
  136. def current_inspector_set_max_annotations(max_annotations: int) -> None:
  137. pass
  138. def current_inspector_invalidate_texture_cache() -> None:
  139. """ CurrentInspector_InvalidateTextureCache
  140. * If using the InspectorFlags_NoAutoReadTexture flag then call this to
  141. * indicate your texture has changed context.
  142. """
  143. pass
  144. # CurrentInspector_SetCustomBackgroundColor
  145. # * If using InspectorAlphaMode_CustomColor then this is the color that will be
  146. # * blended as the background where alpha is less than one.
  147. #
  148. @overload
  149. def current_inspector_set_custom_background_color(color: ImVec4Like) -> None:
  150. pass
  151. @overload
  152. def current_inspector_set_custom_background_color(color: ImU32) -> None:
  153. pass
  154. def current_inspector_get_id() -> ImGuiID:
  155. """ CurrentInspector_GetID
  156. * Get the ID of the current inspector. Currently only used for calling
  157. * ReleaseInspectorData.
  158. """
  159. pass
  160. # Some convenience functions for drawing ImGui controls for the current Inspector
  161. def draw_color_matrix_editor() -> None:
  162. """ ColorMatrix editor. See comments on ColorMatrix below."""
  163. pass
  164. def draw_grid_editor() -> None:
  165. """ Grid editor. Enable/Disable grid. Set Grid Color."""
  166. pass
  167. def draw_color_channel_selector() -> None:
  168. """ For toggling R,G,B channels"""
  169. pass
  170. def draw_alpha_mode_selector() -> None:
  171. """ A combo box for selecting the alpha mode"""
  172. pass
  173. def set_zoom_rate(factor: float) -> None:
  174. """-------------------------------------------------------------------------
  175. [SECTION] CONTEXT-WIDE SETTINGS
  176. -------------------------------------------------------------------------
  177. /* SetZoomRate
  178. * factor should be greater than 1. A value of 1.5 means one mouse wheel
  179. * scroll will increase zoom level by 50%. The factor used for zooming out is
  180. * 1/factor. */
  181. """
  182. pass
  183. #-------------------------------------------------------------------------
  184. # [SECTION] ANNOTATION TOOLS
  185. #-------------------------------------------------------------------------
  186. def draw_annotation_line(
  187. draw_list: ImDrawList,
  188. from_texel: ImVec2Like,
  189. to_texel: ImVec2Like,
  190. texels_to_pixels: Transform2D,
  191. color: ImU32
  192. ) -> None:
  193. """ DrawAnnotationLine
  194. * Convenience function to add a line to draw list using texel coordinates.
  195. """
  196. pass
  197. #-------------------------------------------------------------------------
  198. # [SECTION] Annotation Classes
  199. #-------------------------------------------------------------------------
  200. class ValueText:
  201. """ ValueText
  202. * An annoation class that draws text inside each texel when zoom level is high enough for it to fit.
  203. * The text shows the value of the texel. E.g. "R:255, G: 128, B:0, A:255"
  204. """
  205. class Format(enum.IntEnum):
  206. hex_string = enum.auto() # (= 0) # E.g. #EF97B9FF
  207. bytes_hex = enum.auto() # (= 1) # E.g. R:#EF G:#97 B:#B9 A:#FF (split over 4 lines)
  208. bytes_dec = enum.auto() # (= 2) # E.g. R:239 G: 151 B:185 A:255 (split over 4 lines)
  209. floats = enum.auto() # (= 3) # E.g. 0.937 0.592 0.725 1.000 (split over 4 lines)
  210. def __init__(self, format: ValueText.Format = ValueText.HexString) -> None:
  211. pass
  212. def draw_annotation(
  213. self,
  214. draw_list: ImDrawList,
  215. texel: ImVec2Like,
  216. texels_to_pixels: Transform2D,
  217. value: ImVec4Like
  218. ) -> None:
  219. pass
  220. class Arrow:
  221. """ Arrow
  222. * An annotation class that draws an arrow inside each texel when zoom level is
  223. * high enough. The direction and length of the arrow are determined by texel
  224. * values.
  225. * The X and Y components of the arrow is determined by the VectorIndex_x, and
  226. * VectorIndex_y channels of the texel value. Examples:
  227. * VectorIndex_x = 0, VectorIndex_y = 1 means X component is red and Y component is green
  228. * VectorIndex_x = 1, VectorIndex_y = 2 means X component is green and Y component is blue
  229. * VectorIndex_x = 0, VectorIndex_y = 3 means X component is red and Y component is alpha
  230. *
  231. * ZeroPoint is the texel value which corresponds to a zero length vector. E.g.
  232. * ZeroPoint = (0.5, 0.5) means (0.5, 0.5) will be drawn as a zero length arrow
  233. *
  234. * All public properties can be directly manipulated. There are also presets that can be set
  235. * by calling UsePreset.
  236. """
  237. vector_index_x: int
  238. vector_index_y: int
  239. line_scale: ImVec2
  240. zero_point: ImVec2 = ImVec2(0, 0)
  241. class Preset(enum.IntEnum):
  242. normal_map = enum.auto() # (= 0) # For normal maps. I.e. Arrow is in (R,G) channels. 128, 128 is zero point
  243. normalized_float = enum.auto() # (= 1) # Arrow in (R,G) channels. 0,0 is zero point, (1,0) will draw an arrow exactly to
  244. # right edge of texture. (0,-1) will draw exactly to the bottom etc.
  245. def __init__(
  246. self,
  247. x_vector_index: int = 0,
  248. y_vector_index: int = 1,
  249. line_scale: Optional[ImVec2Like] = None
  250. ) -> None:
  251. """Python bindings defaults:
  252. If lineScale is None, then its default value will be: ImVec2(1, 1)
  253. """
  254. pass
  255. def use_preset(self, param_0: Arrow.Preset) -> Arrow:
  256. pass
  257. def draw_annotation(
  258. self,
  259. draw_list: ImDrawList,
  260. texel: ImVec2Like,
  261. texels_to_pixels: Transform2D,
  262. value: ImVec4Like
  263. ) -> None:
  264. pass
  265. #-------------------------------------------------------------------------
  266. # [SECTION] INTERNAL
  267. #-------------------------------------------------------------------------
  268. class Transform2D:
  269. scale: ImVec2
  270. translate: ImVec2
  271. def __mul__(self, rhs: ImVec2Like) -> ImVec2:
  272. """ Transform a vector by this transform. Scale is applied first"""
  273. pass
  274. def inverse(self) -> Transform2D:
  275. """ Return an inverse transform such that transform.Inverse() * transform * vector == vector"""
  276. pass
  277. def __init__(
  278. self,
  279. scale: Optional[ImVec2Like] = None,
  280. translate: Optional[ImVec2Like] = None
  281. ) -> None:
  282. """Auto-generated default constructor with named params
  283. Python bindings defaults:
  284. If any of the params below is None, then its default value below will be used:
  285. * Scale: ImVec2()
  286. * Translate: ImVec2()
  287. """
  288. pass
  289. #-------------------------------------------------------------------------
  290. # [SECTION] FORWARD DECLARATIONS FOR TEMPLATE IMPLEMENTATION - Do not call directly
  291. #-------------------------------------------------------------------------
  292. #################### </generated_from:imgui_tex_inspect.h> ####################
  293. #################### <generated_from:imgui_tex_inspect_demo.h> ####################
  294. # ImGuiTexInspect, a texture inspector widget for dear imgui
  295. class Texture:
  296. texture: ImTextureID
  297. size: ImVec2
  298. def __init__(
  299. self,
  300. texture: Optional[ImTextureID] = None,
  301. size: Optional[ImVec2Like] = None
  302. ) -> None:
  303. """Auto-generated default constructor with named params
  304. Python bindings defaults:
  305. If any of the params below is None, then its default value below will be used:
  306. * texture: ImTextureID()
  307. * size: ImVec2()
  308. """
  309. pass
  310. def show_demo_window() -> None:
  311. pass
  312. #################### </generated_from:imgui_tex_inspect_demo.h> ####################
  313. # </litgen_stub> // Autogenerated code end!