YSTest: Image.h 源文件

YSTest PreAlpha_b700_20160611 The YSLib Test Project

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

- 文件列表
- 文件成员

Image.h
浏览该文件的文档.
1 /*
2 © 2013-2016 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 #include YFM_YSLib_Core_YClock // for TimeSpan;
34 //#include <FreeImage.h>
35
37 struct FIBITMAP;
39 struct FIMETADATA;
41 struct FITAG;
43 struct FIMEMORY;
44
45 namespace YSLib
46 {
47
48 namespace Drawing
49 {
50
52 class CompactPixmap;
54 class HBitmap;
55
57 using BitPerPixel = std::uint8_t;
58
59
66 enum class ImageFormat : int
67 {
68 Unknown = -1,
69 BMP = 0,
70 ICO = 1,
71 JPEG = 2,
73 PNG = 13,
74 GIF = 25
75 };
76
77
83 enum class ImageDecoderFlags : int
84 {
85 Default = 0,
86 GIF_Load256 = 1,
87 GIF_Playback = 2,
88 ICO_MakeAlpha = 1,
89 JPEG_Fast = 0x0001,
90 JPEG_Accurate = 0x0002,
91 JPEG_CMYK = 0x0004,
92 JPEG_EXIFRotate = 0x0008,
93 JPEG_GreyScale = 0x0010,
94 JPEG_QualitySuperb = 0x80,
95 JPEG_QualityGood = 0x0100,
96 JPEG_QualityNormal = 0x0200,
97 JPEG_QualityAverage = 0x0400,
98 JPEG_QualityBad = 0x0800,
99 JPEG_Progressive = 0x2000,
100 JPEG_Subsampling_411 = 0x1000,
101 JPEG_Subsampling_420 = 0x4000,
102 JPEG_Subsampling_422 = 0x8000,
103 JPEG_Subsampling_444 = 0x10000,
104 JPEG_Optimize = 0x20000,
105 JPEG_Baseline = 0x40000
106 };
107
112 DefBitmaskEnum(ImageDecoderFlags)
113
114
115
121 enum class SamplingFilter
122 {
123 Box = 0,
124 Bicubic = 1,
125 Bilinear = 2,
126 BSpline = 3,
127 CatmullRom = 4,
128 Lanczos3 = 5
129 };
130
131
137 enum class ImageMetadataModel
138 {
139 NoData = -1,
140 Comments = 0,
141 EXIF_Main = 1,
142 EXIF_EXIF = 2,
143 EXIF_GPS = 3,
144 EXIF_MakerNote = 4,
145 EXIF_Interop = 5,
146 IPTC = 6,
147 XMP = 7,
148 GeoTIFF = 8,
149 Animation = 9,
150 Custom = 10,
151 EXIF_RAW = 11
152 };
153
154
159 class YF_API BadImageAlloc : public std::bad_alloc
160 {
161 public:
163
164 DefDeCtor(BadImageAlloc)
165 DefDeCopyCtor(BadImageAlloc)
167 ~BadImageAlloc() override;
169 };
170
171
176 class YF_API UnsupportedImageFormat
177 : public GeneralEvent, public ystdex::unsupported
178 {
179 public:
181 using GeneralEvent::GeneralEvent;
182
184 DefDeCopyCtor(UnsupportedImageFormat)
189 ~UnsupportedImageFormat() override;
190 };
191
192
194
195
198 class YF_API UnknownImageFormat : public UnsupportedImageFormat
199 {
200 public:
202 using UnsupportedImageFormat::UnsupportedImageFormat;
203
205 DefDeCopyCtor(UnknownImageFormat)
210 ~UnknownImageFormat() override;
211 };
212
213
218 class YF_API ImageMemory final
219 {
220 public:
221 using NativeHandle = ::FIMEMORY*;
223 using Buffer = vector<octet>;
224
225 private:
227 class YF_API ImageMemoryDelete
228 {
229 public:
230 using pointer = NativeHandle;
231
232 void
233 operator()(pointer) const ynothrow;
234 };
235
236 Buffer buffer;
237 ImageFormat format;
239 unique_ptr_from<ImageMemoryDelete> p_memory;
240
241 public:
256 explicit
257 ImageMemory(const HBitmap&, ImageFormat = ImageFormat::BMP,
258 ImageDecoderFlags = ImageDecoderFlags::Default);
265 ImageMemory(Buffer);
268 ImageMemory(Buffer, ImageFormat);
270 template<typename _func>
271 ImageMemory(_func f)
272 : ImageMemory(f())
273 {}
275 template<typename _func>
276 ImageMemory(_func f, ImageFormat fmt)
277 : ImageMemory(f(), fmt)
278 {}
280 DefDelMoveCtor(ImageMemory)
282 DefDeDtor(ImageMemory)
284
286 DefGetter(const ynothrow, const Buffer&, Buffer, buffer)
287 DefGetter(const ynothrow, ImageFormat, Format, format)
288 DefGetter(const ynothrow, NativeHandle, NativeHandle, p_memory.get())
289 };
291
292
298 class YF_API HBitmap final
299 {
300 public:
301 using DataPtr = observer_ptr<::FIBITMAP>;
303 class YF_API Deleter
304 {
305 public:
306 using pointer = ::FIBITMAP*;
307
308 void
309 operator()(pointer) const ynothrow;
310 };
311
312 private:
314 unique_ptr_from<Deleter> p_bitmap;
315
316 public:
321 DefDeCtor(HBitmap)
327 HBitmap(DataPtr ptr) ynothrow
328 : p_bitmap(ptr.get())
329 {}
331
332 HBitmap(const Size&, BitPerPixel = 0);
343 explicit YB_NONNULL(2)
344 HBitmap(BitmapPtr, const Size&, size_t = 0);
346
351 HBitmap(const CompactPixmap&);
363 YB_NONNULL(2)
364 HBitmap(const char*, ImageDecoderFlags = ImageDecoderFlags::Default);
366 YB_NONNULL(2)
367 HBitmap(const char*, ImageFormat,
368 ImageDecoderFlags = ImageDecoderFlags::Default);
373 YB_NONNULL(2)
374 HBitmap(const char16_t*, ImageDecoderFlags = ImageDecoderFlags::Default);
376 YB_NONNULL(2)
377 HBitmap(const char16_t*, ImageFormat,
378 ImageDecoderFlags = ImageDecoderFlags::Default);
384 template<class _tString,
385 yimpl(typename = ystdex::enable_for_string_class_t<_tString>)>
386 HBitmap(const _tString& filename,
387 ImageDecoderFlags = ImageDecoderFlags::Default)
388 : HBitmap(&filename[0])
389 {}
394 template<class _tString,
395 yimpl(typename = ystdex::enable_for_string_class_t<_tString>)>
396 HBitmap(const _tString& filename, ImageFormat fmt,
397 ImageDecoderFlags = ImageDecoderFlags::Default)
398 : HBitmap(&filename[0], fmt)
399 {}
401
405 HBitmap(const ImageMemory&, ImageDecoderFlags = ImageDecoderFlags::Default);
413 HBitmap(const HBitmap&, BitPerPixel);
415
416
421 HBitmap(const HBitmap&, const Size&, SamplingFilter);
423 HBitmap(const HBitmap&);
424 DefDeMoveCtor(HBitmap)
426 DefDeDtor(HBitmap)
428
430
431 HBitmap&
433 operator=(HBitmap pixmap) ynothrow
434 {
435 pixmap.swap(*this);
436 return *this;
437 }
438
439 DefBoolNeg(explicit, bool(p_bitmap))
440
441
449 byte*
450 operator[](size_t) const ynothrowv;
452
457 operator CompactPixmap() const;
458
459 BitPerPixel
460 GetBPP() const ynothrow;
462 DefGetter(const ynothrow, DataPtr, DataPtr, make_observer(p_bitmap.get()))
463 SDst
464 GetHeight() const ynothrow;
466 DefGetter(const ynothrow, Size, Size, {GetWidth(), GetHeight()})
468 SDst
469 GetPitch() const ynothrow;
476 byte*
477 GetPixels() const ynothrow;
486 PDefH(byte*, GetScanLine, size_t idx) const ynothrow
487 ImplRet(p_bitmap ? (*this)[idx] : nullptr)
488 SDst
489 GetWidth() const ynothrow;
490
496 Deleter::pointer
497 Release() ynothrow;
498
503 void
504 Rescale(const Size&, SamplingFilter = SamplingFilter::Box);
505
512 void
514 SaveTo(const char*, ImageFormat = ImageFormat::BMP,
515 ImageDecoderFlags = ImageDecoderFlags::Default) const;
517 void
518 SaveTo(const char16_t*, ImageFormat = ImageFormat::BMP,
519 ImageDecoderFlags = ImageDecoderFlags::Default) const;
524 template<class _tString,
525 yimpl(typename = ystdex::enable_for_string_class_t<_tString>)>
526 void
527 SaveTo(const _tString& filename, ImageFormat fmt = ImageFormat::BMP,
528 ImageDecoderFlags flags = ImageDecoderFlags::Default) const
529 {
530 SaveTo(&filename[0], fmt, flags);
531 }
533
538 PDefH(void, swap, HBitmap& pixmap) ynothrow
539 ImplExpr(std::swap(p_bitmap, pixmap.p_bitmap))
540 };
541
543
544
551 YF_API Timers::TimeSpan
552 GetFrameTimeOf(const HBitmap&);
553
562 YF_API Size
563 GetLogicalSizeOf(const HBitmap&);
564
566 inline DefSwap(ynothrow, HBitmap)
568
569
570
572
576 class MultiBitmapData;
577
584 class YF_API HMultiBitmap final
585 {
586 public:
587 using DataPtr = shared_ptr<MultiBitmapData>;
589 using iterator = ystdex::subscriptive_iterator<const HMultiBitmap, HBitmap,
590 ptrdiff_t, const HBitmap*, HBitmap>;
592 using const_iterator = iterator;
593
594 private:
595 DataPtr pages{};
596
597 public:
603 DefDeCtor(HMultiBitmap)
615 HMultiBitmap(const char*, ImageDecoderFlags = ImageDecoderFlags::Default);
617 HMultiBitmap(const char*, ImageFormat,
618 ImageDecoderFlags = ImageDecoderFlags::Default);
623 HMultiBitmap(const char16_t*,
624 ImageDecoderFlags = ImageDecoderFlags::Default);
626 HMultiBitmap(const char16_t*, ImageFormat,
627 ImageDecoderFlags = ImageDecoderFlags::Default);
629
630
634 template<class _tString,
635 yimpl(typename = ystdex::enable_for_string_class_t<_tString>)>
636 HMultiBitmap(const _tString& filename,
637 ImageDecoderFlags flags = ImageDecoderFlags::Default)
638 : HMultiBitmap(&filename[0], flags)
639 {}
641 template<class _tString,
642 yimpl(typename = ystdex::enable_for_string_class_t<_tString>)>
643 HMultiBitmap(const _tString& filename, ImageFormat fmt,
644 ImageDecoderFlags flags = ImageDecoderFlags::Default)
645 : HMultiBitmap(&filename[0], fmt, flags)
646 {}
648
649 DefDeCopyMoveCtorAssignment(HMultiBitmap)
650
651 DefBoolNeg(explicit, bool(pages))
652
654 PDefHOp(HBitmap, [], size_t idx) const ynothrowv
655 ImplRet(Lock(idx))
656
657 size_t
658 GetPageCount() const ynothrow;
659
660 HBitmap
661 Lock(size_t = 0) const ynothrowv;
662
664 PDefH(void, swap, HMultiBitmap& multi_pixmap) ynothrow
665 ImplExpr(std::swap(pages, multi_pixmap.pages))
666
668
669 PDefH(iterator, begin, ) const ynothrow
670 ImplRet(HMultiBitmap::iterator(*this, 0))
671
672 PDefH(iterator, end, ) const ynothrow
673 ImplRet(HMultiBitmap::iterator(*this, GetPageCount()))
675 };
676
678 inline DefSwap(ynothrow, HMultiBitmap)
680
681
688 class YF_API ImageTag final
689 {
690 public:
691 using DataPtr = ::FITAG*;
692 using ID = std::uint16_t;
697 enum Type
698 {
699 NoType = 0,
700 Byte = 1,
701 ASCII = 2,
702 Short = 3,
703 Long = 4,
704 Rational = 5,
705 SByte = 6,
706 Undefined = 7,
707 SShort = 8,
708 SLong = 9,
709 SRational = 10,
710 Float = 11,
711 Double = 12,
712 IFD = 13,
713 Palette = 14,
714 Long8 = 16,
715 SLong8 = 17,
716 IFD8 = 18
717 };
718
719 private:
720 DataPtr p_tag = {};
722 bool owns = {};
723
724 public:
729 DefDeCtor(ImageTag)
736 ImageTag(DataPtr ptr, bool o = true) ynothrow
737 : p_tag(ptr), owns(o)
738 {}
748 ImageTag(HBitmap::DataPtr, ImageMetadataModel, const char*);
751 ImageTag(const HBitmap&, ImageMetadataModel, const char*);
752 template<typename _tBitmap, class _tString,
753 yimpl(typename = ystdex::enable_for_string_class_t<_tString>)>
754 ImageTag(const _tBitmap& bmp, ImageMetadataModel model, _tString& name)
755 : ImageTag(bmp, model, &name[0])
756 {}
758 ImageTag(const ImageTag&) ythrow(BadImageAlloc);
764 ImageTag(const ImageTag& tag, std::false_type) ynothrow
765 : ImageTag(tag.p_tag, {})
766 {}
767 ~ImageTag();
768
769 DefBoolNeg(explicit, p_tag)
770
771 size_t
772 GetCount() const ynothrow;
774 DefGetter(const ynothrow, DataPtr, DataPtr, p_tag)
775 const char*
776 GetDescription() const ynothrow;
777 ID
778 GetID() const ynothrow;
779 const char*
780 GetKey() const ynothrow;
781 size_t
782 GetLength() const ynothrow;
783 Type
784 GetType() const ynothrow;
786 const void*
787 GetValuePtr() const ynothrow;
788
790 bool
791 SetCount(size_t) const ynothrow;
792 bool
793 SetDescription(const char*) const ynothrow;
794 bool
795 SetID(ID) const ynothrow;
796 bool
797 SetKey(const char*) const ynothrow;
799 bool
800 SetLength(size_t) const ynothrow;
801 bool
802 SetType(Type) const ynothrow;
803 bool
804 SetValue(const void*) const ynothrow;
805
810 DataPtr
811 Release() ynothrow;
812
818 template<typename _type>
819 const _type&
820 TryGetValue() const ythrow(GeneralEvent)
821 {
822 if(const auto p = GetValuePtr())
823 return Deref(static_cast<const _type*>(p));
824 throw GeneralEvent("Null tag value found.");
825 }
826 };
827
834 YF_API string
835 to_string(const ImageTag&, ImageMetadataModel);
836
837
844 class YF_API ImageMetadataFindData final : private noncopyable
845 {
846 public:
847 using DataPtr = ::FIMETADATA*;
848
854 ImageMetadataModel CurrentModel;
855
856 private:
857 HBitmap::DataPtr p_bitmap;
858 ImageTag::DataPtr p_tag = {};
859 DataPtr p_metadata = {};
860
861 public:
863
864 ImageMetadataFindData(HBitmap::DataPtr, ImageMetadataModel);
865 ImageMetadataFindData(const HBitmap&, ImageMetadataModel);
867 ~ImageMetadataFindData();
869
870 DefBoolNeg(explicit, p_metadata)
871
872 DefGetter(const ynothrow, ImageTag, Tag, {p_tag, {}})
873
874 private:
875 void
876 Close() ynothrow;
877
878 public:
880 void
881 Read() ynothrow;
882
883 void
884 Rewind() ynothrow;
885 };
886
887
893 class YF_API HImageMetadata final : private ystdex::deref_self<HImageMetadata>
894 {
895 friend deref_self<HImageMetadata>;
896
897 private:
898 unique_ptr<ImageMetadataFindData> p_data;
899
900 public:
901 template<typename... _tParams>
902 explicit
903 HImageMetadata(_tParams&&... args)
904 : p_data(new ImageMetadataFindData(yforward(args)...))
905 {}
906 DefDeMoveCtor(HImageMetadata)
907
908 DefDeMoveAssignment(HImageMetadata)
909
914 using deref_self<HImageMetadata>::operator*;
915
917 PDefHOp(HImageMetadata&, ++, ) ynothrow
918 ImplRet(Deref(p_data).Read(), *this)
919
920 explicit DefCvt(const ynothrow, bool, bool(p_data))
921
923 operator ImageTag() const;
924
925 PDefH(void, Rewind, )
926 ImplRet(Deref(p_data).Rewind())
927 };
928
929
934 using HImageMetadataIterator = ystdex::indirect_input_iterator<HImageMetadata*>;
935
936
938 class YF_API ImageCodec final
939 {
940 public:
941 ImageCodec();
943 ~ImageCodec();
944
955 static ImageFormat
956 DetectFormat(ImageMemory::NativeHandle, size_t);
958 static ImageFormat
959 DetectFormat(const char*);
961 static ImageFormat
962 DetectFormat(const char16_t*);
964
966 static CompactPixmap
967 Load(ImageMemory::Buffer);
968
976 static HMultiBitmap
978 LoadForPlaying(const char*);
980 static HMultiBitmap
981 LoadForPlaying(const char16_t*);
986 template<class _tString,
987 yimpl(typename = ystdex::enable_for_string_class_t<_tString>)>
988 static HMultiBitmap
989 LoadForPlaying(const _tString& filename)
990 {
991 return LoadForPlaying(&filename[0]);
992 }
994
1001 template<class _tSeqCon, typename _type>
1002 static _tSeqCon
1003 LoadSequence(const _type& path)
1004 {
1005 const auto multi_bitmap(LoadForPlaying(path));
1006 _tSeqCon con(multi_bitmap.begin(), multi_bitmap.end());
1007
1008 if(con.empty())
1009 con.emplace_back(path);
1010 return con;
1011 }
1012 };
1013
1014 } // namespace Drawing;
1015
1016 } // namespace YSLib;
1017
1018 #endif
1019
YSLib::Drawing::ImageDecoderFlags::Default
YSLib::Drawing::ImageDecoderFlags
ImageDecoderFlags
图像解码器标识。
Definition: Image.h:83
YSLib::Drawing::ImageMemory::ImageMemoryDelete
Definition: Image.h:227
platform::p
while p p
Definition: YCLib/FileSystem.h:225
YSLib::Drawing::UnsupportedImageFormat
未被支持的图像格式异常：表示请求的操作涉及的图像格式不受库的支持。
Definition: Image.h:176
YSLib::Drawing::ImageMemory::ImageMemoryDelete::pointer
NativeHandle pointer
Definition: Image.h:230
YSLib::Drawing::ImageDecoderFlags::JPEG_QualityGood
YSLib::Drawing::ImageMetadataModel::NoData
YSLib::Drawing::ImageCodec
Definition: Image.h:938
YSLib::Drawing::ImplExpr
tr TextRegion &tr ImplExpr(tr.Margin.Bottom=SPos(FetchResizedBottomMargin(tr))) YF_API SDst FetchCharWidth(const Font &
取指定的字符使用指定字体的显示宽度。
ystdex::swap
void swap(container_adaptor< _tSeqCon > &x, container_adaptor< _tSeqCon > &y)
Definition: container.hpp:179
YSLib::Drawing::ImageMetadataModel::EXIF_GPS
YSLib::Drawing::ImageFormat::GIF
YSLib::GeneralEvent
std::runtime_error GeneralEvent
一般运行时异常事件类。
Definition: YException.h:45
DefBitmaskEnum
#define DefBitmaskEnum(_tEnum)
Definition: YBaseMacro.h:475
YSLib::yimpl
YF_API yimpl(GUIApplication &) FetchGlobalInstance()
取全局应用程序实例。
YSLib::Drawing::GetLogicalSizeOf
Size GetLogicalSizeOf(const HBitmap &bmp)
Definition: Image.cpp:445
NPL::A1::name
ctx const string & name
Definition: NPLA1.h:248
YSLib::Drawing::ImageMemory::ImageMemory
ImageMemory(_func f, ImageFormat fmt)
构造：以指定格式新建并打开内存缓冲区。
Definition: Image.h:276
YSLib::Drawing::HMultiBitmap::HMultiBitmap
HMultiBitmap(const _tString &filename, ImageFormat fmt, ImageDecoderFlags flags=ImageDecoderFlags::Default)
构造：使用指定字符串文件名和解码器标识。
Definition: Image.h:643
YSLib::Drawing::ImageMemory::Buffer
vector< octet > Buffer
Definition: Image.h:223
DefDeCopyMoveCtorAssignment
#define DefDeCopyMoveCtorAssignment(_t)
Definition: YBaseMacro.h:201
YSLib::UI::Close
void Close(IWidget &wgt)
Definition: YWidget.cpp:92
YSLib
YSLib 命名空间。
Definition: AndroidHost.h:45
YSLib::Drawing::ImageDecoderFlags::JPEG_Accurate
YSLib::Drawing::ImageDecoderFlags::GIF_Load256
YSLib::Drawing::ImageDecoderFlags::JPEG_Progressive
YSLib::Drawing::HBitmap::DataPtr
observer_ptr<::FIBITMAP > DataPtr
Definition: Image.h:301
YSLib::Drawing::CompactPixmap
标准矩形像素图缓冲区。
Definition: YGDI.h:243
YSLib::Drawing::ImageFormat
ImageFormat
图像格式。
Definition: Image.h:66
ynothrowv
#define ynothrowv
YSLib 无异常抛出保证验证：有条件地使用无异常抛出规范。
Definition: ydef.h:760
YSLib::Drawing::ImageDecoderFlags::JPEG_EXIFRotate
YSLib::Drawing::PDefH
yconstfn PDefH(Size, Transpose, const Size &s) ynothrow ImplRet(
转置。
Definition: YGDIBase.h:516
DefDeCtor
#define DefDeCtor(_t)
简单通用成员函数定义。
Definition: YBaseMacro.h:156
YSLib::Drawing::ImageDecoderFlags::JPEG_QualityAverage
CHRLib::CharSet::ASCII
yconstexpr const Encoding ASCII(US_ASCII)
YSLib::Drawing::ImageMetadataModel::EXIF_Interop
YSLib::Drawing::ImageDecoderFlags::JPEG_Baseline
DefGetter
#define DefGetter(_q, _t, _n,...)
Definition: YBaseMacro.h:240
YSLib::Drawing::ImageMetadataFindData::p_bitmap
HBitmap::DataPtr p_bitmap
Definition: Image.h:857
YSLib::Drawing::ImageDecoderFlags::JPEG_QualityBad
DefCvt
#define DefCvt(_q, _t,...)
Definition: YBaseMacro.h:205
CHRLib::char16_t
char16_t((*c_ptr<< CHAR_BIT)|c_ptr[1])) inline PDefH(char16_t
取 c_ptr 指向的小端序双字节字符。
YSLib::Drawing::ImageDecoderFlags::JPEG_QualitySuperb
YSLib::ynothrow
YB_PURE const _type size_t n ynothrow
Definition: YCoreUtilities.h:168
YSLib::Drawing::ImageDecoderFlags::JPEG_QualityNormal
YSLib::Drawing::ImageMetadataModel::GeoTIFF
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:219
YSLib::Drawing::ImageFormat::BMP
YSLib::Drawing::ImageDecoderFlags::JPEG_Subsampling_444
YSLib::Timers::TimeSpan
std::chrono::duration< Duration::rep, std::milli > TimeSpan
低精度时间间隔。
Definition: YClock.h:81
std
Definition: memory.hpp:1100
platform::Deref
yconstfn auto Deref(_type &&p) -> decltype(*p)
断言并解引用非空指针。
Definition: Debug.h:440
YSLib::Drawing::ImageMetadataFindData::CurrentModel
ImageMetadataModel CurrentModel
当前生效的模型。
Definition: Image.h:854
YSLib::Drawing::to_string
string to_string(const ImageTag &tag, ImageMetadataModel model)
Definition: Image.cpp:699
DefDeMoveAssignment
#define DefDeMoveAssignment(_t)
Definition: YBaseMacro.h:190
YSLib::Drawing::ImageCodec::LoadSequence
static _tSeqCon LoadSequence(const _type &path)
读取指定路径的图片文件为用于直接呈现的帧序列。
Definition: Image.h:1003
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:83
YSLib::Drawing::ImageDecoderFlags::JPEG_Subsampling_422
YSLib::Drawing::HBitmap
位图句柄：指向位图数据。
Definition: Image.h:298
YSLib::Drawing::ImageMetadataModel
ImageMetadataModel
图像元数据模型标识。
Definition: Image.h:137
YSLib::Drawing::HBitmap::HBitmap
HBitmap(const _tString &filename, ImageFormat fmt, ImageDecoderFlags=ImageDecoderFlags::Default)
构造：使用指定字符串文件名和解码器标识。
Definition: Image.h:396
YSLib::Drawing::ImageMetadataFindData
图像元数据。
Definition: Image.h:844
YSLib::Drawing::ImageDecoderFlags::JPEG_Subsampling_420
DefDeCopyCtor
#define DefDeCopyCtor(_t)
Definition: YBaseMacro.h:161
YSLib::Drawing::HImageMetadata
元数据句柄：表示打开的元数据和内容迭代状态。
Definition: Image.h:893
YSLib::Drawing::ImageDecoderFlags::JPEG_GreyScale
YSLib::Drawing::ImageCodec::LoadForPlaying
static HMultiBitmap LoadForPlaying(const _tString &filename)
构造：使用指定字符串文件名。
Definition: Image.h:989
YSLib::path
YF_API const char * path
Definition: Initialization.h:74
YSLib::Drawing::GetHeight
tr GetHeight())) inline PDefH(void
按字体高度和行距调整文本区域的底边距。
YSLib::Drawing::ImageFormat::Unknown
YSLib::Drawing::HBitmap::Deleter
Definition: Image.h:303
ystdex
特性测试宏。
Definition: ydef.h:796
DefDeMoveCtor
#define DefDeMoveCtor(_t)
Definition: YBaseMacro.h:166
YSLib::Drawing::Size
屏幕区域大小。
Definition: YGDIBase.h:293
YSLib::Drawing::HImageMetadata::HImageMetadata
HImageMetadata(_tParams &&...args)
Definition: Image.h:903
ystdex::subscriptive_iterator
成员下标迭代器。
Definition: iterator.hpp:1243
YSLib::Drawing::ImageDecoderFlags::JPEG_Fast
YSLib::Drawing::BitmapPtr
Pixel * BitmapPtr
Definition: YGraphics.h:42
Drawing
YSLib::Drawing::ImageMemory
图像内存对象；保存图像内容的数据缓冲对象。
Definition: Image.h:218
YSLib::Drawing::ImageMetadataModel::IPTC
YSLib::IO::int
YF_API int
Definition: File.h:49
YSLib::Drawing::buffer
The boundary is out of the buffer
Definition: YDraw.h:118
YSLib::YB_NONNULL
YF_API YB_NONNULL(1, 2) ValueNode LoadNPLA1File(const char *disp
载入 NPLA1 配置文件。
YSLib::Drawing::ImageMetadataModel::Animation
ystdex::byte
unsigned char byte
字节类型。
Definition: ydef.h:808
platform::ID
std::uintmax_t ID
YF_Platform_* 宏替换值的公共类型。
Definition: YCommon.h:50
YSLib::Drawing::ImageMetadataModel::EXIF_RAW
YSLib::Drawing::ImageMetadataModel::XMP
YSLib::Drawing::MultiBitmapData
Definition: Image.cpp:455
YSLib::Drawing::UnknownImageFormat
未知图像格式异常：表示请求的操作涉及的图像格式因为不明确而不受库的支持。
Definition: Image.h:198
YSLib::Drawing::GetFrameTimeOf
TimeSpan GetFrameTimeOf(const HBitmap &bmp)
Definition: Image.cpp:437
DefDeDtor
#define DefDeDtor(_t)
Definition: YBaseMacro.h:176
YSLib::Drawing::ImageMemory::NativeHandle
::FIMEMORY * NativeHandle
Definition: Image.h:221
ystdex::noncopyable
不可复制对象：禁止派生类调用默认原型的复制构造函数和复制赋值操作符。
Definition: base.h:41
YSLib::Drawing::ImageDecoderFlags::JPEG_Subsampling_411
YSLib::Drawing::ImageMetadataModel::Comments
yforward
#define yforward(_expr)
根据参数类型使用 std::forward 传递对应参数。
Definition: ydef.h:969
YSLib::Drawing::ImageFormat::ICO
DefBoolNeg
#define DefBoolNeg(_spec,...)
定义表示显式转换 bool 操作符及其否定的 operator! 。
Definition: YBaseMacro.h:227
ystdex::make_observer
observer_ptr< _type > make_observer(_type *p)
Definition: memory.hpp:1042
YSLib::Drawing::HBitmap::Deleter::pointer
::FIBITMAP * pointer
Definition: Image.h:306
YSLib::Drawing::ImageDecoderFlags::GIF_Playback
YSLib::Drawing::ImageMetadataModel::EXIF_Main
YF_API
#define YF_API
Definition: Platform.h:56
ythrow
#define ythrow(...)
YSLib 动态异常规范：根据是否使用异常规范宏指定或忽略动态异常规范。
Definition: ydef.h:791
YSLib::Drawing::ImageMetadataFindData::DataPtr
::FIMETADATA * DataPtr
Definition: Image.h:847
YSLib::Drawing::BitPerPixel
std::uint8_t BitPerPixel
Definition: Image.h:57
YSLib::Drawing::ImageDecoderFlags::JPEG_Optimize
ystdex::cpp2011::begin
_type * begin(_type(&&array)[_vN])
Definition: range.hpp:46
YSLib::Drawing::ImageDecoderFlags::ICO_MakeAlpha
YSLib::IO::f
const string &path const String &path _func f
Definition: YSLib/Service/FileSystem.h:430
CHRLib::args
_tParams && args
Definition: CharacterProcessing.h:538
ystdex::indirect_input_iterator
间接输入迭代器。
Definition: iterator.hpp:818
YSLib::Drawing::BadImageAlloc
图像资源分配失败异常：表示存储等资源不足导致无法创建图像。
Definition: Image.h:159
ystdex::unsupported
异常：不支持的操作。
Definition: ystdex/exception.h:116
YSLib::ImplRet
ImplRet(FetchGlobalInstance().GetGUIHostRef()) YF_API void Execute(GUIApplication &
执行程序主消息循环。
YSLib::Drawing::ImageDecoderFlags::JPEG_CMYK
YSLib::Drawing::ImageFormat::PNG
DefDelMoveCtor
#define DefDelMoveCtor(_t)
Definition: YBaseMacro.h:168
YSLib::Drawing::HMultiBitmap
多页面位图句柄：指向多页面位图数据。
Definition: Image.h:584
YSLib::Drawing::ImageMetadataModel::EXIF_MakerNote
ystdex::cpp2011::end
_type * end(_type(&&array)[_vN])
Definition: range.hpp:54
YSLib::Drawing::ImageMetadataModel::EXIF_EXIF
platform::KeyCategory::Lock
表示锁定键。
Definition: Keys.h:115
YSLib::Drawing::HImageMetadata::p_data
unique_ptr< ImageMetadataFindData > p_data
Definition: Image.h:898
YSLib::Drawing::HMultiBitmap::DataPtr
shared_ptr< MultiBitmapData > DataPtr
Definition: Image.h:587
platform::SDst
std::uint16_t SDst
屏幕坐标距离。
Definition: Video.h:43
YSLib::Drawing::ImageMetadataModel::Custom
YSLib::Drawing::ImageFormat::JPEG