Class: Rixmap::Format::PNG::Chunk::BaseChunk
- Inherits:
-
Object
- Object
- Rixmap::Format::PNG::Chunk::BaseChunk
- Defined in:
- lib/rixmap/format/png/chunk.rb
Overview
PNGチャンクベースクラス
Instance Method Summary collapse
-
#copysafe? ⇒ Boolean
コピー安全なチャンクかどうかを返します.
-
#data ⇒ String
チャンクデータを返します.
-
#data=(data) ⇒ Object
チャンクデータを更新します.
-
#initialize(type, data = nil) ⇒ BaseChunk
constructor
チャンクを初期化します.
-
#optional? ⇒ Boolean
補助チャンクかどうかを返します.
-
#private? ⇒ Boolean
プライベートチャンクかどうかを返します.
-
#standard? ⇒ Boolean
標準チャンクかどうかを返します.
-
#type ⇒ String
チャンクタイプを返します.
Constructor Details
#initialize(type, data = nil) ⇒ BaseChunk
チャンクを初期化します.
40 41 42 43 44 45 |
# File 'lib/rixmap/format/png/chunk.rb', line 40 def initialize(type, data = nil) @type = type @data = nil self.data = data unless data.nil? end |
Instance Method Details
#copysafe? ⇒ Boolean
コピー安全なチャンクかどうかを返します.
95 96 97 |
# File 'lib/rixmap/format/png/chunk.rb', line 95 def copysafe?() return (@type[3].ord & 0x20) != 0 end |
#data ⇒ String
チャンクデータを返します.
57 58 59 60 |
# File 'lib/rixmap/format/png/chunk.rb', line 57 def data() self.pack() return @data end |
#data=(data) ⇒ Object
チャンクデータを更新します.
65 66 67 68 69 |
# File 'lib/rixmap/format/png/chunk.rb', line 65 def data=(data) @data = data self.unpack() return nil end |
#optional? ⇒ Boolean
補助チャンクかどうかを返します.
74 75 76 |
# File 'lib/rixmap/format/png/chunk.rb', line 74 def optional?() return (@type[0].ord & 0x20) != 0 end |
#private? ⇒ Boolean
プライベートチャンクかどうかを返します.
81 82 83 |
# File 'lib/rixmap/format/png/chunk.rb', line 81 def private?() return (@type[1].ord & 0x20) != 0 end |
#standard? ⇒ Boolean
標準チャンクかどうかを返します.
88 89 90 |
# File 'lib/rixmap/format/png/chunk.rb', line 88 def standard?() return (@type[2].ord & 0x20) == 0 end |
#type ⇒ String
チャンクタイプを返します.
50 51 52 |
# File 'lib/rixmap/format/png/chunk.rb', line 50 def type() return @type end |