cntfill.c
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
#include <math.h>
00037
#include "idcnt.h"
00038
#include "idima.h"
00039
00056
int
00057 _IdCntDrawPolygonOffset(
PCONTOUR_USHORT contour,
00058
int ox,
int oy,
00059 PPIMAGE_UCHAR image,
00060
int code,
int closed,
int greylevel)
00061 {
00062
int i;
00063
int NbPts =
IdCntUsedNbX(contour);
00064
if (NbPts < 2) {
00065
return 0;
00066 }
00067
00068
for (i = 0; i < NbPts - 1; i++) {
00069
if (!
IdImaDrawLine
00070 (
image, greylevel,
code,
IdCntGetX(contour, i) - ox,
00071
IdCntGetY(contour, i) - oy,
IdCntGetX(contour,
00072 i + 1) - ox,
00073
IdCntGetY(contour, i + 1) - oy)) {
00074
return 0;
00075 }
00076 }
00077
if (closed == 1)
00078
if (!
IdImaDrawLine
00079 (
image, greylevel,
code,
00080
IdCntGetX(contour, NbPts - 1) - ox,
IdCntGetY(contour,
00081 NbPts -
00082 1) - oy,
00083
IdCntGetX(contour, 0) - ox,
IdCntGetY(contour,
00084 0) -
00085 oy)) {
return 0;
00086 }
00087
00088
return (1);
00089 }
00090
00102
int
00103 IdCntDrawPolyLine(
PCONTOUR_USHORT contour,
00104 PPIMAGE_UCHAR image,
00105
int code,
00106
int greylevel)
00107 {
00108
return _IdCntDrawPolygonOffset(contour,
00109 0,0,
image,
code, 0, greylevel);
00110 }
00111
00125
int
00126 IdCntDrawPolyLineOffset(
PCONTOUR_USHORT contour,
00127
int ox,
int oy,
00128 PPIMAGE_UCHAR image,
00129
int code,
00130
int greylevel)
00131 {
00132
return _IdCntDrawPolygonOffset(contour,
00133 ox, oy,
image,
code, 0, greylevel);
00134 }
00135
00147
int
00148 IdCntDrawPolygon(
PCONTOUR_USHORT contour,
00149 PPIMAGE_UCHAR image,
00150
int code,
int greylevel)
00151 {
00152
return _IdCntDrawPolygonOffset(contour,
00153 0,0,
image,
code, 1, greylevel);
00154 }
00155
00169
int
00170 IdCntDrawPolygonOffset(
PCONTOUR_USHORT contour,
00171
int ox,
int oy,
00172 PPIMAGE_UCHAR image,
00173
int code,
int greylevel)
00174 {
00175
return _IdCntDrawPolygonOffset(contour,
00176 ox, oy,
image,
code, 1, greylevel);
00177 }
Generated on Wed Oct 19 09:28:32 2005 for SIMRI3D by
1.3.7