Documentation
¶
Overview ¶
Package rmrender provides parsing and rendering of reMarkable .rm binary files to PDF.
Index ¶
Constants ¶
const ( // Width in pixels (1404) Width = 1404 // Height in pixels (1872) Height = 1872 // DPI of the reMarkable screen DPI = 226 )
Dimensions defines the reMarkable screen dimensions
Variables ¶
This section is empty.
Functions ¶
func EstimateComplexity ¶
EstimateComplexity returns an estimate of rendering complexity
Useful for progress reporting and performance optimization decisions.
func ExportMetadata ¶
ExportMetadata extracts metadata about a document without rendering
Types ¶
type BrushType ¶
type BrushType int
BrushType represents the type of brush/tool used
const ( // BrushBallpoint is a standard pen BrushBallpoint BrushType = 2 // BrushMarker is a broad marker BrushMarker BrushType = 3 // BrushFineliner is a thin, precise pen BrushFineliner BrushType = 4 // BrushSharpPencil is a mechanical pencil BrushSharpPencil BrushType = 7 // BrushTiltPencil is a pencil with tilt support BrushTiltPencil BrushType = 1 // BrushBrush is a paintbrush/calligraphy brush BrushBrush BrushType = 0 // BrushHighlighter is a semi-transparent highlighter BrushHighlighter BrushType = 5 // BrushEraser removes strokes BrushEraser BrushType = 6 // BrushEraseSection removes entire sections BrushEraseSection BrushType = 8 // BrushCalligraphy is a calligraphy pen BrushCalligraphy BrushType = 21 )
type Color ¶
type Color int
Color represents stroke colors
const ( // ColorBlack is standard black ink ColorBlack Color = 0 // ColorGray is gray ink ColorGray Color = 1 // ColorWhite is white ink (eraser on black background) ColorWhite Color = 2 // ColorYellow is yellow highlighter ColorYellow Color = 3 // ColorGreen is green highlighter ColorGreen Color = 4 // ColorPink is pink highlighter ColorPink Color = 5 // ColorBlue is blue highlighter ColorBlue Color = 6 // ColorRed is red ink ColorRed Color = 7 // ColorGrayOverlay is gray overlay ColorGrayOverlay Color = 8 )
type Layer ¶
type Layer struct {
// Lines contains all the strokes in this layer
Lines []Line
}
Layer represents a drawing layer in the document The reMarkable supports multiple layers that can be toggled on/off
type Line ¶
type Line struct {
// BrushType specifies what tool was used
BrushType BrushType
// Color of the stroke
Color Color
// BrushSize is the thickness/size setting (0-2 usually)
BrushSize float32
// Points contains all the points that make up this stroke
Points []Point
}
Line represents a single stroke (pen stroke, eraser stroke, etc.)
type ParseResult ¶
type ParseResult struct {
Version Version
LayerCount int
StrokeCount int
PointCount int
ParsedAt time.Time
ParseError error
}
ParseResult contains metadata about the parsing operation
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser handles parsing of .rm binary files
type Point ¶
type Point struct {
// X coordinate (0 to Width)
X float32
// Y coordinate (0 to Height)
Y float32
// Pressure (0.0 to 1.0) - affects stroke width
Pressure float32
// Speed of the stroke at this point (for texture simulation)
Speed float32
// Direction of stroke (for brush effects)
Direction float32
// Width at this point (may be calculated from pressure and brush size)
Width float32
// Tilt of the pen (for advanced brush effects)
TiltX float32
TiltY float32
}
Point represents a single point in a stroke with position and pressure
type RenderOptions ¶
type RenderOptions struct {
// RenderLayers controls which layers to render (nil = all)
RenderLayers []int
// BackgroundColor for the PDF page
BackgroundColor Color
// EnablePressure enables pressure-sensitive stroke width
EnablePressure bool
// EnableAntialiasing enables anti-aliasing for smoother strokes
EnableAntialiasing bool
// StrokeQuality controls rendering quality (higher = more points, smoother)
StrokeQuality int // 1-10, default 5
}
RenderOptions configures the rendering process
func DefaultRenderOptions ¶
func DefaultRenderOptions() *RenderOptions
DefaultRenderOptions returns sensible default rendering options
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
Renderer handles rendering of parsed .rm documents to PDF
func NewRenderer ¶
func NewRenderer() *Renderer
NewRenderer creates a new renderer with default options
func NewRendererWithOptions ¶
func NewRendererWithOptions(opts *RenderOptions) *Renderer
NewRendererWithOptions creates a renderer with custom options
func (*Renderer) RenderLayers ¶
RenderLayers renders only specific layers from a document
func (*Renderer) RenderPage ¶
RenderPage renders a single page with the given strokes
This is useful for multi-page documents where each .rm file represents one page.
func (*Renderer) RenderToPDF ¶
RenderToPDF renders a parsed Document to PDF format
This creates a single-page PDF with all strokes rendered as vector graphics. The PDF will use the reMarkable dimensions (1404x1872 pixels at 226 DPI).