This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Basics
Rendering
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Version Control
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
Animations-Related Classes
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
VR-Related Classes
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

Unigine.ImageConverter Class

This class is used to define the convertation parameters required for the image at the import.

ImageConverter Class

Enums

MIPMAPS_MODE#

NameDescription
DISABLE = 0Mipmaps are not generated.
POINT = 1Point filtering method is used at mipmap generation.
LINEAR = 2Linear filtering method is used at mipmap generation.
BLUR = 3Blurring is applied at mipmap generation.
SHARPEN = 4Sharpening is applied at mipmap generation.
COMBINED = 5Combination of the loaded 2D image with the most detailed mipmap image.
GGX = 6Generation of mipmaps for cubemap images (IMAGE_CUBE or IMAGE_CUBE_ARRAY) using GGX BRDF microfacet model.

RESOLUTION_MODE#

NameDescription
AUTO = 0Resolution set by the converter depending on the image format (for example, the 2D image is converted to 2D array / 3D image).
ORIGINAL = 1Resolution of the original image.
MANUAL = 2Resolution set manually in the converter.

COMPRESSION_QUALITY#

NameDescription
LOW = 0Low quality of compression.
HIGH = 1High quality of compression.

RESIZE_FILTER#

NameDescription
POINT = 0Point filtering method used for resizing.
LINEAR = 1Linear filtering method used for resizing.
MIN = 2Minimum filtering method used for resizing.

RANGE_MODE#

NameDescription
DISABLE = 0Image values are not normalized.
NORMALIZE = 1Values in all channels of the image are normalized altogeter to the values from 0 to 1 (i.e. overall brightness of the image). Recommended to be used for colors.
NORMALIZE_PER_CHANNEL = 2Normalization to the values from 0 to 1 is performed for each channel of the image separately.
MANUAL = 3Normalization to manually set values is performed.

Properties

int Type#

The numerical code of the image type.

int Format#

The numerical code of the image format.

ImageConverter.RESOLUTION_MODE ResolutionMode#

The resolution mode to be used for the image.

ImageConverter.RESIZE_FILTER ResizeFilter#

The resize filter to be used for the image.

int Width#

The image width, in pixels.

int Height#

The image height, in pixels.

int Depth#

The image depth, in pixels.

Image.FILE_COMPRESSION FileCompression#

The image file compression type.

ImageConverter.COMPRESSION_QUALITY CompressionQuality#

The image file compression quality.

bool GPUCompression#

The value specifying if GPU compression is used at converting the image.

ImageConverter.MIPMAPS_MODE MipmapsMode#

The filtering type for the image mipmaps.

float MipmapsGamma#

The gamma correction value used for the mipmaps.

float MipmapsFilterRadius#

The radius used for the mipmaps filtering.

float MipmapsFilterIntensity#

The filter intensity value used for the mipmaps.

bool MipmapsSharpOnlyLightness#

The value specifying if sharpness is applied to the HSL lightness value of the mipmap only.

Image.GGX_MIPMAPS_QUALITY GGXMipmapsQuality#

The quality for mipmaps generated for cubemap images using the GGX BRDF microfacet model. The value is applied when the mipmap mode is set to GGX.

ImageConverter.RANGE_MODE RangeMode#

The range mode to be applied at the image conversion.

bool FlipX#

The value specifying if the image is to be flipped horizontally.

bool FlipY#

The value specifying if the image is to be flipped vertically.

int Blur#

The amount of blur in pixels.

int Rotate#

The image rotation angle.

Members


ImageConverter ( ) #

Default constructor. An empty instance with default parameters is created.

ImageConverter ( ImageConverter imageconverter ) #

Constructor. Creates an image converter by copying a given source image converter.

Arguments

  • ImageConverter imageconverter - Source image converter.

void SetRange ( int channel, dvec4 value ) #

Sets the range to be applied at the image conversion.
Notice
The range of the final image will be clamped, if the set range values exceed the maximum values of the image conversion format.

Arguments

  • int channel - Number of the channel to be inverted, in the range from 0 to the total number of channels.
  • dvec4 value - Range values: x and y coordinates of the value specify the original range, z and w specify the range to which the image will be converted.

dvec4 GetRange ( int channel ) #

Returns the range to be applied at the image conversion.

Arguments

  • int channel - Number of the channel to be inverted, in the range from 0 to the total number of channels.

Return value

Range values: x and y coordinates of the value specify the original range, z and w specify the range to which the image will be converted.

bool GetInvertChannel ( int channel ) #

Returns the value indicating if the channel needs to be inverted.

Arguments

  • int channel - The number of the channel to be inverted, in the range from 0 to the total number of channels.

Return value

true if the channel needs to be inverted; otherwise, false.

void SetInvertChannel ( int channel, bool value ) #

Inverts the values stored in the specified channel. Channels of images of half (FORMAT_R16F to FORMAT_RGBA16F) and float (FORMAT_R32F to FORMAT_RGBA32F) formats cannot be inverted.

Arguments

  • int channel - The number of the channel to be inverted, in the range from 0 to the total number of channels.
  • bool value - true if the channel needs to be inverted; otherwise, false.

void Reset ( ) #

Sets the converter to the default values.

void Copy ( ImageConverter converter ) #

Copies data from the specified source converter.

Arguments

  • ImageConverter converter - The source converter.

ImageConverter Clone ( ) #

Creates a clone of the specified source converter.

Return value

The converter to be cloned.

bool Load ( string path ) #

Loads the image converter settings on the disk using the specified path.

Arguments

  • string path - The path to the file with the image converter settings.

Return value

true if the image converter settings are loaded successfully; otherwise, false.

void Load ( Json json ) #

Loads the .json object with the image converter settings.

Arguments

  • Json json - The object with the image converter settings.

bool Save ( string path ) #

Saves image converter settings on the disk to the specified location.

Arguments

  • string path - The path to the file to store the image converter settings.

Return value

true if the image converter settings are saved successfully; otherwise, false.

void Save ( Json json ) #

Saves image converter settings to the specified .json object.

Arguments

  • Json json - The object with the image converter settings.

void UpdateParameters ( Image image ) #

Validates the parameters of the image converter for the specified image. This method allows checking the resulting parameters before converting the image.

Arguments

  • Image image - The image to be converted.

bool RunCpu ( Image image ) #

Runs the image converter on CPU.

Arguments

  • Image image - The image to be converted.

Return value

true if the image has been converted successfully; otherwise, false.

bool Run ( Converted on_converted, Image image ) #

Runs the image converter.

Arguments

  • Converted on_converted - Callback to be fired after image conversion.
  • Image image - Image to be converted.

Return value

true if the image has been converted successfully; otherwise, false.
Last update: 2024-12-13
Build: ()