encode.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. /*
  2. * Copyright 2011-2018 Branimir Karadzic. All rights reserved.
  3. * License: https://github.com/bkaradzic/bimg#license-bsd-2-clause
  4. */
  5. #ifndef BIMG_ENCODE_H_HEADER_GUARD
  6. #define BIMG_ENCODE_H_HEADER_GUARD
  7. #include "bimg.h"
  8. namespace bimg
  9. {
  10. struct Quality
  11. {
  12. enum Enum
  13. {
  14. Default,
  15. Highest,
  16. Fastest,
  17. Count
  18. };
  19. };
  20. ///
  21. void imageEncodeFromRgba8(
  22. bx::AllocatorI* _allocator
  23. , void* _dst
  24. , const void* _src
  25. , uint32_t _width
  26. , uint32_t _height
  27. , uint32_t _depth
  28. , TextureFormat::Enum _format
  29. , Quality::Enum _quality
  30. , bx::Error* _err = NULL
  31. );
  32. ///
  33. void imageEncodeFromRgba32f(
  34. bx::AllocatorI* _allocator
  35. , void* _dst
  36. , const void* _src
  37. , uint32_t _width
  38. , uint32_t _height
  39. , uint32_t _depth
  40. , TextureFormat::Enum _format
  41. , Quality::Enum _quality
  42. , bx::Error* _err = NULL
  43. );
  44. ///
  45. void imageEncode(
  46. bx::AllocatorI* _allocator
  47. , void* _dst
  48. , const void* _src
  49. , TextureFormat::Enum _srcFormat
  50. , uint32_t _width
  51. , uint32_t _height
  52. , uint32_t _depth
  53. , TextureFormat::Enum _dstFormat
  54. , Quality::Enum _quality
  55. , bx::Error* _err
  56. );
  57. ///
  58. ImageContainer* imageEncode(
  59. bx::AllocatorI* _allocator
  60. , TextureFormat::Enum _dstFormat
  61. , Quality::Enum _quality
  62. , const ImageContainer& _input
  63. );
  64. ///
  65. void imageRgba32f11to01(
  66. void* _dst
  67. , uint32_t _width
  68. , uint32_t _height
  69. , uint32_t _depth
  70. , uint32_t _pitch
  71. , const void* _src
  72. );
  73. ///
  74. void imageMakeDist(
  75. bx::AllocatorI* _allocator
  76. , void* _dst
  77. , uint32_t _width
  78. , uint32_t _height
  79. , uint32_t _srcPitch
  80. , const void* _src
  81. );
  82. ///
  83. float imageQualityRgba8(
  84. const void* _reference
  85. , const void* _data
  86. , uint16_t _width
  87. , uint16_t _height
  88. );
  89. ///
  90. bool imageResizeRgba32fLinear(
  91. ImageContainer* _dst
  92. , const ImageContainer* _src
  93. );
  94. ///
  95. float imageAlphaTestCoverage(
  96. TextureFormat::Enum _format
  97. , uint32_t _width
  98. , uint32_t _height
  99. , uint32_t _srcPitch
  100. , const void* _src
  101. , float _alphaRef
  102. , float _scale = 1.0f
  103. );
  104. ///
  105. void imageScaleAlphaToCoverage(
  106. TextureFormat::Enum _format
  107. , uint32_t _width
  108. , uint32_t _height
  109. , uint32_t _srcPitch
  110. , void* _src
  111. , float _coverage
  112. , float _alphaRef
  113. );
  114. ///
  115. ImageContainer* imageCubemapFromLatLongRgba32F(
  116. bx::AllocatorI* _allocator
  117. , const ImageContainer& _input
  118. , bool _useBilinearInterpolation
  119. , bx::Error* _err
  120. );
  121. ///
  122. ImageContainer* imageCubemapFromStripRgba32F(
  123. bx::AllocatorI* _allocator
  124. , const ImageContainer& _input
  125. , bx::Error* _err
  126. );
  127. ///
  128. ImageContainer* imageGenerateMips(
  129. bx::AllocatorI* _allocator
  130. , const ImageContainer& _image
  131. );
  132. struct LightingModel
  133. {
  134. enum Enum
  135. {
  136. Phong,
  137. PhongBrdf,
  138. Blinn,
  139. BlinnBrdf,
  140. Ggx,
  141. Count
  142. };
  143. };
  144. ///
  145. ImageContainer* imageCubemapRadianceFilter(
  146. bx::AllocatorI* _allocator
  147. , const ImageContainer& _image
  148. , LightingModel::Enum _lightingModel
  149. , bx::Error* _err
  150. );
  151. } // namespace bimg
  152. #endif // BIMG_ENCODE_H_HEADER_GUARD