Skip to content

Commit

Permalink
Update IPixel method calls to match new signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
JimBobSquarePants committed Dec 6, 2018
1 parent 83caea0 commit a5b1e67
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static void Decode<TPixel>(byte[] data, Buffer2D<TPixel> pixels, int left
{
int bit = (b >> (7 - shift)) & 1;
byte intensity = (bit == 1) ? (byte)255 : (byte)0;
color.PackFromRgba32(new Rgba32(intensity, intensity, intensity, 255));
color.FromRgba32(new Rgba32(intensity, intensity, intensity, 255));
pixels[x + shift, y] = color;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ public static void Decode<TPixel>(byte[] data, Buffer2D<TPixel> pixels, int left
byte byteData = data[offset++];

byte intensity1 = (byte)(((byteData & 0xF0) >> 4) * 17);
color.PackFromRgba32(new Rgba32(intensity1, intensity1, intensity1, 255));
color.FromRgba32(new Rgba32(intensity1, intensity1, intensity1, 255));
pixels[x, y] = color;

byte intensity2 = (byte)((byteData & 0x0F) * 17);
color.PackFromRgba32(new Rgba32(intensity2, intensity2, intensity2, 255));
color.FromRgba32(new Rgba32(intensity2, intensity2, intensity2, 255));
pixels[x + 1, y] = color;
}

Expand All @@ -51,7 +51,7 @@ public static void Decode<TPixel>(byte[] data, Buffer2D<TPixel> pixels, int left
byte byteData = data[offset++];

byte intensity1 = (byte)(((byteData & 0xF0) >> 4) * 17);
color.PackFromRgba32(new Rgba32(intensity1, intensity1, intensity1, 255));
color.FromRgba32(new Rgba32(intensity1, intensity1, intensity1, 255));
pixels[left + width - 1, y] = color;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static void Decode<TPixel>(byte[] data, Buffer2D<TPixel> pixels, int left
for (int x = left; x < left + width; x++)
{
byte intensity = data[offset++];
color.PackFromRgba32(new Rgba32(intensity, intensity, intensity, 255));
color.FromRgba32(new Rgba32(intensity, intensity, intensity, 255));
pixels[x, y] = color;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static void Decode<TPixel>(byte[] data, uint[] bitsPerSample, Buffer2D<TP
{
int value = bitReader.ReadBits(bitsPerSample[0]);
float intensity = ((float)value) / factor;
color.PackFromVector4(new Vector4(intensity, intensity, intensity, 1.0f));
color.FromVector4(new Vector4(intensity, intensity, intensity, 1.0f));
pixels[x, y] = color;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private static TPixel[] GeneratePalette<TPixel>(uint[] colorMap, int colorCount)
float r = colorMap[rOffset + i] / 65535F;
float g = colorMap[gOffset + i] / 65535F;
float b = colorMap[bOffset + i] / 65535F;
palette[i].PackFromVector4(new Vector4(r, g, b, 1.0f));
palette[i].FromVector4(new Vector4(r, g, b, 1.0f));
}

return palette;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static void Decode<TPixel>(byte[] data, Buffer2D<TPixel> pixels, int left
byte r = data[offset++];
byte g = data[offset++];
byte b = data[offset++];
color.PackFromRgba32(new Rgba32(r, g, b, 255));
color.FromRgba32(new Rgba32(r, g, b, 255));
pixels[x, y] = color;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static void Decode<TPixel>(byte[][] data, uint[] bitsPerSample, Buffer2D<
float r = ((float)rBitReader.ReadBits(bitsPerSample[0])) / rFactor;
float g = ((float)gBitReader.ReadBits(bitsPerSample[1])) / gFactor;
float b = ((float)bBitReader.ReadBits(bitsPerSample[2])) / bFactor;
color.PackFromVector4(new Vector4(r, g, b, 1.0f));
color.FromVector4(new Vector4(r, g, b, 1.0f));
pixels[x, y] = color;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static void Decode<TPixel>(byte[] data, uint[] bitsPerSample, Buffer2D<TP
float r = ((float)bitReader.ReadBits(bitsPerSample[0])) / rFactor;
float g = ((float)bitReader.ReadBits(bitsPerSample[1])) / gFactor;
float b = ((float)bitReader.ReadBits(bitsPerSample[2])) / bFactor;
color.PackFromVector4(new Vector4(r, g, b, 1.0f));
color.FromVector4(new Vector4(r, g, b, 1.0f));
pixels[x, y] = color;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static void Decode<TPixel>(byte[] data, Buffer2D<TPixel> pixels, int left
{
int bit = (b >> (7 - shift)) & 1;
byte intensity = (bit == 1) ? (byte)0 : (byte)255;
color.PackFromRgba32(new Rgba32(intensity, intensity, intensity, 255));
color.FromRgba32(new Rgba32(intensity, intensity, intensity, 255));
pixels[x + shift, y] = color;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ public static void Decode<TPixel>(byte[] data, Buffer2D<TPixel> pixels, int left
byte byteData = data[offset++];

byte intensity1 = (byte)((15 - ((byteData & 0xF0) >> 4)) * 17);
color.PackFromRgba32(new Rgba32(intensity1, intensity1, intensity1, 255));
color.FromRgba32(new Rgba32(intensity1, intensity1, intensity1, 255));
pixels[x, y] = color;

byte intensity2 = (byte)((15 - (byteData & 0x0F)) * 17);
color.PackFromRgba32(new Rgba32(intensity2, intensity2, intensity2, 255));
color.FromRgba32(new Rgba32(intensity2, intensity2, intensity2, 255));
pixels[x + 1, y] = color;
}

Expand All @@ -51,7 +51,7 @@ public static void Decode<TPixel>(byte[] data, Buffer2D<TPixel> pixels, int left
byte byteData = data[offset++];

byte intensity1 = (byte)((15 - ((byteData & 0xF0) >> 4)) * 17);
color.PackFromRgba32(new Rgba32(intensity1, intensity1, intensity1, 255));
color.FromRgba32(new Rgba32(intensity1, intensity1, intensity1, 255));
pixels[left + width - 1, y] = color;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static void Decode<TPixel>(byte[] data, Buffer2D<TPixel> pixels, int left
for (int x = left; x < left + width; x++)
{
byte intensity = (byte)(255 - data[offset++]);
color.PackFromRgba32(new Rgba32(intensity, intensity, intensity, 255));
color.FromRgba32(new Rgba32(intensity, intensity, intensity, 255));
pixels[x, y] = color;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static void Decode<TPixel>(byte[] data, uint[] bitsPerSample, Buffer2D<TP
{
int value = bitReader.ReadBits(bitsPerSample[0]);
float intensity = 1.0f - (((float)value) / factor);
color.PackFromVector4(new Vector4(intensity, intensity, intensity, 1.0f));
color.FromVector4(new Vector4(intensity, intensity, intensity, 1.0f));
pixels[x, y] = color;
}

Expand Down

0 comments on commit a5b1e67

Please sign in to comment.