Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: fpdfsdk/src/fpdfeditimg.cpp

Issue 1799773002: Move fpdfsdk/src up to fpdfsdk/. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase to master Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fpdfsdk/src/fpdfedit_embeddertest.cpp ('k') | fpdfsdk/src/fpdfeditpage.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7 #include "public/fpdf_edit.h"
8
9 #include "fpdfsdk/include/fsdk_define.h"
10
11 DLLEXPORT FPDF_PAGEOBJECT STDCALL
12 FPDFPageObj_NewImgeObj(FPDF_DOCUMENT document) {
13 CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document);
14 if (!pDoc)
15 return nullptr;
16 CPDF_ImageObject* pImageObj = new CPDF_ImageObject;
17 CPDF_Image* pImg = new CPDF_Image(pDoc);
18 pImageObj->m_pImage = pImg;
19 return pImageObj;
20 }
21
22 DLLEXPORT FPDF_BOOL STDCALL
23 FPDFImageObj_LoadJpegFile(FPDF_PAGE* pages,
24 int nCount,
25 FPDF_PAGEOBJECT image_object,
26 FPDF_FILEACCESS* fileAccess) {
27 if (!image_object || !fileAccess || !pages)
28 return FALSE;
29
30 IFX_FileRead* pFile = new CPDF_CustomAccess(fileAccess);
31 CPDF_ImageObject* pImgObj = (CPDF_ImageObject*)image_object;
32 pImgObj->m_GeneralState.GetModify();
33 for (int index = 0; index < nCount; index++) {
34 CPDF_Page* pPage = CPDFPageFromFPDFPage(pages[index]);
35 if (!pPage)
36 continue;
37 pImgObj->m_pImage->ResetCache(pPage, NULL);
38 }
39 pImgObj->m_pImage->SetJpegImage(pFile);
40
41 return TRUE;
42 }
43
44 DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetMatrix(FPDF_PAGEOBJECT image_object,
45 double a,
46 double b,
47 double c,
48 double d,
49 double e,
50 double f) {
51 if (!image_object)
52 return FALSE;
53 CPDF_ImageObject* pImgObj = (CPDF_ImageObject*)image_object;
54 pImgObj->m_Matrix.a = (FX_FLOAT)a;
55 pImgObj->m_Matrix.b = (FX_FLOAT)b;
56 pImgObj->m_Matrix.c = (FX_FLOAT)c;
57 pImgObj->m_Matrix.d = (FX_FLOAT)d;
58 pImgObj->m_Matrix.e = (FX_FLOAT)e;
59 pImgObj->m_Matrix.f = (FX_FLOAT)f;
60 pImgObj->CalcBoundingBox();
61 return TRUE;
62 }
63
64 DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetBitmap(FPDF_PAGE* pages,
65 int nCount,
66 FPDF_PAGEOBJECT image_object,
67 FPDF_BITMAP bitmap) {
68 if (!image_object || !bitmap || !pages)
69 return FALSE;
70 CFX_DIBitmap* pBmp = NULL;
71 pBmp = (CFX_DIBitmap*)bitmap;
72 CPDF_ImageObject* pImgObj = (CPDF_ImageObject*)image_object;
73 pImgObj->m_GeneralState.GetModify();
74 for (int index = 0; index < nCount; index++) {
75 CPDF_Page* pPage = CPDFPageFromFPDFPage(pages[index]);
76 if (!pPage)
77 continue;
78 pImgObj->m_pImage->ResetCache(pPage, NULL);
79 }
80 pImgObj->m_pImage->SetImage(pBmp, FALSE);
81 pImgObj->CalcBoundingBox();
82 return TRUE;
83 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/fpdfedit_embeddertest.cpp ('k') | fpdfsdk/src/fpdfeditpage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698