How to use Form pixelCompare:with:at:

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to use Form pixelCompare:with:at:

Herbert König
Hi,

Form>>pixelCompare:with:at: seems to always return 0.

I use it like
|pict1 pict2|
pict1 := (Form extent: 100@100 depth: 32) fillBlack.
pict2 := (Form extent: 100@100 depth: 32) fillWithColor: Color red.
pict1 pixelCompare: pict1 boundingBox with: pict2 at: 0@0

As I get the same result in a 4.4 and a 3.8 image I guess I don't
understand how it's used. No senders in either image.

Any help is appreciated.

Cheers,

Herbert
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: How to use Form pixelCompare:with:at:

Bert Freudenberg
On 07.01.2014, at 15:19, Herbert König <[hidden email]> wrote:

> Hi,
>
> Form>>pixelCompare:with:at: seems to always return 0.
>
> I use it like
> |pict1 pict2|
> pict1 := (Form extent: 100@100 depth: 32) fillBlack.
> pict2 := (Form extent: 100@100 depth: 32) fillWithColor: Color red.
> pict1 pixelCompare: pict1 boundingBox with: pict2 at: 0@0
>
> As I get the same result in a 4.4 and a 3.8 image I guess I don't understand how it's used. No senders in either image.
Try 16 bit forms.

- Bert -


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners

smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to use Form pixelCompare:with:at:

Herbert König
Hi Bert,

Am 07.01.2014 15:57, schrieb Bert Freudenberg:
> Try 16 bit forms. - Bert -
thanks, that works.

Is this a bug or infeasible with 32 Bit Forms? it's surprisingly fast.
(I'm dealing with Photos)

Cheers

Herbert

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: How to use Form pixelCompare:with:at:

Bert Freudenberg

On 07.01.2014, at 16:13, Herbert König <[hidden email]> wrote:

> Hi Bert,
>
> Am 07.01.2014 15:57, schrieb Bert Freudenberg:
>> Try 16 bit forms. - Bert -
> thanks, that works.
>
> Is this a bug or infeasible with 32 Bit Forms? it's surprisingly fast. (I'm dealing with Photos)

It's using BitBlt so should be fast indeed. Sounds like a bug that it does not work in 32 bits, at least according to the comment.

OTOH all the BitBlt tally operations only work up to 16 bit depth. With 32 bit forms you could easily overflow a SmallInteger. So you might want to reduce the depth of the forms anyway before comparing.

- Bert -



_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners

smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to use Form pixelCompare:with:at:

Herbert König

Am 07.01.2014 16:23, schrieb Bert Freudenberg:

> On 07.01.2014, at 16:13, Herbert König <[hidden email]> wrote:
>
>> Hi Bert,
>>
>> Am 07.01.2014 15:57, schrieb Bert Freudenberg:
>>> Try 16 bit forms. - Bert -
>> thanks, that works.
>>
>> Is this a bug or infeasible with 32 Bit Forms? it's surprisingly fast. (I'm dealing with Photos)
> It's using BitBlt so should be fast indeed. Sounds like a bug that it does not work in 32 bits, at least according to the comment.
>
> OTOH all the BitBlt tally operations only work up to 16 bit depth. With 32 bit forms you could easily overflow a SmallInteger. So you might want to reduce the depth of the forms anyway before comparing.
>
How convenient that asGrayScale (I use that anyway) makes it 8Bit deep.

-Herbert
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners