Function getFileDialogFilters

Synopsis

#include <Source/Falcor/Utils/Image/Bitmap.h>

static FileDialogFilterVec getFileDialogFilters(ResourceFormat format=ResourceFormat::Unknown)

Description

Get the file dialog filter vec for images.

Parameters:

[ in ] format - If set to ResourceFormat::Unknown, will return all the supported image file formats. If set to something else, will only return file types which support this format.

Source

Lines 356-389 in Source/Falcor/Utils/Image/Bitmap.cpp. Line 106 in Source/Falcor/Utils/Image/Bitmap.h.

FileDialogFilterVec Bitmap::getFileDialogFilters(ResourceFormat format)
{
    FileDialogFilterVec filters;
    bool showHdr = true;
    bool showLdr = true;
    if (format != ResourceFormat::Unknown)
    {
        // Save float, half and large integer (16/32 bit) formats as HDR.
        showHdr = getFormatType(format) == FormatType::Float || isConvertibleToRGBA32Float(format);
        showLdr = !showHdr;
    }
    if (showHdr)
    {
        filters.push_back({ "exr", "High Dynamic Range" });
        filters.push_back({ "pfm", "Portable Float Map" });
    }
    if (showLdr)
    {
        filters.push_back({ "png", "Portable Network Graphics" });
        filters.push_back({ "jpg", "JPEG" });
        filters.push_back({ "bmp", "Bitmap Image File" });
        filters.push_back({ "tga", "Truevision Graphics Adapter" });
    }
    // List of formats we can only load from
    if (format == ResourceFormat::Unknown)
    {
        filters.push_back({ "hdr", "High Dynamic Range" });
    }
    return filters;
}





Add Discussion as Guest

Log in to DocsForge