pub struct Text { /* private fields */ }
Expand description
- This structure represents a text string to draw.
- Parameters match cv::putText().
Implementations§
Source§impl Text
impl Text
Sourcepub fn new(
text_: &str,
org_: Point,
ff_: i32,
fs_: f64,
color_: Scalar,
thick_: i32,
lt_: i32,
bottom_left_origin_: bool,
) -> Result<Text>
pub fn new( text_: &str, org_: Point, ff_: i32, fs_: f64, color_: Scalar, thick_: i32, lt_: i32, bottom_left_origin_: bool, ) -> Result<Text>
Text constructor
§Parameters
- text_: The text string to be drawn
- org_: The bottom-left corner of the text string in the image
- ff_: The font type, see [hershey_fonts]
- fs_: The font scale factor that is multiplied by the font-specific base size
- color_: The text color
- thick_: The thickness of the lines used to draw a text
- lt_: The line type. See [line_types]
- bottom_left_origin_: When true, the image data origin is at the bottom-left corner. Otherwise, it is at the top-left corner
§C++ default parameters
- thick_: 1
- lt_: 8
- bottom_left_origin_: false
Sourcepub fn new_def(
text_: &str,
org_: Point,
ff_: i32,
fs_: f64,
color_: Scalar,
) -> Result<Text>
pub fn new_def( text_: &str, org_: Point, ff_: i32, fs_: f64, color_: Scalar, ) -> Result<Text>
Text constructor
§Parameters
- text_: The text string to be drawn
- org_: The bottom-left corner of the text string in the image
- ff_: The font type, see [hershey_fonts]
- fs_: The font scale factor that is multiplied by the font-specific base size
- color_: The text color
- thick_: The thickness of the lines used to draw a text
- lt_: The line type. See [line_types]
- bottom_left_origin_: When true, the image data origin is at the bottom-left corner. Otherwise, it is at the top-left corner
§Note
This alternative version of [new] function uses the following default values for its arguments:
- thick_: 1
- lt_: 8
- bottom_left_origin_: false
pub fn default() -> Text
Trait Implementations§
Source§impl Boxed for Text
impl Boxed for Text
Source§unsafe fn from_raw(ptr: <Text as OpenCVFromExtern>::ExternReceive) -> Self
unsafe fn from_raw(ptr: <Text as OpenCVFromExtern>::ExternReceive) -> Self
Wrap the specified raw pointer Read more
Source§fn into_raw(self) -> <Text as OpenCVTypeExternContainer>::ExternSendMut
fn into_raw(self) -> <Text as OpenCVTypeExternContainer>::ExternSendMut
Return the underlying raw pointer while consuming this wrapper. Read more
Source§fn as_raw(&self) -> <Text as OpenCVTypeExternContainer>::ExternSend
fn as_raw(&self) -> <Text as OpenCVTypeExternContainer>::ExternSend
Return the underlying raw pointer. Read more
Source§fn as_raw_mut(&mut self) -> <Text as OpenCVTypeExternContainer>::ExternSendMut
fn as_raw_mut(&mut self) -> <Text as OpenCVTypeExternContainer>::ExternSendMut
Return the underlying mutable raw pointer Read more
Source§impl TextTrait for Text
impl TextTrait for Text
fn as_raw_mut_Text(&mut self) -> *mut c_void
Source§fn set_fs(&mut self, val: f64)
fn set_fs(&mut self, val: f64)
The font scale factor that is multiplied by the font-specific base size
Source§fn set_bottom_left_origin(&mut self, val: bool)
fn set_bottom_left_origin(&mut self, val: bool)
When true, the image data origin is at the bottom-left corner. Otherwise, it is at the top-left corner
Source§impl TextTraitConst for Text
impl TextTraitConst for Text
fn as_raw_Text(&self) -> *const c_void
Source§fn bottom_left_origin(&self) -> bool
fn bottom_left_origin(&self) -> bool
When true, the image data origin is at the bottom-left corner. Otherwise, it is at the top-left corner
impl Send for Text
Auto Trait Implementations§
impl Freeze for Text
impl RefUnwindSafe for Text
impl !Sync for Text
impl Unpin for Text
impl UnwindSafe for Text
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
Source§unsafe fn modify_inplace<Res>(
&mut self,
f: impl FnOnce(&Mat, &mut Mat) -> Res,
) -> Res
unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res, ) -> Res
Helper function to call OpenCV functions that allow in-place modification of a
Mat
or another similar object. By passing
a mutable reference to the Mat
to this function your closure will get called with the read reference and a write references
to the same Mat
. This is unsafe in a general case as it leads to having non-exclusive mutable access to the internal data,
but it can be useful for some performance sensitive operations. One example of an OpenCV function that allows such in-place
modification is imgproc::threshold
. Read more