You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by Jun Inamori <ju...@oop-reserch.com> on 2002/08/29 19:10:51 UTC

Question about IndexImage

Hi,

Congratulations for the release of Version 1.5 Beta 4!
By the way, while I looked into the source of:
  org/apache/batik/ext/awt/image/rendered/IndexImage.java
I had the small question.
Within its "getIndexedImage" method, there is a line of:

   IndexColorModel model=new IndexColorModel(4,256,r,g,b);

But, I think the length of byte[] (which are passed as the last 3 parameters) does not always equal to 256.
So, the line below may be safe:

   IndexColorModel model=new IndexColorModel(4,nCubes,r,g,b);

Happy Java programming!
-------
Jun Inamori
OOP-Reserch
E-mail: jun@oop-reserch.com
URL:    http://www.oop-reserch.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org


[RE] Question about IndexImage

Posted by Thomas E Deweese <th...@kodak.com>.
>>>>> "JI" == Jun Inamori <ju...@oop-reserch.com> writes:

JI> Hi,

JI> Congratulations for the release of Version 1.5 Beta 4!  By the
JI> way, while I looked into the source of:
JI> org/apache/batik/ext/awt/image/rendered/IndexImage.java I had the
JI> small question.  Within its "getIndexedImage" method, there is a
JI> line of:

JI>    IndexColorModel model=new IndexColorModel(4,256,r,g,b);

JI> But, I think the length of byte[] (which are passed as the last 3
JI> parameters) does not always equal to 256.  So, the line below may
JI> be safe:

JI>    IndexColorModel model=new IndexColorModel(4,nCubes,r,g,b);

       Yes, good point, and the '4' should really be the number of bits.
I'll check in this fix.


JI> Happy Java programming!  ------- Jun Inamori OOP-Reserch E-mail:
JI> jun@oop-reserch.com URL: http://www.oop-reserch.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org