TNB Library
TnbExifFile.h
[詳解]
1#pragma once
11#include "TnbGdiPlus.h"
12#include "TnbBitmapHandle.h"
13#include "TnbVector.h"
14#include "TnbMap.h"
15
16
17
18//TNB Library
19namespace TNB
20{
21
22
23
54{
55public:
57 struct TRational
58 {
59 DWORD molecular;
61 };
64 {
65 long molecular;
67 };
68
70 enum EType
71 {
72 ET_Byte = PropertyTagTypeByte,
73 ET_Ascii = PropertyTagTypeASCII,
74 ET_Short = PropertyTagTypeShort,
75 ET_Long = PropertyTagTypeLong,
76 ET_Rational = PropertyTagTypeRational,
77 ET_Undefined = PropertyTagTypeUndefined,
78 ET_SLong = PropertyTagTypeSLONG,
79 ET_SRational = PropertyTagTypeSRational,
80 };
81
87 {
88 public:
90 CTagInfo(void) : m_type(ET_Undefined), m_length(0)
91 {
92 }
98 bool IsEmpty(void) const
99 {
100 return m_length == 0;
101 }
106 EType GetType(void) const
107 {
108 return m_type;
109 }
115 size_t GetLength(void) const
116 {
117 return m_length;
118 }
124 {
125 return m_Get(BYTE(), ET_Byte);
126 }
132 void SetByte(size_t len, const BYTE* P)
133 {
134 m_Set(len, P, ET_Byte);
135 }
140 void SetByte(BYTE b)
141 {
142 SetByte(1, &b);
143 }
149 LPCSTR GetAscii(void) const
150 {
151 LPCSTR P = NULL;
152 if ( m_type == ET_Ascii )
153 {
154 P = reinterpret_cast<LPCSTR>(m_data.ReferBuffer());
155 }
156 return P;
157 }
163 void SetAscii(LPCSTR lpsz, size_t len = INVALID_SIZE)
164 {
165 if ( lpsz == NULL )
166 {
167 m_Set(0, lpsz, ET_Ascii);
168 }
169 else
170 {
171 if ( len == INVALID_SIZE )
172 {
173 len = STRLIB::GetLen(lpsz) + 1;
174 }
175 ASSERT( ! ::IsBadReadPtr(lpsz, len) );
176 m_Set(len, lpsz, ET_Ascii);
177 }
178 }
184 {
185 return m_Get(WORD(), ET_Short);
186 }
192 void SetShort(size_t len, const WORD* P)
193 {
194 m_Set(len, P, ET_Short);
195 }
200 void SetShort(WORD w)
201 {
202 SetShort(1, &w);
203 }
209 {
210 return m_Get(DWORD(), ET_Long);
211 }
217 void SetLong(size_t len, const DWORD* P)
218 {
219 m_Set(len, P, ET_Long);
220 }
225 void SetLong(DWORD d)
226 {
227 SetLong(1, &d);
228 }
234 {
235 return m_Get(TRational(), ET_Rational);
236 }
242 void SetRational(size_t len, const TRational* P)
243 {
244 m_Set(len, P, ET_Rational);
245 }
251 void SetRational(DWORD d1, DWORD d2)
252 {
253 TRational r = { d1, d2 };
254 SetRational(1, &r);
255 }
261 {
262 return m_Get(BYTE(), ET_Undefined);
263 }
269 void SetUndefined(size_t len, const BYTE* P)
270 {
271 m_Set(len, P, ET_Undefined);
272 }
278 {
279 return m_Get(long(), ET_SLong);
280 }
286 void SetSLong(size_t len, const long* P)
287 {
288 m_Set(len, P, ET_SLong);
289 }
294 void SetSLong(long l)
295 {
296 SetSLong(1, &l);
297 }
303 {
304 return m_Get(TSRational(), ET_SRational);
305 }
311 void SetSRational(size_t len, const TSRational* P)
312 {
313 m_Set(len, P, ET_SRational);
314 }
320 void SetSRational(long d1, long d2)
321 {
322 TSRational r = { d1, d2 };
323 SetSRational(1, &r);
324 }
335 bool Get(Gdiplus::PropertyItem& _pi)
336 {
337 if ( m_length != 0 )
338 {
339 _pi.type = static_cast<WORD>(m_type);
340 _pi.length = ToDword(m_data.GetSize());
341 _pi.value = m_data.GetBuffer();
342 m_data.ReleaseBuffer();
343 return true;
344 }
345 return false;
346 }
354 bool Set(const Gdiplus::PropertyItem& p)
355 {
356 switch ( p.type )
357 {
358 case ET_Byte: // 8ビット符号無し整数。
359 SetByte(p.length, static_cast<const BYTE*>(p.value));
360 break;
361 case ET_Ascii: // ASCII文字列。
362 SetAscii(static_cast<LPCSTR>(p.value));
363 break;
364 case ET_Short: // 16ビット符号無し整数。
365 SetShort(p.length / sizeof(WORD), static_cast<const WORD*>(p.value));
366 break;
367 case ET_Long: // 32ビット符号無し整数。
368 SetLong(p.length / sizeof(DWORD), static_cast<const DWORD*>(p.value));
369 break;
370 case ET_Rational: // 32ビット符号無し有理数(整数 2個。分子、分母)。
371 SetRational(p.length / sizeof(TRational), static_cast<const TRational*>(p.value));
372 break;
373 case ET_Undefined: // 任意の 8bitデータ。
374 SetUndefined(p.length, static_cast<const BYTE*>(p.value));
375 break;
376 case ET_SLong: // 32ビット符号付き整数。
377 SetSLong(p.length / sizeof(long), static_cast<const long*>(p.value));
378 break;
379 case ET_SRational: // 32ビット符号付き有理数(整数 2個。分子、分母)。
380 SetSRational(p.length / sizeof(TSRational), static_cast<const TSRational*>(p.value));
381 break;
382 default:
383 return false;
384 }
385 return true;
386 }
393 CStr ToString(size_t mx = INVALID_SIZE) const
394 {
395 CStr s;
396 size_t ln = min(mx, m_length);
397 switch ( m_type )
398 {
399 case ET_Undefined: // 任意の 8bitデータ。
400 case ET_Byte: // 8ビット符号無し整数。
401 {
402 const BYTE* P = m_data.ReferBuffer();
403 loop ( i, ln )
404 {
405 s += CStr::Fmt(_T("%u "), P[i]);
406 }
407 }
408 break;
409 case ET_Ascii: // ASCII文字列。
410 s = reinterpret_cast<LPCSTR>(m_data.ReferBuffer());
411 break;
412 case ET_Short: // 16ビット符号無し整数。
413 {
414 const WORD* P = reinterpret_cast<const WORD*>(m_data.ReferBuffer());
415 loop ( i, ln )
416 {
417 s += CStr::Fmt(_T("%u "), P[i]);
418 }
419 }
420 break;
421 case ET_Long: // 32ビット符号無し整数。
422 {
423 const DWORD* P = reinterpret_cast<const DWORD*>(m_data.ReferBuffer());
424 loop ( i, ln )
425 {
426 s += CStr::Fmt(_T("%u "), P[i]);
427 }
428 }
429 break;
430 case ET_Rational: // 32ビット符号無し有理数(整数 2個。分子、分母)。
431 {
432 const TRational* P = reinterpret_cast<const TRational*>(m_data.ReferBuffer());
433 loop ( i, ln )
434 {
435 s += CStr::Fmt(_T("%u/%u "), P[i].molecular, P[i].denominator);
436 }
437 }
438 break;
439 case ET_SLong: // 32ビット符号付き整数。
440 {
441 const long* P = reinterpret_cast<const long*>(m_data.ReferBuffer());
442 loop ( i, ln )
443 {
444 s += CStr::Fmt(_T("%d "), P[i]);
445 }
446 }
447 break;
448 case ET_SRational: // 32ビット符号付き有理数(整数 2個。分子、分母)。
449 {
450 const TSRational* P = reinterpret_cast<const TSRational*>(m_data.ReferBuffer());
451 loop ( i, ln )
452 {
453 s += CStr::Fmt(_T("%d/%d "), P[i].molecular, P[i].denominator);
454 }
455 }
456 break;
457 default:
458 break;
459 }
460 s += CStr::Fmt(_T("(l=%d)"), m_length);
461 return s;
462 }
463 private:
464 EType m_type;
465 CByteVector m_data;
466 size_t m_length;
467 // ゲッター
468 template<typename T>
469 CVectorT<T> m_Get(T dmy, EType t) const
470 {
471 CVectorT<T> r;
472 if ( m_type == t )
473 {
474 ASSERT( m_data.GetSize() / sizeof(T) == m_length );
475 r.SetElements(m_length, reinterpret_cast<const T*>(m_data.ReferBuffer()));
476 }
477 return r;
478 }
479 // セッター
480 template<typename T>
481 void m_Set(size_t len, T* P, EType t)
482 {
483 m_type = t;
484 m_length = len;
485 m_data.SetElements(len * sizeof(T), reinterpret_cast<const BYTE*>(P));
486 }
487 };
488
490
491
492 //----
493
494
496 CExifFile(void) : m_pBmp(NULL)
497 {
498 }
499
502 {
503 Empty();
504 }
505
510 void Empty(void)
511 {
512 if ( m_pBmp != NULL )
513 {
514 delete m_pBmp;
515 m_pBmp = NULL;
516 }
517 m_tags.RemoveAll();
518 }
519
528 bool Attach(LPCWSTR lpszFileName)
529 {
531 Empty();
532 m_pBmp = Gdiplus::Bitmap::FromFile(lpszFileName);
533 if ( m_pBmp !=NULL && m_pBmp->GetLastStatus() == Gdiplus::Ok )
534 {
535 UINT cnt = m_pBmp->GetPropertyCount();
536 CWorkMemT<PROPID> propIDs(cnt);
537 m_pBmp->GetPropertyIdList(cnt, propIDs);
538 loop( i, cnt )
539 {
540 PROPID id = propIDs[i];
541 UINT size = m_pBmp->GetPropertyItemSize(id);
542 if ( size > 0 )
543 {
544 CWorkMem mem(size);
545 Gdiplus::PropertyItem* P = reinterpret_cast<Gdiplus::PropertyItem*>(mem.Ref());
546 m_pBmp->GetPropertyItem(id, size, P);
547 m_tags[id].Set(*P);
548 }
549 }
550 return true;
551 }
552 Empty();
553 return false;
554 }
555
564 bool Load(LPCWSTR lpszFileName)
565 {
566 if ( Attach(lpszFileName) )
567 {
568 if ( m_pBmp != NULL )
569 {
570 delete m_pBmp;
571 m_pBmp = NULL;
572 }
573 HPALETTE hPal = NULL;
574 CBitmapHandle b = CGdiPlus::LoadBitmap(lpszFileName);
575 m_pBmp = Gdiplus::Bitmap::FromHBITMAP(b, hPal);
576 if ( m_pBmp != NULL && m_pBmp->GetLastStatus() == Gdiplus::Ok )
577 {
578 return true;
579 }
580 }
581 Empty();
582 return false;
583 }
584
593 bool Load(HBITMAP hBmp, HPALETTE hPal = NULL)
594 {
596 Empty();
597 m_pBmp = Gdiplus::Bitmap::FromHBITMAP(hBmp, hPal);
598 if ( m_pBmp !=NULL && m_pBmp->GetLastStatus() == Gdiplus::Ok )
599 {
600 return true;
601 }
602 Empty();
603 return false;
604 }
605
615 bool SaveJpeg(LPCWSTR lpsz, LONG jpegQuality = 80)
616 {
617 return Save(lpsz, CGdiPlus::JPG, jpegQuality);
618 }
619
631 bool Save(LPCWSTR lpsz, CGdiPlus::EBitmapFormat fmt = CGdiPlus::JPG, LONG jpegQuality = 80)
632 {
633 bool r = m_Save(lpsz, m_pBmp, fmt, jpegQuality);
634 if ( ! r && m_pBmp != NULL )
635 {
636 TRACE0("Exif;画像再構築\n");
637 Gdiplus::Color c;
638 c.SetFromCOLORREF(RGB(0, 0, 0));
639 HBITMAP hBmp = NULL;
640 if ( m_pBmp->GetHBITMAP(c, &hBmp) == Gdiplus::Ok && hBmp != NULL )
641 {
642 HPALETTE h = NULL;
643 Gdiplus::Bitmap bm(hBmp, h);
644 r = m_Save(lpsz, &bm, fmt, jpegQuality);
645 _DeleteObject(hBmp);
646 }
647 }
648 return r;
649 }
650
657 const Gdiplus::Bitmap* ReferBitmap(void) const
658 {
659 return m_pBmp;
660 }
661
668 {
670 if ( m_pBmp != NULL )
671 {
672 Gdiplus::Color c;
673 c.SetFromCOLORREF(RGB(0, 0, 0));
674 HBITMAP hBmp = NULL;
675 if ( m_pBmp->GetHBITMAP(c, &hBmp) == Gdiplus::Ok && hBmp != NULL )
676 {
677 b = hBmp;
678 }
679 }
680 return b;
681 }
682
687 const CMapTagInfos& GetTagInfoMap(void) const
688 {
689 #ifdef _DEBUG
690 loop ( i, m_tags.GetSize() )
691 {
692 TRACE2("tag [%04X] = %s\n", m_tags.Get(i).first, m_tags.Get(i).second.ToString(16));
693 }
694 #endif
695 return m_tags;
696 }
697
704 const CTagInfo* GetTagInfo(PROPID id) const
705 {
706 return m_tags.GetValuePtr(id);
707 }
708
715 {
716 CStr s;
717 const CTagInfo* P = GetTagInfo(PropertyTagExifUserComment);
718 if ( P != NULL )
719 {
720 CByteVector vb = P->GetUndefined();
721 if ( vb.GetSize() >= 8 )
722 {
723 vb.Add(0); //NULL終端追加
724 vb.Add(0); //NULL終端追加
725 LPCSTR lpsz = reinterpret_cast<LPCSTR>(vb.ReferBuffer());
726 bool isUnicode = (STRLIB::Compare(lpsz, "UNICODE") == 0);
727 if ( lpsz[0] == 0 && sizeof(TCHAR) == 2 )
728 {
729 isUnicode = true;
730 }
731 if ( isUnicode )
732 {
733 s = reinterpret_cast<LPCWSTR>(&lpsz[8]);
734 }
735 else
736 {
737 s = &lpsz[8];
738 }
739 }
740 }
741 return s;
742 }
743
750 void GetCopyrightTag(CStr& _s1, CStr& _s2) const
751 {
752 _s1.Empty();
753 _s2.Empty();
754 const CTagInfo* P = GetTagInfo(PropertyTagCopyright);
755 if ( P != NULL )
756 {
757 size_t len = P->GetLength();
758 LPCSTR lpsz = P->GetAscii();
759 _s1 = lpsz;
760 if ( _s1.GetLength() + 1 < len && lpsz != NULL )
761 {
762 _s2 = &lpsz[_s1.GetLength() + 1];
763 }
764 }
765 }
766
771 void RemoveTagInfo(PROPID id)
772 {
773 m_tags.RemoveKey(id);
774 }
775
782 void SetTagInfo(PROPID id, const CTagInfo& ti)
783 {
784 m_tags[id] = ti;
785 }
786
794 void SetTagInfo(PROPID id, LPCSTR lpsz, size_t len = INVALID_SIZE)
795 {
796 m_tags[id].SetAscii(lpsz, len);
797 }
798
805 void SetTagInfo(PROPID id, const SYSTEMTIME& st)
806 {
807 char buf[64];//おおめ
808 STRLIB::PrintF(buf, 64, "%04d:%02d:%02d %02d:%02d:%02d"
809 , st.wYear, st.wMonth, st.wDay
810 ,st.wHour, st.wMinute, st.wSecond);
811 SetTagInfo(id, buf);
812 }
813
820 void SetVersionTag(DWORD ver = 0x0210)
821 {
822 CTagInfo ti;
823 CAscii s;
824 s.Format("%04X", ver);
825 LPCSTR lpsz = s;
826 ti.SetUndefined(4, reinterpret_cast<const BYTE*>(lpsz));
827 SetTagInfo(PropertyTagExifVer, ti);
828 }
829
836 void SetUserCommentTag(LPCSTR lpsz)
837 {
838 size_t len = STRLIB::GetLen(lpsz);
839 CWorkMemT<BYTE> mm(8 + len);
840 if ( STRLIB::IsAsciiOnly(lpsz) )
841 {
842 const BYTE bb[8] = { 'A', 'S', 'C', 'I', 'I', 0, 0, 0 };
843 TNB::MemCopy(&mm[0], bb, 8);
844 }
845 else
846 {
847 const BYTE bb[8] = { 'J', 'I', 'S', 0, 0, 0, 0, 0 };
848 TNB::MemCopy(&mm[0], bb, 8);
849 }
850 TNB::MemCopy(&mm[8], lpsz, len);
851 CTagInfo ti;
852 ti.SetUndefined(8 + len, mm);
853 SetTagInfo(PropertyTagExifUserComment, ti);
854 }
855
862 void SetUserCommentTag(LPCWSTR lpsz)
863 {
864 size_t len = STRLIB::GetLen(lpsz) * sizeof(WCHAR);
865 CWorkMemT<BYTE> mm(8 + len);
866 const BYTE bb[8] = { 'U', 'N', 'I', 'C', 'O', 'D', 'E', 0 };
867 TNB::MemCopy(&mm[0], bb, 8);
868 TNB::MemCopy(&mm[8], lpsz, len);
869 CTagInfo ti;
870 ti.SetUndefined(8 + len, mm);
871 SetTagInfo(PropertyTagExifUserComment, ti);
872 }
873
880 void SetCopyrightTag(LPCSTR lpsz1, LPCSTR lpsz2 = NULL)
881 {
882 CAscii s2 = lpsz2;
883 if ( s2.IsEmpty() )
884 {
885 SetTagInfo(PropertyTagCopyright, lpsz1);
886 }
887 else
888 {
889 CAscii s1 = lpsz1;
890 if ( s1.IsEmpty() )
891 {
892 s1 = " ";
893 }
894 CWorkMemT<char> mm(s1.GetLength() + s2.GetLength() + 2);
895 STRLIB::Copy(&mm[0], s1);
896 STRLIB::Copy(&mm[s1.GetLength() + 1], s2);
897 SetTagInfo(PropertyTagCopyright, &mm[0], mm.GetSize());
898 }
899 }
900
906 {
907 const BYTE a[4] = {2, 0, 0, 0};
908 CTagInfo ti;
909 ti.SetByte(4, a);
910 SetTagInfo(PropertyTagGpsVer, ti);
911 }
912
921 void SetGpsLatitudeTag(bool isNorth, DWORD dd, DWORD mm, double ss)
922 {
924 SetTagInfo(PropertyTagGpsLatitudeRef, isNorth ? "N" : "S");
925 TRational r[3] = { dd, 1, mm, 1, static_cast<DWORD>(ss * 1000), 1000 };
926 CTagInfo ti;
927 ti.SetRational(3, r);
928 SetTagInfo(PropertyTagGpsLatitude, ti);
929 }
930
939 void SetGpsLongitudeTag(bool isEast, DWORD dd, DWORD mm, double ss)
940 {
942 SetTagInfo(PropertyTagGpsLongitudeRef, isEast ? "E" : "W");
943 TRational r[3] = { dd, 1, mm, 1, static_cast<DWORD>(ss * 1000), 1000 };
944 CTagInfo ti;
945 ti.SetRational(3, r);
946 SetTagInfo(PropertyTagGpsLongitude, ti);
947 }
948
955 void SetGpsAltitudeTag(DWORD d1, DWORD d2 = 1)
956 {
958 CTagInfo ti;
959 ti.SetByte(0);
960 SetTagInfo(PropertyTagGpsAltitudeRef, ti);
961 ti.SetRational(d1, d2);
962 SetTagInfo(PropertyTagGpsAltitude, ti);
963 }
964
965private:
966 // 画像ファイル作成.
967 bool m_Save(LPCWSTR lpsz, Gdiplus::Bitmap* B, CGdiPlus::EBitmapFormat fmt = CGdiPlus::JPG, LONG jpegQuality = 80)
968 {
970 if ( B != NULL )
971 {
972 UINT cnt = B->GetPropertyCount();
973 CWorkMemT<PROPID> propIDs(cnt);
974 B->GetPropertyIdList(cnt, propIDs);
975 loop( i, cnt )
976 {
977 PROPID id = propIDs[i];
978 B->RemovePropertyItem(id);
979 }
980 Gdiplus::PropertyItem pi;
981 loop ( i, m_tags.GetSize() )
982 {
983 pi.id = m_tags.Ref(i).first;
984 if ( m_tags.Ref(i).second.Get(pi) )
985 {
986 if ( B->SetPropertyItem(&pi) != Gdiplus::Ok )
987 {
988 return false;
989 }
990 }
991 }
992 return CGdiPlus::SaveBitmap(lpsz, *B, fmt, jpegQuality);
993 }
994 return false;
995 }
996
997 Gdiplus::Bitmap* m_pBmp;
998 CMapTagInfos m_tags;
999};
1000
1001
1002
1003}; // TNB
1004
ビットマップハンドル関係のヘッダ
#define loop(VAR, CNT)
loop構文.
Definition: TnbDef.h:343
GDI+ 関係のヘッダ
マップ型情報管理関係のヘッダ
配列型情報管理関係のヘッダ
HBITMAP型ハンドルハンドル
[ETC] コピー不可能スーパークラス.
Definition: TnbDef.h:599
CVectorT< BYTE > GetByte(void) const
[取得] 8bit符号無し整数取得.
Definition: TnbExifFile.h:123
CVectorT< TSRational > GetSRational(void) const
[取得] 32bit符号付き有理数取得.
Definition: TnbExifFile.h:302
bool Set(const Gdiplus::PropertyItem &p)
[設定] プロパティアイテム設定
Definition: TnbExifFile.h:354
bool IsEmpty(void) const
[確認] データ有無確認
Definition: TnbExifFile.h:98
CVectorT< WORD > GetShort(void) const
[取得] 16bit符号無し整数取得.
Definition: TnbExifFile.h:183
void SetLong(DWORD d)
[設定] 32bit符号無し整数設定.
Definition: TnbExifFile.h:225
CVectorT< long > GetSLong(void) const
[取得] 32bit符号付き整数取得.
Definition: TnbExifFile.h:277
void SetRational(DWORD d1, DWORD d2)
[設定] 32bit符号無し有理数設定.
Definition: TnbExifFile.h:251
size_t GetLength(void) const
[取得] データ数取得.
Definition: TnbExifFile.h:115
void SetByte(size_t len, const BYTE *P)
[設定] 8bit符号無し整数設定.
Definition: TnbExifFile.h:132
CByteVector GetUndefined(void) const
[取得] 任意の 8bitデータ取得.
Definition: TnbExifFile.h:260
LPCSTR GetAscii(void) const
[取得] ASCII取得.
Definition: TnbExifFile.h:149
void SetLong(size_t len, const DWORD *P)
[設定] 32bit符号無し整数設定.
Definition: TnbExifFile.h:217
void SetByte(BYTE b)
[設定] 8bit符号無し整数設定.
Definition: TnbExifFile.h:140
void SetUndefined(size_t len, const BYTE *P)
[設定] 任意の 8bitデータ設定.
Definition: TnbExifFile.h:269
CTagInfo(void)
コンストラクタ.
Definition: TnbExifFile.h:90
CVectorT< DWORD > GetLong(void) const
[取得] 32bit符号無し整数取得.
Definition: TnbExifFile.h:208
void SetSRational(long d1, long d2)
[設定] 32bit符号付き有理数設定.
Definition: TnbExifFile.h:320
void SetShort(size_t len, const WORD *P)
[設定] 16bit符号無し整数設定.
Definition: TnbExifFile.h:192
void SetShort(WORD w)
[設定] 16bit符号無し整数設定.
Definition: TnbExifFile.h:200
bool Get(Gdiplus::PropertyItem &_pi)
[取得] プロパティアイテム取得
Definition: TnbExifFile.h:335
CVectorT< TRational > GetRational(void) const
[取得] 32bit符号無し有理数取得.
Definition: TnbExifFile.h:233
void SetSLong(size_t len, const long *P)
[設定] 32bit符号無し整数設定.
Definition: TnbExifFile.h:286
EType GetType(void) const
[取得] データ型取得
Definition: TnbExifFile.h:106
void SetSRational(size_t len, const TSRational *P)
[設定] 32bit符号付き有理数設定.
Definition: TnbExifFile.h:311
CStr ToString(size_t mx=INVALID_SIZE) const
[取得] 文字列化
Definition: TnbExifFile.h:393
void SetSLong(long l)
[設定] 32bit符号無し整数設定.
Definition: TnbExifFile.h:294
void SetRational(size_t len, const TRational *P)
[設定] 32bit符号無し有理数設定.
Definition: TnbExifFile.h:242
void SetAscii(LPCSTR lpsz, size_t len=INVALID_SIZE)
[設定] ASCII設定.
Definition: TnbExifFile.h:163
EXIF規格ファイル管理クラス
Definition: TnbExifFile.h:54
const CMapTagInfos & GetTagInfoMap(void) const
[参照] EXIFタグ情報一覧参照.
Definition: TnbExifFile.h:687
bool Load(LPCWSTR lpszFileName)
[読込] ファイル読込み.
Definition: TnbExifFile.h:564
const Gdiplus::Bitmap * ReferBitmap(void) const
[取得] Bitmap取得.
Definition: TnbExifFile.h:657
~CExifFile(void)
デストラクタ
Definition: TnbExifFile.h:501
void SetUserCommentTag(LPCWSTR lpsz)
[設定] UserCommentタグ設定(UNICODE).
Definition: TnbExifFile.h:862
const CTagInfo * GetTagInfo(PROPID id) const
[取得] EXIFタグ情報取得
Definition: TnbExifFile.h:704
void SetGpsAltitudeTag(DWORD d1, DWORD d2=1)
[設定] 高度設定
Definition: TnbExifFile.h:955
void SetGpsLongitudeTag(bool isEast, DWORD dd, DWORD mm, double ss)
[設定] 経度設定
Definition: TnbExifFile.h:939
void SetTagInfo(PROPID id, const CTagInfo &ti)
[設定] EXIFタグ情報設定.
Definition: TnbExifFile.h:782
void SetCopyrightTag(LPCSTR lpsz1, LPCSTR lpsz2=NULL)
[取得] Copyrightタグ取得.
Definition: TnbExifFile.h:880
CBitmapHandle GetBitmap(void) const
[取得] Bitmap取得.
Definition: TnbExifFile.h:667
bool SaveJpeg(LPCWSTR lpsz, LONG jpegQuality=80)
[作成] Jpegファイル作成.
Definition: TnbExifFile.h:615
bool Save(LPCWSTR lpsz, CGdiPlus::EBitmapFormat fmt=CGdiPlus::JPG, LONG jpegQuality=80)
[作成] 画像ファイル作成.
Definition: TnbExifFile.h:631
CExifFile(void)
コンストラクタ
Definition: TnbExifFile.h:496
void SetGpsVersionTag(void)
[設定] GPSバージョン情報設定
Definition: TnbExifFile.h:905
void RemoveTagInfo(PROPID id)
[設定] EXIFタグ情報削除.
Definition: TnbExifFile.h:771
void Empty(void)
[設定] エンプティ化
Definition: TnbExifFile.h:510
void SetUserCommentTag(LPCSTR lpsz)
[設定] UserCommentタグ設定(ASCII/JIS).
Definition: TnbExifFile.h:836
bool Attach(LPCWSTR lpszFileName)
[読込] ファイル読込み(Attach).
Definition: TnbExifFile.h:528
CMapT< PROPID, CTagInfo > CMapTagInfos
タグ情報のマップ
Definition: TnbExifFile.h:489
EType
データ型
Definition: TnbExifFile.h:71
@ ET_Undefined
任意の 8bitデータ。
Definition: TnbExifFile.h:77
@ ET_Long
32ビット符号無し整数。
Definition: TnbExifFile.h:75
@ ET_SRational
32ビット符号付き有理数(整数 2個。分子、分母)。
Definition: TnbExifFile.h:79
@ ET_Byte
8ビット符号無し整数。
Definition: TnbExifFile.h:72
@ ET_Rational
32ビット符号無し有理数(整数 2個。分子、分母)。
Definition: TnbExifFile.h:76
@ ET_Ascii
ASCII文字列。
Definition: TnbExifFile.h:73
@ ET_SLong
32ビット符号付き整数。
Definition: TnbExifFile.h:78
@ ET_Short
16ビット符号無し整数。
Definition: TnbExifFile.h:74
void SetTagInfo(PROPID id, const SYSTEMTIME &st)
[設定] EXIFタグ情報設定(時間ASCII文字列).
Definition: TnbExifFile.h:805
bool Load(HBITMAP hBmp, HPALETTE hPal=NULL)
[読込] HBITMAP読込み.
Definition: TnbExifFile.h:593
CStr GetUserCommentTag(void) const
[取得] UserCommentタグ取得.
Definition: TnbExifFile.h:714
void SetGpsLatitudeTag(bool isNorth, DWORD dd, DWORD mm, double ss)
[設定] 緯度設定
Definition: TnbExifFile.h:921
void GetCopyrightTag(CStr &_s1, CStr &_s2) const
[取得] Copyrightタグ取得.
Definition: TnbExifFile.h:750
void SetTagInfo(PROPID id, LPCSTR lpsz, size_t len=INVALID_SIZE)
[設定] EXIFタグ情報設定(ASCII文字列).
Definition: TnbExifFile.h:794
void SetVersionTag(DWORD ver=0x0210)
[設定] バージョンタグ設定.
Definition: TnbExifFile.h:820
EBitmapFormat
Saveフォーマット値
Definition: TnbGdiPlus.h:756
static HBITMAP LoadBitmap(LPCWSTR lpsz)
[作成] 画像ファイル読込み.
Definition: TnbGdiPlus.h:687
static bool Startup(void)
[設定] GDI+ 初期化.
Definition: TnbGdiPlus.h:648
static bool SaveBitmap(LPCWSTR lpsz, Gdiplus::Bitmap &bmp, EBitmapFormat fmt=BMP, LONG jpegQuality=80)
[作成] 画像ファイル作成.
Definition: TnbGdiPlus.h:776
virtual CPair & Ref(INDEX index)
[取得] 要素の参照取得.
Definition: TnbMap.h:367
virtual size_t GetSize(void) const
[取得] 要素数取得
Definition: TnbMap.h:327
bool RemoveKey(INK key)
[削除] キーと値を削除
Definition: TnbMap.h:504
virtual bool Set(INDEX index, const CPair &t)
[設定] 要素の設定.
Definition: TnbMap.h:381
virtual bool RemoveAll(void)
[削除] すべてのキーと値を削除
Definition: TnbMap.h:434
const VAL * GetValuePtr(INK key) const
[取得] 値アドレス取得.
Definition: TnbMap.h:526
virtual CPair Get(INDEX index) const
[取得] キーと値を取得.
Definition: TnbMap.h:341
FIRST first
一つ目の型の値
Definition: TnbPair.h:44
SECOND second
二つ目の型の値
Definition: TnbPair.h:45
bool IsEmpty(void) const
[確認] 空チェック
Definition: TnbStr.h:528
size_t GetLength(void) const
[取得] 文字列長
Definition: TnbStr.h:518
static CStrT Fmt(const TCHAR *lpszFormat,...)
[作成] 書式付き文字列作成
Definition: TnbStr.h:1206
void Empty(void)
[削除] 空化
Definition: TnbStr.h:197
void Format(const TYP *lpszFormat,...)
[代入] 書式付き文字列代入.
Definition: TnbStr.h:359
virtual size_t GetSize(void) const
[取得] サイズ取得
Definition: TnbVector.h:368
TYP * GetBuffer(size_t size=0)
[操作] データアドレス取得
Definition: TnbVector.h:745
void ReleaseBuffer(void)
[操作] データの管理を元に戻す.
Definition: TnbVector.h:805
virtual const TYP * ReferBuffer(void) const
[取得] データアドレス取得
Definition: TnbVector.h:664
virtual INDEX Add(const TYP &t)
[追加] 要素一つ追加.
Definition: TnbVector.h:383
virtual size_t SetElements(size_t size, const TYP *P=NULL)
[設定] 複数要素設定.
Definition: TnbVector.h:526
ワークメモリテンプレート.
Definition: TnbDef.h:633
size_t GetSize(void) const
[取得] サイズ取得
Definition: TnbDef.h:665
const TYP * Ref(void) const
[取得] ポインタ取得
Definition: TnbDef.h:712
int Compare(LPCSTR P1, LPCSTR P2, INT_PTR len=-1, DWORD dwCmpFlags=0)
[比較] 文字列比較(ASCII/SJIS用)
Definition: TnbStrLib.h:135
size_t GetLen(LPCSTR lpsz)
[計算] 文字列長計算(ASCII/SJIS用)
Definition: TnbStrLib.h:44
DWORD ToDword(LPCSTR lpsz, int iBase=10)
[変換] INT変換(ASCII/SJIS用).
Definition: TnbStrLib.h:395
void Copy(LPSTR _dst, LPCSTR src)
[複製] 文字列コピー(ASCII/SJIS用)
Definition: TnbStrLib.h:89
bool IsAsciiOnly(LPCSTR lpsz)
[判断] ASCIIオンリー判断
Definition: TnbStrLib.h:471
bool PrintF(LPSTR _pWork, size_t iLen, LPCSTR lpFmt,...)
[作成] 書式付き文字列作成(ASCII/SJIS用)
Definition: TnbDef.h:1101
TNB Library
Definition: TnbDoxyTitle.txt:2
void MemCopy(T *_pDst, const void *pSrc, size_t len)
[複製] メモリコピー
Definition: TnbDef.h:376
システムタイム型.
Definition: TnbTime.h:876
WORD wYear
Definition: TnbTime.h:877
WORD wSecond
Definition: TnbTime.h:883
WORD wMonth
Definition: TnbTime.h:878
WORD wHour
Definition: TnbTime.h:881
WORD wDay
Definition: TnbTime.h:880
WORD wMinute
Definition: TnbTime.h:882
符号無し有理数
Definition: TnbExifFile.h:58
符号付き有理数
Definition: TnbExifFile.h:64