Module

Caman

Package
purescript-camanjs
Repository
m3tti/purescript-camanjs

#RGB Source

type RGB = { blue :: Int, green :: Int, red :: Int }

Is used for defining red, green and blue values of a pixel

#RGBA Source

type RGBA = { alpha :: Int, blue :: Int, green :: Int, red :: Int }

Is used for defining red, green, blue and alpha values for a pixel

#Channels Source

data Channels

Defining the channels of a pixel or image

Constructors

Instances

#Point Source

type Point = { x :: Int, y :: Int }

Defining a point in a Curve Points type

#CurvePoints Source

type CurvePoints = { p0 :: Point, p1 :: Point, p2 :: Point, p3 :: Point }

Defining a bezier curve

#ProcessFn Source

type ProcessFn = Int -> ProcessPoint -> RGB -> Effect RGB

Processor Function to modify a given point and its surrounding points The function has to return the modified pixel red, green and blue value

#ProcessPoint Source

#Processor Source

data Processor

Processors define the Categories of diffrent image functinalities

PointProcessor is a processor which defines a function how to modify the pixel and its surrounding

Kernel define a simple matrix (1 dimensional array) that describes how to modify a certain pixel based on the ones around it. The GIMP documentation does a great job at explaining this.

Constructors

#getPixelRelative Source

getPixelRelative :: ProcessPoint -> Point -> Effect RGBA

Used in a PointProcessor. This function returns the pixel on the given relative position

#getPixel Source

getPixel :: ProcessPoint -> Point -> Effect RGBA

Used in a PointProcessor. Gets the current pixel.

#putPixelRelative Source

putPixelRelative :: ProcessPoint -> Point -> RGBA -> Effect Unit

Used in a PointProcessor. Sets the pixel on the given relative position

#putPixel Source

putPixel :: ProcessPoint -> Point -> RGBA -> Effect Unit

Used in a PointProcessor. Sets the current pixel

#register Source

register :: Processor -> Effect Unit

Used with a Processor it registers a new filter with a given name. The filter could be called via the Filter CustomFilter ADT

#Blender Source

data Blender

Blending Modes for a new layer. That can be used in a NewLayer rendering

Constructors

Instances

#Size Source

type Size = { height :: Int, width :: Int }

Size is used for two filters Resize and Crop

#LayerOption Source

data LayerOption

Layer Options are used in a New layer to do adjustments before modifing the new layer with filters

Constructors

#Layer Source

data Layer

Layer types that can be rendered MainLayer is the Image itself NewLayer is a new layer that can be arranged with LayerOptions and modified by filters like the main layer

Constructors

#render Source

render :: Layer -> Aff Unit

Render the filters to a given layer

Modules
Caman