class WAD::Colormap

Overview

Map to adjust pixel values for reduced brightness.

Included Modules

Defined in:

wa-cr/wad/wad-data/texture.cr
write.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from module WritingAdditions::Colormap

write(file : String | Path) : UInt32
write(io : IO) : UInt32
write

Constructor Detail

def self.parse(filename : String | Path) : Colormap #

Parses a colormap file given the filename

Opens a colormap file and parses it:

my_colormap = WAD::Colormap.parse("Path/To/Colormap")

def self.parse(io : IO) : 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

Instance Method Detail

def clone #

Returns a copy of self with all instance variables cloned.


def tables : Array(Table) #

def tables=(tables : Array(Table)) #