YSTest: Image.h 源文件

YSTest PreAlpha_b800_20170810 The YSLib Test Project

- 首页
- 相关页面
- 模块
- 命名空间
- 类
- 文件

- 文件列表
- 文件成员

Image.h
浏览该文件的文档.
1 /*
2 © 2013-2017 FrankHB.
3
4 This file is part of the YSLib project, and may only be used,
5 modified, and distributed under the terms of the YSLib project
6 license, LICENSE.TXT. By continuing to use, modify, or distribute
7 this file you indicate that you have read the license and
8 understand and accept it fully.
9 */
10
28 #ifndef YSL_INC_Adaptor_Image_h_
29 #define YSL_INC_Adaptor_Image_h_ 1
30
31 #include "../Core/YModules.h"
32 #include YFM_YSLib_Core_YGraphics // for ystdex::unsupported,
33 // ystdex::copy_and_swap;
34 #include YFM_YSLib_Core_YClock // for TimeSpan;
35 //#include <FreeImage.h>
36
38 struct FIBITMAP;
40 struct FIMETADATA;
42 struct FITAG;
44 struct FIMEMORY;
45
46 namespace YSLib
47 {
48
49 namespace Drawing
50 {
51
53 class CompactPixmap;
55 class HBitmap;
56
58 using BitPerPixel = std::uint8_t;
59
60
67 enum class ImageFormat : int
68 {
69 Unknown = -1,
70 BMP = 0,
71 ICO = 1,
72 JPEG = 2,
74 PNG = 13,
75 GIF = 25
76 };
77
78
84 enum class ImageDecoderFlags : int
85 {
86 Default = 0,
87 GIF_Load256 = 1,
88 GIF_Playback = 2,
89 ICO_MakeAlpha = 1,
90 JPEG_Fast = 0x0001,
91 JPEG_Accurate = 0x0002,
92 JPEG_CMYK = 0x0004,
93 JPEG_EXIFRotate = 0x0008,
94 JPEG_GreyScale = 0x0010,
95 JPEG_QualitySuperb = 0x80,
96 JPEG_QualityGood = 0x0100,
97 JPEG_QualityNormal = 0x0200,
98 JPEG_QualityAverage = 0x0400,
99 JPEG_QualityBad = 0x0800,
100 JPEG_Progressive = 0x2000,
101 JPEG_Subsampling_411 = 0x1000,
102 JPEG_Subsampling_420 = 0x4000,
103 JPEG_Subsampling_422 = 0x8000,
104 JPEG_Subsampling_444 = 0x10000,
105 JPEG_Optimize = 0x20000,
106 JPEG_Baseline = 0x40000
107 };
108
113 DefBitmaskEnum(ImageDecoderFlags)
114
115
116
122 enum class SamplingFilter
123 {
124 Box = 0,
125 Bicubic = 1,
126 Bilinear = 2,
127 BSpline = 3,
128 CatmullRom = 4,
129 Lanczos3 = 5
130 };
131
132
138 enum class ImageMetadataModel
139 {
140 NoData = -1,
141 Comments = 0,
142 EXIF_Main = 1,
143 EXIF_EXIF = 2,
144 EXIF_GPS = 3,
145 EXIF_MakerNote = 4,
146 EXIF_Interop = 5,
147 IPTC = 6,
148 XMP = 7,
149 GeoTIFF = 8,
150 Animation = 9,
151 Custom = 10,
152 EXIF_RAW = 11
153 };
154
155
160 class YF_API BadImageAlloc : public std::bad_alloc
161 {
162 public:
164
165 DefDeCtor(BadImageAlloc)
166 DefDeCopyCtor(BadImageAlloc)
168 ~BadImageAlloc() override;
170 };
171
172
177 class YF_API UnsupportedImageFormat
178 : public GeneralEvent, public ystdex::unsupported
179 {
180 public:
182 using GeneralEvent::GeneralEvent;
183
185 DefDeCopyCtor(UnsupportedImageFormat)
190 ~UnsupportedImageFormat() override;
191 };
192
193
195
196
199 class YF_API UnknownImageFormat : public UnsupportedImageFormat
200 {
201 public:
203 using UnsupportedImageFormat::UnsupportedImageFormat;
204
206 DefDeCopyCtor(UnknownImageFormat)
211 ~UnknownImageFormat() override;
212 };
213
214
219 class YF_API ImageMemory final
220 {
221 public:
222 using NativeHandle = ::FIMEMORY*;
224 using Buffer = vector<octet>;
225
226 private:
228 class YF_API Deleter
229 {
230 public:
231 using pointer = NativeHandle;
232
233 void
234 operator()(pointer) const ynothrow;
235 };
236
237 Buffer buffer;
238 ImageFormat format;
240 unique_ptr_from<Deleter> p_memory;
241
242 public:
257 explicit
258 ImageMemory(const HBitmap&, ImageFormat = ImageFormat::BMP,
259 ImageDecoderFlags = ImageDecoderFlags::Default);
266 ImageMemory(Buffer);
269 ImageMemory(Buffer, ImageFormat);
271 template<typename _func>
272 ImageMemory(_func f)
273 : ImageMemory(f())
274 {}
276 template<typename _func>
277 ImageMemory(_func f, ImageFormat fmt)
278 : ImageMemory(f(), fmt)
279 {}
281 DefDelMoveCtor(ImageMemory)
283 DefDeDtor(ImageMemory)
285
287 DefGetter(const ynothrow, const Buffer&, Buffer, buffer)
288 DefGetter(const ynothrow, ImageFormat, Format, format)
289 DefGetter(const ynothrow, NativeHandle, NativeHandle, p_memory.get())
290 };
292
293
299 class YF_API HBitmap final
300 {
301 public:
302 using DataPtr = observer_ptr<::FIBITMAP>;
304 class YF_API Deleter
305 {
306 public:
307 using pointer = ::FIBITMAP*;
308
309 void
310 operator()(pointer) const ynothrow;
311 };
312
313 private:
315 unique_ptr_from<Deleter> p_bitmap;
316
317 public:
322 DefDeCtor(HBitmap)
328 HBitmap(DataPtr ptr) ynothrow
329 : p_bitmap(ptr.get())
330 {}
332
333 HBitmap(const Size&, BitPerPixel = 0);
344 explicit YB_NONNULL(2)
345 HBitmap(BitmapPtr, const Size&, size_t = 0);
347
352 HBitmap(const CompactPixmap&);
364 YB_NONNULL(2)
365 HBitmap(const char*, ImageDecoderFlags = ImageDecoderFlags::Default);
367 YB_NONNULL(2)
368 HBitmap(const char*, ImageFormat,
369 ImageDecoderFlags = ImageDecoderFlags::Default);
374 YB_NONNULL(2)
375 HBitmap(const char16_t*, ImageDecoderFlags = ImageDecoderFlags::Default);
377 YB_NONNULL(2)
378 HBitmap(const char16_t*, ImageFormat,
379 ImageDecoderFlags = ImageDecoderFlags::Default);
385 template<class _tString,
386 yimpl(typename = ystdex::enable_for_string_class_t<_tString>)>
387 HBitmap(const _tString& filename,
388 ImageDecoderFlags = ImageDecoderFlags::Default)
389 : HBitmap(&filename[0])
390 {}
395 template<class _tString,
396 yimpl(typename = ystdex::enable_for_string_class_t<_tString>)>
397 HBitmap(const _tString& filename, ImageFormat fmt,
398 ImageDecoderFlags = ImageDecoderFlags::Default)
399 : HBitmap(&filename[0], fmt)
400 {}
402
406 HBitmap(const ImageMemory&, ImageDecoderFlags = ImageDecoderFlags::Default);
414 HBitmap(const HBitmap&, BitPerPixel);
416
417
422 HBitmap(const HBitmap&, const Size&, SamplingFilter);
424 HBitmap(const HBitmap&);
425 DefDeMoveCtor(HBitmap)
427 DefDeDtor(HBitmap)
429
431
432 PDefHOp(HBitmap&, =, const HBitmap& pixmap)
434 ImplRet(ystdex::copy_and_swap(*this, pixmap))
435 DefDeMoveAssignment(HBitmap)
437
439
440 DefBoolNeg(explicit, bool(p_bitmap))
441
450 byte*
451 operator[](size_t) const ynothrowv;
453
458 operator CompactPixmap() const;
459
460 BitPerPixel
461 GetBPP() const ynothrow;
463 DefGetter(const ynothrow, DataPtr, DataPtr, make_observer(p_bitmap.get()))
464 SDst
465 GetHeight() const ynothrow;
467 DefGetter(const ynothrow, Size, Size, {GetWidth(), GetHeight()})
469 SDst
470 GetPitch() const ynothrow;
477 byte*
478 GetPixels() const ynothrow;
487 PDefH(byte*, GetScanLine, size_t idx) const ynothrow
488 ImplRet(p_bitmap ? (*this)[idx] : nullptr)
489 SDst
490 GetWidth() const ynothrow;
491
497 Deleter::pointer
498 Release() ynothrow;
499
504 void
505 Rescale(const Size&, SamplingFilter = SamplingFilter::Box);
506
513 void
515 SaveTo(const char*, ImageFormat = ImageFormat::BMP,
516 ImageDecoderFlags = ImageDecoderFlags::Default) const;
518 void
519 SaveTo(const char16_t*, ImageFormat = ImageFormat::BMP,
520 ImageDecoderFlags = ImageDecoderFlags::Default) const;
525 template<class _tString,
526 yimpl(typename = ystdex::enable_for_string_class_t<_tString>)>
527 void
528 SaveTo(const _tString& filename, ImageFormat fmt = ImageFormat::BMP,
529 ImageDecoderFlags flags = ImageDecoderFlags::Default) const
530 {
531 SaveTo(&filename[0], fmt, flags);
532 }
534
539 friend PDefH(void, swap, HBitmap& x, HBitmap& y) ynothrow
540 ImplExpr(std::swap(x.p_bitmap, y.p_bitmap))
541 };
542
544
545
552 YF_API Timers::TimeSpan
553 GetFrameTimeOf(const HBitmap&);
554
563 YF_API Size
564 GetLogicalSizeOf(const HBitmap&);
566
567
569
570
574 class MultiBitmapData;
575
582 class YF_API HMultiBitmap final
583 {
584 public:
585 using DataPtr = shared_ptr<MultiBitmapData>;
587 using iterator = ystdex::subscriptive_iterator<const HMultiBitmap, HBitmap,
588 ptrdiff_t, const HBitmap*, HBitmap>;
590 using const_iterator = iterator;
591
592 private:
593 DataPtr pages{};
594
595 public:
601 DefDeCtor(HMultiBitmap)
613 HMultiBitmap(const char*, ImageDecoderFlags = ImageDecoderFlags::Default);
615 HMultiBitmap(const char*, ImageFormat,
616 ImageDecoderFlags = ImageDecoderFlags::Default);
621 HMultiBitmap(const char16_t*,
622 ImageDecoderFlags = ImageDecoderFlags::Default);
624 HMultiBitmap(const char16_t*, ImageFormat,
625 ImageDecoderFlags = ImageDecoderFlags::Default);
627
628
632 template<class _tString,
633 yimpl(typename = ystdex::enable_for_string_class_t<_tString>)>
634 HMultiBitmap(const _tString& filename,
635 ImageDecoderFlags flags = ImageDecoderFlags::Default)
636 : HMultiBitmap(&filename[0], flags)
637 {}
639 template<class _tString,
640 yimpl(typename = ystdex::enable_for_string_class_t<_tString>)>
641 HMultiBitmap(const _tString& filename, ImageFormat fmt,
642 ImageDecoderFlags flags = ImageDecoderFlags::Default)
643 : HMultiBitmap(&filename[0], fmt, flags)
644 {}
646
647 DefDeCopyMoveCtorAssignment(HMultiBitmap)
648
649 DefBoolNeg(explicit, bool(pages))
650
652 PDefHOp(HBitmap, [], size_t idx) const ynothrowv
653 ImplRet(Lock(idx))
654
655 size_t
656 GetPageCount() const ynothrow;
657
658 HBitmap
659 Lock(size_t = 0) const ynothrowv;
660
665 friend PDefH(void, swap, HMultiBitmap& x, HMultiBitmap& y) ynothrow
666 ImplExpr(std::swap(x.pages, y.pages))
667
669
670 PDefH(iterator, begin, ) const ynothrow
671 ImplRet(HMultiBitmap::iterator(*this, 0))
672
673 PDefH(iterator, end, ) const ynothrow
674 ImplRet(HMultiBitmap::iterator(*this, GetPageCount()))
676 };
678
679
686 class YF_API ImageTag final
687 {
688 public:
689 using DataPtr = ::FITAG*;
690 using ID = std::uint16_t;
695 enum Type
696 {
697 NoType = 0,
698 Byte = 1,
699 ASCII = 2,
700 Short = 3,
701 Long = 4,
702 Rational = 5,
703 SByte = 6,
704 Undefined = 7,
705 SShort = 8,
706 SLong = 9,
707 SRational = 10,
708 Float = 11,
709 Double = 12,
710 IFD = 13,
711 Palette = 14,
712 Long8 = 16,
713 SLong8 = 17,
714 IFD8 = 18
715 };
716
717 private:
718 DataPtr p_tag = {};
720 bool owns = {};
721
722 public:
727 DefDeCtor(ImageTag)
734 ImageTag(DataPtr ptr, bool o = true) ynothrow
735 : p_tag(ptr), owns(o)
736 {}
746 ImageTag(HBitmap::DataPtr, ImageMetadataModel, const char*);
749 ImageTag(const HBitmap&, ImageMetadataModel, const char*);
750 template<typename _tBitmap, class _tString,
751 yimpl(typename = ystdex::enable_for_string_class_t<_tString>)>
752 ImageTag(const _tBitmap& bmp, ImageMetadataModel model, _tString& name)
753 : ImageTag(bmp, model, &name[0])
754 {}
756 ImageTag(const ImageTag&) ythrow(BadImageAlloc);
762 ImageTag(const ImageTag& tag, ystdex::false_) ynothrow
763 : ImageTag(tag.p_tag, {})
764 {}
765 ~ImageTag();
766
767 DefBoolNeg(explicit, p_tag)
768
769 size_t
770 GetCount() const ynothrow;
772 DefGetter(const ynothrow, DataPtr, DataPtr, p_tag)
773 const char*
774 GetDescription() const ynothrow;
775 ID
776 GetID() const ynothrow;
777 const char*
778 GetKey() const ynothrow;
779 size_t
780 GetLength() const ynothrow;
781 Type
782 GetType() const ynothrow;
788 template<typename _type>
789 const _type&
790 GetValue() const ythrow(GeneralEvent)
791 {
792 if(const auto p = GetValuePtr())
793 return Deref(static_cast<const _type*>(p));
794 throw GeneralEvent("Null tag value found.");
795 }
797 const void*
798 GetValuePtr() const ynothrow;
799
801 bool
802 SetCount(size_t) const ynothrow;
803 bool
804 SetDescription(const char*) const ynothrow;
805 bool
806 SetID(ID) const ynothrow;
807 bool
808 SetKey(const char*) const ynothrow;
810 bool
811 SetLength(size_t) const ynothrow;
812 bool
813 SetType(Type) const ynothrow;
814 bool
815 SetValue(const void*) const ynothrow;
816
821 DataPtr
822 Release() ynothrow;
823 };
824
831 YF_API string
832 to_string(const ImageTag&, ImageMetadataModel);
833
834
841 class YF_API ImageMetadataFindData final : private noncopyable
842 {
843 public:
844 using DataPtr = ::FIMETADATA*;
845
851 ImageMetadataModel CurrentModel;
852
853 private:
854 HBitmap::DataPtr p_bitmap;
855 ImageTag::DataPtr p_tag = {};
856 DataPtr p_metadata = {};
857
858 public:
860
861 ImageMetadataFindData(HBitmap::DataPtr, ImageMetadataModel);
862 ImageMetadataFindData(const HBitmap&, ImageMetadataModel);
864 ~ImageMetadataFindData();
866
867 DefBoolNeg(explicit, p_metadata)
868
869 DefGetter(const ynothrow, ImageTag, Tag, {p_tag, {}})
870
871 private:
872 void
873 Close() ynothrow;
874
875 public:
877 void
878 Read() ynothrow;
879
880 void
881 Rewind() ynothrow;
882 };
883
884
890 class YF_API HImageMetadata final : private ystdex::deref_self<HImageMetadata>
891 {
892 friend deref_self<HImageMetadata>;
893
894 private:
895 unique_ptr<ImageMetadataFindData> p_data;
896
897 public:
898 template<typename... _tParams>
899 explicit
900 HImageMetadata(_tParams&&... args)
901 : p_data(new ImageMetadataFindData(yforward(args)...))
902 {}
903 DefDeMoveCtor(HImageMetadata)
904
905 DefDeMoveAssignment(HImageMetadata)
906
911 using deref_self<HImageMetadata>::operator*;
912
914 PDefHOp(HImageMetadata&, ++, ) ynothrow
915 ImplRet(Deref(p_data).Read(), *this)
916
917 explicit DefCvt(const ynothrow, bool, bool(p_data))
918
920 operator ImageTag() const;
921
922 PDefH(void, Rewind, )
923 ImplRet(Deref(p_data).Rewind())
924 };
925
926
931 using HImageMetadataIterator = ystdex::indirect_input_iterator<HImageMetadata*>;
932
933
935 class YF_API ImageCodec final
936 {
937 public:
939 ImageCodec();
941 ~ImageCodec();
942
953 static ImageFormat
954 DetectFormat(ImageMemory::NativeHandle, size_t);
956 static ImageFormat
957 DetectFormat(const char*);
959 static ImageFormat
960 DetectFormat(const char16_t*);
962
964 static CompactPixmap
965 Load(ImageMemory::Buffer);
966
974 static HMultiBitmap
976 LoadForPlaying(const char*);
978 static HMultiBitmap
979 LoadForPlaying(const char16_t*);
984 template<class _tString,
985 yimpl(typename = ystdex::enable_for_string_class_t<_tString>)>
986 static HMultiBitmap
987 LoadForPlaying(const _tString& filename)
988 {
989 return LoadForPlaying(&filename[0]);
990 }
992
999 template<class _tSeqCon, typename _type>
1000 static _tSeqCon
1001 LoadSequence(const _type& path)
1002 {
1003 const auto multi_bitmap(LoadForPlaying(path));
1004 _tSeqCon con(multi_bitmap.begin(), multi_bitmap.end());
1005
1006 if(con.empty())
1007 con.emplace_back(path);
1008 return con;
1009 }
1010 };
1011
1012 } // namespace Drawing;
1013
1014 } // namespace YSLib;
1015
1016 #endif
1017
ystdex::unsupported
异常：不支持的操作。
Definition: ystdex/exception.h:116
YSLib::Drawing::GetHeight
tr GetHeight())) inline PDefH(void
按字体高度和行距调整文本区域的底边距。
ystdex::subscriptive_iterator
成员下标迭代器。
Definition: iterator.hpp:1247
YSLib::Drawing::ImageMetadataFindData::CurrentModel
ImageMetadataModel CurrentModel
当前生效的模型。
Definition: Image.h:851
platform::ID
std::uintmax_t ID
YF_Platform_* 宏替换值的公共类型。
Definition: YCommon.h:52
YSLib::Drawing::ImageMetadataModel::NoData
YSLib::Drawing::ImageMemory::NativeHandle
::FIMEMORY * NativeHandle
Definition: Image.h:222
YSLib::Drawing::to_string
string to_string(const ImageTag &tag, ImageMetadataModel model)
Definition: Image.cpp:701
YSLib::Drawing::HMultiBitmap
多页面位图句柄：指向多页面位图数据。
Definition: Image.h:582
YSLib::Drawing::ImageMetadataModel::EXIF_GPS
platform::KeyCategory::Lock
表示锁定键。
Definition: Keys.h:115
YSLib::Drawing::ImageFormat::GIF
YSLib::Drawing::buffer
The boundary is out of the buffer
Definition: YDraw.h:118
DefBitmaskEnum
#define DefBitmaskEnum(_tEnum)
Definition: YBaseMacro.h:481
YSLib::Drawing::ImageMetadataModel
ImageMetadataModel
图像元数据模型标识。
Definition: Image.h:138
YSLib
YSLib 命名空间。
Definition: AndroidHost.h:45
YSLib::Drawing::ImageDecoderFlags::JPEG_QualityGood
DefBoolNeg
#define DefBoolNeg(_spec,...)
定义表示显式转换 bool 操作符及其否定的 operator! 。
Definition: YBaseMacro.h:228
ystdex::make_observer
observer_ptr< _type > make_observer(_type *p)
Definition: pointer.hpp:326
YSLib::Drawing::GetFrameTimeOf
TimeSpan GetFrameTimeOf(const HBitmap &bmp)
Definition: Image.cpp:440
platform::Deref
yconstfn auto Deref(_type &&p) -> decltype(*p)
断言并解引用非空指针。
Definition: Debug.h:451
YSLib::UI::y
SPos SPos y
Definition: YWidget.cpp:44
platform::size_t
YF_API size_t
Definition: FileIO.h:1353
YSLib::Drawing::BitmapPtr
Pixel * BitmapPtr
Definition: YGraphics.h:42
YSLib::Drawing::ImageDecoderFlags::GIF_Load256
YSLib::Drawing::ImageCodec::LoadForPlaying
static HMultiBitmap LoadForPlaying(const _tString &filename)
构造：使用指定字符串文件名。
Definition: Image.h:987
YSLib::Drawing::ImageTag::ImageTag
ImageTag(const _tBitmap &bmp, ImageMetadataModel model, _tString &name)
Definition: Image.h:752
ystdex::false_
bool_< false > false_
Definition: type_traits.hpp:392
CHRLib::f
f(d, s)
CHRLib::CharSet::ASCII
yconstexpr const Encoding ASCII(US_ASCII)
YSLib::Drawing::CompactPixmap
标准矩形像素图缓冲区。
Definition: YGDI.h:243
DefDeMoveCtor
#define DefDeMoveCtor(_t)
Definition: YBaseMacro.h:167
YSLib::Drawing::ImageCodec
Definition: Image.h:935
YSLib::Drawing::ImageDecoderFlags::JPEG_Accurate
YSLib::Drawing::BitPerPixel
std::uint8_t BitPerPixel
Definition: Image.h:58
YSLib::UI::Close
void Close(IWidget &wgt)
Definition: YWidget.cpp:92
YSLib::Drawing::ImageDecoderFlags::JPEG_QualityAverage
YSLib::Drawing::ImageMetadataModel::EXIF_Interop
YSLib::Drawing::ImageDecoderFlags::JPEG_Progressive
DefDeCopyMoveCtorAssignment
#define DefDeCopyMoveCtorAssignment(_t)
Definition: YBaseMacro.h:202
CHRLib::args
_tParams && args
Definition: CharacterProcessing.h:538
YSLib::Drawing::ImageDecoderFlags::JPEG_EXIFRotate
YSLib::Drawing::ImageDecoderFlags::JPEG_Baseline
YSLib::Drawing::HImageMetadata::p_data
unique_ptr< ImageMetadataFindData > p_data
Definition: Image.h:895
ystdex::enable_for_string_class_t
enable_if_t< is_string_class< decay_t< _tParam >>::value, _type > enable_for_string_class_t
选择字符串类类型的特定重载避免和其它非字符串类型冲突。
Definition: string.hpp:274
ystdex::cpp2011::end
_type * end(_type(&&array)[_vN])
Definition: range.hpp:54
YSLib::Drawing::UnsupportedImageFormat
未被支持的图像格式异常：表示请求的操作涉及的图像格式不受库的支持。
Definition: Image.h:177
YSLib::Drawing::ImageDecoderFlags::JPEG_QualitySuperb
YSLib::Drawing::ImageDecoderFlags::JPEG_QualityNormal
YSLib::Drawing::ImageMemory::ImageMemory
ImageMemory(_func f, ImageFormat fmt)
构造：以指定格式新建并打开内存缓冲区。
Definition: Image.h:277
YSLib::Drawing::ImageFormat::BMP
YSLib::Drawing::ImageMemory::Buffer
vector< octet > Buffer
Definition: Image.h:224
DefDeMoveAssignment
#define DefDeMoveAssignment(_t)
Definition: YBaseMacro.h:191
YSLib::Drawing::HBitmap::HBitmap
HBitmap(const _tString &filename, ImageFormat fmt, ImageDecoderFlags=ImageDecoderFlags::Default)
构造：使用指定字符串文件名和解码器标识。
Definition: Image.h:397
DefDeCtor
#define DefDeCtor(_t)
简单通用成员函数定义。
Definition: YBaseMacro.h:157
YSLib::Drawing::ImageTag::DataPtr
::FITAG * DataPtr
Definition: Image.h:689
YSLib::Drawing::ImageDecoderFlags::JPEG_QualityBad
platform::SDst
std::uint16_t SDst
屏幕坐标距离。
Definition: Video.h:44
YSLib::Drawing::x
The boundary is out of the const Rect SDst SPos x
Definition: YDraw.h:127
YSLib::Drawing::ImageMetadataModel::GeoTIFF
YSLib::Drawing::ImageDecoderFlags::JPEG_Subsampling_444
YSLib::Drawing::ImageDecoderFlags::JPEG_Subsampling_422
ystdex
特性测试宏。
Definition: ydef.h:822
DefDeDtor
#define DefDeDtor(_t)
Definition: YBaseMacro.h:177
YSLib::Drawing::ImageDecoderFlags::JPEG_Subsampling_420
YSLib::Drawing::ImageDecoderFlags::JPEG_GreyScale
YSLib::Drawing::ImageMetadataFindData::p_bitmap
HBitmap::DataPtr p_bitmap
Definition: Image.h:854
YSLib::Drawing::HImageMetadata
元数据句柄：表示打开的元数据和内容迭代状态。
Definition: Image.h:890
YSLib::Drawing::HBitmap
位图句柄：指向位图数据。
Definition: Image.h:299
YSLib::Drawing::ImplExpr
tr TextRegion &tr ImplExpr(tr.Margin.Bottom=SPos(FetchResizedBottomMargin(tr))) YF_API SDst FetchCharWidth(const Font &
取指定的字符使用指定字体的显示宽度。
YF_API
#define YF_API
Definition: Platform.h:56
Drawing
YSLib::Drawing::HMultiBitmap::HMultiBitmap
HMultiBitmap(const _tString &filename, ImageFormat fmt, ImageDecoderFlags flags=ImageDecoderFlags::Default)
构造：使用指定字符串文件名和解码器标识。
Definition: Image.h:641
YSLib::Drawing::MultiBitmapData
Definition: Image.cpp:457
YSLib::Drawing::ImageDecoderFlags
ImageDecoderFlags
图像解码器标识。
Definition: Image.h:84
YSLib::Drawing::HBitmap::Deleter::pointer
::FIBITMAP * pointer
Definition: Image.h:307
YSLib::yimpl
YF_API yimpl(GUIApplication &) FetchGlobalInstance()
取全局应用程序实例。
YSLib::Drawing::ImageMetadataFindData::DataPtr
::FIMETADATA * DataPtr
Definition: Image.h:844
YSLib::Drawing::HBitmap::DataPtr
observer_ptr<::FIBITMAP > DataPtr
Definition: Image.h:302
YSLib::ynothrow
YB_PURE const _type size_t n ynothrow
Definition: YCoreUtilities.h:168
YSLib::Drawing::ImageTag::ID
std::uint16_t ID
Definition: Image.h:690
YSLib::Drawing::GetLogicalSizeOf
Size GetLogicalSizeOf(const HBitmap &bmp)
Definition: Image.cpp:448
YSLib::Drawing::ImageMetadataModel::IPTC
YSLib::Drawing::ImageMemory::Deleter
Definition: Image.h:228
YSLib::Drawing::ImageMemory
图像内存对象；保存图像内容的数据缓冲对象。
Definition: Image.h:219
YSLib::Drawing::ImageFormat::Unknown
ynothrowv
#define ynothrowv
YSLib 无异常抛出保证验证：有条件地使用无异常抛出规范。
Definition: ydef.h:786
YSLib::Drawing::ImageMetadataModel::EXIF_RAW
YSLib::Drawing::ImageMetadataModel::XMP
YSLib::Drawing::ImageDecoderFlags::JPEG_Fast
YSLib::Drawing::ImageMemory::Deleter::pointer
NativeHandle pointer
Definition: Image.h:231
ystdex::swap
void swap(container_adaptor< _tSeqCon > &x, container_adaptor< _tSeqCon > &y)
Definition: container.hpp:179
YSLib::YB_NONNULL
YF_API YB_NONNULL(1, 2) ValueNode LoadNPLA1File(const char *disp
载入 NPLA1 配置文件。
YSLib::Drawing::ImageFormat
ImageFormat
图像格式。
Definition: Image.h:67
std
Definition: memory.hpp:1183
YSLib::ImplRet
ImplRet(FetchGlobalInstance().GetGUIHostRef()) YF_API void Execute(GUIApplication &
执行程序主消息循环。
DefGetter
#define DefGetter(_q, _t, _n,...)
Definition: YBaseMacro.h:241
YSLib::Drawing::HImageMetadata::HImageMetadata
HImageMetadata(_tParams &&...args)
Definition: Image.h:900
ythrow
#define ythrow(...)
YSLib 动态异常规范：根据是否使用异常规范宏指定或忽略动态异常规范。
Definition: ydef.h:817
ystdex::byte
unsigned char byte
字节类型。
Definition: ydef.h:834
YSLib::Drawing::ImageTag::Type
Type
元数据类型标识。
Definition: Image.h:695
YSLib::GeneralEvent
std::runtime_error GeneralEvent
一般运行时异常事件类。
Definition: YException.h:46
DefCvt
#define DefCvt(_q, _t,...)
Definition: YBaseMacro.h:206
YSLib::Drawing::ImageMetadataModel::Animation
DefDeCopyCtor
#define DefDeCopyCtor(_t)
Definition: YBaseMacro.h:162
YSLib::Drawing::ImageFormat::ICO
YSLib::UI::name
yconstfn const string & name
Definition: Loader.h:130
ystdex::noncopyable
不可复制对象：禁止派生类调用默认原型的复制构造函数和复制赋值操作符。
Definition: base.h:41
YSLib::Drawing::Size
屏幕区域大小。
Definition: YGDIBase.h:293
YSLib::Drawing::ImageMetadataModel::EXIF_Main
ystdex::copy_and_swap
_type & copy_and_swap(_type &obj, const _type2 &new_val)
复制后交换。
Definition: utility.hpp:170
ystdex::indirect_input_iterator
间接输入迭代器。
Definition: iterator.hpp:822
yforward
#define yforward(_expr)
根据参数类型使用 std::forward 传递对应参数。
Definition: ydef.h:995
YSLib::Drawing::ImageDecoderFlags::ICO_MakeAlpha
DefDelMoveCtor
#define DefDelMoveCtor(_t)
Definition: YBaseMacro.h:169
CHRLib::char16_t
char16_t((*c_ptr<< CHAR_BIT)|c_ptr[1])) inline PDefH(char16_t
取 c_ptr 指向的小端序双字节字符。
YSLib::Drawing::UnknownImageFormat
未知图像格式异常：表示请求的操作涉及的图像格式因为不明确而不受库的支持。
Definition: Image.h:199
YSLib::Drawing::ImageDecoderFlags::JPEG_Subsampling_411
ystdex::cpp2011::begin
_type * begin(_type(&&array)[_vN])
Definition: range.hpp:46
YSLib::Drawing::ImageMetadataModel::Comments
YSLib::Drawing::ImageFormat::PNG
YSLib::Drawing::ImageMetadataModel::EXIF_MakerNote
YSLib::Drawing::PDefH
yconstfn PDefH(Size, Transpose, const Size &s) ynothrow ImplRet(
转置。
Definition: YGDIBase.h:516
YSLib::Drawing::ImageCodec::LoadSequence
static _tSeqCon LoadSequence(const _type &path)
读取指定路径的图片文件为用于直接呈现的帧序列。
Definition: Image.h:1001
YSLib::Drawing::ImageMetadataModel::EXIF_EXIF
YSLib::Drawing::ImageDecoderFlags::GIF_Playback
YSLib::IO::int
YF_API int
Definition: File.h:51
YSLib::Drawing::ImageMetadataFindData
图像元数据。
Definition: Image.h:841
YSLib::Drawing::BadImageAlloc
图像资源分配失败异常：表示存储等资源不足导致无法创建图像。
Definition: Image.h:160
YSLib::Drawing::ImageDecoderFlags::JPEG_Optimize
platform::references::unique_ptr_from
unique_ptr< ystdex::defer_element< ystdex::unique_ptr_pointer< void, _tDeleter >, _tDefault >, _tDeleter > unique_ptr_from
取删除器对应的 unique_ptr 实例。
Definition: Reference.h:99
YSLib::Drawing::ImageTag
图像元数据标签。
Definition: Image.h:686
YSLib::Timers::TimeSpan
std::chrono::duration< Duration::rep, std::milli > TimeSpan
低精度时间间隔。
Definition: YClock.h:81
YSLib::path
YF_API const char * path
Definition: Initialization.h:77
YSLib::Drawing::HMultiBitmap::DataPtr
shared_ptr< MultiBitmapData > DataPtr
Definition: Image.h:585
YSLib::Drawing::ImageMetadataModel::Custom
YSLib::Drawing::ImageFormat::JPEG
YSLib::Drawing::ImageDecoderFlags::Default
YSLib::Drawing::ImageDecoderFlags::JPEG_CMYK
YSLib::Drawing::HBitmap::Deleter
Definition: Image.h:304
CHRLib::p
const auto p(d)
YSLib::swap
void swap(ValueNode &x, ValueNode &y) ynothrow
Definition: ValueNode.cpp:73
ystdex::details::get
get())
Definition: cast.hpp:102