1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
|
/*
* JPEGFrame
*
* Copyright (c) 2005, 2006 Marco Schmidt.
* All rights reserved.
*/
package net.sourceforge.jiu.codecs.jpeg;
/**
* Data class to store information on a JPEG frame.
* A frame here is JPEG terminology for a complete image
* and has nothing to do with GUI components like JFrame objects
* in Swing.
* @author Marco Schmidt
* @since 0.13.0
*/
public class JPEGFrame
{
private JPEGFrameComponent[] components;
private int numComponents;
private int height;
private int samplePrecision;
private int width;
public JPEGFrameComponent[] getComponents()
{
return components;
}
public int getHeight()
{
return height;
}
public int getNumComponents()
{
return numComponents;
}
public int getSamplePrecision()
{
return samplePrecision;
}
public int getWidth()
{
return width;
}
public void setComponents(JPEGFrameComponent[] components)
{
this.components = components;
}
public void setHeight(int i)
{
height = i;
}
public void setNumComponents(int i)
{
numComponents = i;
}
public void setSamplePrecision(int i)
{
samplePrecision = i;
}
public void setWidth(int i)
{
width = i;
}
public String toString()
{
StringBuffer sb = new StringBuffer();
sb.append("#components=");
sb.append(numComponents);
sb.append("/precision=");
sb.append(samplePrecision);
sb.append("/width=");
sb.append(width);
sb.append("/height=");
sb.append(height);
if (components != null)
{
for (int i = 0; i < components.length; i++)
{
JPEGFrameComponent comp = components[i];
if (comp != null)
{
sb.append("/");
sb.append(comp.toString());
}
}
}
return sb.toString();
}
}
|