Image
Image module provides functions to parse and save image files.
Topics
Types
-
Describes one DDS image.
-
Describes one subresource in one DDS image.
-
Represents one loaded DDS image.
-
Describes one image file (except DDS, which is described by DDSImageDesc).
Enumerations
-
Specifies additional flags of one DDS image.
-
Specifies pixel formats of one DDS image. Maps to DXGI_FORMAT.
-
Specifies the dimension of one DDS texture.
-
Formats that can be saved in one image file (except DDS, which is identified by DDSFormat).
Functions
-
Checks whether one DDSFormat is a valid format for DDS files.
-
bool is_compressed(DDSFormat fmt)
Checks whether one DDSFormat is a compressed format.
-
Checks whether one DDSFormat is a packed format.
-
usize bits_per_pixel(DDSFormat fmt)
Gets the number of bits used to represent one pixel in the specified format.
-
constexpr u32 calc_dds_subresoruce_index(u32 mip_slice, u32 array_slice, u32 mip_levels)
Calculates subresource index for the specified subresource in DDS image.
-
R< DDSImage > new_dds_image(const DDSImageDesc &desc)
Creates one new DDS image object that can be saved later.
-
R< DDSImageDesc > read_dds_image_file_desc(const void *data, usize data_size)
Reads DDS image description from DDS image file data.
-
R< DDSImage > read_dds_image(const void *data, usize data_size)
Reads DDS image data from DDS image file data.
-
RV write_dds_file(ISeekableStream *stream, const DDSImage &image)
Writes the DDS image to one DDS file.
-
constexpr u32 pixel_size(ImageFormat format)
Gets the size of one pixel of the specified format in bytes.
-
R< ImageDesc > read_image_file_desc(const void *data, usize data_size)
Reads image description from image file data.
-
Reads image description and pixel data from image file data.
-
RV write_png_file(ISeekableStream stream, const ImageDesc &desc, const void data, usize data_size)
Writes the image data to one PNG file.
-
RV write_bmp_file(ISeekableStream stream, const ImageDesc &desc, const void data, usize data_size)
Writes the image data to one BMP file.
-
RV write_tga_file(ISeekableStream stream, const ImageDesc &desc, const void data, usize data_size)
Writes the image data to one TGA file.
-
Writes the image data to one JPEG file.
-
RV write_hdr_file(ISeekableStream stream, const ImageDesc &desc, const void data, usize data_size)
Writes the image data to one HDR file.
-
Image::ImageFormat get_rhi_desired_format(Image::ImageFormat format)
Gets desired image format form RHI format.
-
RHI::Format image_to_rhi_format(Image::ImageFormat format)
Converts image format to RHI format.
-
Image::ImageFormat rhi_to_image_format(RHI::Format format)
Converts RHI format to image format.
-
RHI::Format dds_to_rhi_format(Image::DDSFormat format)
Converts DDS image format to RHI format.
-
DDSFormat rhi_to_dds_format(RHI::Format format)
Converts RHI format to DDS image format.