Raven Engine v0.1
Loading...
Searching...
No Matches
Raven::Image2D Class Referenceabstract

Abstract interface representing a GPU image resource.Defines lifecycle management, resizing, and query functions for images. More...

#include <Image.h>

Inheritance diagram for Raven::Image2D:
Raven::VulkanImage2D

Public Member Functions

virtual ~Image2D ()=default
virtual ImageSpecificationGetSpecification ()=0
 Get mutable reference to the image specification.
virtual const ImageSpecificationGetSpecification () const =0
 Get immutable reference to the image specification.
virtual void Resize (const u32 width, const u32 height)=0
 Resize the image to new width and height.
virtual u32 GetWidth () const =0
 Get the width of the image in pixels.
virtual u32 GetHeight () const =0
 Get the height of the image in pixels.
virtual Crux::uvec2 GetSize () const =0
 Get image size as 2D vector.
virtual float GetAspectRatio () const =0
 Get the aspect ratio (width/height) of the image.
virtual void Invalidate ()=0
 Invalidate the image resource.
virtual void Release ()=0
 Release the image resource immediately.
virtual void CreatePerLayerImageViews ()=0
 Create per-layer image views.
virtual Buffer GetBuffer () const =0
 Get a copy of the internal buffer abstraction.
virtual BufferGetBuffer ()=0
 Get a mutable reference to the internal buffer.

Static Public Member Functions

static Ref< Image2DCreate (const ImageSpecification &spec)
 Factory method to create a concrete Image2D instance.

Detailed Description

Abstract interface representing a GPU image resource.

Defines lifecycle management, resizing, and query functions for images.

Constructor & Destructor Documentation

◆ ~Image2D()

virtual Raven::Image2D::~Image2D ( )
virtualdefault

Member Function Documentation

◆ Create()

Ref< Image2D > Raven::Image2D::Create ( const ImageSpecification & spec)
static

Factory method to create a concrete Image2D instance.

Parameters
specSpecification for the image creation.
Returns
Reference-counted pointer to the created Image2D.

◆ CreatePerLayerImageViews()

virtual void Raven::Image2D::CreatePerLayerImageViews ( )
pure virtual

Create per-layer image views.

Generates Vulkan image views (or API equivalent) for each layer of the image. Important for array textures or layered rendering.

Implemented in Raven::VulkanImage2D.

◆ GetAspectRatio()

virtual float Raven::Image2D::GetAspectRatio ( ) const
pure virtual

Get the aspect ratio (width/height) of the image.

Returns
Floating point aspect ratio.

Implemented in Raven::VulkanImage2D.

◆ GetBuffer() [1/2]

virtual Buffer Raven::Image2D::GetBuffer ( ) const
pure virtual

Get a copy of the internal buffer abstraction.

Returns
Buffer representing the image's underlying memory.

Implemented in Raven::VulkanImage2D.

◆ GetBuffer() [2/2]

virtual Buffer & Raven::Image2D::GetBuffer ( )
pure virtual

Get a mutable reference to the internal buffer.

Allows modification of the buffer, e.g., for updates or transfers.

Implemented in Raven::VulkanImage2D.

◆ GetHeight()

virtual u32 Raven::Image2D::GetHeight ( ) const
pure virtual

Get the height of the image in pixels.

Returns
Height in pixels.

Implemented in Raven::VulkanImage2D.

◆ GetSize()

virtual Crux::uvec2 Raven::Image2D::GetSize ( ) const
pure virtual

Get image size as 2D vector.

Returns
Vector containing width and height.

Implemented in Raven::VulkanImage2D.

◆ GetSpecification() [1/2]

virtual const ImageSpecification & Raven::Image2D::GetSpecification ( ) const
pure virtual

Get immutable reference to the image specification.

For read-only access to image parameters.

Implemented in Raven::VulkanImage2D.

◆ GetSpecification() [2/2]

virtual ImageSpecification & Raven::Image2D::GetSpecification ( )
pure virtual

Get mutable reference to the image specification.

Allows querying and modifying image creation parameters after instantiation.

Implemented in Raven::VulkanImage2D.

◆ GetWidth()

virtual u32 Raven::Image2D::GetWidth ( ) const
pure virtual

Get the width of the image in pixels.

Returns
Width in pixels.

Implemented in Raven::VulkanImage2D.

◆ Invalidate()

virtual void Raven::Image2D::Invalidate ( )
pure virtual

Invalidate the image resource.

Signals that the current GPU resource is stale and needs re-creation.

Implemented in Raven::VulkanImage2D.

◆ Release()

virtual void Raven::Image2D::Release ( )
pure virtual

Release the image resource immediately.

Frees associated GPU resources.

Implemented in Raven::VulkanImage2D.

◆ Resize()

virtual void Raven::Image2D::Resize ( const u32 width,
const u32 height )
pure virtual

Resize the image to new width and height.

Parameters
widthNew image width in pixels.
heightNew image height in pixels.

Typically triggers resource re-creation internally.

Implemented in Raven::VulkanImage2D.


The documentation for this class was generated from the following files: