abstract class CrImage::Window(T)

Overview

Represents a read-only view on top of a Map.

Constructing one of these over a larger Map allows for a re-indexed view within that map. If needing to sum all values within a certain area, a Window can be constructed around that area and then summed from that.

See RepeatView, ErrorView, and BlackView for specific edge handling cases.

Direct Known Subclasses

Defined in:

cr-image/window_view.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(width : Int32, height : Int32, map : CrImage::Map(T), map_x : Int32, map_y : Int32) #

[View source]

Instance Method Detail

abstract def [](x : Int32, y : Int32) : T #

[View source]
def half_height : Int32 #

[View source]
def half_width : Int32 #

[View source]
def height : Int32 #

[View source]
def map : Map(T) #

[View source]
def map_x : Int32 #

[View source]
def map_y : Int32 #

[View source]
def mean : Float64 #

Calculate the mean for all values in the window


[View source]
def size : Int32 #

Return the size of this window


[View source]
def sum : Float64 #

Sum all values in the window together


[View source]
def sum(& : T, Int32, Int32, self -> T) : Float64 #

Iterate over all values within the window and sum the result of the passed in block


[View source]
def width : Int32 #

[View source]