-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
codec: add a null check in
ImageIOJPEGImageWriter
, other small impr…
…ovements
- Loading branch information
Showing
11 changed files
with
395 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
echosvg-codec/src/main/java/io/sf/carte/echosvg/ext/awt/image/codec/impl/ColorUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
See the NOTICE file distributed with this work for additional | ||
information regarding copyright ownership. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
package io.sf.carte.echosvg.ext.awt.image.codec.impl; | ||
|
||
import java.awt.color.ColorSpace; | ||
|
||
/** | ||
* Color utilities. | ||
* | ||
* @version $Id$ | ||
*/ | ||
public class ColorUtil { | ||
|
||
/** | ||
* Avoid instantiation. | ||
*/ | ||
ColorUtil() { | ||
super(); | ||
} | ||
|
||
/** | ||
* | ||
* @param colorSpace the color space. | ||
* @return {@code true} if it is a built-in color space. | ||
*/ | ||
public static boolean isBuiltInColorSpace(ColorSpace colorSpace) { | ||
return colorSpace.isCS_sRGB() || colorSpace == ColorSpace.getInstance(ColorSpace.CS_CIEXYZ) | ||
|| colorSpace == ColorSpace.getInstance(ColorSpace.CS_GRAY) | ||
|| colorSpace == ColorSpace.getInstance(ColorSpace.CS_LINEAR_RGB) | ||
|| colorSpace == ColorSpace.getInstance(ColorSpace.CS_PYCC); | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
echosvg-codec/src/main/java/io/sf/carte/echosvg/ext/awt/image/codec/impl/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
See the NOTICE file distributed with this work for additional | ||
information regarding copyright ownership. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
/** | ||
* Implementation classes, do not use outside of the codec module. | ||
*/ | ||
package io.sf.carte.echosvg.ext.awt.image.codec.impl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.