129 MediaFrame newFrame = vdb.convertToFormat(PixelFormat.INT_ARGB_PRE); 130 vdb.releaseFrame(); 131 vdb = newFrame; 132 if (null == vdb) { 133 // FIXME: error condition? 134 return null; 135 } 136 } 137 138 tex = J2DTexture.create(vdb.getPixelFormat(), WrapMode.CLAMP_TO_EDGE, 139 vdb.getWidth(), vdb.getHeight()); 140 vdb.releaseFrame(); 141 return tex; 142 } 143 144 @Override 145 public boolean isCompatibleTexture(Texture tex) { 146 return tex instanceof J2DTexture; 147 } 148 149 public int getMaximumTextureSize() { 150 return Integer.MAX_VALUE; 151 } 152 153 public boolean isFormatSupported(PixelFormat format) { 154 switch (format) { 155 case BYTE_RGB: 156 case BYTE_GRAY: 157 case INT_ARGB_PRE: 158 case BYTE_BGRA_PRE: 159 return true; 160 case BYTE_ALPHA: 161 case BYTE_APPLE_422: 162 case MULTI_YCbCr_420: 163 case FLOAT_XYZW: 164 default: 165 return false; 166 } 167 } 168 | 129 MediaFrame newFrame = vdb.convertToFormat(PixelFormat.INT_ARGB_PRE); 130 vdb.releaseFrame(); 131 vdb = newFrame; 132 if (null == vdb) { 133 // FIXME: error condition? 134 return null; 135 } 136 } 137 138 tex = J2DTexture.create(vdb.getPixelFormat(), WrapMode.CLAMP_TO_EDGE, 139 vdb.getWidth(), vdb.getHeight()); 140 vdb.releaseFrame(); 141 return tex; 142 } 143 144 @Override 145 public boolean isCompatibleTexture(Texture tex) { 146 return tex instanceof J2DTexture; 147 } 148 149 @Override 150 protected boolean canClampToZero() { 151 return false; 152 } 153 154 public int getMaximumTextureSize() { 155 return Integer.MAX_VALUE; 156 } 157 158 public boolean isFormatSupported(PixelFormat format) { 159 switch (format) { 160 case BYTE_RGB: 161 case BYTE_GRAY: 162 case INT_ARGB_PRE: 163 case BYTE_BGRA_PRE: 164 return true; 165 case BYTE_ALPHA: 166 case BYTE_APPLE_422: 167 case MULTI_YCbCr_420: 168 case FLOAT_XYZW: 169 default: 170 return false; 171 } 172 } 173 |