Skip to content

Conversation

henrik-andersson-sus
Copy link
Contributor

Added support for displaying DDS images using the Pfim library.

@henrik-andersson-sus
Copy link
Contributor Author

One improvement might be to create a helper file to move the hash sets IMG_EXTS and PFIM_EXTS but also the functions BitmapFromFile, BitmapFromStream and BitmapFromPfim since they are used from multiple classes, but I'm unsure of the file structure to know where to place such file.

@henrik-andersson-sus
Copy link
Contributor Author

henrik-andersson-sus commented Jun 6, 2025

I've rebased the branch based on the refactoring i a023a92 which also solves my concern regarding the file structure 👍Now it is implemented as a separate ImageDecoder

@love-linger
Copy link
Collaborator

Avalonia also supports multiple pixel formats, see PixelFormats

public static class PixelFormats
{
    public static PixelFormat Rgb565 { get; } = new PixelFormat(PixelFormatEnum.Rgb565);
    public static PixelFormat Rgba8888 { get; } = new PixelFormat(PixelFormatEnum.Rgba8888);
    public static PixelFormat Rgba64 { get; } = new PixelFormat(PixelFormatEnum.Rgba64);
    public static PixelFormat Bgra8888 { get; } = new PixelFormat(PixelFormatEnum.Bgra8888);
    public static PixelFormat BlackWhite { get; } = new PixelFormat(PixelFormatEnum.BlackWhite);
    public static PixelFormat Gray2 { get; } = new PixelFormat(PixelFormatEnum.Gray2);
    public static PixelFormat Gray4 { get; } = new PixelFormat(PixelFormatEnum.Gray4);
    public static PixelFormat Gray8 { get; } = new PixelFormat(PixelFormatEnum.Gray8);
    public static PixelFormat Gray16 { get; } = new PixelFormat(PixelFormatEnum.Gray16);
    public static PixelFormat Gray32Float { get; } = new PixelFormat(PixelFormatEnum.Gray32Float);
    public static PixelFormat Rgb24 { get; } = new PixelFormat(PixelFormatEnum.Rgb24);
    public static PixelFormat Rgb32 { get; } = new PixelFormat(PixelFormatEnum.Rgb32);
    public static PixelFormat Bgr24 { get; } = new PixelFormat(PixelFormatEnum.Bgr24);
    public static PixelFormat Bgr32 { get; } = new PixelFormat(PixelFormatEnum.Bgr32);
    public static PixelFormat Bgr555 { get; } = new PixelFormat(PixelFormatEnum.Bgr555);
    public static PixelFormat Bgr565 { get; } = new PixelFormat(PixelFormatEnum.Bgr565);
}

@love-linger love-linger self-assigned this Jun 6, 2025
@love-linger love-linger added the enhancement New feature or request label Jun 6, 2025
@love-linger love-linger merged commit a2ca071 into sourcegit-scm:develop Jun 6, 2025
13 checks passed
love-linger added a commit that referenced this pull request Jun 6, 2025
- fix the issue that not all channel takes 8 bits
- if `PixelFormatTranscoder.Transcode` supports the same pixel formats, let it converts pixels automatically

Signed-off-by: leo <[email protected]>
love-linger added a commit that referenced this pull request Jun 6, 2025
- fix the issue that not all channel takes 8 bits
- if `PixelFormatTranscoder.Transcode` supports the same pixel formats, let it converts pixels automatically

Signed-off-by: leo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants