2013-09-19 12:46:19 -07:00
using MediaBrowser.Model.Drawing ;
2013-09-19 08:12:28 -07:00
using MediaBrowser.Model.Entities ;
2013-03-08 14:06:02 -07:00
using ServiceStack.ServiceHost ;
2013-02-20 18:33:05 -07:00
namespace MediaBrowser.Api.Images
{
/// <summary>
/// Class ImageRequest
/// </summary>
public class ImageRequest : DeleteImageRequest
{
/// <summary>
/// The max width
/// </summary>
2013-03-08 14:06:02 -07:00
[ApiMember(Name = "MaxWidth", Description = "The maximum image width to return.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
2013-02-21 00:00:04 -07:00
public int? MaxWidth { get ; set ; }
2013-03-08 14:06:02 -07:00
2013-02-20 18:33:05 -07:00
/// <summary>
/// The max height
/// </summary>
2013-03-08 14:06:02 -07:00
[ApiMember(Name = "MaxHeight", Description = "The maximum image height to return.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
2013-02-21 00:00:04 -07:00
public int? MaxHeight { get ; set ; }
2013-03-08 14:06:02 -07:00
2013-02-20 18:33:05 -07:00
/// <summary>
/// The width
/// </summary>
2013-03-08 14:06:02 -07:00
[ApiMember(Name = "Width", Description = "The fixed image width to return.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
2013-02-21 00:00:04 -07:00
public int? Width { get ; set ; }
2013-03-08 14:06:02 -07:00
2013-02-20 18:33:05 -07:00
/// <summary>
/// The height
/// </summary>
2013-03-08 14:06:02 -07:00
[ApiMember(Name = "Height", Description = "The fixed image height to return.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
2013-02-21 00:00:04 -07:00
public int? Height { get ; set ; }
2013-03-08 14:06:02 -07:00
2013-02-20 18:33:05 -07:00
/// <summary>
/// Gets or sets the quality.
/// </summary>
/// <value>The quality.</value>
2013-03-08 14:06:02 -07:00
[ApiMember(Name = "Quality", Description = "Optional quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
2013-02-20 18:33:05 -07:00
public int? Quality { get ; set ; }
2013-03-08 14:06:02 -07:00
2013-02-20 18:33:05 -07:00
/// <summary>
/// Gets or sets the tag.
/// </summary>
/// <value>The tag.</value>
2013-03-08 14:06:02 -07:00
[ApiMember(Name = "Tag", Description = "Optional. Supply the cache tag from the item object to receive strong caching headers.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
2013-02-20 18:33:05 -07:00
public string Tag { get ; set ; }
2013-06-04 18:19:25 -07:00
2013-06-05 05:35:18 -07:00
[ApiMember(Name = "CropWhitespace", Description = "Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")]
2013-06-04 18:19:25 -07:00
public bool? CropWhitespace { get ; set ; }
2013-06-05 05:35:18 -07:00
[ApiMember(Name = "EnableImageEnhancers", Description = "Enable or disable image enhancers such as cover art.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")]
public bool EnableImageEnhancers { get ; set ; }
2013-09-19 08:12:28 -07:00
[ApiMember(Name = "Format", Description = "Determines the output foramt of the image - original,gif,jpg,png", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")]
public ImageOutputFormat Format { get ; set ; }
2013-09-19 10:45:48 -07:00
[ApiMember(Name = "Indicator", Description = "Determines what overlay to render, if any. none, watched.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")]
2013-09-19 17:53:18 -07:00
public ImageOverlay ? Indicator { get ; set ; }
2013-09-21 08:06:00 -07:00
[ApiMember(Name = "PercentPlayed", Description = "Percent to render for the percent played overlay", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")]
public int PercentPlayed { get ; set ; }
[ApiMember(Name = "BackgroundColor", Description = "Optional. Apply a background color for transparent images.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public string BackgroundColor { get ; set ; }
2013-09-19 08:12:28 -07:00
2013-06-05 05:35:18 -07:00
public ImageRequest ( )
{
EnableImageEnhancers = true ;
2013-09-19 08:12:28 -07:00
Format = ImageOutputFormat . Original ;
2013-06-05 05:35:18 -07:00
}
2013-02-20 18:33:05 -07:00
}
/// <summary>
/// Class DeleteImageRequest
/// </summary>
public class DeleteImageRequest
{
/// <summary>
/// Gets or sets the type of the image.
/// </summary>
/// <value>The type of the image.</value>
2013-03-08 14:06:02 -07:00
[ApiMember(Name = "Type", Description = "Image Type", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
[ApiMember(Name = "Type", Description = "Image Type", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")]
[ApiMember(Name = "Type", Description = "Image Type", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "DELETE")]
2013-02-20 18:33:05 -07:00
public ImageType Type { get ; set ; }
2013-03-08 14:06:02 -07:00
2013-02-20 18:33:05 -07:00
/// <summary>
/// Gets or sets the index.
/// </summary>
/// <value>The index.</value>
2013-03-08 14:06:02 -07:00
[ApiMember(Name = "Index", Description = "Image Index", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
[ApiMember(Name = "Index", Description = "Image Index", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "POST")]
[ApiMember(Name = "Index", Description = "Image Index", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "DELETE")]
2013-02-20 18:33:05 -07:00
public int? Index { get ; set ; }
}
}