RawImage.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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-2016 Tao Yue
  9. //
  10. // See LICENSE.txt for complete licensing and attribution information.
  11. //
  12. /////////////////////////////////////////////////////////////////////////////////
  13. using System;
  14. using PDNWrapper;
  15. namespace PhotoshopFile.Compression
  16. {
  17. internal class RawImage : ImageData
  18. {
  19. private byte[] data;
  20. protected override bool AltersWrittenData
  21. {
  22. get { return false; }
  23. }
  24. public RawImage(byte[] data, Size size, int bitDepth)
  25. : base(size, bitDepth)
  26. {
  27. this.data = data;
  28. }
  29. internal override void Read(byte[] buffer)
  30. {
  31. Array.Copy(data, buffer, data.Length);
  32. }
  33. public override byte[] ReadCompressed()
  34. {
  35. return data;
  36. }
  37. }
  38. }