forked from crskycode/BCnEncoder.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBc5BlockEncoder.cs
More file actions
26 lines (23 loc) · 792 Bytes
/
Copy pathBc5BlockEncoder.cs
File metadata and controls
26 lines (23 loc) · 792 Bytes
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
using BCnEncoder.Shared;
using BCnEncoder.Shared.Colors;
namespace BCnEncoder.Encoder
{
internal class Bc5BlockEncoder : BaseBcBlockEncoder<Bc5Block, RgEncodingContext>
{
private readonly Bc4ComponentBlockEncoder redBlockEncoder;
private readonly Bc4ComponentBlockEncoder greenBlockEncoder;
public Bc5BlockEncoder(ColorComponent component1, ColorComponent component2)
{
redBlockEncoder = new Bc4ComponentBlockEncoder(component1);
greenBlockEncoder = new Bc4ComponentBlockEncoder(component2);
}
public override Bc5Block EncodeBlock(in RgEncodingContext context)
{
return new Bc5Block
{
redBlock = redBlockEncoder.EncodeBlock(context.RawBlock, context.Quality),
greenBlock = greenBlockEncoder.EncodeBlock(context.RawBlock, context.Quality)
};
}
}
}