Class: Rixmap::Mode
- Inherits:
-
Data
- Object
- Data
- Rixmap::Mode
- Defined in:
- src/rixmapcore.cxx,
src/rixmapcore.cxx
Overview
画像形式情報クラス.
Instance Method Summary collapse
-
#channels ⇒ Array<String>
この画像形式に含まれるチャンネルリストを返します.
-
#depth ⇒ Integer
ピクセルあたりのビット数を返します.
-
#grayscale? ⇒ Boolean
グレースケール形式かどうかを返します.
-
#has_alpha? ⇒ Boolean
透明度をサポートしているかを返します.
-
#indexed? ⇒ Boolean
インデックスカラー形式かどうかを返します.
-
#inspect ⇒ String
オブジェクトとしての文字列表現を返します.
-
#name ⇒ String
画像形式名を文字列として取得します.
-
#rgb? ⇒ Boolean
RGBカラー形式かどうかを返します.
-
#to_i ⇒ Integer
画像形式値を整数値に変換します.
Instance Method Details
#channels ⇒ Array<String>
この画像形式に含まれるチャンネルリストを返します.
978 979 980 981 982 983 984 985 986 987 |
# File 'src/rixmapcore.cxx', line 978 static VALUE Mode_getChannels(VALUE self) { Rixmap::ModeData* _this = rixmap_unwrap<Rixmap::ModeData>(self); const Rixmap::ChannelArray& channels = _this->getChannels(); VALUE items = rb_ary_new(); for (auto it = channels.begin(); it != channels.end(); it++) { const char ch = static_cast<char>(*it); rb_ary_push(items, rb_str_new(&ch, 1)); } return items; } |
#depth ⇒ Integer
ピクセルあたりのビット数を返します.
968 969 970 971 |
# File 'src/rixmapcore.cxx', line 968 static VALUE Mode_getDepth(VALUE self) { Rixmap::ModeData* _this = rixmap_unwrap<Rixmap::ModeData>(self); return INT2FIX(_this->getDepth()); } |
#grayscale? ⇒ Boolean
グレースケール形式かどうかを返します.
1008 1009 1010 1011 1012 1013 1014 1015 |
# File 'src/rixmapcore.cxx', line 1008 static VALUE Mode_isGrayScaleType(VALUE self) { Rixmap::ModeData* _this = rixmap_unwrap<Rixmap::ModeData>(self); if (_this->isGrayScaleType()) { return Qtrue; } else { return Qfalse; } } |
#has_alpha? ⇒ Boolean
透明度をサポートしているかを返します.
1036 1037 1038 1039 1040 1041 1042 1043 |
# File 'src/rixmapcore.cxx', line 1036 static VALUE Mode_hasAlpha(VALUE self) { Rixmap::ModeData* _this = rixmap_unwrap<Rixmap::ModeData>(self); if (_this->hasAlpha()) { return Qtrue; } else { return Qfalse; } } |
#indexed? ⇒ Boolean
インデックスカラー形式かどうかを返します.
1022 1023 1024 1025 1026 1027 1028 1029 |
# File 'src/rixmapcore.cxx', line 1022 static VALUE Mode_isIndexedType(VALUE self) { Rixmap::ModeData* _this = rixmap_unwrap<Rixmap::ModeData>(self); if (_this->isIndexedType()) { return Qtrue; } else { return Qfalse; } } |
#inspect ⇒ String
オブジェクトとしての文字列表現を返します.
1060 1061 1062 1063 1064 1065 1066 1067 1068 |
# File 'src/rixmapcore.cxx', line 1060 static VALUE Mode_inspect(VALUE self) { Rixmap::ModeData* _this = rixmap_unwrap<Rixmap::ModeData>(self); const std::string& name = _this->getName(); return rb_enc_sprintf( rb_usascii_encoding(), "#<%s:%p name=%s, depth=%d>", rb_obj_classname(self), reinterpret_cast<void*>(self), name.c_str(), _this->getDepth()); } |
#name ⇒ String
画像形式名を文字列として取得します.
957 958 959 960 961 |
# File 'src/rixmapcore.cxx', line 957 static VALUE Mode_getName(VALUE self) { Rixmap::ModeData* _this = rixmap_unwrap<Rixmap::ModeData>(self); const std::string& name = _this->getName(); return rb_str_new_cstr(name.c_str()); } |
#rgb? ⇒ Boolean
RGBカラー形式かどうかを返します.
994 995 996 997 998 999 1000 1001 |
# File 'src/rixmapcore.cxx', line 994 static VALUE Mode_isRGBType(VALUE self) { Rixmap::ModeData* _this = rixmap_unwrap<Rixmap::ModeData>(self); if (_this->isRGBType()) { return Qtrue; } else { return Qfalse; } } |
#to_i ⇒ Integer
画像形式値を整数値に変換します.
1050 1051 1052 1053 |
# File 'src/rixmapcore.cxx', line 1050 static VALUE Mode_toInteger(VALUE self) { Rixmap::ModeData* _this = rixmap_unwrap<Rixmap::ModeData>(self); return ULONG2NUM(_this->getValue()); } |