Expose palette reading function
This commit is contained in:
parent
12a1ade9ef
commit
e8ee56234a
1 changed files with 2 additions and 2 deletions
|
@ -177,7 +177,7 @@ namespace LibDgf.Graphics
|
||||||
if (imageHeader.ClutPixelFormat == TxmPixelFormat.PSMCT32)
|
if (imageHeader.ClutPixelFormat == TxmPixelFormat.PSMCT32)
|
||||||
{
|
{
|
||||||
stream.Seek(16, SeekOrigin.Begin);
|
stream.Seek(16, SeekOrigin.Begin);
|
||||||
palette = GetRgba32Palette(br, imageHeader.ClutWidth, imageHeader.ClutHeight);
|
palette = ReadRgba32Palette(br, imageHeader.ClutWidth, imageHeader.ClutHeight);
|
||||||
//fs.Seek(16, SeekOrigin.Begin);
|
//fs.Seek(16, SeekOrigin.Begin);
|
||||||
//using (var palImage = ConvertTxmRgba32(br, imageHeader.ClutWidth, imageHeader.ClutHeight))
|
//using (var palImage = ConvertTxmRgba32(br, imageHeader.ClutWidth, imageHeader.ClutHeight))
|
||||||
//{
|
//{
|
||||||
|
@ -271,7 +271,7 @@ namespace LibDgf.Graphics
|
||||||
return img;
|
return img;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Rgba32[] GetRgba32Palette(BinaryReader br, int width, int height)
|
public static Rgba32[] ReadRgba32Palette(BinaryReader br, int width, int height)
|
||||||
{
|
{
|
||||||
int count = width * height;
|
int count = width * height;
|
||||||
Rgba32[] colors = new Rgba32[count];
|
Rgba32[] colors = new Rgba32[count];
|
||||||
|
|
Loading…
Add table
Reference in a new issue