2021-08-09 15:52:55 +02:00
namespace Umbraco.Cms.Core.Models
2020-02-07 15:01:03 -08:00
{
2020-02-09 11:12:29 -08:00
/// <summary>
2021-08-09 15:52:55 +02:00
/// These are options that are passed to the IImageUrlGenerator implementation to determine the URL that is generated.
2020-02-09 11:12:29 -08:00
/// </summary>
2020-02-07 15:01:03 -08:00
public class ImageUrlGenerationOptions
{
2022-02-21 10:12:51 +01:00
public ImageUrlGenerationOptions ( string? imageUrl ) = > ImageUrl = imageUrl ;
2020-02-09 11:12:29 -08:00
2022-02-21 10:12:51 +01:00
public string? ImageUrl { get ; }
2021-08-09 15:52:55 +02:00
2020-02-07 15:01:03 -08:00
public int? Width { get ; set ; }
2021-08-09 15:52:55 +02:00
2020-02-07 15:01:03 -08:00
public int? Height { get ; set ; }
2021-08-09 15:52:55 +02:00
2020-02-07 15:01:03 -08:00
public int? Quality { get ; set ; }
2021-08-09 15:52:55 +02:00
2020-05-20 17:39:07 +02:00
public ImageCropMode ? ImageCropMode { get ; set ; }
2021-08-09 15:52:55 +02:00
2020-05-20 17:39:07 +02:00
public ImageCropAnchor ? ImageCropAnchor { get ; set ; }
2021-08-09 15:52:55 +02:00
2022-01-21 11:43:58 +01:00
public FocalPointPosition ? FocalPoint { get ; set ; }
2021-08-09 15:52:55 +02:00
2022-01-21 11:43:58 +01:00
public CropCoordinates ? Crop { get ; set ; }
2021-08-09 15:52:55 +02:00
2022-01-21 11:43:58 +01:00
public string? CacheBusterValue { get ; set ; }
2021-08-09 15:52:55 +02:00
2022-01-21 11:43:58 +01:00
public string? FurtherOptions { get ; set ; }
2021-08-09 15:52:55 +02:00
2020-02-09 11:12:29 -08:00
/// <summary>
2021-08-09 15:52:55 +02:00
/// The focal point position, in whatever units the registered IImageUrlGenerator uses, typically a percentage of the total image from 0.0 to 1.0.
2020-02-09 11:12:29 -08:00
/// </summary>
2020-02-07 15:01:03 -08:00
public class FocalPointPosition
{
2021-08-10 17:20:03 +02:00
public FocalPointPosition ( decimal left , decimal top )
2020-02-09 11:12:29 -08:00
{
Left = left ;
Top = top ;
}
public decimal Left { get ; }
2021-08-09 15:52:55 +02:00
2020-02-09 11:12:29 -08:00
public decimal Top { get ; }
2020-02-07 15:01:03 -08:00
}
2020-02-09 11:12:29 -08:00
/// <summary>
2021-08-09 15:52:55 +02:00
/// The bounds of the crop within the original image, in whatever units the registered IImageUrlGenerator uses, typically a percentage between 0.0 and 1.0.
2020-02-09 11:12:29 -08:00
/// </summary>
2020-02-07 15:01:03 -08:00
public class CropCoordinates
{
2021-08-10 17:20:03 +02:00
public CropCoordinates ( decimal left , decimal top , decimal right , decimal bottom )
2020-02-09 11:12:29 -08:00
{
2021-08-10 17:20:03 +02:00
Left = left ;
Top = top ;
Right = right ;
Bottom = bottom ;
2020-02-09 11:12:29 -08:00
}
2021-08-10 17:20:03 +02:00
public decimal Left { get ; }
2021-08-09 15:52:55 +02:00
2021-08-10 17:20:03 +02:00
public decimal Top { get ; }
2021-08-09 15:52:55 +02:00
2021-08-10 17:20:03 +02:00
public decimal Right { get ; }
2021-08-09 15:52:55 +02:00
2021-08-10 17:20:03 +02:00
public decimal Bottom { get ; }
2020-02-07 15:01:03 -08:00
}
}
}