コード例 #1
0
ファイル: psGfx.c プロジェクト: ucscGenomeBrowser/kent
void psWhOut(struct psGfx *ps, double width, double height)
/* Output width/height transformed into PostScript space. */
{
FILE *f = ps->f;
psFloatOut(f, width * ps->xScale);
psFloatOut(f, height * -ps->yScale);
}
コード例 #2
0
ファイル: psGfx.c プロジェクト: ucscGenomeBrowser/kent
void psXyOut(struct psGfx *ps, double x, double y)
/* Output x,y position transformed into PostScript space. */
{
FILE *f = ps->f;
psFloatOut(f, x * ps->xScale + ps->xOff);
psFloatOut(f, y * ps->yScale + ps->yOff);
}
コード例 #3
0
ファイル: psGfx.c プロジェクト: ucscGenomeBrowser/kent
void psFillEllipse(struct psGfx *ps, double x, double y, double xrad, double yrad)
{
FILE *f = ps->f;
fprintf(f, "newpath\n");
psXyOut(ps, x, y);
psWhOut(ps, xrad, yrad);
psFloatOut(f, 0.0);
psFloatOut(f, 360.0);
fprintf(f, "ellipse\n");
fprintf(f, "closepath\n");
fprintf(f, "fill\n");
}
コード例 #4
0
ファイル: psGfx.c プロジェクト: ucscGenomeBrowser/kent
void psFillCircle(struct psGfx *ps, double x, double y, double rad)
{
FILE *f = ps->f;
fprintf(f, "newpath\n");
psXyOut(ps, x, y);
psFloatOut(f, rad * ps->xScale);
psFloatOut(f, 0.0);
psFloatOut(f, 360.0);
fprintf(f, "arc\n");
fprintf(f, "closepath\n");
fprintf(f, "fill\n");
}
コード例 #5
0
ファイル: psGfx.c プロジェクト: JinfengChen/pblat
void psDrawEllipse(struct psGfx *ps, double x, double y, double xrad, double yrad,
    double startAngle, double endAngle)
{
FILE *f = ps->f;
fprintf(f, "newpath\n");
psXyOut(ps, x, y);
psWhOut(ps, xrad, yrad);
psFloatOut(f, startAngle);
psFloatOut(f, endAngle);
fprintf(f, "ellipse\n");
fprintf(f, "closepath\n");
fprintf(f, "stroke\n");
}
コード例 #6
0
ファイル: psGfx.c プロジェクト: ucscGenomeBrowser/kent
void psDrawEllipse(struct psGfx *ps, double x, double y, double xrad, double yrad,
                                        double startAngle, double endAngle)
/* Draw ellipse.  Args are center point x and y, horizontal radius, vertical radius,
        start and end angles (e.g. 0 and 180 to draw top half, 180 and 360 for bottom)
 */
{
FILE *f = ps->f;
fprintf(f, "newpath\n");
psXyOut(ps, x, y);
psWhOut(ps, xrad, yrad);
psFloatOut(f, startAngle);
psFloatOut(f, endAngle);
fprintf(f, "ellipse\n");
fprintf(f, "stroke\n");
}
コード例 #7
0
ファイル: psGfx.c プロジェクト: ucscGenomeBrowser/kent
void psSetGray(struct psGfx *ps, double grayVal)
/* Set gray value. */
{
FILE *f = ps->f;
if (grayVal < 0) grayVal = 0;
if (grayVal > 1) grayVal = 1;
psFloatOut(f, grayVal);
fprintf(f, "setgray\n");
}
コード例 #8
0
ファイル: psGfx.c プロジェクト: ucscGenomeBrowser/kent
void psSetColor(struct psGfx *ps, int r, int g, int b)
/* Set current color. */
{
FILE *f = ps->f;
double scale = 1.0/255;
if (r == g && g == b)
    {
    psFloatOut(f, scale * r);
    fprintf(f, "setgray\n");
    }
else
    {
    psFloatOut(f, scale * r);
    psFloatOut(f, scale * g);
    psFloatOut(f, scale * b);
    fprintf(f, "setrgbcolor\n");
    }
}