Class: Exerb::Win32::Struct::IconImageHeader

Inherits:
Base
  • Object
show all
Defined in:
lib/exerb/win32/struct/icon_dir_entry.rb

Overview

#

Constant Summary collapse

FORMAT =
'LllSSLLllLL'

Instance Attribute Summary collapse

Attributes inherited from Base

#position

Instance Method Summary collapse

Methods inherited from Base

read, #read, #size, #update

Constructor Details

#initializeIconImageHeader

Returns a new instance of IconImageHeader.



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/exerb/win32/struct/icon_dir_entry.rb', line 53

def initialize
  # This struct is identical to BITMAPINFOHEADER.
  
  @_size           = 0
  @width           = 0
  @height          = 0
  @planes          = 0
  @bit_count       = 0
  @compression     = 0
  @size_image      = 0
  @xpels_per_meter = 0
  @ypels_per_meter = 0
  @clr_used        = 0
  @clr_important   = 0
end

Instance Attribute Details

#_sizeObject

Returns the value of attribute _size.



69
70
71
# File 'lib/exerb/win32/struct/icon_dir_entry.rb', line 69

def _size
  @_size
end

#bit_countObject

Returns the value of attribute bit_count.



69
70
71
# File 'lib/exerb/win32/struct/icon_dir_entry.rb', line 69

def bit_count
  @bit_count
end

#clr_importantObject

Returns the value of attribute clr_important.



69
70
71
# File 'lib/exerb/win32/struct/icon_dir_entry.rb', line 69

def clr_important
  @clr_important
end

#clr_usedObject

Returns the value of attribute clr_used.



69
70
71
# File 'lib/exerb/win32/struct/icon_dir_entry.rb', line 69

def clr_used
  @clr_used
end

#compressionObject

Returns the value of attribute compression.



69
70
71
# File 'lib/exerb/win32/struct/icon_dir_entry.rb', line 69

def compression
  @compression
end

#heightObject

Returns the value of attribute height.



69
70
71
# File 'lib/exerb/win32/struct/icon_dir_entry.rb', line 69

def height
  @height
end

#planesObject

Returns the value of attribute planes.



69
70
71
# File 'lib/exerb/win32/struct/icon_dir_entry.rb', line 69

def planes
  @planes
end

#size_imageObject

Returns the value of attribute size_image.



69
70
71
# File 'lib/exerb/win32/struct/icon_dir_entry.rb', line 69

def size_image
  @size_image
end

#widthObject

Returns the value of attribute width.



69
70
71
# File 'lib/exerb/win32/struct/icon_dir_entry.rb', line 69

def width
  @width
end

#xpels_per_meterObject

Returns the value of attribute xpels_per_meter.



69
70
71
# File 'lib/exerb/win32/struct/icon_dir_entry.rb', line 69

def xpels_per_meter
  @xpels_per_meter
end

#ypels_per_meterObject

Returns the value of attribute ypels_per_meter.



69
70
71
# File 'lib/exerb/win32/struct/icon_dir_entry.rb', line 69

def ypels_per_meter
  @ypels_per_meter
end

Instance Method Details

#packObject



71
72
73
# File 'lib/exerb/win32/struct/icon_dir_entry.rb', line 71

def pack
  return [@_size, @width, @height, @planes, @bit_count, @compression, @size_image, @xpels_per_meter, @ypels_per_meter, @clr_used, @clr_important].pack(FORMAT)
end

#unpack(bin) ⇒ Object



75
76
77
78
# File 'lib/exerb/win32/struct/icon_dir_entry.rb', line 75

def unpack(bin)
  @_size, @width, @height, @planes, @bit_count, @compression, @size_image, @xpels_per_meter, @ypels_per_meter, @clr_used, @clr_important = bin.unpack(FORMAT)
  return self
end