コード例 #1
0
ファイル: util.cpp プロジェクト: AbdelghaniDr/mirror
Size GetPixelsPerMeter(const Draw& draw)
{
	if(draw.Dots())
		return Size(DOTS_PER_METER_INT, DOTS_PER_METER_INT);
	else
		return iscale(draw.GetPagePixels(), Size(1000, 1000), max(draw.GetPageMMs(), Size(1, 1)));
}
コード例 #2
0
ファイル: DrawData.cpp プロジェクト: dreamsxin/ultimatepp
void DrawImageBandRLE(Draw& w, int x, int y, const Image& m, int minp)
{
	int xi = 0;
	int cx = m.GetWidth();
	int ccy = m.GetHeight();
	Buffer<bool> todo(cx, true);
#ifdef BENCHMARK_RLE
	sTotal += cx;
#endif
	while(xi < cx) {
		int xi0 = xi;
		while(w.Dots() && IsWhiteColumn(m, xi) && xi < cx)
			xi++;
		if(xi - xi0 >= 16) {
#ifdef BENCHMARK_RLE
			sRle += xi - xi0;
#endif
			w.DrawRect(x + xi0, y, xi - xi0, ccy, White);
			Fill(~todo + xi0, ~todo + xi, false);
		}
		xi++;
	}
	
	xi = 0;
	while(xi < cx)
		if(todo[xi]) {
			int xi0 = xi;
			while(xi < cx && todo[xi] && xi - xi0 < 2000)
				xi++;
			w.DrawImage(x + xi0, y, m, RectC(xi0, 0, xi - xi0, ccy));
		}
		else
			xi++;
}
コード例 #3
0
ファイル: util.cpp プロジェクト: AbdelghaniDr/mirror
NAMESPACE_UPP

#ifdef SYSTEMDRAW

Size GetPixelsPerMeter(const Draw& draw)
{
	if(draw.Dots())
		return Size(DOTS_PER_METER_INT, DOTS_PER_METER_INT);
	else
		return Size(96 * DOTS_PER_METER_INT / 600, 96 * DOTS_PER_METER_INT / 600);
}
コード例 #4
0
ファイル: util.cpp プロジェクト: AbdelghaniDr/mirror
int HorzPixelsToDots(const Draw& draw, int dots)
{
	return draw.Dots() ? dots : fround(dots / GetHorzPixelsPerDot(draw));
}
コード例 #5
0
ファイル: util.cpp プロジェクト: AbdelghaniDr/mirror
Size PixelsToDots(const Draw& draw, Size size)
{
	return draw.Dots() ? size
		: iscale(size, Size(DOTS_PER_METER_INT, DOTS_PER_METER_INT), GetPixelsPerMeter(draw));
}
コード例 #6
0
ファイル: util.cpp プロジェクト: AbdelghaniDr/mirror
int PixelsToDots(const Draw& draw, int pixels)
{
	return draw.Dots() ? pixels : fround(pixels / GetAvgPixelsPerDot(draw));
}
コード例 #7
0
ファイル: util.cpp プロジェクト: AbdelghaniDr/mirror
int VertDotsToPixels(const Draw& draw, int dots)
{
	return draw.Dots() ? dots : fround(dots * GetVertPixelsPerDot(draw));
}
コード例 #8
0
ファイル: util.cpp プロジェクト: AbdelghaniDr/mirror
double GetAvgPixelsPerDot(const Draw& draw)
{
	if(draw.Dots())
		return 1;
	return GetAvgPixelsPerMeter(draw) / DOTS_PER_METER_DBL;
}
コード例 #9
0
ファイル: util.cpp プロジェクト: AbdelghaniDr/mirror
double GetVertPixelsPerDot(const Draw& draw)
{
	return draw.Dots() ? 1 : GetVertPixelsPerMeter(draw) / DOTS_PER_METER_DBL;
}
コード例 #10
0
ファイル: util.cpp プロジェクト: AbdelghaniDr/mirror
int GetVertPixelsPerMeter(const Draw& draw)
{
	return draw.Dots() ? DOTS_PER_METER_INT : 96 * DOTS_PER_METER_INT / 600;
}
コード例 #11
0
ファイル: util.cpp プロジェクト: AbdelghaniDr/mirror
Size PointsToPixels(const Draw& draw, Size points)
{
	if(draw.Dots())
		return points * 600 / 72;
	return iscale(points, draw.GetPixelsPerInch(), Size(72, 72));
}
コード例 #12
0
ファイル: util.cpp プロジェクト: AbdelghaniDr/mirror
int PointsToPixels(const Draw& draw, int points)
{
	if(draw.Dots())
		return points * 600 / 72;
	return iscale(points, draw.GetPixelsPerInch().cx, 72);
}
コード例 #13
0
ファイル: util.cpp プロジェクト: AbdelghaniDr/mirror
Size PixelsToPoints(const Draw& draw, Size pixels)
{
	if(draw.Dots())
		return pixels * 72 / 600;
	return iscale(pixels, Size(72, 72), draw.GetPixelsPerInch());
}
コード例 #14
0
ファイル: util.cpp プロジェクト: AbdelghaniDr/mirror
int PixelsToPoints(const Draw& draw, int pixels)
{
	if(draw.Dots())
		return pixels * 72 / 600;
	return iscale(pixels, 72, draw.GetPixelsPerInch().cx);
}
コード例 #15
0
ファイル: util.cpp プロジェクト: AbdelghaniDr/mirror
int GetVertPixelsPerMeter(const Draw& draw)
{
	return draw.Dots() ? DOTS_PER_METER_INT
		: iscale(draw.GetPagePixels().cy, 1000, max(draw.GetPageMMs().cy, 1));
}