RawImage.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Photoshop PSD FileType Plugin for Paint.NET
  4. // http://psdplugin.codeplex.com/
  5. //
  6. // This software is provided under the MIT License:
  7. // Copyright (c) 2006-2007 Frank Blumenberg
  8. // Copyright (c) 2010-2017 Tao Yue
  9. //
  10. // See LICENSE.txt for complete licensing and attribution information.
  11. //
  12. /////////////////////////////////////////////////////////////////////////////////
  13. using System;
  14. using System.Drawing;
  15. namespace PhotoshopFile.Compression
  16. {
  17. internal class RawImage : ImageData
  18. {
  19. private byte[] data;
  20. protected override bool AltersWrittenData => false;
  21. public RawImage(byte[] data, Size size, int bitDepth)
  22. : base(size, bitDepth)
  23. {
  24. this.data = data;
  25. }
  26. internal override void Read(byte[] buffer)
  27. {
  28. Array.Copy(data, buffer, data.Length);
  29. }
  30. public override byte[] ReadCompressed()
  31. {
  32. return data;
  33. }
  34. internal override void WriteInternal(byte[] array)
  35. {
  36. data = array;
  37. }
  38. }
  39. }