SYNOPSIS
loadrt raster [count=N|names=name1[,name2…]]
DESCRIPTION
The raster component converts a single raster program line to laser output. The position pin is slaved to the axis that the raster line maps too. The raster program must be programmed for each raster line that is to be executed. The port must be programmed prior to a raster line being executed.
A python component RasterProgrammer (lib/python/RasterProgrammer.py
) is
provided to ease programming of the raster component.
An example configs/sim/axis/laser
shows how these pieces could be integrated
for a functional laser engraver config.
A program line format is as follows:
{program_offset};{bits_per_pixel};{pixels_per_unit};{number_of_ pixels};{pixel_data ....}
-
program_offset: a float. It indicates the start position of the raster line relative to the current axis position. A negative program_offset indicates that the raster sweeps from positive to negative. A zero or positive program_offset* indicates that the raster sweeps from negative to positive direction.
-
bits_per_pixel: an integer. It indicates the precision of a pixel value and consequently the number of bytes consumed per pixel value. A bits per pixel of 4 takes 1 character (0-F) and scales out from from 0.0 to 1.0 (0 being 0 and E being 1.0). F corresponds to off or -1.0. A bits per pixel of 8 takes 2 characters per pixel, 12 takes 3 characters per pixel etc…
-
pixels_per_unit: a float that represents the size of a pixel in machine units. 1 would correspond to 1 pixel per machine unit, 100 would correspond to 100 pixels per machine unit.
-
number_of_pixels: an integer that indicates the length of the raster line in pixels. The length of the rasterline in machine units would be number_of_pixels / pixels_per_unit
-
pixel_data: a series of hexadeicmal digits ([0-9][a-f][A-F]) the represents the pixel data. bits_per_pixel determines the resolution of a pixel and how many hexadecimal digits per pixel. pixel data characters have no delimiter between each pixel.
4 bpp is one character per pixel
8 bpp is 2 characters per pixel
12 bpp is 3
etc…
FUNCTIONS
- raster.N (requires a floating-point thread)
-
PINS
- raster.N.position float in
-
input coordinate for raster
- raster.N.reset bit in
-
resets the component
- raster.N.program port in
-
pixel data used by the raster
- raster.N.run bit in
-
starts the raster
- raster.N.enabled bit out (default: 0)
-
When a valid raster program is running.
- raster.N.output float out (default: -1)
-
current output level command
- raster.N.fault bit out (default: 0)
-
If error has occurred
- raster.N.fault-code s32 out (default: 0)
-
Code of fault
- raster.N.state s32 out (default: 0)
-
current state
- raster.N.program-position float out (default: 0.0)
-
base position of program at run start
- raster.N.program-offset float out (default: 0.0)
-
offset to start of pixel data
- raster.N.bpp s32 out (default: 0)
-
bits per pixel.
- raster.N.ppu float out (default: 0.0)
-
pixels per unit
- raster.N.count s32 out (default: 0)
-
pixel count
- raster.N.bitmap-position float out (default: 0.0)
-
calculated position in bitmap
- raster.N.current-pixel-value float out (default: -1.0)
-
current loaded pixel value
- raster.N.previous-pixel-value float out (default: -1.0)
-
previously loaded pixel value
- raster.N.current-pixel-index s32 out (default: -1)
-
currently loaded pixel index
- raster.N.fraction float out (default: 0.0)
-
LICENSE
GPL