Login
Username:

Password:

Remember me



Lost Password?

Register now!
Main Menu
Who is Online
18 user(s) are online (17 user(s) are browsing Forum)

Members: 0
Guests: 18

more...


Browsing this Thread:   1 Anonymous Users




(1) 2 »


Re: BitMapScale() bug - the "desty" parameter is wrongly scaled
#11
Just can't stay away
Just can't stay away


See User information
Thanks

Posted on: 2013/6/15 8:03
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: BitMapScale() bug - the "desty" parameter is wrongly scaled
#10
Home away from home
Home away from home


See User information
Quote:

x303 wrote:
Will there be a patch for the normal icaros build soon for those who don't run nightlys ?


Here you go.

Attach file:


Link only for registered users

Posted on: 2013/6/15 1:39
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: BitMapScale() bug - the "desty" parameter is wrongly scaled
#9
Just can't stay away
Just can't stay away


See User information
Will there be a patch for the normal icaros build soon for those who don't run nightlys ?


Posted on: 2013/6/14 11:14
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: BitMapScale() bug - the "desty" parameter is wrongly scaled
#8
Home away from home
Home away from home


See User information
Quote:
ncafferkey wrote:
ScalePixelArray() is now implemented in ABI v1 and v0. It will appear in ABIv0 nightlies in the next day or two.

Magnifique ! Thanks you very much for that, and thank you for backporting at well.

Finally, i can get rid of my shoddy scaling routines \o/

Posted on: 2013/6/13 7:17
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: BitMapScale() bug - the "desty" parameter is wrongly scaled
#7
Home away from home
Home away from home


See User information
Quote:

magorium wrote:
@mazze:

not wanting to hijack this thread but since we're on the subject of scaling it took me almost half a day before i figured out that ScalePixelArray() was not implemented by looking at the sources. I mention this as you seem to be working on some of the documentation lately ?


ScalePixelArray() is now implemented in ABI v1 and v0. It will appear in ABIv0 nightlies in the next day or two.

Posted on: 2013/6/13 1:54
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: BitMapScale() bug - the "desty" parameter is wrongly scaled
#6
Home away from home
Home away from home


See User information
It looks like desty was added twice to the row counter. Please test with next nightly build.

Posted on: 2013/1/17 21:16
AROS - Make code, not war :knuddel:
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: BitMapScale() bug - the "desty" parameter is wrongly scaled
#5
Home away from home
Home away from home


See User information
Quote:

PortablE wrote:
As this is inside VMWare Player, I am using VESA.


On Linux/hosted with X11 driver I can reproduce the problem. I wrote a sample:

#include <proto/exec.h>
#include <proto/dos.h>
#include <proto/graphics.h>
#include <proto/intuition.h>

#include <graphics/gfxmacros.h>

#include <stdlib.h>
#include <stdio.h>

static struct Window *window;
static 
struct ColorMap *cm;
static 
struct RastPort *win_rp;

#define BMWIDTH (50)
#define BMHEIGHT (50)
struct BitMap *from_bm, *to_bm;
struct RastPort *bm_rp;

static 
LONG pen1=-1;
static 
LONG pen2=-1;

static 
void draw_bitmap(void);
static 
void clean_exit(CONST_STRPTR s);
static 
void handle_events(void);

