ImageData.h
1 // Copyright 2001-2022 Aspose Pty Ltd. All Rights Reserved.
3 //
4 // This file is part of Aspose.Words. The source code in this file
5 // is only intended as a supplement to the documentation, and is provided
6 // "as is", without warranty of any kind, either expressed or implied.
9 #pragma once
10 
11 #include <system/io/std_stream_wrappers.h>
12 #include <system/array.h>
13 #include <mutex>
14 #include <memory>
15 #include <iostream>
16 #include <cstdint>
17 
18 #include <Aspose.Words.Cpp/IBorderAttrSource.h>
19 #include <Aspose.Words.Cpp/Drawing/ImageType.h>
20 #include <Aspose.Words.Cpp/aspose_words_api_defs.h>
21 
22 namespace Aspose
23 {
24 
25 namespace Words
26 {
27 
28 class BorderCollection;
29 enum class BorderType;
30 
31 namespace Drawing
32 {
33 
34 class ImageSize;
35 
36 }
37 
38 }
39 }
40 namespace System
41 {
42 namespace Collections
43 {
44 namespace Generic
45 {
46 template <typename, typename> class SortedList;
47 }
48 }
49 namespace Drawing
50 {
51 class Color;
52 class Image;
53 }
54 namespace IO
55 {
56 class Stream;
57 }
58 }
59 
60 namespace Aspose {
61 
62 namespace Words {
63 
64 namespace Drawing {
65 
141 class ASPOSE_WORDS_SHARED_CLASS ImageData : public Aspose::Words::IBorderAttrSource
142 {
143  typedef ImageData ThisType;
144  typedef Aspose::Words::IBorderAttrSource BaseType;
145 
146  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
147  ASPOSE_WORDS_SHARED_RTTI_INFO_DECL();
148 
149 public:
150 
186  ASPOSE_WORDS_SHARED_API System::ArrayPtr<uint8_t> get_ImageBytes();
187 
189  ASPOSE_WORDS_SHARED_API void set_ImageBytes(const System::ArrayPtr<uint8_t>& value);
190 
224  ASPOSE_WORDS_SHARED_API bool get_HasImage();
225 
271 
301 
362  ASPOSE_WORDS_SHARED_API bool get_IsLink();
363 
424  ASPOSE_WORDS_SHARED_API bool get_IsLinkOnly();
425 
469  ASPOSE_WORDS_SHARED_API System::String get_SourceFullName();
470 
472  ASPOSE_WORDS_SHARED_API void set_SourceFullName(const System::String& value);
473 
536  ASPOSE_WORDS_SHARED_API System::String get_Title();
537 
539  ASPOSE_WORDS_SHARED_API void set_Title(const System::String& value);
540 
610  ASPOSE_WORDS_SHARED_API double get_CropTop();
611 
613  ASPOSE_WORDS_SHARED_API void set_CropTop(double value);
614 
684  ASPOSE_WORDS_SHARED_API double get_CropBottom();
685 
687  ASPOSE_WORDS_SHARED_API void set_CropBottom(double value);
688 
758  ASPOSE_WORDS_SHARED_API double get_CropLeft();
759 
761  ASPOSE_WORDS_SHARED_API void set_CropLeft(double value);
762 
832  ASPOSE_WORDS_SHARED_API double get_CropRight();
833 
835  ASPOSE_WORDS_SHARED_API void set_CropRight(double value);
836 
898 
961  ASPOSE_WORDS_SHARED_API System::Drawing::Color get_ChromaKey();
962 
964  ASPOSE_WORDS_SHARED_API void set_ChromaKey(System::Drawing::Color value);
965 
1029  ASPOSE_WORDS_SHARED_API double get_Brightness();
1030 
1032  ASPOSE_WORDS_SHARED_API void set_Brightness(double value);
1033 
1097  ASPOSE_WORDS_SHARED_API double get_Contrast();
1098 
1100  ASPOSE_WORDS_SHARED_API void set_Contrast(double value);
1101 
1164  ASPOSE_WORDS_SHARED_API bool get_BiLevel();
1165 
1167  ASPOSE_WORDS_SHARED_API void set_BiLevel(bool value);
1168 
1231  ASPOSE_WORDS_SHARED_API bool get_GrayScale();
1232 
1234  ASPOSE_WORDS_SHARED_API void set_GrayScale(bool value);
1235 
1271  ASPOSE_WORDS_SHARED_API void SetImage(const System::SharedPtr<System::Drawing::Image>& image);
1272 
1308  ASPOSE_WORDS_SHARED_API void SetImage(const System::SharedPtr<System::IO::Stream>& stream);
1309 
1351  ASPOSE_WORDS_SHARED_API void SetImage(const System::String& fileName);
1352 
1391 
1426 
1456  ASPOSE_WORDS_SHARED_API System::ArrayPtr<uint8_t> ToByteArray();
1457 
1495  ASPOSE_WORDS_SHARED_API void Save(const System::SharedPtr<System::IO::Stream>& stream);
1496 
1527  ASPOSE_WORDS_SHARED_API void Save(const System::String& fileName);
1528 
1529  template <typename CharType, typename Traits>
1530  void SetImage(std::basic_istream<CharType, Traits>& stream)
1531  {
1532  auto streamWrapper = System::IO::WrapSTDIOStream(stream);
1533  SetImage(streamWrapper);
1534  }
1535 
1536  template <typename CharType, typename Traits>
1537  void Save(std::basic_ostream<CharType, Traits>& stream)
1538  {
1539  auto streamWrapper = System::IO::WrapSTDIOStream(stream);
1540  Save(streamWrapper);
1541  }
1542 
1543 protected:
1544 
1545  virtual ASPOSE_WORDS_SHARED_API ~ImageData();
1546 
1547 private:
1548 
1550 
1553 
1555 
1556  System::SharedPtr<System::Object> GetDirectBorderAttr(int32_t ) override;
1557  System::SharedPtr<System::Object> FetchInheritedBorderAttr(int32_t ) override;
1558  void SetBorderAttr(int32_t , System::SharedPtr<System::Object> ) override;
1559 
1560 };
1561 
1562 }
1563 }
1564 }