[Comment] ColorArray and Color

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

[Comment] ColorArray and Color

Hannes Hirzel
Hello

while looking at the possibilities of Unicode implementation I saw
that the class ColorArray has no comment.


I think it could be something like.


       "ColorArray stores Color instances in a compact way as 32 bit
integers (words).
        It is used by the class ColorForm."

Ken, is this correct? I only see that the class is actually use in

ColorForm>>
readAttributesFrom: aBinaryStream
        super readAttributesFrom: aBinaryStream.
        colors _ ColorArray new: (2 raisedTo: depth).
        1 to: colors size do: [:idx |
                colors basicAt: idx put: (aBinaryStream nextLittleEndianNumber: 4).
        ].
       

And that there are two classes of Color
    Color
      TranslucentColor   (has alpha).

Color claims to be an abstract class according to the comment.

But my image has
    Color allInstances size  1038

Regards
Hannes

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: [Comment] ColorArray and Color

KenDickey
On Tue, 5 Feb 2013 09:36:20 +0000
"H. Hirzel" <[hidden email]> wrote:


>        "ColorArray stores Color instances in a compact way as 32 bit
> integers (words).
>         It is used by the class ColorForm."
>
> Ken, is this correct? I only see that the class is actually use in

I do not know.  I have never used it.

-KenD

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
-KenD
Reply | Threaded
Open this post in threaded view
|

Re: [Comment] ColorArray and Color

Hannes Hirzel
I am not surprised because it seems to be of use only for  ColorForm internally.

But it is a nice example of a variableWordSubclass

      ArrayedCollection variableWordSubclass: #ColorArray

--Hannes

On 2/5/13, Ken Dickey <[hidden email]> wrote:

> On Tue, 5 Feb 2013 09:36:20 +0000
> "H. Hirzel" <[hidden email]> wrote:
>
>
>>        "ColorArray stores Color instances in a compact way as 32 bit
>> integers (words).
>>         It is used by the class ColorForm."
>>
>> Ken, is this correct? I only see that the class is actually use in
>
> I do not know.  I have never used it.
>
> -KenD
>
> _______________________________________________
> Cuis mailing list
> [hidden email]
> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: [Comment] ColorArray and Color

Juan Vuletich-4
Hi Hannes,

You're right. I'll add your comment.

BTW, this is only using when hibernating a ColorForm... And it makes me
wonder, does it make any sense to hibernate Forms with our
multi-gigabyte RAMs?

Cheers,
Juan Vuletich

On 2/6/2013 8:29 AM, H. Hirzel wrote:

> I am not surprised because it seems to be of use only for  ColorForm internally.
>
> But it is a nice example of a variableWordSubclass
>
>        ArrayedCollection variableWordSubclass: #ColorArray
>
> --Hannes
>
> On 2/5/13, Ken Dickey<[hidden email]>  wrote:
>> On Tue, 5 Feb 2013 09:36:20 +0000
>> "H. Hirzel"<[hidden email]>  wrote:
>>
>>
>>>         "ColorArray stores Color instances in a compact way as 32 bit
>>> integers (words).
>>>          It is used by the class ColorForm."
>>>
>>> Ken, is this correct? I only see that the class is actually use in
>> I do not know.  I have never used it.
>>
>> -KenD
>>
>> _______________________________________________
>> Cuis mailing list
>> [hidden email]
>> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>>
> _______________________________________________
> Cuis mailing list
> [hidden email]
> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>


_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: [Comment] ColorArray and Color

Hannes Hirzel
Hello Juan

On 2/7/13, Juan Vuletich <[hidden email]> wrote:
> Hi Hannes,
>
> You're right. I'll add your comment.
>
> BTW, this is only using when hibernating a ColorForm... And it makes me
> wonder, does it make any sense to hibernate Forms with our
> multi-gigabyte RAMs?

I assume so still.

In ContentPack, I'd like to load 60...300 color pictures for an ABC book.

    https://github.com/hhzl/ContentPack

At the moment I only have 8 pictures. That is a limitation of the way
I store the instances of Form in source code; I need to do it in
compressed format with instances of ByteArray; and that is probably a
better way of efficiently storing pictures, even in the image).

And as we are talking about Unicode. Instances of the class Form use
by far the largest amount of memory in Cuis4.1 (SpaceTally). So it
pays off to do some considerations how to manage them efficiently.

BTW compared to that it seems not so important if a character uses 8
bit or 32 bit in an instance of String. There are about 17000
instances of the class String in Cuis.
For Unicode support I see several possible solutions (3...5).

Regards
Hannes Hirzel


>
> On 2/6/2013 8:29 AM, H. Hirzel wrote:
>> I am not surprised because it seems to be of use only for  ColorForm
>> internally.
>>
>> But it is a nice example of a variableWordSubclass
>>
>>        ArrayedCollection variableWordSubclass: #ColorArray
>>
>> --Hannes
>>
>> On 2/5/13, Ken Dickey<[hidden email]>  wrote:
>>> On Tue, 5 Feb 2013 09:36:20 +0000
>>> "H. Hirzel"<[hidden email]>  wrote:
>>>
>>>
>>>>         "ColorArray stores Color instances in a compact way as 32 bit
>>>> integers (words).
>>>>          It is used by the class ColorForm."
>>>>
>>>> Ken, is this correct? I only see that the class is actually use in
>>> I do not know.  I have never used it.
>>>
>>> -KenD
>>>
>>> _______________________________________________
>>> Cuis mailing list
>>> [hidden email]
>>> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>>>
>> _______________________________________________
>> Cuis mailing list
>> [hidden email]
>> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>>
>
>
> _______________________________________________
> Cuis mailing list
> [hidden email]
> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org