int main(void)
{
    
window OpenWindowTags(NULL,
        
WA_Left,   50,
        
WA_Top,    70,
        
WA_Width,  400,
        
WA_Height350,
    
        
WA_Title,         "Bitmap Graphics",
        
WA_Activate,      TRUE,
        
WA_SmartRefresh,  TRUE,
        
WA_NoCareRefreshTRUE,
        
WA_GimmeZeroZeroTRUE,
        
WA_CloseGadget,   TRUE,
        
WA_DragBar,       TRUE,
        
WA_DepthGadget,   TRUE,
        
WA_IDCMP,         IDCMP_CLOSEWINDOW,
        
TAG_END);
    
    if (! 
windowclean_exit("Can't open windown");
    
    
win_rp window->RPort;
    
cm window->WScreen->ViewPort.ColorMap;

    
pen1 ObtainBestPen(cm0xFFFF0000 TAG_END);
    
pen2 ObtainBestPen(cm0xFFFF0000 TAG_END);
    if ( !
pen1 || !pen2clean_exit("Can't allocate penn");
    
    
draw_bitmap();
    
handle_events();

    
clean_exit(NULL);

    return 
0;
}


static 
void draw_bitmap(void)
{
    
UWORD depth GetBitMapAttr(win_rp->BitMapBMA_DEPTH);

    
from_bm AllocBitMap(BMWIDTH BMHEIGHTdepthBMF_MINPLANESwin_rp->BitMap);
    if (!
from_bmclean_exit("Can't allocate bitmapn");

    
to_bm AllocBitMap(BMWIDTH 200200BMF_MINPLANESwin_rp->BitMap);
    if (!
to_bmclean_exit("Can't allocate bitmapn");
    
    
bm_rp CreateRastPort();
    if (!
bm_rpclean_exit("Can't allocate rastport!n");
    
bm_rp->BitMap from_bm;

    
SetRast(bm_rp0);
    
SetAPen(bm_rppen1);
    
DrawCircle(bm_rp242424);
    
SetAPen(bm_rppen2);
    
Move(bm_rp00);
    
Draw(bm_rp4949);
    
Move(bm_rp490);
    
Draw(bm_rp049);
    
Draw(bm_rp4949);
    
Draw(bm_rp490);
    
Draw(bm_rp00);
    
Draw(bm_rp049);

    
struct BitScaleArgs bsa = {
        
00// UWORD   bsa_SrcX, bsa_SrcY;                    /* source origin */
        
5050// UWORD   bsa_SrcWidth, bsa_SrcHeight;         /* source size */
        
11// UWORD   bsa_XSrcFactor, bsa_YSrcFactor;        /* scale factor denominators */
        
2020// UWORD   bsa_DestX, bsa_DestY;                  /* destination origin */
        
00// UWORD   bsa_DestWidth, bsa_DestHeight;         /* destination size result */
        
11// UWORD   bsa_XDestFactor, bsa_YDestFactor;      /* scale factor numerators */
        
from_bm// struct BitMap *bsa_SrcBitMap;               /* source BitMap */
        
to_bm// struct BitMap *bsa_DestBitMap;                /* destination BitMap */
        
0// ULONG   bsa_Flags;                                /* reserved.  Must be zero! */
        
0// UWORD   bsa_XDDA, bsa_YDDA;                       /* reserved */
        
0// LONG    bsa_Reserved1;
        
// LONG    bsa_Reserved2;
    
};

    
ClipBlit(bm_rp00win_rp00BMWIDTHBMHEIGHT0xC0);

    
bm_rp->BitMap to_bm;
    
SetRast(bm_rp0);

    
BitMapScale(&bsa);

    
ClipBlit(bm_rp00win_rp050BMWIDTHBMHEIGHT0xC0);
    
ClipBlit(bm_rp00win_rp500BMWIDTHBMHEIGHT0xC0);
}


static 
void handle_events(void)
{
    
struct IntuiMessage *imsg;
    
struct MsgPort *port window->UserPort;
    
BOOL terminated FALSE;
        
    while (!
terminated)
    {
        
Wait(1L << port->mp_SigBit);
        if ((
imsg = (struct IntuiMessage *)GetMsg(port)) != NULL)
        {
            switch (
imsg->Class)
            {
                case 
IDCMP_CLOSEWINDOW:
                    
terminated TRUE;
                    break;
            }
            
ReplyMsg((struct Message *)imsg);
        }
    }
}


static 
void clean_exit(CONST_STRPTR s)
{
    if (
sPutStr(s);

    
// Give back allocated resourses
    
if (from_bmFreeBitMap(from_bm);
    if (
to_bmFreeBitMap(to_bm);
    if (
bm_rpFreeRastPort(bm_rp);
    if (
pen1 != -1ReleasePen(cmpen1);
    if (
pen2 != -1ReleasePen(cmpen2);
    if (
windowCloseWindow(window);

    exit(
0);
}


Even with scaler fraction set to 1:1 there is a difference between x and y shift.


Edit: problem is reproducible on both ABIv1 and v0.

Attach file:



jpg  (0.00 KB)


Posted on: 2013/1/17 19:55
AROS - Make code, not war :knuddel:
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: BitMapScale() bug - the "desty" parameter is wrongly scaled
#4
Home away from home
Home away from home


See User information
@mazze:

not wanting to hijack this thread but since we're on the subject of scaling it took me almost half a day before i figured out that ScalePixelArray() was not implemented by looking at the sources. I mention this as you seem to be working on some of the documentation lately ?

Posted on: 2013/1/17 19:02
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: BitMapScale() bug - the "desty" parameter is wrongly scaled
#3
Home away from home
Home away from home


See User information
As this is inside VMWare Player, I am using VESA.

Posted on: 2013/1/17 18:42
ChrisH
--
Author of the PortablE programming language.
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: BitMapScale() bug - the "desty" parameter is wrongly scaled
#2
Home away from home
Home away from home


See User information
As it could be driver related: what driver (vesa, x11 etc) are you using? It should be visible in the Screenmode Prefs.

Posted on: 2013/1/17 18:29
AROS - Make code, not war :knuddel:
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 




(1) 2 »



You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[Advanced Search]


Search
Top Posters
1 paolone
paolone
4462
2 nikolaos
nikolaos
4206
3 magorium
magorium
4095
4 phoenixkonsole
phoenixkonsole
3942
5 deadwood
deadwood
2917
6 ncafferkey
ncafferkey
2810
7 mazze
mazze
2222
8 Kalamatee
Kalamatee
2212
9 clusteruk
clusteruk
2114
Powered by XOOPS © 2001-2025 The XOOPS Project