# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
#' cleanBinaryImage
#'
#' Removes alpha channel from png image.
#'
#' @param img A matrix of 1s and 0s.
#'
#' @return png image with the alpha channel removed
#'
cleanBinaryImage <- function(img) {
.Call(`_handwriter_cleanBinaryImage`, img)
}
#' getGraphInfo_cpp
#'
#' Gather and format the parameter values need to calculate the distance
#' between ' two graphs.
#'
#' @param imageList1 A graph
#' @param imageList2 A graph
#' @param isProto1 True or false. Is the graph information in prototype format?
#' @param isProto2 True or false. Is the graph information in prototype format?
#' @param numPathCuts An integer number of cuts to make when comparing segments
#' of paths ' @return List of formatted parameters
#'
#' @noRd
getGraphInfo_cpp <- function(imageList1, imageList2, isProto1, isProto2, numPathCuts) {
.Call(`_handwriter_getGraphInfo_cpp`, imageList1, imageList2, isProto1, isProto2, numPathCuts)
}
#' addToFeatures
#'
#' @param FeatureSet The current list of features that have been calculated
#' @param LetterList List of all letters and their information
#' @param vectorDims Vectors with image Dims
#'
#' @return A list consisting of current features calculated in FeatureSet as well as measures of compactness, loop count, and loop dimensions
#'
addToFeatures <- function(FeatureSet, LetterList, vectorDims) {
.Call(`_handwriter_addToFeatures`, FeatureSet, LetterList, vectorDims)
}
#' rgba2rgb
#'
#' Removes alpha channel from png image.
#'
#' @param img A 3-d array with slices R, G, B, and alpha.
#' @return img as a 3D array with alpha channel removed
#'
rgba2rgb <- function(img) {
.Call(`_handwriter_rgba2rgb`, img)
}
#' rgba2grayscale
#'
#' Changes RGB image to grayscale
#'
#' @param img A 3D array with slices R, G, and B
#' @return img as a 3D array as grayscale
#'
#' @export
rgb2grayscale <- function(img) {
.Call(`_handwriter_rgb2grayscale`, img)
}
#' whichToFill
#'
#' Finds pixels in the plot that shouldn't be white and makes them black.
#' Quick and helpful cleaning for before the thinning algorithm runs.
#'
#' @param img A binary matrix.
#' @return A cleaned up image.
#'
#' @export
whichToFill <- function(img) {
.Call(`_handwriter_whichToFill`, img)
}
#' thinImage
#'
#' This function returns a vector of locations for black pixels in the thinned image.
#' Thinning done using Zhang - Suen algorithm.
#'
#' @param img A binary matrix of the text that is to be thinned.
#' @return A thinned, one pixel wide, image.
#'
#' @export
thinImage <- function(img) {
.Call(`_handwriter_thinImage`, img)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.