/* Attention to owner of getimage() in TheMatrix*/
Hi! I am working on the RIGHT way to test getimage(). When I do testing do I
just compare the bufferedImage line2 only , should I consider line 1?
Example: "BufferedImage@e2cb55:" @e2cb55 is the buffered image's memory
location right?
If I only use m.getImage().getdata() then I just receive line2's info, so if
I required to compare A's line 1&2 with B'line1&2 in order to proove the two
image are equal, then getdata is insufficient(imcomplete), because it left
out some data.
/* Attention to owner of getimage() in TheMatrix*/
Hi! I am working on the RIGHT way to test getimage(). When I do testing do I
just compare the bufferedImage line2 only , should I consider line 1? Also I
updated the testgetimage() code, something odd, equality failed when I
compare only line2. Even when println returns the same result???
Example: Comparing only without "BufferedImage@e2cb55:" @e2cb55 is the
buffered image's memory location right?
If I only use m.getImage().getdata() then I just receive line2's info, so if
I required to compare A's line 1&2 with B'line1&2 in order to proove the two
image are equal, then getdata is insufficient(imcomplete), because it left
out some data.
Image A =>
System.out.println(m.getImage().toString());
Line1:
BufferedImage@e2cb55: type = 1 DirectColorModel: rmask=ff0000 gmask=ff00
bmask=ff amask=0
Line2:
IntegerInterleavedRaster: width = 75 height = 75 #Bands = 3 xOff = 0 yOff =
0 dataOffset[0] 0
Image B =>
System.out.println(bufferedImage.toString());
Line 1:
BufferedImage@19360e2: type = 1 DirectColorModel: rmask=ff0000 gmask=ff00
bmask=ff amask=0
Line2:
IntegerInterleavedRaster: width = 75 height = 75 #Bands = 3 xOff = 0 yOff =
0 dataOffset[0] 0
In sum, let's recap. the problem: compare line 2 only to proove two buffered
image equal?
Yes (error) or No (.tostring and stringtokenizer consideration)?
Thanks you for your time.
best wishes,
Henry Chan
Computer Science Major
Simon Fraser University
|