Class Image

Inheritance Relationships

Base Type

Derived Type

Class Documentation

class Image : public portal::renderer::RendererResource

Abstract image interface for GPU textures and render targets.

Provides dimension queries, data transfer, mipmap support, and per-layer view creation. Concrete implementations (VulkanImage) handle actual GPU allocation.

Subclassed by portal::renderer::vulkan::VulkanImage

Public Functions

inline explicit Image(const StringId &id)
virtual void resize(size_t width, size_t height) = 0

Resizes image (recreates GPU allocation)

virtual void reallocate() = 0

Reallocates image with current properties.

virtual void release() = 0

Releases GPU resources.

virtual size_t get_width() const = 0

Gets image width.

virtual size_t get_height() const = 0

Gets image height.

virtual glm::uvec2 get_size() const = 0

Gets image size as 2D vector.

virtual bool has_mip() const = 0

Checks if image has mipmaps.

virtual float get_aspect_ratio() const = 0

Gets aspect ratio (width/height)

virtual const image::Properties &get_prop() const = 0

Gets image properties.

virtual Buffer get_buffer() const = 0

Gets CPU buffer (const)

virtual Buffer &get_buffer() = 0

Gets CPU buffer (mutable)

virtual Reference<ImageView> get_view() const = 0
virtual void create_per_layer_image_view() = 0

Creates per-layer image views for array/cube textures.

virtual void set_data(Buffer buffer) = 0

Uploads data to GPU.

Parameters:

buffer – CPU buffer to upload

virtual Buffer copy_to_host_buffer() = 0

Downloads GPU data to CPU buffer.

Returns:

CPU buffer with image data