forked from khomiakmaxim/Puzzles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Pixel.cs
41 lines (35 loc) · 1.05 KB
/
Pixel.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PuzzlesProj
{
//даний клас відповідає за кожний окремий піксель зображення
public class Pixel
{
private int red;
private int green;
private int blue;
public int Red { get { return red; } set { red = value; } }
public int Green { get { return green; } set { green = value; } }
public int Blue { get { return blue; } set { blue = value; } }
public Pixel()
{
}
public Pixel(int red = 0, int green = 0, int blue = 0)
{
this.red = red;
this.green = green;
this.blue = blue;
}
public int gray_scale()
{
return (int) (0.3 * red + 0.59 * green + 0.11 * blue);
}
public override string ToString()
{
return gray_scale() + "\n";
}
}
}