1 /*
2 * Copyright (c) 1995, 2003, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
101 count++;
102 }
103 return count;
104 }
105
106 protected int setHints(int hints) {
107 ImageConsumerQueue cq = null;
108 int count = 0;
109 while ((cq = nextConsumer(cq)) != null) {
110 cq.consumer.setHints(hints);
111 count++;
112 }
113 return count;
114 }
115
116 protected void headerComplete() {
117 feeder.setPriority(ImageFetcher.LOW_PRIORITY);
118 }
119
120 protected int setPixels(int x, int y, int w, int h, ColorModel model,
121 byte pix[], int off, int scansize) {
122 source.latchConsumers(this);
123 ImageConsumerQueue cq = null;
124 int count = 0;
125 while ((cq = nextConsumer(cq)) != null) {
126 cq.consumer.setPixels(x, y, w, h, model, pix, off, scansize);
127 count++;
128 }
129 return count;
130 }
131
132 protected int setPixels(int x, int y, int w, int h, ColorModel model,
133 int pix[], int off, int scansize) {
134 source.latchConsumers(this);
135 ImageConsumerQueue cq = null;
136 int count = 0;
137 while ((cq = nextConsumer(cq)) != null) {
138 cq.consumer.setPixels(x, y, w, h, model, pix, off, scansize);
139 count++;
140 }
141 return count;
142 }
143
144 protected int imageComplete(int status, boolean done) {
145 source.latchConsumers(this);
146 if (done) {
147 finished = true;
148 source.doneDecoding(this);
149 }
150 ImageConsumerQueue cq = null;
151 int count = 0;
152 while ((cq = nextConsumer(cq)) != null) {
153 cq.consumer.imageComplete(status);
|
1 /*
2 * Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
101 count++;
102 }
103 return count;
104 }
105
106 protected int setHints(int hints) {
107 ImageConsumerQueue cq = null;
108 int count = 0;
109 while ((cq = nextConsumer(cq)) != null) {
110 cq.consumer.setHints(hints);
111 count++;
112 }
113 return count;
114 }
115
116 protected void headerComplete() {
117 feeder.setPriority(ImageFetcher.LOW_PRIORITY);
118 }
119
120 protected int setPixels(int x, int y, int w, int h, ColorModel model,
121 byte[] pix, int off, int scansize) {
122 source.latchConsumers(this);
123 ImageConsumerQueue cq = null;
124 int count = 0;
125 while ((cq = nextConsumer(cq)) != null) {
126 cq.consumer.setPixels(x, y, w, h, model, pix, off, scansize);
127 count++;
128 }
129 return count;
130 }
131
132 protected int setPixels(int x, int y, int w, int h, ColorModel model,
133 int[] pix, int off, int scansize) {
134 source.latchConsumers(this);
135 ImageConsumerQueue cq = null;
136 int count = 0;
137 while ((cq = nextConsumer(cq)) != null) {
138 cq.consumer.setPixels(x, y, w, h, model, pix, off, scansize);
139 count++;
140 }
141 return count;
142 }
143
144 protected int imageComplete(int status, boolean done) {
145 source.latchConsumers(this);
146 if (done) {
147 finished = true;
148 source.doneDecoding(this);
149 }
150 ImageConsumerQueue cq = null;
151 int count = 0;
152 while ((cq = nextConsumer(cq)) != null) {
153 cq.consumer.imageComplete(status);
|