Skip to content
Snippets Groups Projects
Verified Commit 160c8569 authored by Tobias Frisch's avatar Tobias Frisch
Browse files

Adjusted doxygen comments of images

parent 5abd98b4
No related branches found
No related tags found
1 merge request!97Resolve "Dokumentation vervollständigen"
...@@ -14,6 +14,13 @@ namespace vkcv { ...@@ -14,6 +14,13 @@ namespace vkcv {
class ImageManager; class ImageManager;
/**
* @brief Returns whether an image format is usable as depth buffer.
*
* @param format Vulkan image format
* @return True, if the format is valid to use as depth buffer,
* otherwise false.
*/
bool isDepthFormat(const vk::Format format); bool isDepthFormat(const vk::Format format);
class Image { class Image {
...@@ -21,76 +28,107 @@ namespace vkcv { ...@@ -21,76 +28,107 @@ namespace vkcv {
public: public:
/** /**
* @return Vulkan format of the image * @brief Returns the format of the image.
*
* @return Vulkan image format
*/ */
[[nodiscard]] [[nodiscard]]
vk::Format getFormat() const; vk::Format getFormat() const;
/** /**
* @brief Returns the width of the image.
*
* @return Width of the image * @return Width of the image
*/ */
[[nodiscard]] [[nodiscard]]
uint32_t getWidth() const; uint32_t getWidth() const;
/** /**
* @brief Returns the height of the image.
*
* @return Height of the image * @return Height of the image
*/ */
[[nodiscard]] [[nodiscard]]
uint32_t getHeight() const; uint32_t getHeight() const;
/** /**
* @brief Returns the depth of the image.
*
* @return Depth of the image * @return Depth of the image
*/ */
[[nodiscard]] [[nodiscard]]
uint32_t getDepth() const; uint32_t getDepth() const;
/** /**
* @return Handle of the image to be used with the #Core * @brief Returns the image handle of the image.
*
* @return Handle of the image
*/ */
[[nodiscard]] [[nodiscard]]
const vkcv::ImageHandle& getHandle() const; const vkcv::ImageHandle& getHandle() const;
/** /**
* @return Number of mip levels of the image * @brief Returns the amount of mip levels of the image.
*
* @return Number of mip levels
*/ */
[[nodiscard]] [[nodiscard]]
uint32_t getMipCount() const; uint32_t getMipCount() const;
/** /**
* @brief Switch the image layout, returns after operation is finished * @brief Switches the image layout,
* returns after operation is finished.
* *
* @param newLayout Layout that image is switched to * @param[in] newLayout Layout that image is switched to
*/ */
void switchLayout(vk::ImageLayout newLayout); void switchLayout(vk::ImageLayout newLayout);
/** /**
* @brief Fill the image with data * @brief Fills the image with data of a given size in bytes.
* *
* @param data Pointer to the source data * @param[in] data Pointer to the source data
* @param size Lower limit of the data size to copy in bytes, * @param[in] size Lower limit of the data size to copy in bytes,
* the actual number of copied bytes is min(size, imageDataSize) * the actual number of copied bytes is min(size, imageDataSize)
*/ */
void fill(const void* data, size_t size = SIZE_MAX); void fill(const void* data, size_t size = SIZE_MAX);
/** /**
* @brief Generates the entire mip chain from mip 0, returns after operation is finished * @brief Generates the entire mip chain from mip level zero,
* returns after operation is finished
*/ */
void generateMipChainImmediate(); void generateMipChainImmediate();
/** /**
* @brief Record mip chain generation to command stream, mip 0 is used as source * @brief Records mip chain generation to command stream,
* mip level zero is used as source
* *
* @param cmdStream Command stream that the commands are recorded into * @param[out] cmdStream Command stream that the commands are recorded into
*/ */
void recordMipChainGeneration(const vkcv::CommandStreamHandle& cmdStream); void recordMipChainGeneration(const vkcv::CommandStreamHandle& cmdStream);
private: private:
// TODO: const qualifier removed, very hacky!!! // TODO: const qualifier removed, very hacky!!!
// Else you cannot recreate an image. Pls fix. // Else you cannot recreate an image. Pls fix.
ImageManager* m_manager; ImageManager* m_manager;
ImageHandle m_handle; ImageHandle m_handle;
Image(ImageManager* manager, const ImageHandle& handle); Image(ImageManager* manager, const ImageHandle& handle);
/**
* @brief Creates an image with given parameters like width, height,
* depth, amount of mip levels and others.
*
* @param[in,out] manager Image manager
* @param[in] format Vulkan image format
* @param[in] width Width of the image
* @param[in] height Height of the image
* @param[in] depth Depth of the image
* @param[in] mipCount Amount of mip levels
* @param[in] supportStorage Support of storage
* @param[in] supportColorAttachment Support of color attachment
* @param[in] msaa MSAA mode
* @return New created image
*/
static Image create( static Image create(
ImageManager* manager, ImageManager* manager,
vk::Format format, vk::Format format,
......
...@@ -11,7 +11,22 @@ namespace vkcv { ...@@ -11,7 +11,22 @@ namespace vkcv {
enum class Multisampling { None, MSAA2X, MSAA4X, MSAA8X }; enum class Multisampling { None, MSAA2X, MSAA4X, MSAA8X };
/**
* @brief Returns the sample count flag bits of a given
* multi-sample anti-aliasing mode.
*
* @param[in] msaa MSAA mode
* @return Sample count flag bits
*/
vk::SampleCountFlagBits msaaToVkSampleCountFlag(Multisampling msaa); vk::SampleCountFlagBits msaaToVkSampleCountFlag(Multisampling msaa);
uint32_t msaaToSampleCount(Multisampling msaa);
/**
* @brief Returns the amount of samples of a given
* multi-sample anti-aliasing mode.
*
* @param msaa MSAA mode
* @return Number of samples
*/
uint32_t msaaToSampleCount(Multisampling msaa);
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment