Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
ImageToolsFwd.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2018 DIVIDE-Studio
3 Copyright (c) 2009 Ionut Cava
4
5 This file is part of DIVIDE Framework.
6
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software
9 and associated documentation files (the "Software"), to deal in the Software
10 without restriction,
11 including without limitation the rights to use, copy, modify, merge, publish,
12 distribute, sublicense,
13 and/or sell copies of the Software, and to permit persons to whom the
14 Software is furnished to do so,
15 subject to the following conditions:
16
17 The above copyright notice and this permission notice shall be included in
18 all copies or substantial portions of the Software.
19
20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 IMPLIED,
22 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
23 PARTICULAR PURPOSE AND NONINFRINGEMENT.
24 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
25 DAMAGES OR OTHER LIABILITY,
26 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
27 IN CONNECTION WITH THE SOFTWARE
28 OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
30 */
31
32#pragma once
33#ifndef DVD_UTILITY_IMAGETOOLS_FWD_H
34#define DVD_UTILITY_IMAGETOOLS_FWD_H
35
36namespace Divide {
37 namespace ImageTools {
38
39 void OnStartup(bool upperLeftOrigin);
40 void OnShutdown();
41
42 [[nodiscard]] bool UseUpperLeftOrigin() noexcept;
43
44 enum class MipMapFilter : U8 {
45 BOX,
47 KAISER,
48 COUNT
49 };
50
51 enum class ImageOutputFormat : U8 {
52 BC1, //Will be BC1n for normal maps
53 BC1a,
54 BC2,
55 BC3,//Will be BC3n for normal maps
56 BC4,
57 BC5,
58 BC6,
59 BC7,
60 //BC3_RGBM, //Not supported
61 AUTO, // BC7 for textures, BC5 for normal maps, BC4 single channel images
62 COUNT
63 };
64
66 bool _useDDSCache = true;
67 bool _waitForDDSConversion = false;
68 bool _skipMipMaps = false;
69 bool _isNormalMap = false;
70 bool _fastCompression = false;
71 bool _outputSRGB = false;
75 };
76
78
79
80 enum class SaveImageFormat : U8 {
81 PNG,
82 BMP,
83 TGA,
84 //HDR, /// Use special function for this!
85 JPG,
86 COUNT
87 };
88
90 bool SaveImage(const ResourcePath& filename, U16 width, U16 height, U8 numberOfComponents, U8 bytesPerPixel, const bool sourceIsBGR, const Byte* imageData, SaveImageFormat format);
92 bool SaveImageHDR(const ResourcePath& filename, U16 width, U16 height, U8 numberOfComponents, U8 bytesPerPixel, const bool sourceIsBGR, const F32* imageData);
93
94 } //namespace ImageTools
95} //namespace Divide
96
97#endif //DVD_UTILITY_IMAGETOOLS_FWD_H
#define FWD_DECLARE_MANAGED_STRUCT(T)
bool SaveImage(const ResourcePath &filename, U16 width, U16 height, U8 numberOfComponents, U8 bytesPerPixel, const bool sourceIsBGR, const Byte *imageData, SaveImageFormat format)
Save an image to file of the desired format. Only R/RG/RGB/RGBA 8 bits per pixel data is supported as...
bool UseUpperLeftOrigin() noexcept
Definition: ImageTools.cpp:202
void OnStartup(bool upperLeftOrigin)
Definition: ImageTools.cpp:186
bool SaveImageHDR(const ResourcePath &filename, U16 width, U16 height, U8 numberOfComponents, U8 bytesPerPixel, const bool sourceIsBGR, const F32 *imageData)
Save an HDR image to file of the desired format.
Handle console commands that start with a forward slash.
Definition: AIProcessor.cpp:7
std::byte Byte
uint8_t U8
uint16_t U16
bool _alphaChannelTransparency
If false, the alpha channel represents arbitrary data (e.g. in splatmaps)
Definition: ImageToolsFwd.h:72
bool _waitForDDSConversion
If false, we will load the src image and convert to DDS in the background. If true,...
Definition: ImageToolsFwd.h:67