PNM::PPM - Givralix/pnm GitHub Wiki

self.blue

Returns the blue part of the picture as a PNM::PGM object.

self.data

Returns self.data.

self.green

Returns the green part of the picture as a PNM::PGM object.

self.height

Returns self.height.

self.maxval

Returns self.maxval.

self.maxval=(new_maxval : Int32)

Changes self.maxval to new_maxval and adapts the picture data to the new maximum value.

self.new(data : Slice(UInt8))

Creates a new PNM::PPM object from a raw PPM file.

self.new(@width: Int32, @height : Int32, @maxval : Int32, @data : Slice(UInt8))

Creates a new PNM::PPM object from attributes.

self.red

Returns the red part of the picture as a PNM::PGM object.

self.to_pbm

Returns the picture converted to a PNM::PBM object with a threshold of 128.

self.to_pbm(threshold : Int32)

Returns the picture converted to a PNM::PBM object with a specified threshold.

self.to_pgm

Returns the picture converted to a PNM::PGM object.

self.unsafe_maxval(new_maxval : Int32)

Changes self.maxval to new_maxval without adapting the picture data to the new maximum value.

self.width

Returns self.width.

self.write(filename : String)

Writes self to a PPM file.