public static BytePtr PDJPG_EmitTagLayer(PDJPG_Context ctx, BytePtr ct, string name) { BytePtr ctt; int i; //ctx.huff.ct = ct; ctx.huff.win = 0; ctx.huff.pos = 0; //ctx.huff.InitOutputStream(ctx, ct); ct.emit(0xFF); ct.emit(JPG.JPG_APP11); ctt = ct; ct.emit(0x00); ct.emit(0x00); ct.EmitString("TagLayer"); ct.EmitString(name); i = ct - ctt; ctt[0] = (i >> 8) & 0xFF; ctt[1] = i & 0xFF; return (ct); }
public static BytePtr PDJPG_EmitMarkerJFIF(PDJPG_Context ctx, BytePtr ct) { BytePtr ctt; int i; if (ctx.jpg_clrtrans != PDJPG_CLRS_YCBCR) return (ct); //ctx.huff.ct = ct; ctx.huff.win = 0; ctx.huff.pos = 0; //ctx.huff.InitOutputStream(ctx, ct); ct.emit(0xFF); ct.emit(JPG.JPG_APP0); ctt = ct; ct.emit(0x00); ct.emit(0x00); ct.EmitString("JFIF"); //PDJPG_WriteString(ctx, "JFIF"); ct.emit(0x01); //version high ct.emit(0x02); //version low ct.emit(0x00); //no units ct.emit(0x00); //X density ct.emit(0x01); ct.emit(0x00); //Y density ct.emit(0x01); ct.emit(0x00); //thumbnail ct.emit(0x00); // ctx.huff.WriteString(ctx, name); i = ct - ctt; ctt[0] = (i >> 8) & 0xFF; ctt[1] = i & 0xFF; return (ct); }