Skip to content

Commit dce2dc4

Browse files
committed
Add .DownscalingDecode
1 parent cf93d7f commit dce2dc4

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/Imageflow/Fluent/FluentBuildJob.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,23 @@ internal void AddOutput(int ioId, IOutputDestination destination)
2929
throw new ArgumentException("ioId", $"ioId {ioId} has already been assigned");
3030
_outputs.Add(ioId, destination);
3131
}
32-
32+
public BuildNode DownscalingDecode(IBytesSource source, int ioId, int widthHint, int heightHint, bool scaleLumaSpatially = false, bool gammaCorrectForSrgbDuringSpatialLumaScaling = false)
33+
{
34+
AddInput(ioId, source);
35+
return BuildNode.StartNode(this, new
36+
{
37+
decode = new
38+
{
39+
io_id = ioId,
40+
commands = new object[] {new { jpeg_downscale_hints = new {
41+
width = widthHint,
42+
height = heightHint,
43+
scale_luma_spatially = scaleLumaSpatially,
44+
gamma_correct_for_srgb_during_spatial_luma_scaling = gammaCorrectForSrgbDuringSpatialLumaScaling
45+
} } }
46+
}
47+
});
48+
}
3349
public BuildNode Decode(IBytesSource source, int ioId)
3450
{
3551
AddInput(ioId, source);

0 commit comments

Comments
 (0)