RawImageResource.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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-2013 Tao Yue
  9. //
  10. // See LICENSE.txt for complete licensing and attribution information.
  11. //
  12. /////////////////////////////////////////////////////////////////////////////////
  13. using System;
  14. using System.IO;
  15. using PDNWrapper;
  16. namespace PhotoshopFile
  17. {
  18. /// <summary>
  19. /// Stores the raw data for unimplemented image resource types.
  20. /// </summary>
  21. internal class RawImageResource : ImageResource
  22. {
  23. public byte[] Data { get; private set; }
  24. private ResourceID id;
  25. public override ResourceID ID
  26. {
  27. get { return id; }
  28. }
  29. public RawImageResource(ResourceID resourceId, string name)
  30. : base(name)
  31. {
  32. this.id = resourceId;
  33. }
  34. public RawImageResource(PsdBinaryReader reader, string signature,
  35. ResourceID resourceId, string name, int numBytes)
  36. : base(name)
  37. {
  38. this.Signature = signature;
  39. this.id = resourceId;
  40. Data = reader.ReadBytes(numBytes);
  41. }
  42. }
  43. }