Table of Contents

Class ImageSize

Namespace
Mythosia.AI.Models.Images
Assembly
Mythosia.AI.Abstractions.dll

Immutable image sizing intent. Exact pixels and resolution presets are distinct requests; providers reject unsupported kinds instead of silently approximating dimensions.

public sealed class ImageSize
Inheritance
ImageSize
Inherited Members

Properties

AspectRatio

Requested aspect ratio in Preset mode; Auto for other modes.

public ImageAspectRatio AspectRatio { get; }

Property Value

ImageAspectRatio

Auto

Let the provider select the output size.

public static ImageSize Auto { get; }

Property Value

ImageSize

Height

Requested height in Pixels mode; zero for other modes.

public int Height { get; }

Property Value

int

Kind

The sizing mode selected by the factory.

public ImageSizeKind Kind { get; }

Property Value

ImageSizeKind

Resolution

Requested resolution grade in Preset mode; Auto for other modes.

public ImageResolution Resolution { get; }

Property Value

ImageResolution

Width

Requested width in Pixels mode; zero for other modes.

public int Width { get; }

Property Value

int

Methods

Pixels(int, int)

Request exact positive pixel dimensions. Model-specific bounds are validated by the provider. Providers that only support resolution grades reject this mode.

public static ImageSize Pixels(int width, int height)

Parameters

width int
height int

Returns

ImageSize

Preset(ImageResolution, ImageAspectRatio)

Request a provider resolution grade and optional aspect ratio. Auto resolution can be used to request only a ratio. Actual pixel dimensions remain provider-selected.

public static ImageSize Preset(ImageResolution resolution, ImageAspectRatio aspectRatio = ImageAspectRatio.Auto)

Parameters

resolution ImageResolution
aspectRatio ImageAspectRatio

Returns

ImageSize