<commit_before>//! Core data structures in OpenCV

use libc::{c_int, c_double, c_char, c_uchar, size_t};
use num;
use std::ffi::CString;

/// Opaque data struct for C bindings
#[derive(Clone, Copy, Debug)]
pub enum CMat {}
unsafe impl Send for CMat {}
impl CMat {
    pub fn new() -> *mut CMat {
        unsafe { cv_mat_new() }
    }
}

/// This wraps OpenCV's `Mat` class which is designed for n-dimensional dense
/// array. It's the most widely used data structure in image/video processing
/// since images are often stored as `Mat`.
#[derive(Debug)]
pub struct Mat {
    /// Pointer to the actual C/C++ data structure
    pub inner: *mut CMat,

    /// Number of columns
    pub cols: i32,

    /// Number of rows
    pub rows: i32,

    /// Depth of this mat
    pub depth: i32,
}

/// A 4-element struct that is widely used to pass pixel values.
#[derive(Default, Debug, Clone, Copy)]
#[repr(C)]
pub struct Scalar {
    v0: i32,
    v1: i32,
    v2: i32,
    v3: i32,
}<commit_msg>fix(core): add impl Send for Mat<commit_after>//! Core data structures in OpenCV

use libc::{c_int, c_double, c_char, c_uchar, size_t};
use num;
use std::ffi::CString;

/// Opaque data struct for C bindings
#[derive(Clone, Copy, Debug)]
pub enum CMat {}
unsafe impl Send for CMat {}
impl CMat {
    pub fn new() -> *mut CMat {
        unsafe { cv_mat_new() }
    }
}

/// This wraps OpenCV's `Mat` class which is designed for n-dimensional dense
/// array. It's the most widely used data structure in image/video processing
/// since images are often stored as `Mat`.
#[derive(Debug)]
pub struct Mat {
    /// Pointer to the actual C/C++ data structure
    pub inner: *mut CMat,

    /// Number of columns
    pub cols: i32,

    /// Number of rows
    pub rows: i32,

    /// Depth of this mat
    pub depth: i32,
}

// TODO(benzh): Should consider Unique<T>,
// https://github.com/rust-lang/rust/issues/27730
unsafe impl Send for Mat {}

/// A 4-element struct that is widely used to pass pixel values.
#[derive(Default, Debug, Clone, Copy)]
#[repr(C)]
pub struct Scalar {
    v0: i32,
    v1: i32,
    v2: i32,
    v3: i32,
}
{'fraction_non_alphanumeric': 0.13049645390070921, 'fraction_numerical': 0.02033096926713948, 'mean_word_length': 2.8194945848375452, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 6, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6288271', 'n_tokens_mistral': 745, 'n_tokens_neox': 720, 'n_words': 279}