class WAD::Colormap
- WAD::Colormap
- Reference
- Object
Overview
Map to adjust pixel values for reduced brightness.
Included Modules
Defined in:
wa-cr/wad/wad-data/texture.crwrite.cr
Constructors
-
.parse(filename : String | Path) : Colormap
Parses a colormap file given the filename
-
.parse(io : IO) : Colormap
Parses a colormap file given the io
Class Method Summary
-
.is_colormap?(name : String)
Checks to see if name is "COLORMAP"
Instance Method Summary
-
#clone
Returns a copy of
self
with all instance variables cloned. - #tables : Array(Table)
- #tables=(tables : Array(Table))
Instance methods inherited from module WritingAdditions::Colormap
write(file : String | Path) : UInt32write(io : IO) : UInt32 write
Constructor Detail
Parses a colormap file given the filename
Opens a colormap file and parses it:
my_colormap = WAD::Colormap.parse("Path/To/Colormap")
Parses a colormap file given the io
Opens a colormap io and parses it:
File.open("Path/To/Colormap") do |file|
my_colormap = WAD::Colormap.parse(file)
end
Class Method Detail
def self.is_colormap?(name : String)
#
Checks to see if name is "COLORMAP"
Returns true if the name is a colormap:
colormap_name = "COLORMAP"
if WAD::Colormap.is_colormap?(genmidi_name)
puts "Is a ColorMap"
else
puts "Is not a ColorMap"
end