This page has been translated automatically.
Видеоуроки
Интерфейс
Основы
Продвинутый уровень
Подсказки и советы
Основы
Программирование на C#
Рендеринг
Профессиональный уровень (SIM)
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Режимы вывода изображения
Физика
Браузер SDK 2
Лицензирование и типы лицензий
Дополнения (Add-Ons)
Демонстрационные проекты
API Samples
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Контроль версий
Настройки и предпочтения
Работа с проектами
Настройка параметров ноды
Setting Up Materials
Настройка свойств
Освещение
Sandworm
Использование инструментов редактора для конкретных задач
Расширение функционала редактора
Встроенные объекты
Ноды (Nodes)
Объекты (Objects)
Эффекты
Декали
Источники света
Geodetics
World-ноды
Звуковые объекты
Объекты поиска пути
Player-ноды
Программирование
Основы
Настройка среды разработки
Примеры использования
C++
C#
UnigineScript
Унифицированный язык шейдеров UUSL (Unified UNIGINE Shader Language)
Плагины
Форматы файлов
Материалы и шейдеры
Rebuilding the Engine Tools
Интерфейс пользователя (GUI)
Двойная точность координат
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
Работа с контентом
Оптимизация контента
Материалы
Визуальный редактор материалов
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Учебные материалы

Unigine.ImageConverter Class

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

ImageConverter Class

Перечисления (Enums)

MIPMAPS_MODE#

ИмяОписание
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#

ИмяОписание
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#

ИмяОписание
LOW = 0Low quality of compression.
HIGH = 1High quality of compression.

RESIZE_FILTER#

ИмяОписание
POINT = 0Point filtering method used for resizing.
LINEAR = 1Linear filtering method used for resizing.
MIN = 2Minimum filtering method used for resizing.

RANGE_MODE#

ИмяОписание
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: 13.12.2024
Build: ()