@Override public Deque<Pair<PathReal, PathVirtual>> getMountedArchives() { final Deque<Pair<PathReal, PathVirtual>> result = new ArrayDeque<Pair<PathReal, PathVirtual>>(); final Iterator<Archive<?>> iter = this.archive_list.descendingIterator(); while (iter.hasNext()) { final Archive<?> a = iter.next(); final Pair<PathReal, PathVirtual> p = Pair.pair(a.getRealPath(), a.getMountPath()); result.push(p); } return result; }
/** * Return a new pair {@code (left, right)}. * * @param <A> The type of left values. * @param <B> The type of right values. * @param left The left value * @param right The right value * * @return A new pair */ public static <A, B> Pair<A, B> pair( final A left, final B right) { return new Pair<A, B>(left, right); }
private static R2LightBufferType newDiffuseOnly( final JCGLFramebuffersType g_fb, final R2LightBufferDescriptionType desc, final List<JCGLFramebufferColorAttachmentPointType> points, final List<JCGLFramebufferDrawBufferType> buffers, final Pair<JCGLTextureUnitType, JCGLTexture2DType> p_depth, final Pair<JCGLTextureUnitType, JCGLTexture2DType> p_diff) { final R2Texture2DType rt_depth = R2Texture2DStatic.of(p_depth.getRight()); final R2Texture2DType rt_diff = R2Texture2DStatic.of(p_diff.getRight()); final JCGLFramebufferBuilderType fbb = g_fb.framebufferNewBuilder(); fbb.attachColorTexture2DAt( points.get(0), buffers.get(0), rt_diff.texture()); fbb.attachDepthStencilTexture2D(rt_depth.texture()); final JCGLFramebufferType fb = g_fb.framebufferAllocate(fbb); return new R2LightBuffers.LightBufferDiffuseOnly( fb, desc, rt_depth, rt_diff); }
private static R2LightBufferType newDiffuseSpecular( final JCGLFramebuffersType g_fb, final R2LightBufferDescriptionType desc, final List<JCGLFramebufferColorAttachmentPointType> points, final List<JCGLFramebufferDrawBufferType> buffers, final Pair<JCGLTextureUnitType, JCGLTexture2DType> p_depth, final Pair<JCGLTextureUnitType, JCGLTexture2DType> p_diff, final Pair<JCGLTextureUnitType, JCGLTexture2DType> p_spec) { final R2Texture2DType rt_depth = R2Texture2DStatic.of(p_depth.getRight()); final R2Texture2DType rt_diff = R2Texture2DStatic.of(p_diff.getRight()); final R2Texture2DType rt_spec = R2Texture2DStatic.of(p_spec.getRight()); final JCGLFramebufferBuilderType fbb = g_fb.framebufferNewBuilder(); fbb.attachColorTexture2DAt( points.get(0), buffers.get(0), rt_diff.texture()); fbb.attachColorTexture2DAt( points.get(1), buffers.get(1), rt_spec.texture()); fbb.attachDepthStencilTexture2D(rt_depth.texture()); final JCGLFramebufferType fb = g_fb.framebufferAllocate(fbb); return new R2LightBuffers.LightBufferDiffuseSpecular( fb, desc, rt_depth, rt_diff, rt_spec); }
private static R2LightBufferType newSpecularOnly( final JCGLFramebuffersType g_fb, final R2LightBufferDescriptionType desc, final List<JCGLFramebufferColorAttachmentPointType> points, final List<JCGLFramebufferDrawBufferType> buffers, final Pair<JCGLTextureUnitType, JCGLTexture2DType> p_depth, final Pair<JCGLTextureUnitType, JCGLTexture2DType> p_spec) { final R2Texture2DType rt_depth = R2Texture2DStatic.of(p_depth.getRight()); final R2Texture2DType rt_spec = R2Texture2DStatic.of(p_spec.getRight()); final JCGLFramebufferBuilderType fbb = g_fb.framebufferNewBuilder(); fbb.attachColorTexture2DAt( points.get(1), buffers.get(1), rt_spec.texture()); fbb.attachDepthStencilTexture2D(rt_depth.texture()); final JCGLFramebufferType fb = g_fb.framebufferAllocate(fbb); return new R2LightBuffers.LightBufferSpecularOnly( fb, desc, rt_depth, rt_spec); }
final int minor = Integer.parseUnsignedInt(text.get(2)); schema_version = Optional.of(Pair.pair( Integer.valueOf(major), Integer.valueOf(minor)));
private String matchString() { final StringBuilder sb = new StringBuilder(64); if (this.name.isPresent()) { sb.append(this.name.get().value()); } else { sb.append("-"); } sb.append(" "); if (this.version.isPresent()) { sb.append(Integer.toUnsignedString( this.version.get().getLeft().intValue())); sb.append(" "); sb.append(Integer.toUnsignedString( this.version.get().getRight().intValue())); } else { sb.append("-"); } return sb.toString(); } }
private static R2MaskBuffer createMaskBufferWithCreated( final JCGLFramebuffersType g_fb, final JCGLTexturesType g_t, final R2MaskBufferDescriptionType desc, final UnsignedRangeInclusiveL range_x, final UnsignedRangeInclusiveL range_y, final JCGLTextureUnitContextMutableType cc, final JCGLFramebufferBuilderType fbb, final R2Texture2DType rt, final R2DepthAttachmentCreateType create) { final JCGLTextureFormat format = depthFormatForPrecision(create.precision()); final Pair<JCGLTextureUnitType, JCGLTexture2DType> pd = cc.unitContextAllocateTexture2D( g_t, range_x.getInterval(), range_y.getInterval(), format, JCGLTextureWrapS.TEXTURE_WRAP_CLAMP_TO_EDGE, JCGLTextureWrapT.TEXTURE_WRAP_CLAMP_TO_EDGE, JCGLTextureFilterMinification.TEXTURE_FILTER_NEAREST, JCGLTextureFilterMagnification.TEXTURE_FILTER_NEAREST); final JCGLTexture2DType td = pd.getRight(); fbb.attachDepthTexture2D(td); final JCGLFramebufferType fb = g_fb.framebufferAllocate(fbb); return new R2MaskBuffer( fb, desc, rt, R2Texture2DStatic.of(td), null); }
this.bindings[this.next] = t; ++this.next; return Pair.pair(u, t);
@Override void run( final LogUsableType log, final PrintStream out, final ShellConfig config, final FilesystemType fs) throws FilesystemError { final Deque<Pair<PathReal, PathVirtual>> mounts = fs.getMountedArchives(); int longest = 0; for (final Pair<PathReal, PathVirtual> pair : mounts) { longest = Math.max(longest, pair.getRight().toString().length()); } longest += 2; for (final Pair<PathReal, PathVirtual> pair : mounts) { out.print(pair.getRight()); ShellCommand.printPadSpace(out, longest, pair .getRight() .toString() .length()); out.println(pair.getLeft().toString()); } }
private static R2ImageBuffer createImageBufferWithCreated( final JCGLFramebuffersType g_fb, final JCGLTexturesType g_t, final R2ImageBufferDescriptionType desc, final UnsignedRangeInclusiveL range_x, final UnsignedRangeInclusiveL range_y, final JCGLTextureUnitContextMutableType cc, final JCGLFramebufferBuilderType fbb, final R2Texture2DType rt, final R2DepthAttachmentCreateType create) { final JCGLTextureFormat format = depthFormatForPrecision(create.precision()); final Pair<JCGLTextureUnitType, JCGLTexture2DType> pd = cc.unitContextAllocateTexture2D( g_t, range_x.getInterval(), range_y.getInterval(), format, JCGLTextureWrapS.TEXTURE_WRAP_CLAMP_TO_EDGE, JCGLTextureWrapT.TEXTURE_WRAP_CLAMP_TO_EDGE, JCGLTextureFilterMinification.TEXTURE_FILTER_NEAREST, JCGLTextureFilterMagnification.TEXTURE_FILTER_NEAREST); final JCGLTexture2DType td = pd.getRight(); fbb.attachDepthTexture2D(td); final JCGLFramebufferType fb = g_fb.framebufferAllocate(fbb); return new R2ImageBuffer( fb, desc, rt, R2Texture2DStatic.of(td), null); }
this.bindings[this.next] = t; ++this.next; return Pair.pair(u, t);
final R2Texture2DType rt_rgba = R2Texture2DStatic.of(p_rgba.getRight()); final R2Texture2DType rt_depth = R2Texture2DStatic.of(p_depth.getRight()); final R2Texture2DType rt_norm = R2Texture2DStatic.of(p_norm.getRight()); R2Texture2DType rt_spec = null; rt_norm.texture()); if (p_spec != null) { rt_spec = R2Texture2DStatic.of(p_spec.getRight()); fbb.attachColorTexture2DAt( points.get(2),
return Pair.pair(c_master, c_slave);
final R2Texture2DType rt = R2Texture2DStatic.of(p.getRight()); fbb.attachColorTexture2DAt(points.get(0), buffers.get(0), rt.texture());
return Pair.pair(c_master, c_slave);