Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
PixelInformation.cs
1
using
SkiaSharp;
2
3
namespace
Waher.Script.Graphs
4
{
8
public
abstract
class
PixelInformation
9
{
10
private
readonly
byte
[] binary;
11
private
readonly
int
width;
12
private
readonly
int
height;
13
20
public
PixelInformation
(
byte
[]
Binary
,
int
Width
,
int
Height
)
21
{
22
this.binary =
Binary
;
23
this.width =
Width
;
24
this.height =
Height
;
25
}
26
30
public
byte
[]
Binary
=> this.binary;
31
35
public
int
Width
=> this.width;
36
40
public
int
Height
=> this.height;
41
47
public
static
PixelInformation
FromImage
(SKImage Image)
48
{
49
using
(SKData Data = Image.Encode())
50
{
51
return
new
PixelInformationPng
(Data.ToArray(), Image.Width, Image.Height);
52
}
53
}
54
64
public
static
PixelInformation
FromRaw
(SKColorType ColorType,
byte
[]
Binary
,
int
Width
,
int
Height
,
int
BytesPerRow)
65
{
66
return
new
PixelInformationRaw
(ColorType,
Binary
,
Width
,
Height
, BytesPerRow);
67
}
68
73
public
abstract
SKImage
CreateBitmap
();
74
79
public
virtual
byte
[]
EncodeAsPng
()
80
{
81
using
(SKImage Image = this.
CreateBitmap
())
82
{
83
using
(SKData Data = Image.Encode())
84
{
85
return
Data.ToArray();
86
}
87
}
88
}
89
94
public
abstract
PixelInformationRaw
GetRaw
();
95
96
}
97
}
Waher.Script.Graphs.PixelInformation
Contains pixel information
Definition:
PixelInformation.cs:9
Waher.Script.Graphs.PixelInformation.Width
int Width
Width
Definition:
PixelInformation.cs:35
Waher.Script.Graphs.PixelInformation.PixelInformation
PixelInformation(byte[] Binary, int Width, int Height)
Contains pixel information
Definition:
PixelInformation.cs:20
Waher.Script.Graphs.PixelInformation.GetRaw
abstract PixelInformationRaw GetRaw()
Gets raw pixel data.
Waher.Script.Graphs.PixelInformation.FromRaw
static PixelInformation FromRaw(SKColorType ColorType, byte[] Binary, int Width, int Height, int BytesPerRow)
Gets the pixel information object from raw pixel data.
Definition:
PixelInformation.cs:64
Waher.Script.Graphs.PixelInformation.EncodeAsPng
virtual byte[] EncodeAsPng()
Encodes the pixels into a binary PNG image.
Definition:
PixelInformation.cs:79
Waher.Script.Graphs.PixelInformation.CreateBitmap
abstract SKImage CreateBitmap()
Creates an SKImage image. It must be disposed by the caller.
Waher.Script.Graphs.PixelInformation.Binary
byte[] Binary
Binary representation of pixels
Definition:
PixelInformation.cs:30
Waher.Script.Graphs.PixelInformation.Height
int Height
Height
Definition:
PixelInformation.cs:40
Waher.Script.Graphs.PixelInformation.FromImage
static PixelInformation FromImage(SKImage Image)
Gets the pixel information from an SKImage.
Definition:
PixelInformation.cs:47
Waher.Script.Graphs.PixelInformationPng
Contains pixel information in PNG format
Definition:
PixelInformationPng.cs:10
Waher.Script.Graphs.PixelInformationRaw
Contains pixel information in a raw unencoded format.
Definition:
PixelInformationRaw.cs:11
Waher.Script.Graphs
Definition:
CanvasGraph.cs:11
IoTGateway
Script
Waher.Script.Graphs
PixelInformation.cs
Generated by
1.9.5