mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-09-10 03:54:54 -06:00
Draw, CtrlCore: Major refactor of Draw
git-svn-id: svn://ultimatepp.org/upp/trunk@5545 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
fa5f9ec55e
commit
bd87a04fda
37 changed files with 2704 additions and 2655 deletions
|
|
@ -115,6 +115,48 @@ int Draw::GetCloffLevel() const { return 0; }
|
|||
|
||||
// -------------------------------
|
||||
|
||||
void Draw::SysDrawImageOp(int x, int y, const Image& img, const Rect& src, Color color)
|
||||
{
|
||||
NEVER();
|
||||
}
|
||||
|
||||
void Draw::DrawImageOp(int x, int y, int cx, int cy, const Image& img, const Rect& src, Color color)
|
||||
{
|
||||
LTIMING("DrawImageOp");
|
||||
bool tonative = !IsNative();
|
||||
if(tonative) {
|
||||
BeginNative();
|
||||
Native(x, y);
|
||||
Native(cx, cy);
|
||||
}
|
||||
Size sz = Size(cx, cy);
|
||||
if((cx > 2000 || cy > 1500) && IsNull(color) && IsPrinter()) {
|
||||
int yy = 0;
|
||||
ImageRaster ir(img);
|
||||
RescaleImage rm;
|
||||
rm.Create(Size(cx, cy), ir, src);
|
||||
while(yy < cy) {
|
||||
int ccy = min(cy - yy, 16);
|
||||
ImageBuffer ib(cx, ccy);
|
||||
for(int q = 0; q < ccy; q++)
|
||||
rm.Get(ib[q]);
|
||||
DrawImageBandRLE(*this, x, y + yy, ib, 16);
|
||||
yy += ccy;
|
||||
}
|
||||
}
|
||||
else
|
||||
if(src.GetSize() == sz)
|
||||
SysDrawImageOp(x, y, img, src, color);
|
||||
else {
|
||||
Image h = Rescale(img, Size(cx, cy), src);
|
||||
SysDrawImageOp(x, y, h, h.GetSize(), color);
|
||||
}
|
||||
if(tonative)
|
||||
EndNative();
|
||||
}
|
||||
|
||||
// -------------------------------
|
||||
|
||||
void Draw::DrawRect(const Rect& rect, Color color)
|
||||
{
|
||||
DrawRect(rect.left, rect.top, rect.GetWidth(), rect.GetHeight(), color);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue