You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Factory.java 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. /* $Id$ */
  18. package org.apache.fop.afp;
  19. import java.io.OutputStream;
  20. import org.apache.commons.logging.Log;
  21. import org.apache.commons.logging.LogFactory;
  22. import org.apache.fop.afp.goca.GraphicsData;
  23. import org.apache.fop.afp.ioca.ImageContent;
  24. import org.apache.fop.afp.ioca.ImageRasterData;
  25. import org.apache.fop.afp.ioca.ImageSegment;
  26. import org.apache.fop.afp.ioca.ImageSizeParameter;
  27. import org.apache.fop.afp.modca.ActiveEnvironmentGroup;
  28. import org.apache.fop.afp.modca.ContainerDataDescriptor;
  29. import org.apache.fop.afp.modca.Document;
  30. import org.apache.fop.afp.modca.GraphicsDataDescriptor;
  31. import org.apache.fop.afp.modca.GraphicsObject;
  32. import org.apache.fop.afp.modca.IMImageObject;
  33. import org.apache.fop.afp.modca.ImageDataDescriptor;
  34. import org.apache.fop.afp.modca.ImageObject;
  35. import org.apache.fop.afp.modca.IncludeObject;
  36. import org.apache.fop.afp.modca.IncludePageSegment;
  37. import org.apache.fop.afp.modca.InvokeMediumMap;
  38. import org.apache.fop.afp.modca.MapCodedFont;
  39. import org.apache.fop.afp.modca.MapContainerData;
  40. import org.apache.fop.afp.modca.MapDataResource;
  41. import org.apache.fop.afp.modca.ObjectAreaDescriptor;
  42. import org.apache.fop.afp.modca.ObjectAreaPosition;
  43. import org.apache.fop.afp.modca.ObjectContainer;
  44. import org.apache.fop.afp.modca.ObjectEnvironmentGroup;
  45. import org.apache.fop.afp.modca.Overlay;
  46. import org.apache.fop.afp.modca.PageDescriptor;
  47. import org.apache.fop.afp.modca.PageGroup;
  48. import org.apache.fop.afp.modca.PageObject;
  49. import org.apache.fop.afp.modca.PresentationEnvironmentControl;
  50. import org.apache.fop.afp.modca.PresentationTextDescriptor;
  51. import org.apache.fop.afp.modca.PresentationTextObject;
  52. import org.apache.fop.afp.modca.ResourceEnvironmentGroup;
  53. import org.apache.fop.afp.modca.ResourceGroup;
  54. import org.apache.fop.afp.modca.ResourceObject;
  55. import org.apache.fop.afp.modca.StreamedResourceGroup;
  56. import org.apache.fop.afp.modca.TagLogicalElement;
  57. import org.apache.fop.afp.util.StringUtils;
  58. /**
  59. * Creator of MO:DCA structured field objects
  60. */
  61. public class Factory {
  62. /** Static logging instance */
  63. private static final Log log = LogFactory.getLog(Factory.class); // CSOK: ConstantName
  64. private static final String OBJECT_ENVIRONMENT_GROUP_NAME_PREFIX = "OEG";
  65. private static final String ACTIVE_ENVIRONMENT_GROUP_NAME_PREFIX = "AEG";
  66. private static final String IMAGE_NAME_PREFIX = "IMG";
  67. private static final String GRAPHIC_NAME_PREFIX = "GRA";
  68. private static final String BARCODE_NAME_PREFIX = "BAR";
  69. // private static final String OTHER_NAME_PREFIX = "OTH";
  70. private static final String OBJECT_CONTAINER_NAME_PREFIX = "OC";
  71. private static final String RESOURCE_NAME_PREFIX = "RES";
  72. private static final String RESOURCE_GROUP_NAME_PREFIX = "RG";
  73. private static final String PAGE_GROUP_NAME_PREFIX = "PGP";
  74. private static final String PAGE_NAME_PREFIX = "PGN";
  75. private static final String OVERLAY_NAME_PREFIX = "OVL";
  76. private static final String PRESENTATION_TEXT_NAME_PREFIX = "PT";
  77. private static final String DOCUMENT_NAME_PREFIX = "DOC";
  78. private static final String IM_IMAGE_NAME_PREFIX = "IMIMG";
  79. private static final String IMAGE_SEGMENT_NAME_PREFIX = "IS";
  80. /** the page group count */
  81. private int pageGroupCount = 0;
  82. /** the page count */
  83. private int pageCount = 0;
  84. /** the image count */
  85. private int imageCount = 0;
  86. /** the im image count */
  87. private int imImageCount = 0;
  88. /** the image segment count */
  89. private int imageSegmentCount = 0;
  90. /** the graphic count */
  91. private int graphicCount = 0;
  92. /** the object container count */
  93. private int objectContainerCount = 0;
  94. /** the resource count */
  95. private int resourceCount = 0;
  96. /** the resource group count */
  97. private int resourceGroupCount = 0;
  98. /** the overlay count */
  99. private int overlayCount = 0;
  100. /** the presentation text object count */
  101. private int textObjectCount = 0;
  102. /** the active environment group count */
  103. private int activeEnvironmentGroupCount = 0;
  104. /** the document count */
  105. private int documentCount = 0;
  106. /** the object environment group count */
  107. private int objectEnvironmentGroupCount = 0;
  108. /**
  109. * Main constructor
  110. */
  111. public Factory() {
  112. }
  113. /**
  114. * Creates a new IOCA {@link ImageObject}
  115. *
  116. * @return a new {@link ImageObject}
  117. */
  118. public ImageObject createImageObject() {
  119. String name = IMAGE_NAME_PREFIX
  120. + StringUtils.lpad(String.valueOf(++imageCount), '0', 5);
  121. ImageObject imageObject = new ImageObject(this, name);
  122. return imageObject;
  123. }
  124. /**
  125. * Creates an IOCA {@link IMImageObject}
  126. *
  127. * @return a new {@link IMImageObject}
  128. */
  129. public IMImageObject createIMImageObject() {
  130. String name = IM_IMAGE_NAME_PREFIX
  131. + StringUtils.lpad(String.valueOf(++imImageCount), '0', 3);
  132. IMImageObject imImageObject = new IMImageObject(name);
  133. return imImageObject;
  134. }
  135. /**
  136. * Creates a new GOCA {@link GraphicsObject}
  137. *
  138. * @return a new {@link GraphicsObject}
  139. */
  140. public GraphicsObject createGraphicsObject() {
  141. String name = GRAPHIC_NAME_PREFIX
  142. + StringUtils.lpad(String.valueOf(++graphicCount), '0', 5);
  143. GraphicsObject graphicsObj = new GraphicsObject(this, name);
  144. return graphicsObj;
  145. }
  146. /**
  147. * Creates a new MO:DCA {@link ObjectContainer}
  148. *
  149. * @return a new {@link ObjectContainer}
  150. */
  151. public ObjectContainer createObjectContainer() {
  152. String name = OBJECT_CONTAINER_NAME_PREFIX
  153. + StringUtils.lpad(String.valueOf(++objectContainerCount), '0', 6);
  154. return new ObjectContainer(this, name);
  155. }
  156. /**
  157. * Creates a new MO:DCA {@link ResourceObject}
  158. *
  159. * @param resourceName the resource object name
  160. * @return a new {@link ResourceObject}
  161. */
  162. public ResourceObject createResource(String resourceName) {
  163. return new ResourceObject(resourceName);
  164. }
  165. /**
  166. * Creates a new MO:DCA {@link ResourceObject}
  167. *
  168. * @return a new {@link ResourceObject}
  169. */
  170. public ResourceObject createResource() {
  171. String name = RESOURCE_NAME_PREFIX
  172. + StringUtils.lpad(String.valueOf(++resourceCount), '0', 5);
  173. return createResource(name);
  174. }
  175. /**
  176. * Creates a new MO:DCA {@link PageGroup}
  177. * @param tleSequence current start tle sequence number within stream
  178. * @return a new {@link PageGroup}
  179. */
  180. public PageGroup createPageGroup(int tleSequence) {
  181. String name = PAGE_GROUP_NAME_PREFIX
  182. + StringUtils.lpad(String.valueOf(++pageGroupCount), '0', 5);
  183. return new PageGroup(this, name, tleSequence);
  184. }
  185. /**
  186. * Creates a new MO:DCA {@link ActiveEnvironmentGroup}
  187. *
  188. * @param width the page width
  189. * @param height the page height
  190. * @param widthRes the page width resolution
  191. * @param heightRes the page height resolution
  192. * @return a new {@link ActiveEnvironmentGroup}
  193. */
  194. public ActiveEnvironmentGroup createActiveEnvironmentGroup(
  195. int width, int height, int widthRes, int heightRes) {
  196. String name = ACTIVE_ENVIRONMENT_GROUP_NAME_PREFIX
  197. + StringUtils.lpad(String.valueOf(++activeEnvironmentGroupCount ), '0', 5);
  198. return new ActiveEnvironmentGroup(this, name, width, height, widthRes, heightRes);
  199. }
  200. /**
  201. * Creates a new MO:DCA {@link ResourceGroup}
  202. *
  203. * @return a new {@link ResourceGroup}
  204. */
  205. public ResourceGroup createResourceGroup() {
  206. String name = RESOURCE_GROUP_NAME_PREFIX
  207. + StringUtils.lpad(String.valueOf(++resourceGroupCount), '0', 6);
  208. return new ResourceGroup(name);
  209. }
  210. /**
  211. * Creates a new MO:DCA {@link StreamedResourceGroup}
  212. *
  213. * @param os the outputstream of the streamed resource group
  214. * @return a new {@link StreamedResourceGroup}
  215. */
  216. public StreamedResourceGroup createStreamedResourceGroup(OutputStream os) {
  217. String name = RESOURCE_GROUP_NAME_PREFIX
  218. + StringUtils.lpad(String.valueOf(++resourceGroupCount), '0', 6);
  219. return new StreamedResourceGroup(name, os);
  220. }
  221. /**
  222. * Creates a new MO:DCA {@link PageObject}.
  223. *
  224. * @param pageWidth
  225. * the width of the page
  226. * @param pageHeight
  227. * the height of the page
  228. * @param pageRotation
  229. * the rotation of the page
  230. * @param pageWidthRes
  231. * the width resolution of the page
  232. * @param pageHeightRes
  233. * the height resolution of the page
  234. *
  235. * @return a new {@link PageObject}
  236. */
  237. public PageObject createPage(int pageWidth, int pageHeight, int pageRotation,
  238. int pageWidthRes, int pageHeightRes) {
  239. String pageName = PAGE_NAME_PREFIX
  240. + StringUtils.lpad(String.valueOf(++pageCount), '0', 5);
  241. return new PageObject(this, pageName, pageWidth, pageHeight,
  242. pageRotation, pageWidthRes, pageHeightRes);
  243. }
  244. /**
  245. * Creates a new MO:DCA {@link PresentationTextObject}.
  246. *
  247. * @return a new {@link PresentationTextObject}
  248. */
  249. public PresentationTextObject createPresentationTextObject() {
  250. String textObjectName = PRESENTATION_TEXT_NAME_PREFIX
  251. + StringUtils.lpad(String.valueOf(++textObjectCount), '0', 6);
  252. return new PresentationTextObject(textObjectName);
  253. }
  254. /**
  255. * Creates a new MO:DCA {@link Overlay}.
  256. *
  257. * @param width
  258. * the width of the overlay
  259. * @param height
  260. * the height of the overlay
  261. * @param widthRes
  262. * the width resolution of the overlay
  263. * @param heightRes
  264. * the height resolution of the overlay
  265. * @param overlayRotation
  266. * the rotation of the overlay
  267. *
  268. * @return a new {@link Overlay}.
  269. */
  270. public Overlay createOverlay(int width, int height,
  271. int widthRes, int heightRes, int overlayRotation) {
  272. String overlayName = OVERLAY_NAME_PREFIX
  273. + StringUtils.lpad(String.valueOf(++overlayCount), '0', 5);
  274. Overlay overlay = new Overlay(this, overlayName, width, height,
  275. overlayRotation, widthRes, heightRes);
  276. return overlay;
  277. }
  278. /**
  279. * Creates a MO:DCA {@link Document}
  280. *
  281. * @return a new {@link Document}
  282. */
  283. public Document createDocument() {
  284. String documentName = DOCUMENT_NAME_PREFIX
  285. + StringUtils.lpad(String.valueOf(++documentCount), '0', 5);
  286. Document document = new Document(this, documentName);
  287. return document;
  288. }
  289. /**
  290. * Creates a MO:DCA {@link MapCodedFont}
  291. *
  292. * @return a new {@link MapCodedFont}
  293. */
  294. public MapCodedFont createMapCodedFont() {
  295. MapCodedFont mapCodedFont = new MapCodedFont();
  296. return mapCodedFont;
  297. }
  298. /**
  299. * Creates a MO:DCA {@link IncludePageSegment}
  300. *
  301. * @param name the page segment name
  302. * @param x the x coordinate
  303. * @param y the y coordinate
  304. *
  305. * @return a new {@link IncludePageSegment}
  306. */
  307. public IncludePageSegment createIncludePageSegment(String name, int x, int y) {
  308. IncludePageSegment includePageSegment = new IncludePageSegment(name, x, y);
  309. return includePageSegment;
  310. }
  311. /**
  312. * Creates a MO:DCA {@link IncludeObject}
  313. *
  314. * @param name the name of this include object
  315. * @return a new {@link IncludeObject}
  316. */
  317. public IncludeObject createInclude(String name) {
  318. IncludeObject includeObject = new IncludeObject(name);
  319. return includeObject;
  320. }
  321. /**
  322. * Creates a MO:DCA {@link TagLogicalElement}
  323. *
  324. * @param name name of the element
  325. * @param value value of the element
  326. * @param tleSequence current start tle sequence number within stream*
  327. * @return a new {@link TagLogicalElement}
  328. */
  329. public TagLogicalElement createTagLogicalElement(String name, String value, int tleSequence) {
  330. TagLogicalElement tle = new TagLogicalElement(name, value, tleSequence);
  331. return tle;
  332. }
  333. /**
  334. * Creates a new {@link DataStream}
  335. *
  336. * @param paintingState the AFP painting state
  337. * @param outputStream an outputstream to write to
  338. * @return a new {@link DataStream}
  339. */
  340. public DataStream createDataStream(AFPPaintingState paintingState, OutputStream outputStream) {
  341. DataStream dataStream = new DataStream(this, paintingState, outputStream);
  342. return dataStream;
  343. }
  344. /**
  345. * Creates a new MO:DCA {@link PageDescriptor}
  346. *
  347. * @param width the page width.
  348. * @param height the page height.
  349. * @param widthRes the page width resolution.
  350. * @param heightRes the page height resolution.
  351. * @return a new {@link PageDescriptor}
  352. */
  353. public PageDescriptor createPageDescriptor(int width, int height, int widthRes, int heightRes) {
  354. PageDescriptor pageDescriptor = new PageDescriptor(width, height, widthRes, heightRes);
  355. return pageDescriptor;
  356. }
  357. /**
  358. * Returns a new MO:DCA {@link ObjectEnvironmentGroup}
  359. *
  360. * @return a new {@link ObjectEnvironmentGroup}
  361. */
  362. public ObjectEnvironmentGroup createObjectEnvironmentGroup() {
  363. String oegName = OBJECT_ENVIRONMENT_GROUP_NAME_PREFIX
  364. + StringUtils.lpad(String.valueOf(++objectEnvironmentGroupCount), '0', 5);
  365. ObjectEnvironmentGroup objectEnvironmentGroup = new ObjectEnvironmentGroup(oegName);
  366. return objectEnvironmentGroup;
  367. }
  368. /**
  369. * Creates a new GOCA {@link GraphicsData}
  370. *
  371. * @return a new {@link GraphicsData}
  372. */
  373. public GraphicsData createGraphicsData() {
  374. GraphicsData graphicsData = new GraphicsData();
  375. return graphicsData;
  376. }
  377. /**
  378. * Creates a new {@link ObjectAreaDescriptor}
  379. *
  380. * @param width the object width.
  381. * @param height the object height.
  382. * @param widthRes the object width resolution.
  383. * @param heightRes the object height resolution.
  384. * @return a new {@link ObjectAreaDescriptor}
  385. */
  386. public ObjectAreaDescriptor createObjectAreaDescriptor(
  387. int width, int height, int widthRes, int heightRes) {
  388. ObjectAreaDescriptor objectAreaDescriptor
  389. = new ObjectAreaDescriptor(width, height, widthRes, heightRes);
  390. return objectAreaDescriptor;
  391. }
  392. /**
  393. * Creates a new {@link ObjectAreaPosition}
  394. *
  395. * @param x the x coordinate.
  396. * @param y the y coordinate.
  397. * @param rotation the coordinate system rotation (must be 0, 90, 180, 270).
  398. * @return a new {@link ObjectAreaPosition}
  399. */
  400. public ObjectAreaPosition createObjectAreaPosition(int x, int y,
  401. int rotation) {
  402. ObjectAreaPosition objectAreaPosition = new ObjectAreaPosition(
  403. x, y, rotation);
  404. return objectAreaPosition;
  405. }
  406. /**
  407. * Creates a new {@link ImageDataDescriptor}
  408. *
  409. * @param width the image width
  410. * @param height the image height
  411. * @param widthRes the x resolution of the image
  412. * @param heightRes the y resolution of the image
  413. * @return a new {@link ImageDataDescriptor}
  414. */
  415. public ImageDataDescriptor createImageDataDescriptor(
  416. int width, int height, int widthRes, int heightRes) {
  417. ImageDataDescriptor imageDataDescriptor = new ImageDataDescriptor(
  418. width, height, widthRes, heightRes);
  419. return imageDataDescriptor;
  420. }
  421. /**
  422. * Creates a new GOCA {@link GraphicsDataDescriptor}
  423. *
  424. * @param xlwind the left edge of the graphics window
  425. * @param xrwind the right edge of the graphics window
  426. * @param ybwind the top edge of the graphics window
  427. * @param ytwind the bottom edge of the graphics window
  428. * @param widthRes the x resolution of the graphics window
  429. * @param heightRes the y resolution of the graphics window
  430. * @return a new {@link GraphicsDataDescriptor}
  431. */
  432. public GraphicsDataDescriptor createGraphicsDataDescriptor(
  433. int xlwind, int xrwind, int ybwind, int ytwind, int widthRes, int heightRes) {
  434. GraphicsDataDescriptor graphicsDataDescriptor = new GraphicsDataDescriptor(
  435. xlwind, xrwind, ybwind, ytwind, widthRes, heightRes);
  436. return graphicsDataDescriptor;
  437. }
  438. /**
  439. * Creates a new MO:DCA {@link ContainerDataDescriptor}
  440. *
  441. * @param dataWidth the container data width
  442. * @param dataHeight the container data height
  443. * @param widthRes the container data width resolution
  444. * @param heightRes the container data height resolution
  445. * @return a new {@link ContainerDataDescriptor}
  446. */
  447. public ContainerDataDescriptor createContainerDataDescriptor(
  448. int dataWidth, int dataHeight, int widthRes, int heightRes) {
  449. ContainerDataDescriptor containerDataDescriptor
  450. = new ContainerDataDescriptor(dataWidth, dataHeight, widthRes, heightRes);
  451. return containerDataDescriptor;
  452. }
  453. /**
  454. * Creates a new MO:DCA {@link MapContainerData}
  455. *
  456. * @param optionValue the option value
  457. * @return a new {@link MapContainerData}
  458. */
  459. public MapContainerData createMapContainerData(byte optionValue) {
  460. MapContainerData mapContainerData = new MapContainerData(optionValue);
  461. return mapContainerData;
  462. }
  463. /**
  464. * Creates a new MO:DCA {@link MapDataResource}
  465. *
  466. * @return a new {@link MapDataResource}
  467. */
  468. public MapDataResource createMapDataResource() {
  469. MapDataResource mapDataResource = new MapDataResource();
  470. return mapDataResource;
  471. }
  472. /**
  473. * Creates a new PTOCA {@link PresentationTextDescriptor}
  474. * @param width presentation width
  475. * @param height presentation height
  476. * @param widthRes resolution of presentation width
  477. * @param heightRes resolution of presentation height
  478. * @return a new {@link PresentationTextDescriptor}
  479. */
  480. public PresentationTextDescriptor createPresentationTextDataDescriptor(
  481. int width, int height, int widthRes, int heightRes) {
  482. PresentationTextDescriptor presentationTextDescriptor
  483. = new PresentationTextDescriptor(width, height,
  484. widthRes, heightRes);
  485. return presentationTextDescriptor;
  486. }
  487. /**
  488. * Creates a new MO:DCA {@link PresentationEnvironmentControl}
  489. *
  490. * @return a new {@link PresentationEnvironmentControl}
  491. */
  492. public PresentationEnvironmentControl createPresentationEnvironmentControl() {
  493. PresentationEnvironmentControl presentationEnvironmentControl
  494. = new PresentationEnvironmentControl();
  495. return presentationEnvironmentControl;
  496. }
  497. /**
  498. * Creates a new MO:DCA {@link InvokeMediumMap}
  499. *
  500. * @param name the object name
  501. * @return a new {@link InvokeMediumMap}
  502. */
  503. public InvokeMediumMap createInvokeMediumMap(String name) {
  504. InvokeMediumMap invokeMediumMap = new InvokeMediumMap(name);
  505. return invokeMediumMap;
  506. }
  507. /**
  508. * Creates a new MO:DCA {@link ResourceEnvironmentGroup}
  509. *
  510. * @return a new {@link ResourceEnvironmentGroup}
  511. */
  512. public ResourceEnvironmentGroup createResourceEnvironmentGroup() {
  513. ResourceEnvironmentGroup resourceEnvironmentGroup = new ResourceEnvironmentGroup();
  514. return resourceEnvironmentGroup;
  515. }
  516. /**
  517. * Creates a new IOCA {@link ImageSegment}
  518. *
  519. * @return a new {@link ImageSegment}
  520. */
  521. public ImageSegment createImageSegment() {
  522. String name = IMAGE_SEGMENT_NAME_PREFIX
  523. + StringUtils.lpad(String.valueOf(++imageSegmentCount), '0', 2);
  524. ImageSegment imageSegment = new ImageSegment(this, name);
  525. return imageSegment;
  526. }
  527. /**
  528. * Creates an new IOCA {@link ImageContent}
  529. *
  530. * @return an {@link ImageContent}
  531. */
  532. public ImageContent createImageContent() {
  533. ImageContent imageContent = new ImageContent();
  534. return imageContent;
  535. }
  536. /**
  537. * Creates a new IOCA {@link ImageRasterData}
  538. *
  539. * @param rasterData raster data
  540. * @return a new {@link ImageRasterData}
  541. */
  542. public ImageRasterData createImageRasterData(byte[] rasterData) {
  543. ImageRasterData imageRasterData = new ImageRasterData(rasterData);
  544. return imageRasterData;
  545. }
  546. /**
  547. * Creates an new IOCA {@link ImageSizeParameter}.
  548. *
  549. * @param hsize The horizontal size of the image.
  550. * @param vsize The vertical size of the image.
  551. * @param hresol The horizontal resolution of the image.
  552. * @param vresol The vertical resolution of the image.
  553. * @return a new {@link ImageSizeParameter}
  554. */
  555. public ImageSizeParameter createImageSizeParameter(int hsize, int vsize,
  556. int hresol, int vresol) {
  557. ImageSizeParameter imageSizeParameter
  558. = new ImageSizeParameter(hsize, vsize, hresol, vresol);
  559. return imageSizeParameter;
  560. }
  561. }