Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Enumerations.cs « UVtools.Core - github.com/sn4k3/UVtools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1e4e9b8baf072288ca106296b8f07afddd01029f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
/*
 *                     GNU AFFERO GENERAL PUBLIC LICENSE
 *                       Version 3, 19 November 2007
 *  Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
 *  Everyone is permitted to copy and distribute verbatim copies
 *  of this license document, but changing it is not allowed.
 */

using Emgu.CV.CvEnum;
using System;
using System.ComponentModel;

namespace UVtools.Core;

/// <summary>
/// Gets index start number, if starts on 0 or 1
/// </summary>
public enum IndexStartNumber : byte
{
    Zero,
    One
}

public enum LayerRangeSelection : byte
{
    None,
    All,
    Current,
    Bottom,
    Normal,
    First,
    Last
}

/// <summary>
/// Flip direction, same as <see cref="FlipType"/>, but add None which must be taken care/ignored on code
/// </summary>
public enum FlipDirection : sbyte
{
    None = sbyte.MinValue,
    Horizontally = FlipType.Horizontal,
    Vertically = FlipType.Vertical,
    Both = FlipType.Both,
}

/// <summary>
/// Rotate direction, same as <see cref="RotateFlags"/>, but add None which must be taken care/ignored on code
/// </summary>
public enum RotateDirection : sbyte
{
    [Description("None")]
    None = -1,
    /// <summary>Rotate 90 degrees clockwise (0)</summary>
    [Description("Rotate 90º CW")]
    Rotate90Clockwise = RotateFlags.Rotate90Clockwise,
    /// <summary>Rotate 180 degrees clockwise (1)</summary>
    [Description("Rotate 180º")]
    Rotate180 = RotateFlags.Rotate180,
    /// <summary>Rotate 270 degrees clockwise (2)</summary>
    [Description("Rotate 90º CCW")]
    Rotate90CounterClockwise = RotateFlags.Rotate90CounterClockwise,
}

public enum Anchor : byte
{
    TopLeft, TopCenter, TopRight,
    MiddleLeft, MiddleCenter, MiddleRight,
    BottomLeft, BottomCenter, BottomRight,
    None
}

public enum LightOffDelaySetMode : byte
{
    [Description("Set the light-off with an extra delay")]
    UpdateWithExtraDelay,

    [Description("Set the light-off without an extra delay")]
    UpdateWithoutExtraDelay,

    [Description("Set the light-off to zero")]
    SetToZero,

    [Description("Disabled")]
    NoAction
}

public enum SpeedUnit : byte
{
    /// <summary>
    /// mm/s
    /// </summary>
    MillimetersPerSecond,
    /// <summary>
    /// mm/m
    /// </summary>
    MillimetersPerMinute,
    /// <summary>
    /// cm/m
    /// </summary>
    CentimetersPerMinute,
}

public enum TimeUnits : byte
{
    /// <summary>
    /// ms
    /// </summary>
    Milliseconds,
    /// <summary>
    /// s
    /// </summary>
    Seconds
}

public enum RemoveSourceFileAction : byte
{
    [Description("Keep the source file")]
    No,

    [Description("Remove the source file")]
    Yes,

    [Description("Prompt before remove the source file")]
    Prompt
}

/*
public static class Enumerations
{
    public static FlipType ToOpenCVFlipType(FlipDirection flip)
    {
        return flip switch
        {
            FlipDirection.None => throw new NotSupportedException($"Flip type: {flip} is not supported by OpenCV."),
            FlipDirection.Horizontally => FlipType.Horizontal,
            FlipDirection.Vertically => FlipType.Vertical,
            FlipDirection.Both => FlipType.Both,
            _ => throw new ArgumentOutOfRangeException(nameof(flip), flip, null)
        };
    }

    public static RotateFlags ToOpenCVRotateFlags(RotateDirection rotate)
    {
        return rotate switch
        {
            RotateDirection.None => throw new NotSupportedException($"Rotate direction: {rotate} is not supported by OpenCV."),
            RotateDirection.Rotate90Clockwise => RotateFlags.Rotate90Clockwise,
            RotateDirection.Rotate90CounterClockwise => RotateFlags.Rotate90CounterClockwise,
            RotateDirection.Rotate180 => RotateFlags.Rotate180,
            _ => throw new ArgumentOutOfRangeException(nameof(rotate), rotate, null)
        };
    }
}*/