在Delphi 7中处理CMYK jpeg文件 [英] handling CMYK jpeg files in Delphi 7

查看:207
本文介绍了在Delphi 7中处理CMYK jpeg文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试访问存储为Jpeg文件的文件,是否有一种简单的方法来显示这些图像文件而没有性能损失?

I am trying to access files that are stored as Jpeg files, is there an easy way to display these image files without performance loss ?

推荐答案

我发现这个页面

http://cc.embarcadero.com/Item/19723

http://cc.embarcadero.com/Item/19723

增强jpeg实现

作者:Gabriel Corneanu

Author: Gabriel Corneanu

本单元包含一个新的jpeg实现(基于Delphi原创)

This unit contains a new jpeg implementation (based on Delphi original)


  • 修复错误访问一个像素高度图片

  • 添加了无损转换支持jpeg图像(基于Thomas G. Lane C库 - 访问 jpegclub.org/jpegtran

  • 添加CMYK支持(只读)

  • 编译为D5-2010和BCB5-6-CMYK到RGB快速MMX转换(不适用于Delphi5,缺少MMX ASM)(如果没有,则返回到简单的pascal实现可用)

  • 在Delphi 5 ASM(CMYK到RGB功能)中修复错误

  • fixed bug accessing one pixel height picture
  • added lossless transformation support for jpeg images (based on Thomas G. Lane C library - visit jpegclub.org/jpegtran )
  • added CMYK support (read only)
  • compiled for D5-2010 AND BCB5-6-CMYK to RGB fast MMX conversion (not for Delphi5, lack of MMX ASM) (fallback to simple pascal implementation if not available)
  • fixed bug in Delphi 5 ASM (CMYK to RGB function)

你只需要jpeg.dcu文件;它可以复制到程序目录或LIB目录中。我生成的obj和hpp文件与CBuilder 5和6一起使用。这就是您需要使用它:

You only need the jpeg.dcu file; it can be copied to program directory or to the LIB directory.I generated obj and hpp files for use with CBuilder 5 and 6 also.This is what you need to use it:

这只是一个枚举

TJpegTransform = ( 
     jt_FLIP_H,     { horizontal flip }
     jt_FLIP_V,     { vertical flip }
     jt_TRANSPOSE,  { transpose across UL-to-LR axis } 
     jt_TRANSVERSE, { transpose across UR-to-LL axis } 
     jt_ROT_90,     { 90-degree clockwise rotation } 
     jt_ROT_180,    { 180-degree rotation } 
     jt_ROT_270     { 270-degree clockwise (or 90 ccw) } 
);

procedure Crop(xoffs,yoffs,newwidth,newheight:integer); 此方法裁剪图像

程序转换(操作:TJpegTransform); 此方法正在应用指定的转换;阅读关于限制的transupp.h注释(我的代码是使用裁剪选项)

procedure Transform(Operation: TJpegTransform);this method is applying the specified transformation; read the transupp.h comments about limitations(my code is using crop option)

属性IsCMYK:boolean read FIsCMYK; 这将指示如果加载的最后一个jpeg图像是CMYK编码的

property IsCMYK: boolean read FIsCMYK; this will indicate if the last jpeg image loaded is CMYK encoded

属性InverseCMYK:boolean read FInverseCMYK write SetInverseCMYK; 如果设置(默认,因为我只能找到这种图像),CMYK图像被解码与反转CMYK值(我看到Photoshop正在做这个)。

property InverseCMYK: boolean read FInverseCMYK write SetInverseCMYK;if set (default, because I could only find this kind of images), the CMYK image is decoded with inversed CMYK values (I read that Photoshop is doing this).

jpegex是使用不同名称编译的单位。当没有源代码链接到原始jpeg单元时,可以使用它来避免冲突。在这种情况下,您可能需要使用合格的类名来解决名称冲突:jpegex.TJpegImage.xxx。当您在一个程序中使用这两个版本时,请小心:即使这些类具有相同的名称,它们也不相同,也不能直接转换或分配。交换数据的唯一方法是从流中保存到/加载。

The jpegex is the same unit compiled with a different name. It can be used to avoid conflicts when you have other components without source code linking to the original jpeg unit. In this case you might need to use qualified class names to solve names conflict: jpegex.TJpegImage.xxx. Be carefull when you use both versions in one program: even though the classes have the same name, they are not identical and you can't cast or assign them directly. The only way to exchange data is saving to/loading from a stream.

发送评论至:
gabrielcorneanuATyahooDOTcom

Send comments to: gabrielcorneanuATyahooDOTcom

这篇关于在Delphi 7中处理CMYK jpeg文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