img_px < typename PIXEL > |
Name | abmt::img_px |
Header | #include <abmt/img.h> |
Attributes |
int32_t | px_size | |
Methods |
| img_px(img img) | |
| img_px(int32_t w=0, int32_t h=0, void* data_ptr=0, bool take_ptr_ownership=false) | Converts the input image to this type. Embedded devices might convert manually to save memory. Sets type and size. Then calls or depending on take_ptr_ownership. When data_ptr == 0 and take_ptr_ownership == false, a new image is create. |
| img_px(int32_t w, int32_t h, const void* data_ptr) | |
void | reset(int32_t w=0, int32_t h=0, void* data_ptr_that_will_be_managed=0) | |
img_px<PIXEL>& | realloc(int32_t w=0, int32_t h=0, void* src_ptr_to_copy_from=0, std::enable_if_t< std::is_same< CHECK, bool_px >::value==false >* =0) | |
img_px<PIXEL>& | realloc(int32_t w=0, int32_t h=0, void* src_ptr_to_copy_from=0, std::enable_if_t< std::is_same< CHECK, bool_px >::value==true >* =0) | |
PIXEL | at(int32_t x, int32_t y, std::enable_if_t< std::is_same< CHECK, bool_px >::value==true >* =0) | Returns the pixel at x,y. |
PIXEL& | at(int32_t x, int32_t y, std::enable_if_t< std::is_same< CHECK, bool_px >::value==false >* =0) | Returns the pixel at x,y. |
PIXEL& | at_2(int32_t x, int32_t y, std::enable_if_t< std::is_same< CHECK, bool_px >::value==false >* =0) | Like at but without limit checking. |
PIXEL | at_2(int32_t x, int32_t y, std::enable_if_t< std::is_same< CHECK, bool_px >::value==true >* =0) | Like at but without limit checking. |
PIXEL& | operator()(int32_t x, int32_t y, std::enable_if_t< std::is_same< CHECK, bool_px >::value==false >* =0) | Same as at(x,y) |
PIXEL | operator()(int32_t x, int32_t y, std::enable_if_t< std::is_same< CHECK, bool_px >::value==true >* =0) | Same as at(x,y) |
region_of_interest<PIXEL> | roi(int top_left_x=0, int top_left_y=0, int _width=-1, int _height=-1) | |
img_px<PIXEL>& | fill(PIXEL color={}) | |
img_px | rotate_90() | clockwise |
img_px | rotate_180() | "clockwise" |
img_px | rotate_270() | clockwise |
img_px | flip_hz() | |
img_px | flip_vt() | |
img_px& | draw_line(line2d l, PIXEL color={}, int line_width=1) | Draws a line from l.p1 to l.p2. On even line_widths the line has a 1px offset to the left. Example: Line from (0,2) to (10,2) with line_width 2: Draws 20px with y = 2 and y = 1; With line_width = 3: Draws 30px with y = 1, 2, 3; |
img_px& | draw_line(int x1, int y1, int x2, int y2, PIXEL color={}, int line_width=1) | |
img_px& | draw_circle(int center_x, int center_y, int radius, PIXEL color={}, int line_width=1) | |
img_px& | draw_circle(vec2 p, double radius, PIXEL color={}, int line_width=1) | |
img_px& | draw_circle(double center_x, double center_y, double radius, PIXEL color={}, int line_width=1) | |
img_px& | draw_cross(vec2 p, PIXEL color={}, int line_width=1, int arm_len=-1) | When arm_len < 0 then it will be set to line_width * 3;. |
img_px& | draw_cross(int center_x, int center_y, PIXEL color={}, int line_width=1, int arm_len=-1) | When arm_len == -1 then it will be set to line_width * 3;. |
img_px& | draw_icon(img_bw img, int top_left_x, int top_left_y, PIXEL color={}, int scale=1) | |
img_px& | write_text(std::string text, vec2 p, PIXEL color={}, int scale=1, abmt::font font=default_font) | |
img_px& | write_text(std::string text, int start_x=0, int start_top_y=0, PIXEL color={}, int scale=1, abmt::font font=default_font) | Writes a string. "\n" starts a new line with 2px*scale spacing. |
img_px& | paste(img_px& img, int at_x=0, int at_y=0) | |
img_px | copy() | |
region_of_interest < typename PIXEL > |
Name | abmt::region_of_interest |
Header | #include <abmt/img.h> |
Attributes |
img_px<PIXEL>* | img | |
int32_t | top_left_x | |
int32_t | top_left_y | |
int32_t | width | |
int32_t | height | |
Methods |
| region_of_interest() | for default construction. |
| region_of_interest(img_px< PIXEL >& img, int32_t top_left_x, int32_t top_left_y, int32_t width, int32_t height) | |
region_of_interest& | set_center(int32_t center_x, int32_t center_y, int32_t new_width=-1, int32_t new_height=-1) | |
region_of_interest& | set_size(int32_t new_width=-1, int32_t new_height=-1) | |
region_of_interest& | correct_to_limit() | |
inner_pixel_iterator<PIXEL> | begin() | |
inner_pixel_iterator<PIXEL> | end() | |
region_of_interest& | fill(PIXEL p={}) | |
region_of_interest& | border(PIXEL color={}, int line_width=1) | Draws a border on the most outer lines inside the region of interest. |
region_of_interest& | shrink(int32_t px) | |
region_of_interest& | grow(int32_t px) | |
region_of_interest& | write_text(std::string text, vec2 p, PIXEL color={}, int scale=1) | |
region_of_interest& | write_text(std::string text, int start_x=0, int start_top_y=0, PIXEL color={}, int scale=1) | |
region_of_interest& | draw_line(line2d l, PIXEL color={}, int line_width=1) | |
region_of_interest& | draw_line(double x1, double y1, double x2, double y2, PIXEL color={}, int line_width=1) | |
region_of_interest& | draw_line(int x1, int y1, int x2, int y2, PIXEL color={}, int line_width=1) | |
region_of_interest& | draw_circle(int center_x, int center_y, int radius, PIXEL color={}, int line_width=1) | |
region_of_interest& | draw_circle(vec2 p, double radius, PIXEL color={}, int line_width=1) | |
region_of_interest& | draw_circle(double center_x, double center_y, double radius, PIXEL color={}, int line_width=1) | |
region_of_interest& | draw_cross(vec2 p, PIXEL color={}, int line_width=1, int arm_len=-1) | When arm_len < 0 then it will be set to line_width * 3;. |
region_of_interest& | draw_cross(int center_x, int center_y, PIXEL color={}, int line_width=1, int arm_len=-1) | When arm_len == -1 then it will be set to line_width * 3;. |
img_px<PIXEL> | copy() | |
...