Ausgeben eines Pufferedimage in seiner ursprünglichen RGB -Farbkanal -Bestellung, nachdem es in ein anderes Format überaJava

Java-Forum
Anonymous
 Ausgeben eines Pufferedimage in seiner ursprünglichen RGB -Farbkanal -Bestellung, nachdem es in ein anderes Format übera

Post by Anonymous »

Erstellen eines Farbkanal-Schalters, der ein gepuffertes Diplomage durchführt und ändert sich nicht zerstört, alle Fälle mit Ausnahme von RGB-Arbeiten. Das Problem tritt auf, wenn versucht wird, die RGB -Neubestellung auf ein bereits neu angeordnetes Bild anzuwenden, d. H. Das Bild wechsle auf GBR und möchte es dann wieder in RGB ändern. Ich habe auch versucht, das Pufferedimage so zu wechseln, um Typ-explizit zu sein (speziell type.int_argb), um festzustellen, ob die Verwendung von CopyData (NULL) das Problem war, wodurch die Pixel vielleicht unabweilbar waren, aber das änderte nichts. Hat jemand irgendwelche Ideen? < /P>

Code: Select all

public BufferedImage apply(BufferedImage input) {
BufferedImage output = new BufferedImage(input.getColorModel(), input.copyData(null), input.isAlphaPremultiplied(), null);
for (int y = 0; y < input.getHeight(); ++y) {
for (int x = 0; x < input.getWidth(); ++x) {
int argb = input.getRGB(x, y);

int a = (argb & 0xFF000000) >>> 24;
int r = (argb & 0x00FF0000) >> 16;
int g = (argb & 0x0000FF00) >> 8;
int b = (argb & 0x000000FF);

switch (orderType) {
case GBR:
argb = (a

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post