-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed error with reading in the wrong number of chunks. Start of hand…
…ling beta feature for color profiles.
- Loading branch information
1 parent
660720b
commit 2115bfd
Showing
10 changed files
with
122 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
Aseprite2Unity/Assets/Aseprite2Unity/Editor/AseReader/AseColorProfileChunk.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace Aseprite2Unity.Editor | ||
{ | ||
public class AseColorProfileChunk : AseChunk | ||
{ | ||
public override ChunkType ChunkType => ChunkType.ColorProfile; | ||
|
||
public ColorProfileType ColorProfileType { get; } | ||
public ColorProfileFlags ColorProfileFlags { get; } | ||
public uint GammaFixed { get; } | ||
|
||
public AseColorProfileChunk(AseFrame frame, AseReader reader) | ||
: base(frame) | ||
{ | ||
ColorProfileType = (ColorProfileType)reader.ReadWORD(); | ||
ColorProfileFlags = (ColorProfileFlags)reader.ReadWORD(); | ||
GammaFixed = reader.ReadDWORD(); | ||
|
||
// Next 8 bytes are reserved | ||
reader.ReadBYTEs(8); | ||
|
||
// fixit - what to do with color profile data? | ||
if (ColorProfileType == ColorProfileType.EmbeddedICC) | ||
{ | ||
var length = (int)reader.ReadDWORD(); | ||
reader.ReadBYTEs(length); | ||
} | ||
} | ||
|
||
public override void Visit(IAseVisitor visitor) | ||
{ | ||
// fixit - nothing for now | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Aseprite2Unity/Assets/Aseprite2Unity/Editor/AseReader/AseColorProfileChunk.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
Aseprite2Unity/Assets/Aseprite2Unity/Editor/AseReader/ColorProfileFlags.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace Aseprite2Unity.Editor | ||
{ | ||
public enum ColorProfileFlags : ushort | ||
{ | ||
SpecialFixedGamma = 1, | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Aseprite2Unity/Assets/Aseprite2Unity/Editor/AseReader/ColorProfileFlags.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
Aseprite2Unity/Assets/Aseprite2Unity/Editor/AseReader/ColorProfileType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace Aseprite2Unity.Editor | ||
{ | ||
public enum ColorProfileType : ushort | ||
{ | ||
NoColorProfile = 0, | ||
sRGB = 1, | ||
EmbeddedICC = 2, | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Aseprite2Unity/Assets/Aseprite2Unity/Editor/AseReader/ColorProfileType.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.