Browse Source

Update IPixel method calls to match new signatures

pull/119/head
James Jackson-South 8 years ago
parent
commit
baf62396cf
  1. 2
      src/ImageSharp/Formats/Tiff/PhotometricInterpretation/BlackIsZero1TiffColor.cs
  2. 6
      src/ImageSharp/Formats/Tiff/PhotometricInterpretation/BlackIsZero4TiffColor.cs
  3. 2
      src/ImageSharp/Formats/Tiff/PhotometricInterpretation/BlackIsZero8TiffColor.cs
  4. 2
      src/ImageSharp/Formats/Tiff/PhotometricInterpretation/BlackIsZeroTiffColor.cs
  5. 2
      src/ImageSharp/Formats/Tiff/PhotometricInterpretation/PaletteTiffColor.cs
  6. 2
      src/ImageSharp/Formats/Tiff/PhotometricInterpretation/Rgb888TiffColor.cs
  7. 2
      src/ImageSharp/Formats/Tiff/PhotometricInterpretation/RgbPlanarTiffColor.cs
  8. 2
      src/ImageSharp/Formats/Tiff/PhotometricInterpretation/RgbTiffColor.cs
  9. 2
      src/ImageSharp/Formats/Tiff/PhotometricInterpretation/WhiteIsZero1TiffColor.cs
  10. 6
      src/ImageSharp/Formats/Tiff/PhotometricInterpretation/WhiteIsZero4TiffColor.cs
  11. 2
      src/ImageSharp/Formats/Tiff/PhotometricInterpretation/WhiteIsZero8TiffColor.cs
  12. 2
      src/ImageSharp/Formats/Tiff/PhotometricInterpretation/WhiteIsZeroTiffColor.cs

2
src/ImageSharp/Formats/Tiff/PhotometricInterpretation/BlackIsZero1TiffColor.cs

@ -42,7 +42,7 @@ namespace SixLabors.ImageSharp.Formats.Tiff
{
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;
}
}

6
src/ImageSharp/Formats/Tiff/PhotometricInterpretation/BlackIsZero4TiffColor.cs

@ -38,11 +38,11 @@ namespace SixLabors.ImageSharp.Formats.Tiff
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;
}
@ -51,7 +51,7 @@ namespace SixLabors.ImageSharp.Formats.Tiff
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;
}
}

2
src/ImageSharp/Formats/Tiff/PhotometricInterpretation/BlackIsZero8TiffColor.cs

@ -35,7 +35,7 @@ namespace SixLabors.ImageSharp.Formats.Tiff
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;
}
}

2
src/ImageSharp/Formats/Tiff/PhotometricInterpretation/BlackIsZeroTiffColor.cs

@ -40,7 +40,7 @@ namespace SixLabors.ImageSharp.Formats.Tiff
{
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;
}

2
src/ImageSharp/Formats/Tiff/PhotometricInterpretation/PaletteTiffColor.cs

@ -62,7 +62,7 @@ namespace SixLabors.ImageSharp.Formats.Tiff
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;

2
src/ImageSharp/Formats/Tiff/PhotometricInterpretation/Rgb888TiffColor.cs

@ -37,7 +37,7 @@ namespace SixLabors.ImageSharp.Formats.Tiff
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;
}
}

2
src/ImageSharp/Formats/Tiff/PhotometricInterpretation/RgbPlanarTiffColor.cs

@ -45,7 +45,7 @@ namespace SixLabors.ImageSharp.Formats.Tiff
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;
}

2
src/ImageSharp/Formats/Tiff/PhotometricInterpretation/RgbTiffColor.cs

@ -43,7 +43,7 @@ namespace SixLabors.ImageSharp.Formats.Tiff
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;
}

2
src/ImageSharp/Formats/Tiff/PhotometricInterpretation/WhiteIsZero1TiffColor.cs

@ -42,7 +42,7 @@ namespace SixLabors.ImageSharp.Formats.Tiff
{
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;
}
}

6
src/ImageSharp/Formats/Tiff/PhotometricInterpretation/WhiteIsZero4TiffColor.cs

@ -38,11 +38,11 @@ namespace SixLabors.ImageSharp.Formats.Tiff
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;
}
@ -51,7 +51,7 @@ namespace SixLabors.ImageSharp.Formats.Tiff
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;
}
}

2
src/ImageSharp/Formats/Tiff/PhotometricInterpretation/WhiteIsZero8TiffColor.cs

@ -35,7 +35,7 @@ namespace SixLabors.ImageSharp.Formats.Tiff
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;
}
}

2
src/ImageSharp/Formats/Tiff/PhotometricInterpretation/WhiteIsZeroTiffColor.cs

@ -40,7 +40,7 @@ namespace SixLabors.ImageSharp.Formats.Tiff
{
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;
}

Loading…
Cancel
Save