finish revising draw_line
This commit is contained in:
parent
d52d027c1a
commit
a7e6c6e009
14
TODO
14
TODO
@ -1,21 +1,9 @@
|
|||||||
- redo draw_line following the draw_circle model: have a simple
|
- hough_circle can use circle thing to incremet in circles
|
||||||
"iterator"-style line draw which calls a function per pixel
|
|
||||||
|
|
||||||
include a _direct version
|
|
||||||
|
|
||||||
get rid of draw_line_user and draw_line_mask
|
|
||||||
|
|
||||||
- test draw_mask on labq images
|
- test draw_mask on labq images
|
||||||
|
|
||||||
we probably need to unpack the ink back to double before blending
|
we probably need to unpack the ink back to double before blending
|
||||||
|
|
||||||
- vips_draw_image() might need a direct mode? see vips_flood_direct()
|
|
||||||
|
|
||||||
- need call operation along a circle, see line draw
|
|
||||||
|
|
||||||
- use with vips_draw_add() to make a mask image for each radius for
|
|
||||||
vips_hough_circle()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- think of a better way to support skipahead
|
- think of a better way to support skipahead
|
||||||
|
@ -4566,13 +4566,37 @@ im_draw_line( VipsImage *image, int x1, int y1, int x2, int y2, VipsPel *ink )
|
|||||||
return( vips_draw_line( image, vec, n, x1, y1, x2, y2, NULL ) );
|
return( vips_draw_line( image, vec, n, x1, y1, x2, y2, NULL ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typedef struct _Line {
|
||||||
|
VipsPlotFn plot;
|
||||||
|
void *a;
|
||||||
|
void *b;
|
||||||
|
void *c;
|
||||||
|
} Line;
|
||||||
|
|
||||||
|
static void
|
||||||
|
draw_line_wrapper( VipsImage *image, int x, int y, void *client )
|
||||||
|
{
|
||||||
|
Line *line = (Line *) client;
|
||||||
|
|
||||||
|
line->plot( image, x, y, line->a, line->b, line->c );
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
im_draw_line_user( VipsImage *image,
|
im_draw_line_user( VipsImage *image,
|
||||||
int x1, int y1, int x2, int y2,
|
int x1, int y1, int x2, int y2,
|
||||||
VipsPlotFn plot, void *a, void *b, void *c )
|
VipsPlotFn plot, void *a, void *b, void *c )
|
||||||
{
|
{
|
||||||
return( vips_draw_line_user( image, x1, y1, x2, y2,
|
Line line;
|
||||||
plot, a, b, c, NULL ) );
|
|
||||||
|
line.plot = plot;
|
||||||
|
line.a = a;
|
||||||
|
line.b = b;
|
||||||
|
line.c = c;
|
||||||
|
|
||||||
|
vips__draw_line_direct( image, x1, y1, x2, y2,
|
||||||
|
draw_line_wrapper, &line );
|
||||||
|
|
||||||
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -56,6 +56,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <vips/vips.h>
|
#include <vips/vips.h>
|
||||||
|
#include <vips/internal.h>
|
||||||
|
|
||||||
#include "drawink.h"
|
#include "drawink.h"
|
||||||
|
|
||||||
@ -67,8 +68,6 @@ typedef struct _VipsDrawCircle {
|
|||||||
int radius;
|
int radius;
|
||||||
gboolean fill;
|
gboolean fill;
|
||||||
|
|
||||||
VipsDrawPoint draw_point;
|
|
||||||
VipsDrawScanline draw_scanline;
|
|
||||||
} VipsDrawCircle;
|
} VipsDrawCircle;
|
||||||
|
|
||||||
typedef struct _VipsDrawCircleClass {
|
typedef struct _VipsDrawCircleClass {
|
||||||
|
@ -60,6 +60,9 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <vips/vips.h>
|
#include <vips/vips.h>
|
||||||
|
#include <vips/internal.h>
|
||||||
|
|
||||||
|
#include "drawink.h"
|
||||||
|
|
||||||
typedef struct _VipsDrawLine {
|
typedef struct _VipsDrawLine {
|
||||||
VipsDrawink parent_object;
|
VipsDrawink parent_object;
|
||||||
@ -237,6 +240,7 @@ static int
|
|||||||
vips_draw_line_build( VipsObject *object )
|
vips_draw_line_build( VipsObject *object )
|
||||||
{
|
{
|
||||||
VipsDraw *draw = VIPS_DRAW( object );
|
VipsDraw *draw = VIPS_DRAW( object );
|
||||||
|
VipsDrawink *drawink = VIPS_DRAWINK( object );
|
||||||
VipsDrawLine *line = (VipsDrawLine *) object;
|
VipsDrawLine *line = (VipsDrawLine *) object;
|
||||||
|
|
||||||
VipsDrawPoint draw_point;
|
VipsDrawPoint draw_point;
|
||||||
|
Loading…
Reference in New Issue
Block a user